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
abenzbiria and lanto-razafindrabe authored Jul 24, 2024
1 parent d89e3e6 commit 2aa7b7f
Show file tree
Hide file tree
Showing 11 changed files with 118 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 @@ -14,6 +14,7 @@
"base",
"attachment_minio",
"base_external_report_layout",
"canada_vat_label",
"ir_attachment_access_token_portal",
"lang_fr_activated",
"mail_bot_no_pong",
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ USER odoo

COPY attachment_minio /mnt/extra-addons/attachment_minio
COPY base_external_report_layout /mnt/extra-addons/base_external_report_layout
COPY canada_vat_label /mnt/extra-addons/canada_vat_label
COPY ir_attachment_access_token_portal /mnt/extra-addons/ir_attachment_access_token_portal
COPY lang_fr_activated /mnt/extra-addons/lang_fr_activated
COPY mail_bot_no_pong /mnt/extra-addons/mail_bot_no_pong
Expand Down
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 2aa7b7f

Please sign in to comment.