Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Malaysia - E-invoicing
Entity: myinvois.document
Compute Method: _compute_name
| Inputs | Method | Outputs |
|---|---|---|
|
""" Compute the name by using the sequence mixin. """ - for document in self.sorted(key=lambda d: (d.myinvois_issuance_date, d._origin.id)): + """ + If there is only one document, we should skip this computation entirely. + """ + dated_documents = self.filtered('myinvois_issuance_date') + for document in dated_documents.sorted(key=lambda d: (d.myinvois_issuance_date, d._origin.id)): document_has_name = document.name and document.name != '/' if document_has_name: if not document._sequence_matches_date(): document.name = False continue if document.myinvois_issuance_date and not document_has_name: document._set_next_sequence() self.filtered(lambda m: not m.name).name = '/' |
|
