-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] product_supplierinfo_certification: New object "Certifica…
…tions" Suppliers.
- Loading branch information
1 parent
cf0346a
commit bf09e77
Showing
17 changed files
with
516 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png | ||
:target: https://www.gnu.org/licenses/agpl | ||
:alt: License: AGPL-3 | ||
|
||
================================== | ||
Product supplierinfo certification | ||
================================== | ||
* New object "Certifications" Suppliers. | ||
* This new field will be displayed in: Supplier Pricelist, Reordering Rules, | ||
and Replenishment. | ||
|
||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/avanzosc/odoo-addons/issues>`_. In case of trouble, | ||
please check there if your issue has already been reported. If you spotted | ||
it first, help us smash it by providing detailed and welcomed feedback. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Ana Juaristi <[email protected]> | ||
* Alfredo de la Fuente <[email protected]> |
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,24 @@ | ||
# Copyright 2023 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
{ | ||
"name": "Product Supplierinfo Certification", | ||
"summary": "Customization Module", | ||
"version": "16.0.1.0.0", | ||
"category": "Sales/Sales", | ||
"license": "AGPL-3", | ||
"author": "AvanzOSC", | ||
"website": "https://github.com/avanzosc/odoo-addons", | ||
"contributors": [ | ||
"Ana Juaristi <[email protected]>", | ||
"Alfredo de la Fuente <[email protected]>", | ||
], | ||
"depends": ["product", "purchase", "stock", "purchase_stock"], | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"views/product_supplierinfo_certification_views.xml", | ||
"views/res_partner_views.xml", | ||
"views/product_supplierinfo_views.xml", | ||
"views/stock_warehouse_orderpoint_views.xml", | ||
], | ||
"installable": True, | ||
} |
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,95 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_supplierinfo_certification | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-04-25 09:20+0000\n" | ||
"PO-Revision-Date: 2024-04-25 09:20+0000\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: product_supplierinfo_certification | ||
#: model:ir.model,name:product_supplierinfo_certification.model_product_supplierinfo_certification | ||
msgid "Certifications In Supplier Pricelist" | ||
msgstr "Certificaciones en tarifa de proveedor" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.actions.act_window,name:product_supplierinfo_certification.action_product_supplierinfo_certification | ||
#: model:ir.ui.menu,name:product_supplierinfo_certification.product_supplierinfo_certification_menu | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.product_supplierinfo_certification_tree_view | ||
msgid "Certifications in Supplier Pricelist" | ||
msgstr "Certificaciones en tarifa de proveedor" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model,name:product_supplierinfo_certification.model_res_partner | ||
msgid "Contact" | ||
msgstr "Contacto" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__create_uid | ||
msgid "Created by" | ||
msgstr "Creado por" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__create_date | ||
msgid "Created on" | ||
msgstr "Creado el" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__name | ||
msgid "Description" | ||
msgstr "Descripción" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__display_name | ||
msgid "Display Name" | ||
msgstr "Mostrar nombre" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__id | ||
msgid "ID" | ||
msgstr "ID" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification____last_update | ||
msgid "Last Modified on" | ||
msgstr "Última modificación el" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__write_uid | ||
msgid "Last Updated by" | ||
msgstr "Última actualización por" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__write_date | ||
msgid "Last Updated on" | ||
msgstr "Última actualización el" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model,name:product_supplierinfo_certification.model_stock_warehouse_orderpoint | ||
msgid "Minimum Inventory Rule" | ||
msgstr "Regla de inventario mínimo" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model,name:product_supplierinfo_certification.model_product_supplierinfo | ||
msgid "Supplier Pricelist" | ||
msgstr "Tarifa de proveedor" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo__certification_id | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_res_partner__certification_id | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_res_users__certification_id | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_stock_warehouse_orderpoint__certification_id | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.product_supplierinfo_search_view | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.stock_reorder_report_search | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.view_res_partner_filter | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.warehouse_orderpoint_search | ||
msgid "Supplier qualification" | ||
msgstr "Calificación proveedor" |
95 changes: 95 additions & 0 deletions
95
product_supplierinfo_certification/i18n/product_supplierinfo_certification.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,95 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_supplierinfo_certification | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-04-25 09:20+0000\n" | ||
"PO-Revision-Date: 2024-04-25 09:20+0000\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: product_supplierinfo_certification | ||
#: model:ir.model,name:product_supplierinfo_certification.model_product_supplierinfo_certification | ||
msgid "Certifications In Supplier Pricelist" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.actions.act_window,name:product_supplierinfo_certification.action_product_supplierinfo_certification | ||
#: model:ir.ui.menu,name:product_supplierinfo_certification.product_supplierinfo_certification_menu | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.product_supplierinfo_certification_tree_view | ||
msgid "Certifications in Supplier Pricelist" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model,name:product_supplierinfo_certification.model_res_partner | ||
msgid "Contact" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__create_uid | ||
msgid "Created by" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__create_date | ||
msgid "Created on" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__name | ||
msgid "Description" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__write_uid | ||
msgid "Last Updated by" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo_certification__write_date | ||
msgid "Last Updated on" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model,name:product_supplierinfo_certification.model_stock_warehouse_orderpoint | ||
msgid "Minimum Inventory Rule" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model,name:product_supplierinfo_certification.model_product_supplierinfo | ||
msgid "Supplier Pricelist" | ||
msgstr "" | ||
|
||
#. module: product_supplierinfo_certification | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_product_supplierinfo__certification_id | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_res_partner__certification_id | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_res_users__certification_id | ||
#: model:ir.model.fields,field_description:product_supplierinfo_certification.field_stock_warehouse_orderpoint__certification_id | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.product_supplierinfo_search_view | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.stock_reorder_report_search | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.view_res_partner_filter | ||
#: model_terms:ir.ui.view,arch_db:product_supplierinfo_certification.warehouse_orderpoint_search | ||
msgid "Supplier qualification" | ||
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,4 @@ | ||
from . import product_supplierinfo_certification | ||
from . import res_partner | ||
from . import product_supplierinfo | ||
from . import stock_warehouse_orderpoint |
15 changes: 15 additions & 0 deletions
15
product_supplierinfo_certification/models/product_supplierinfo.py
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,15 @@ | ||
# Copyright 2023 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from odoo import fields, models | ||
|
||
|
||
class ProductSupplierinfo(models.Model): | ||
_inherit = "product.supplierinfo" | ||
|
||
certification_id = fields.Many2one( | ||
string="Supplier qualification", | ||
comodel_name="product.supplierinfo.certification", | ||
related="partner_id.certification_id", | ||
store=True, | ||
copy=False, | ||
) |
11 changes: 11 additions & 0 deletions
11
product_supplierinfo_certification/models/product_supplierinfo_certification.py
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,11 @@ | ||
# Copyright 2023 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from odoo import fields, models | ||
|
||
|
||
class ProductSupplierinfoCertification(models.Model): | ||
_name = "product.supplierinfo.certification" | ||
_description = "Certifications In Supplier Pricelist" | ||
_order = "name asc" | ||
|
||
name = fields.Char(string="Description", required=True) |
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,13 @@ | ||
# Copyright 2023 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from odoo import fields, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
_inherit = "res.partner" | ||
|
||
certification_id = fields.Many2one( | ||
string="Supplier qualification", | ||
comodel_name="product.supplierinfo.certification", | ||
copy=False, | ||
) |
38 changes: 38 additions & 0 deletions
38
product_supplierinfo_certification/models/stock_warehouse_orderpoint.py
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,38 @@ | ||
# Copyright 2023 Alfredo de la Fuente - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
from odoo import api, fields, models | ||
|
||
|
||
class StockWarehouseOrderpoint(models.Model): | ||
_inherit = "stock.warehouse.orderpoint" | ||
|
||
@api.depends( | ||
"supplier_id", | ||
"product_id", | ||
"product_id.orderpoint_ids", | ||
"product_id.orderpoint_ids.supplier_id", | ||
"product_id.orderpoint_ids.supplier_id.certification_id", | ||
) | ||
def _compute_certification_id(self): | ||
for orderpoint in self: | ||
certification_id = self.env["product.supplierinfo.certification"] | ||
if orderpoint.product_id and orderpoint.supplier_id: | ||
lines = orderpoint.product_id.orderpoint_ids.filtered( | ||
lambda x: x.supplier_id.id == orderpoint.supplier_id.id | ||
) | ||
line = False | ||
if lines and len(lines) == 1: | ||
line = lines | ||
if lines and len(lines) > 1: | ||
line = min(lines, key=lambda x: x.sequence) | ||
if line and line.supplier_id.certification_id: | ||
certification_id = line.supplier_id.certification_id.id | ||
orderpoint.certification_id = certification_id | ||
|
||
certification_id = fields.Many2one( | ||
string="Supplier qualification", | ||
comodel_name="product.supplierinfo.certification", | ||
compute="_compute_certification_id", | ||
copy=False, | ||
store=True, | ||
) |
3 changes: 3 additions & 0 deletions
3
product_supplierinfo_certification/security/ir.model.access.csv
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 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_product_supplierinfo_certification_manager,product.supplierinfo.certification.manager,model_product_supplierinfo_certification,base.group_erp_manager,1,1,1,1 | ||
access_product_supplierinfo_certification_user,product.supplierinfo.certification.user,model_product_supplierinfo_certification,base.group_user,1,0,0,0 |
29 changes: 29 additions & 0 deletions
29
product_supplierinfo_certification/views/product_supplierinfo_certification_views.xml
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,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<record id="product_supplierinfo_certification_tree_view" model="ir.ui.view"> | ||
<field name="name">product.supplierinfo.certification.tree.view</field> | ||
<field name="model">product.supplierinfo.certification</field> | ||
<field name="arch" type="xml"> | ||
<tree editable="top"> | ||
<field name="name" /> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record | ||
id="action_product_supplierinfo_certification" | ||
model="ir.actions.act_window" | ||
> | ||
<field name="name">Certifications in Supplier Pricelist</field> | ||
<field name="res_model">product.supplierinfo.certification</field> | ||
<field name="view_mode">tree</field> | ||
</record> | ||
|
||
<menuitem | ||
id="product_supplierinfo_certification_menu" | ||
action="action_product_supplierinfo_certification" | ||
parent="purchase.menu_purchase_config" | ||
sequence="80" | ||
groups="base.group_erp_manager" | ||
/> | ||
</odoo> |
Oops, something went wrong.