Skip to content

Commit

Permalink
TA#66835 [16.0][MIG] canada_vat_label (#158)
Browse files Browse the repository at this point in the history
Co-authored-by: Lanto Razafindrabe <[email protected]>
  • Loading branch information
2 people authored and majouda committed Sep 3, 2024
1 parent 4d4b1b8 commit 78cd262
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 0 deletions.
36 changes: 36 additions & 0 deletions canada_vat_label/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
================
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>
5 changes: 5 additions & 0 deletions gitoo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@
includes:
- web_view_searchpanel
- web_drop_target
-
- url: https://github.com/Numigi/odoo-web-addons
branch: "16.0"
includes:
- web_custom_label

0 comments on commit 78cd262

Please sign in to comment.