forked from OCA/partner-contact
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1364 from OCA/17.0
Syncing from upstream OCA/partner-contact (17.0)
- Loading branch information
Showing
42 changed files
with
439 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
----------- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_qweb_contact_field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.