[FIX] 10n_ca: Add PST to company
Add l10n_ca_pst field to company opw-2499263 closes odoo/odoo#69613 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
@@ -48,7 +48,9 @@ position.
|
||||
'data/account_chart_template_configure_data.xml',
|
||||
'data/res_company_data.xml',
|
||||
'views/res_partner_view.xml',
|
||||
'views/res_company_view.xml',
|
||||
'views/report_invoice.xml',
|
||||
'views/report_template.xml'
|
||||
],
|
||||
'demo': [
|
||||
'demo/demo_company.xml',
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import res_partner
|
||||
from . import res_company
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# coding: utf-8
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
l10n_ca_pst = fields.Char(related='partner_id.l10n_ca_pst', string='PST', store=False)
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="l10n_ca_external_layout_standard" inherit_id="web.external_layout_standard">
|
||||
<xpath expr="//div[@class='row'][last()]" position="after">
|
||||
<t t-if="company.account_fiscal_country_id.code == 'CA' and company.l10n_ca_pst" class="mt16">
|
||||
<div>PST: <span t-field="company.l10n_ca_pst"/></div>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_ca_external_layout_clean" inherit_id="web.external_layout_clean">
|
||||
<xpath expr="//div[@class='row']" position="after">
|
||||
<t t-if="company.account_fiscal_country_id.code == 'CA' and company.l10n_ca_pst" class="mt16">
|
||||
<div>PST: <span t-field="company.l10n_ca_pst"/></div>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_ca_external_layout_boxed" inherit_id="web.external_layout_boxed">
|
||||
<xpath expr="//div[@class='row mb8']" position="after">
|
||||
<t t-if="company.account_fiscal_country_id.code == 'CA' and company.l10n_ca_pst" class="mt16">
|
||||
<div>PST: <span t-field="company.l10n_ca_pst"/></div>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="l10n_ca_external_layout_background" inherit_id="web.external_layout_background">
|
||||
<xpath expr="//div[@class='float-left company_address']" position="after">
|
||||
<t t-if="company.account_fiscal_country_id.code == 'CA' and company.l10n_ca_pst" class="mt16">
|
||||
<div>PST: <span t-field="company.l10n_ca_pst"/></div>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="res_company_form_inherit_ca" model="ir.ui.view">
|
||||
<field name="name">res.company.form.inherit.l10n.ca</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='vat']" position="after">
|
||||
<field name="l10n_ca_pst" attrs="{'invisible': [('country_code', '!=', 'CA')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user