Skip to content

Commit

Permalink
TA#66835 [16.0][MIG] canada_vat_label (#202)
Browse files Browse the repository at this point in the history
* [16.0][MIG] canada_vat_label
  • Loading branch information
abenzbiria authored Jul 25, 2024
1 parent 63b8d11 commit 93df79e
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 0 deletions.
1 change: 1 addition & 0 deletions .docker_files/main/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"account_show_full_features",
"bank_statement_import_csv",
"canada_account_types",
"canada_vat_label",
"invoice_refund_not_earlier",
"old_accounts",
],
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ COPY account_payment_cancel_group /mnt/extra-addons/account_payment_cancel_group
COPY account_show_full_features /mnt/extra-addons/account_show_full_features
COPY bank_statement_import_csv /mnt/extra-addons/bank_statement_import_csv
COPY canada_account_types /mnt/extra-addons/canada_account_types
COPY canada_vat_label /mnt/extra-addons/canada_vat_label
COPY invoice_refund_not_earlier /mnt/extra-addons/invoice_refund_not_earlier
COPY old_accounts /mnt/extra-addons/old_accounts

Expand Down
35 changes: 35 additions & 0 deletions canada_vat_label/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Canada Vat Label
================
This module customizes the ``VAT`` label for Canada.

.. contents:: Table of Contents

Context
-------
Each company in France has a VAT number. VAT means ``Value-Added Tax``.

In Quebec, each company has 2 numbers: ``GST`` and ``QST``.
In Ontario, companies have a single ``HST`` number.

In Odoo, the field ``vat_label`` of res.country allows to define the label for
the equivalent of ``VAT``.

This mecanism does is inadequate in Canada.

Overview
--------
The solution for Canada is to write all numbers in the same field.

.. image:: static/description/quebec_company.png

The value entered in the field is displayed as is in the footer of external reports.

.. image:: static/description/quebec_footer.png

Contributors
------------
* Numigi (tm) and all its contributors (https://bit.ly/numigiens)

More information
----------------
* Meet us at https://bit.ly/numigi-com
2 changes: 2 additions & 0 deletions canada_vat_label/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2020 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
15 changes: 15 additions & 0 deletions canada_vat_label/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Canada VAT Label",
"version": "16.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"license": "LGPL-3",
"category": "Other",
"summary": "Customize VAT labels for Canada",
"depends": ["web", "web_custom_label", "lang_fr_activated"],
"data": ["data/web_custom_label.xml", "views/report_footer.xml"],
"installable": True,
}
22 changes: 22 additions & 0 deletions canada_vat_label/data/web_custom_label.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo noupdate="1">

<record id="label_vat_english" model="web.custom.label">
<field name="lang">en_US</field>
<field name="model_ids" eval="[(4, ref('base.model_res_company'))]"/>
<field name="type_">field</field>
<field name="position">string</field>
<field name="reference">vat</field>
<field name="term">Tax Number</field>
</record>

<record id="label_vat_french" model="web.custom.label">
<field name="lang">fr_FR</field>
<field name="model_ids" eval="[(4, ref('base.model_res_company'))]"/>
<field name="type_">field</field>
<field name="position">string</field>
<field name="reference">vat</field>
<field name="term">Numéro de taxe</field>
</record>

</odoo>
Binary file added canada_vat_label/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions canada_vat_label/views/report_footer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<template id="external_layout_striped" inherit_id="web.external_layout_striped">
<xpath expr="//li[@t-if='forced_vat']" position="replace">
<li t-if="forced_vat">
<span t-esc="forced_vat"/>
</li>
</xpath>
</template>

<template id="external_layout_boxed" inherit_id="web.external_layout_boxed">
<xpath expr="//li[@t-if='forced_vat']" position="replace">
<li t-if="forced_vat">
<span t-esc="forced_vat"/>
</li>
</xpath>
</template>

<template id="external_layout_clean" inherit_id="web.external_layout_bold">
<xpath expr="//li[@t-if='forced_vat']" position="replace">
<li t-if="forced_vat">
<span t-esc="forced_vat"/>
</li>
</xpath>
</template>

<template id="external_layout_standard" inherit_id="web.external_layout_standard">
<xpath expr="//li[@t-if='forced_vat']" position="replace">
<li t-if="forced_vat">
<span t-esc="forced_vat"/>
</li>
</xpath>
</template>

</odoo>
10 changes: 10 additions & 0 deletions gitoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@
includes:
- account_check_deposit
- account_invoice_constraint_chronology

- url: https://github.com/Numigi/odoo-base-addons
branch: "16.0"
includes:
- lang_fr_activated

- url: https://github.com/Numigi/odoo-web-addons
branch: "16.0"
includes:
- web_custom_label

0 comments on commit 93df79e

Please sign in to comment.