Skip to content

Commit

Permalink
[FIX] l10n_ar_sale: quotation vat_discrimination fixed
Browse files Browse the repository at this point in the history
closes #124

Signed-off-by: Katherine Zaoral <kz@adhoc.com.ar>
  • Loading branch information
matiasperalta1 committed Jun 15, 2023
1 parent aff4d32 commit 0f8d4eb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion l10n_ar_sale/__manifest__.py
@@ -1,6 +1,6 @@
{
'name': 'Argentinian Sale Total Fields',
'version': "16.0.1.1.0",
'version': "16.0.1.2.0",
'category': 'Localization/Argentina',
'sequence': 14,
'author': 'ADHOC SA',
Expand Down
12 changes: 12 additions & 0 deletions l10n_ar_sale/models/sale_order.py
Expand Up @@ -106,3 +106,15 @@ def _get_name_sale_report(self, report_xml_id):
if self.company_id.country_id.code == 'AR':
return 'l10n_ar_sale.report_saleorder_document'
return report_xml_id

def _l10n_ar_include_vat(self):
self.ensure_one()
discriminate_taxes = self.sale_checkbook_id.discriminate_taxes
if discriminate_taxes == 'yes':
return True
elif discriminate_taxes == 'no':
return False
else:
return not (
self.company_id.l10n_ar_company_requires_vat and
self.partner_id.l10n_ar_afip_responsibility_type_id.code in ['1'] or False)
8 changes: 8 additions & 0 deletions l10n_ar_sale/views/l10n_ar_sale_templates.xml
Expand Up @@ -38,5 +38,13 @@
</td>

</template>

<template id="document_tax_totals" inherit_id="account.document_tax_totals" name="document_tax_totals" primary="True">

<xpath expr="//t[@t-foreach]" position="attributes">
<attribute name="t-if">not doc._l10n_ar_include_vat()</attribute>
</xpath>

</template>

</odoo>
3 changes: 3 additions & 0 deletions l10n_ar_sale/views/sale_report_templates.xml
Expand Up @@ -139,6 +139,9 @@

</div>
</div>
<t t-call="account.document_tax_totals" position="attributes">
<attribute name="t-call">l10n_ar_sale.document_tax_totals</attribute>
</t>

</template>
<template id="sale_order_portal_content_discount" inherit_id="sale.sale_order_portal_content">
Expand Down

0 comments on commit 0f8d4eb

Please sign in to comment.