Comments (3)
as today before generating payload I'm calling a method such
def _wait_related_exchange_to_be_sent_and_processed(self):
if not all(
self.exchange_record.dependent_exchange_ids.mapped(
lambda rel_exch: rel_exch.edi_exchange_state
== "output_sent_and_processed"
)
):
raise RetryableJobError(
"Waiting related exchanges to be done before generate...",
)
from edi.
Hi @petrus-v ,
Regarding job dependencies between actions (eg: generate/send) I've recently drafted this #796
As for dependencies between exchanges, we could have a method that accepts a list of records and chains its jobs.
By default this could come from a field as you mentioned. The issue is: the fact that a job is done does not represent the fact that exchange is done. And what if you set the job as done manually? This will likely trigger the next job in the chain.
Hence, I think you cannot avoid checking the state of the former record in the chain in any case.
As of today, I think it's better to leverage events. You can already use them now.
When a record is successfully transitioned to another state you generate the next one. Easy and clear.
Another approach that I drafted is to automate exchange generation based on some rules.
It depends on #797 and OCA/edi-framework#4.
In my case, for instance, I'm able to generate an order response as an ack to the original exchange record that created a SO when the order gets confirmed.
In your case, you can handle what happens on the invoice and on its related record.
Another point is - and this is something I wanted to do since a long time - we should reflect the state of last related job on the exchange record.
from edi.
Related Issues (20)
- Migration to version 16.0 HOT 12
- Documentation required HOT 8
- Question regarding OVH authentication HOT 4
- [14.0] Can't find "endpoint" module required for edi_endpoint_oca HOT 1
- [14.0] edi_storage_oca with SFTP backend ACK aren't synchronized HOT 3
- 14.0 edi_oca synchronize ACK state with parent state when parent isn't processed by itself HOT 5
- Proposed changes for account_invoice_import v16 HOT 3
- Proposal for sale_order_import_csv: migration and import profiles HOT 1
- account_invoice_facturx: Mandatory country issue HOT 6
- Build red on 14.0 and 15.0 branch HOT 1
- pdf_helper.: PDF file parsing failed: '/Names' HOT 4
- account_invoice_facturx: Invoice generated are not valid facturx
- PyPDF2 usage problem in pdf_helper 16.0 HOT 2
- Migration to version 17.0 HOT 5
- [14.0] account_invoice_ubl_peppol tests broken
- Invalid XML invoice according to Mustang app if invoice and company have different currency HOT 1
- product.uom missing for Module account_invoice_import_facturx HOT 1
- Use import simple pdf module with email attachments HOT 1
- [15.0] edi_oca: support multicompany with edi.exchange.record HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edi.