Skip to content

Commit

Permalink
Merge pull request #1364 from OCA/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/partner-contact (17.0)
  • Loading branch information
bt-admin authored Jan 29, 2025
2 parents 16a83b3 + ca6bd43 commit 97d5e03
Show file tree
Hide file tree
Showing 42 changed files with 439 additions and 63 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ addon | version | maintainers | summary
[partner_email_check](partner_email_check/) | 17.0.1.0.0 | | Validate email address field
[partner_email_duplicate_warn](partner_email_duplicate_warn/) | 17.0.1.0.1 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Warning banner on partner form if another partner has the same email
[partner_external_map](partner_external_map/) | 17.0.1.0.0 | | Add Map and Map Routing buttons on partner form to open GMaps, OSM, Bing and others
[partner_fax](partner_fax/) | 17.0.1.0.0 | | Add fax number on partner
[partner_fax](partner_fax/) | 17.0.1.1.0 | | Add fax number on partner
[partner_firstname](partner_firstname/) | 17.0.1.1.0 | | Split first name and last name for non company partners
[partner_identification](partner_identification/) | 17.0.1.1.0 | | Partner Identification Numbers
[partner_identification](partner_identification/) | 17.0.1.2.0 | | Partner Identification Numbers
[partner_identification_gln](partner_identification_gln/) | 17.0.1.0.0 | | This addon extends "Partner Identification Numbers" to provide a number category for GLN registration
[partner_industry_secondary](partner_industry_secondary/) | 17.0.1.1.1 | | Add secondary partner industries
[partner_manual_rank](partner_manual_rank/) | 17.0.1.0.0 | [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) [![frahikLV](https://github.com/frahikLV.png?size=30px)](https://github.com/frahikLV) | Be able to manually flag partners as customer or supplier.
Expand All @@ -65,8 +65,9 @@ addon | version | maintainers | summary
[partner_readonly_security](partner_readonly_security/) | 17.0.1.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Partner Readonly Security
[partner_ref_unique](partner_ref_unique/) | 17.0.1.0.0 | | Add an unique constraint to partner ref field
[partner_second_lastname](partner_second_lastname/) | 17.0.1.0.2 | | Have split first and second lastnames
[partner_stage](partner_stage/) | 17.0.1.0.0 | [![dreispt](https://github.com/dreispt.png?size=30px)](https://github.com/dreispt) | Add lifecycle Stages to Partners
[partner_stage](partner_stage/) | 17.0.1.1.0 | [![dreispt](https://github.com/dreispt.png?size=30px)](https://github.com/dreispt) | Add lifecycle Stages to Partners
[partner_stage_only_confirmed](partner_stage_only_confirmed/) | 17.0.1.0.0 | | Adds filters on form views to display only confirmed partners
[partner_title_active](partner_title_active/) | 17.0.1.0.0 | | Partner Title Active
[partner_tz](partner_tz/) | 17.0.1.0.0 | | Remove partner timezone default value and display on form
[partner_vat_unique](partner_vat_unique/) | 17.0.1.0.0 | | Module to make the VAT number unique for customers and suppliers.
[sale_partner_company_group](sale_partner_company_group/) | 17.0.1.0.0 | | Adds the possibility to add a company group to a company
Expand Down
14 changes: 8 additions & 6 deletions partner_fax/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Partner fax
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2f8e19fa2b5e1e012ce7d31860053bc5b9e15bf4704d7dc64d30cbe0fbf61f2b
!! source digest: sha256:852274337a6fa9b22984e1d1100103390f02242ae6cbe02f7be82baeed1d7aae
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -60,11 +60,13 @@ Credits
Contributors
------------

- Francesco Apruzzese <[email protected]>
- Aitor Bouzas <[email protected]>
- Pimolnat Suntian <[email protected]>
- Nadal Francisco Garcia <[email protected]>
(https://braintec.com)
- Francesco Apruzzese <[email protected]>
- Aitor Bouzas <[email protected]>
- Pimolnat Suntian <[email protected]>
- Nadal Francisco Garcia <[email protected]>
(https://braintec.com)
- Iván Todorovich <[email protected]>
(https://www.camptocamp.com)

Maintainers
-----------
Expand Down
4 changes: 2 additions & 2 deletions partner_fax/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"name": "Partner fax",
"category": "Extra Tools",
"summary": "Add fax number on partner",
"version": "17.0.1.0.0",
"version": "17.0.1.1.0",
"license": "AGPL-3",
"author": "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/partner-contact",
"depends": ["base_setup"],
"data": ["views/res_partner.xml"],
"data": ["views/res_partner.xml", "views/templates.xml"],
"installable": True,
}
4 changes: 4 additions & 0 deletions partner_fax/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ msgid "Contact"
msgstr "Contacte"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr "Fax"

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ msgid "Contact"
msgstr "Kontakt"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr ""

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ msgid "Contact"
msgstr "Contacto"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr "Fax"

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ msgid "Contact"
msgstr "Contact"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr "Fax"

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/he.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ msgid "Contact"
msgstr ""

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr ""

Expand Down
8 changes: 6 additions & 2 deletions partner_fax/i18n/hr_HR.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"

#. module: partner_fax
#: model:ir.model,name:partner_fax.model_res_partner
msgid "Contact"
msgstr "Kontakt"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr ""

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ msgid "Contact"
msgstr "Contatto"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr "Fax"

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ msgid "Contact"
msgstr "Contact"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr ""

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/partner_fax.pot
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ msgid "Contact"
msgstr ""

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr ""

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ msgid "Contact"
msgstr "Contato"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr "Fax"

Expand Down
8 changes: 6 additions & 2 deletions partner_fax/i18n/sl.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
"n%100==4 ? 2 : 3);\n"

#. module: partner_fax
#: model:ir.model,name:partner_fax.model_res_partner
msgid "Contact"
msgstr "Stik"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr ""

Expand Down
4 changes: 4 additions & 0 deletions partner_fax/i18n/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ msgid "Contact"
msgstr "联系人"

#. module: partner_fax
#. odoo-python
#: code:addons/partner_fax/models/ir_qweb_fields.py:0
#: model:ir.model.fields,field_description:partner_fax.field_res_partner__fax
#: model:ir.model.fields,field_description:partner_fax.field_res_users__fax
#: model_terms:ir.ui.view,arch_db:partner_fax.contact
#, python-format
msgid "Fax"
msgstr "传真"

Expand Down
19 changes: 19 additions & 0 deletions partner_fax/models/ir_qweb_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Camptocamp SA (https://www.camptocamp.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, models


class Contact(models.AbstractModel):
_inherit = "ir.qweb.field.contact"

@api.model
def get_available_options(self):
options = super().get_available_options()
options["fields"]["params"]["params"].append(
{
"field_name": "fax",
"label": _("Fax"),
}
)
return options
4 changes: 2 additions & 2 deletions partner_fax/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- Francesco Apruzzese \<<[email protected]>\>
- Aitor Bouzas \<<[email protected]>\>
- Pimolnat Suntian \<<[email protected]>\>
- Nadal Francisco Garcia \<<[email protected]>\>
(<https://braintec.com>)
- Nadal Francisco Garcia \<<[email protected]>\> (<https://braintec.com>)
- Iván Todorovich \<<[email protected]>\> (<https://www.camptocamp.com>)
4 changes: 3 additions & 1 deletion partner_fax/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Partner fax</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2f8e19fa2b5e1e012ce7d31860053bc5b9e15bf4704d7dc64d30cbe0fbf61f2b
!! source digest: sha256:852274337a6fa9b22984e1d1100103390f02242ae6cbe02f7be82baeed1d7aae
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/partner-contact/tree/17.0/partner_fax"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_fax"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds a fax field into the partner form.</p>
Expand Down Expand Up @@ -410,6 +410,8 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
<li>Nadal Francisco Garcia &lt;<a class="reference external" href="mailto:nadal.francisco&#64;braintec.com">nadal.francisco&#64;braintec.com</a>&gt;
(<a class="reference external" href="https://braintec.com">https://braintec.com</a>)</li>
<li>Iván Todorovich &lt;<a class="reference external" href="mailto:ivan.todorovich&#64;camptocamp.com">ivan.todorovich&#64;camptocamp.com</a>&gt;
(<a class="reference external" href="https://www.camptocamp.com">https://www.camptocamp.com</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
1 change: 1 addition & 0 deletions partner_fax/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_qweb_contact_field
37 changes: 37 additions & 0 deletions partner_fax/tests/test_qweb_contact_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2024 Camptocamp SA (https://www.camptocamp.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.tests import TransactionCase

from odoo.addons.base.tests.common import DISABLED_MAIL_CONTEXT


class TestQwebContactField(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, **DISABLED_MAIL_CONTEXT))
cls.partner = cls.env["res.partner"].create(
{
"name": "Test Partner",
"fax": "1234567890",
}
)

def test_qweb_contact_field_fax_displayed(self):
Contact = self.env["ir.qweb.field.contact"]
result = Contact.value_to_html(self.partner, {"fields": ["name", "fax"]})
self.assertIn("1234567890", result)
self.assertIn('itemprop="faxNumber"', result)

def test_qweb_contact_field_fax_hidden_if_not_set(self):
self.partner.fax = None
Contact = self.env["ir.qweb.field.contact"]
result = Contact.value_to_html(self.partner, {"fields": ["name", "fax"]})
self.assertNotIn('itemprop="faxNumber"', result)

def test_qweb_contact_field_fax_hidden_by_default(self):
Contact = self.env["ir.qweb.field.contact"]
result = Contact.value_to_html(self.partner, {})
self.assertNotIn("1234567890", result)
self.assertNotIn('itemprop="faxNumber"', result)
26 changes: 26 additions & 0 deletions partner_fax/views/templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2024 Camptocamp SA (https://www.camptocamp.com).
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>

<template id="contact" inherit_id="base.contact">
<div t-if="mobile and 'mobile' in fields" position="after">
<div
class="d-flex align-items-center gap-1"
t-if="object.fax and 'fax' in fields"
>
<i
t-if="not options.get('no_marker') or options.get('phone_icons')"
class='fa fa-fax fa-fw'
role="img"
aria-label="Fax"
title="Fax"
/>
<span class="o_force_ltr" itemprop="faxNumber" t-esc="object.fax" />
</div>
</div>
</template>

</odoo>
Loading

0 comments on commit 97d5e03

Please sign in to comment.