Split the UBL OrderReference field into sale reference and sale number
Closes #14452
This commit is contained in:
1 parent
402913d4cd
commit
c60436c82a
6 files changed
+18
-3
No files matched your search
@@ -169,6 +169,16 @@ class Invoice(Model):
|
||||
else:
|
||||
return self.invoice.tax_identifier
|
||||
|
||||
@cached_property
|
||||
def sale_reference(self):
|
||||
if hasattr(self.invoice, 'sales'):
|
||||
return ','.join(s.reference for s in self.invoice.sales)
|
||||
|
||||
@cached_property
|
||||
def sale_number(self):
|
||||
if hasattr(self.invoice, 'sales'):
|
||||
return ','.join(s.number for s in self.invoice.sales)
|
||||
|
||||
@property
|
||||
def taxes(self):
|
||||
def key(line):
|
||||
|
||||
@@ -56,6 +56,7 @@ tests_require = [
|
||||
get_require_version('trytond_account_invoice'),
|
||||
get_require_version('trytond_document_incoming_invoice'),
|
||||
get_require_version('trytond_purchase'),
|
||||
get_require_version('trytond_sale'),
|
||||
]
|
||||
|
||||
setup(name=name,
|
||||
|
||||
@@ -21,7 +21,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<cbc:DocumentCurrencyCode>${this.invoice.currency.code}</cbc:DocumentCurrencyCode>
|
||||
<cbc:BuyerReference py:if="this.invoice.reference">${this.invoice.reference}</cbc:BuyerReference>
|
||||
<cac:OrderReference>
|
||||
<cbc:ID>${this.invoice.origins or this.invoice.number}</cbc:ID>
|
||||
<cbc:ID>${this.sale_reference or 'NA'}</cbc:ID>
|
||||
<cbc:SalesOrderID py:if="this.sale_number">${this.sale_number}</cbc:SalesOrderID>
|
||||
</cac:OrderReference>
|
||||
<cac:AdditionalDocumentReference py:for="document in this.additional_documents">
|
||||
<cbc:ID>${document['id']}</cbc:ID>
|
||||
|
||||
@@ -21,7 +21,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<cbc:DocumentCurrencyCode>${this.invoice.currency.code}</cbc:DocumentCurrencyCode>
|
||||
<cbc:BuyerReference py:if="this.invoice.reference">${this.invoice.reference}</cbc:BuyerReference>
|
||||
<cac:OrderReference>
|
||||
<cbc:ID>${this.invoice.origins or this.invoice.number}</cbc:ID>
|
||||
<cbc:ID>${this.sale_reference or 'NA'}</cbc:ID>
|
||||
<cbc:SalesOrderID py:if="this.sale_number">${this.sale_number}</cbc:SalesOrderID>
|
||||
</cac:OrderReference>
|
||||
<cac:AdditionalDocumentReference py:for="document in this.additional_documents">
|
||||
<cbc:ID>${document['id']}</cbc:ID>
|
||||
|
||||
@@ -135,7 +135,8 @@ def get_invoice():
|
||||
class EdocumentUblTestCase(ModuleTestCase):
|
||||
"Test Edocument Ubl module"
|
||||
module = 'edocument_ubl'
|
||||
extras = ['account_invoice', 'document_incoming_invoice', 'purchase']
|
||||
extras = [
|
||||
'account_invoice', 'document_incoming_invoice', 'purchase', 'sale']
|
||||
|
||||
@with_transaction()
|
||||
def test_Invoice_2(self):
|
||||
|
||||
@@ -9,6 +9,7 @@ extras_depend:
|
||||
account_invoice
|
||||
document_incoming_invoice
|
||||
purchase
|
||||
sale
|
||||
xml:
|
||||
account.xml
|
||||
message.xml
|
||||
|
||||
Reference in new issue
Block a user