Skip to content

Commit

Permalink
Merge pull request #1175 from OCA/15.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/partner-contact (15.0)
  • Loading branch information
bt-admin authored Mar 19, 2024
2 parents 08f3b7c + 23276cd commit f7f9437
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 52 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ addon | version | maintainers | summary
[partner_pricelist_search](partner_pricelist_search/) | 15.0.2.0.0 | | Partner pricelist search
[partner_pricelist_tracking](partner_pricelist_tracking/) | 15.0.1.0.0 | | Track partner pricelist changes
[partner_priority](partner_priority/) | 15.0.1.0.0 | [![patrickrwilson](https://github.com/patrickrwilson.png?size=30px)](https://github.com/patrickrwilson) | Adds priority to partners.
[partner_ref_unique](partner_ref_unique/) | 15.0.1.0.1 | [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) | Add an unique constraint to partner ref field
[partner_ref_unique](partner_ref_unique/) | 15.0.1.0.2 | [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) | Add an unique constraint to partner ref field
[partner_second_lastname](partner_second_lastname/) | 15.0.1.0.0 | | Have split first and second lastnames
[partner_stage](partner_stage/) | 15.0.1.0.0 | [![dreispt](https://github.com/dreispt.png?size=30px)](https://github.com/dreispt) | Add lifecycle Stages to Partners
[partner_supplierinfo](partner_supplierinfo/) | 15.0.1.0.0 | | Management of partner reference equivalences
[partner_vat_unique](partner_vat_unique/) | 15.0.1.0.2 | [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) | Module to make the VAT number unique for customers and suppliers.
[partner_vat_unique](partner_vat_unique/) | 15.0.1.0.3 | [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) | Module to make the VAT number unique for customers and suppliers.
[portal_partner_data_no_edit](portal_partner_data_no_edit/) | 15.0.1.0.0 | | Portal Partner Block Data Edit
[res_partner_journal_items_link](res_partner_journal_items_link/) | 15.0.1.0.0 | | Adds a smart button to grant direct access to their accounting notes
[sale_partner_company_group](sale_partner_company_group/) | 15.0.1.0.2 | | Adds the possibility to add a company group to a company
Expand Down
2 changes: 1 addition & 1 deletion partner_ref_unique/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Partner unique reference
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a6c77acb26782c1d90780259443b5080cdcbe42ce412a53ac92288b8f795757c
!! source digest: sha256:2211bcabae029c83b812dc8d9792faa0926fcbd52d4aec91a452e108ee16d66a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion partner_ref_unique/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Partner unique reference",
"summary": "Add an unique constraint to partner ref field",
"version": "15.0.1.0.1",
"version": "15.0.1.0.2",
"category": "Customer Relationship Management",
"website": "https://github.com/OCA/partner-contact",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
10 changes: 0 additions & 10 deletions partner_ref_unique/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from odoo import _, api, models
from odoo.exceptions import ValidationError
from odoo.osv import expression


class ResPartner(models.Model):
Expand All @@ -30,12 +29,3 @@ def _check_ref(self):
_("This reference is equal to partner '%s'")
% other[0].display_name
)

@api.model
def _name_search(self, name="", args=None, operator="ilike", limit=100):
"""Allow searching by ref by default."""
if name and operator in {"=", "ilike", "=ilike", "like", "=like"}:
args = expression.OR([[("ref", operator, name)], args])
return super()._name_search(
name=name, args=args, operator=operator, limit=limit
)
2 changes: 1 addition & 1 deletion partner_ref_unique/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h1 class="title">Partner unique reference</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a6c77acb26782c1d90780259443b5080cdcbe42ce412a53ac92288b8f795757c
!! source digest: sha256:2211bcabae029c83b812dc8d9792faa0926fcbd52d4aec91a452e108ee16d66a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/15.0/partner_ref_unique"><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-15-0/partner-contact-15-0-partner_ref_unique"><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=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows add a unique constraint to partner ref field.</p>
Expand Down
14 changes: 0 additions & 14 deletions partner_ref_unique/tests/test_res_partner_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,3 @@ def test_merge(self):
)
# this shouldn't raise error
wizard.action_merge()

def test_name_search(self):
self.company.partner_ref_unique = "all"
partner = self.partner1
partner.ref = "ref"
result = partner.name_search(name=partner.ref)
self.assertEqual(result[0][0], partner.id)

def test_name_search_args_none(self):
self.company.partner_ref_unique = "all"
partner = self.partner1
partner.ref = "ref"
result = partner.name_search(name=partner.ref, args=None)
self.assertEqual(result[0][0], partner.id)
2 changes: 1 addition & 1 deletion partner_vat_unique/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Partner VAT Unique
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c7b0696706d2e0ffd547cb9b46df319ddcec397443be2ec03c8cf279a11295e3
!! source digest: sha256:8e00a93e39272d47ae9b3570827edcdc1d5a16b4acb8aadaedbf92cecee2ccf7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion partner_vat_unique/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Partner VAT Unique",
"summary": "Module to make the VAT number unique for customers and suppliers.",
"version": "15.0.1.0.2",
"version": "15.0.1.0.3",
"category": "Customer Relationship Management",
"website": "https://github.com/OCA/partner-contact",
"author": "Grant Thornton S.L.P, Odoo Community Association (OCA)",
Expand Down
10 changes: 0 additions & 10 deletions partner_vat_unique/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.osv import expression
from odoo.tools import config


Expand All @@ -27,12 +26,3 @@ def _check_vat_unique(self):
raise ValidationError(
_("The VAT %s already exists in another partner.") % record.vat
)

@api.model
def _name_search(self, name="", args=None, operator="ilike", limit=100):
"""Allow searching by vat by default."""
if name and operator in {"=", "ilike", "=ilike", "like", "=like"}:
args = expression.OR([[("vat", operator, name)], args])
return super()._name_search(
name=name, args=args, operator=operator, limit=limit
)
2 changes: 1 addition & 1 deletion partner_vat_unique/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h1 class="title">Partner VAT Unique</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c7b0696706d2e0ffd547cb9b46df319ddcec397443be2ec03c8cf279a11295e3
!! source digest: sha256:8e00a93e39272d47ae9b3570827edcdc1d5a16b4acb8aadaedbf92cecee2ccf7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/15.0/partner_vat_unique"><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-15-0/partner-contact-15-0-partner_vat_unique"><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=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Module to make the VAT number unique for customers and suppliers. Will not
Expand Down
10 changes: 0 additions & 10 deletions partner_vat_unique/tests/test_vat_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,3 @@ def test_duplicated_vat_creation(self):
def test_duplicate_partner(self):
partner_copied = self.partner.copy()
self.assertFalse(partner_copied.vat)

def test_name_search(self):
partner = self.partner
result = partner.name_search(name=partner.vat)
self.assertEqual(result[0][0], partner.id)

def test_name_search_args_none(self):
partner = self.partner
result = partner.name_search(name=partner.vat, args=None)
self.assertEqual(result[0][0], partner.id)

0 comments on commit f7f9437

Please sign in to comment.