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 #1185 from OCA/17.0
Syncing from upstream OCA/partner-contact (17.0)
- Loading branch information
Showing
20 changed files
with
838 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,90 @@ | ||
======================== | ||
Partner pricelist search | ||
======================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:d17b1b14a086b860b90330557fc80c3d404f5f82ed14c809fb38b0fe146185dc | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github | ||
:target: https://github.com/OCA/partner-contact/tree/17.0/partner_pricelist_search | ||
:alt: OCA/partner-contact | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/partner-contact-17-0/partner-contact-17-0-partner_pricelist_search | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module adds search by pricelist field option in partners. | ||
|
||
Also add a new smart button called "Customers" in pricelist form view to | ||
show partners with that pricelist. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
With many partner records the search can be slow because all partners | ||
are computed. | ||
|
||
No grouping is allowed. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_pricelist_search%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Tecnativa | ||
|
||
Contributors | ||
------------ | ||
|
||
- `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
- Carlos Dauden | ||
- Víctor Martínez | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/17.0/partner_pricelist_search>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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 models |
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,14 @@ | ||
# Copyright 2021 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
{ | ||
"name": "Partner pricelist search", | ||
"version": "17.0.1.0.0", | ||
"author": "Tecnativa,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/partner-contact", | ||
"category": "Partner Management", | ||
"depends": ["product"], | ||
"data": ["views/product_pricelist_views.xml"], | ||
"installable": True, | ||
"license": "AGPL-3", | ||
} |
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,45 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_pricelist_search | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2021-01-15 14:06+0000\n" | ||
"PO-Revision-Date: 2021-01-15 15:07+0100\n" | ||
"Last-Translator: Carlos Dauden <[email protected]>\n" | ||
"Language-Team: \n" | ||
"Language: es\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"X-Generator: Poedit 2.3\n" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model,name:partner_pricelist_search.model_res_partner | ||
msgid "Contact" | ||
msgstr "Contacto" | ||
|
||
#. module: partner_pricelist_search | ||
#: model_terms:ir.ui.view,arch_db:partner_pricelist_search.product_pricelist_view | ||
msgid "Customers" | ||
msgstr "Clientes" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model,name:partner_pricelist_search.model_product_pricelist | ||
#: model:ir.model.fields,field_description:partner_pricelist_search.field_res_partner__property_product_pricelist | ||
#: model:ir.model.fields,field_description:partner_pricelist_search.field_res_users__property_product_pricelist | ||
msgid "Pricelist" | ||
msgstr "Tarifa" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model.fields,help:partner_pricelist_search.field_res_partner__property_product_pricelist | ||
#: model:ir.model.fields,help:partner_pricelist_search.field_res_users__property_product_pricelist | ||
msgid "" | ||
"This pricelist will be used, instead of the default one, for sales to the " | ||
"current partner" | ||
msgstr "" | ||
"Esta tarifa se utilizará, en lugar de la por defecto, para las ventas de la " | ||
"empresa actual" |
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,44 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_pricelist_search | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-12-27 09:37+0000\n" | ||
"Last-Translator: mymage <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model,name:partner_pricelist_search.model_res_partner | ||
msgid "Contact" | ||
msgstr "Contatto" | ||
|
||
#. module: partner_pricelist_search | ||
#: model_terms:ir.ui.view,arch_db:partner_pricelist_search.product_pricelist_view | ||
msgid "Customers" | ||
msgstr "Clienti" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model,name:partner_pricelist_search.model_product_pricelist | ||
#: model:ir.model.fields,field_description:partner_pricelist_search.field_res_partner__property_product_pricelist | ||
#: model:ir.model.fields,field_description:partner_pricelist_search.field_res_users__property_product_pricelist | ||
msgid "Pricelist" | ||
msgstr "Listino prezzi" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model.fields,help:partner_pricelist_search.field_res_partner__property_product_pricelist | ||
#: model:ir.model.fields,help:partner_pricelist_search.field_res_users__property_product_pricelist | ||
msgid "" | ||
"This pricelist will be used, instead of the default one, for sales to the " | ||
"current partner" | ||
msgstr "" | ||
"Questo listino verrà utilizzato, al posto di quello predefinito, per le " | ||
"vendite al partner corrente" |
39 changes: 39 additions & 0 deletions
39
partner_pricelist_search/i18n/partner_pricelist_search.pot
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,39 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * partner_pricelist_search | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 17.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model,name:partner_pricelist_search.model_res_partner | ||
msgid "Contact" | ||
msgstr "" | ||
|
||
#. module: partner_pricelist_search | ||
#: model_terms:ir.ui.view,arch_db:partner_pricelist_search.product_pricelist_view | ||
msgid "Customers" | ||
msgstr "" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model,name:partner_pricelist_search.model_product_pricelist | ||
#: model:ir.model.fields,field_description:partner_pricelist_search.field_res_partner__property_product_pricelist | ||
#: model:ir.model.fields,field_description:partner_pricelist_search.field_res_users__property_product_pricelist | ||
msgid "Pricelist" | ||
msgstr "" | ||
|
||
#. module: partner_pricelist_search | ||
#: model:ir.model.fields,help:partner_pricelist_search.field_res_partner__property_product_pricelist | ||
#: model:ir.model.fields,help:partner_pricelist_search.field_res_users__property_product_pricelist | ||
msgid "" | ||
"This pricelist will be used, instead of the default one, for sales to the " | ||
"current partner" | ||
msgstr "" |
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,2 @@ | ||
from . import product_pricelist | ||
from . import res_partner |
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,14 @@ | ||
# Copyright 2021 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
|
||
from odoo import models | ||
|
||
|
||
class Pricelist(models.Model): | ||
_inherit = "product.pricelist" | ||
|
||
def show_pricelist_partners(self): | ||
xmlid = "base.action_partner_form" | ||
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid) | ||
action["domain"] = [("property_product_pricelist", "in", self.ids)] | ||
return action |
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,32 @@ | ||
# Copyright 2021 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
_inherit = "res.partner" | ||
|
||
property_product_pricelist = fields.Many2one( | ||
search="_search_property_product_pricelist" | ||
) | ||
|
||
@api.model | ||
def search(self, args, offset=0, limit=None, order=None): | ||
# Substitute pricelist tuple | ||
partner_domain = [ | ||
(1, "=", 1) | ||
if (isinstance(x, (list | tuple)) and x[0] == "property_product_pricelist") | ||
else x | ||
for x in args | ||
] | ||
return super( | ||
ResPartner, self.with_context(search_partner_domain=partner_domain) | ||
).search(args, offset=offset, limit=limit, order=order) | ||
|
||
@api.model | ||
def _search_property_product_pricelist(self, operator, value): | ||
domain = self.env.context.get("search_partner_domain", []) | ||
partners = self.with_context(prefetch_fields=False).search(domain) | ||
key = "property_product_pricelist" | ||
return [("id", "in", partners.filtered_domain([(key, operator, value)]).ids)] |
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,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
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,3 @@ | ||
- [Tecnativa](https://www.tecnativa.com): | ||
- Carlos Dauden | ||
- Víctor Martínez |
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,4 @@ | ||
This module adds search by pricelist field option in partners. | ||
|
||
Also add a new smart button called "Customers" in pricelist form view to | ||
show partners with that pricelist. |
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,4 @@ | ||
With many partner records the search can be slow because all partners | ||
are computed. | ||
|
||
No grouping is allowed. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.