[IMP] l10n_ca: add PST number on partner for the invoice

If you have a PST number, certain taxes
don't need to be paid, but the number
should be indicated on the invoice however.

opw-1951352
Closes #31982

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
This commit is contained in:
Josse Colpaert
2019-05-15 15:06:12 +00:00
parent e967435b2d
commit b66d84119c
6 changed files with 39 additions and 0 deletions
+1
View File
@@ -4,6 +4,7 @@
# Copyright (C) 2010 Savoir-faire Linux (<https://www.savoirfairelinux.com>).
from odoo import api, SUPERUSER_ID
from . import models
def load_translations(cr, registry):
+2
View File
@@ -47,6 +47,8 @@ position.
'data/fiscal_templates_data.xml',
'data/account_chart_template_configure_data.xml',
'data/res_company_data.xml',
'views/res_partner_view.xml',
'views/report_invoice.xml',
],
'post_init_hook': 'load_translations',
}
+4
View File
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import res_partner
+8
View File
@@ -0,0 +1,8 @@
# coding: utf-8
from odoo import api, fields, models, _
class ResPartner(models.Model):
_inherit = 'res.partner'
l10n_ca_pst = fields.Char('PST')
+9
View File
@@ -0,0 +1,9 @@
<odoo>
<template id="l10n_ca_report_invoice_document_inherit" inherit_id="account.report_invoice_document">
<div t-if="o.partner_id.vat" position="after">
<t t-if="o.company_id.country_id.code == 'CA' and o.partner_id.l10n_ca_pst" class="mt16">
<div>PST: <span t-field="o.partner_id.l10n_ca_pst"/></div>
</t>
</div>
</template>
</odoo>
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="res_partner_form_inherit_ca" model="ir.ui.view">
<field name="name">res.partner.form.inherit.l10n.ca</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='vat']" position="after">
<field name="l10n_ca_pst"/>
</xpath>
</field>
</record>
</data>
</odoo>