Daily updates from Odoo
Tuesday, April 9, 2019
1 change · master
New functionality added to Odoo
This adds a way to run certain actions only after a business transaction has been fully saved, reducing the risk of emails or invoice-signing calls being sent too early. It is especially useful for processes that contact external systems, such as country-specific electronic invoicing services.
Original PR description
Run only if the system is absolutely sure that the method didn't
trigger any blocking point.
Useful for invoice sign fashion, send emails or other processes
connecting to external systems
@rco-odoo this PR will be useful for all countries where an invoice signed is required.
Example for l10n_mx_edi
```python
@api.run_after_commit
def call_external_service(self):
...
```
Similar to `send_email`
```python
@api.run_after_commit
def send(self):
...
class Partner(...):
...
emails.with_context(run_after_commit=send_after_commit).send()
```
What do you think?