From f586c99df9de4d6df353b0005f4fac0ec8687e2d Mon Sep 17 00:00:00 2001 From: luis Date: Thu, 2 Apr 2026 12:43:36 +0200 Subject: [PATCH] add purchase_price_review_status --- purchase_price_review_status/README.md | 9 ++ purchase_price_review_status/__init__.py | 1 + purchase_price_review_status/__manifest__.py | 16 ++++ purchase_price_review_status/i18n/es.po | 39 ++++++++ .../i18n/purchase_price_review_status.pot | 38 ++++++++ .../models/__init__.py | 2 + .../models/purchase_order.py | 11 +++ .../models/stock_picking.py | 12 +++ .../views/purchase_order_views.xml | 93 +++++++++++++++++++ .../views/stock_picking_views.xml | 39 ++++++++ 10 files changed, 260 insertions(+) create mode 100644 purchase_price_review_status/README.md create mode 100644 purchase_price_review_status/__init__.py create mode 100644 purchase_price_review_status/__manifest__.py create mode 100644 purchase_price_review_status/i18n/es.po create mode 100644 purchase_price_review_status/i18n/purchase_price_review_status.pot create mode 100644 purchase_price_review_status/models/__init__.py create mode 100644 purchase_price_review_status/models/purchase_order.py create mode 100644 purchase_price_review_status/models/stock_picking.py create mode 100644 purchase_price_review_status/views/purchase_order_views.xml create mode 100644 purchase_price_review_status/views/stock_picking_views.xml diff --git a/purchase_price_review_status/README.md b/purchase_price_review_status/README.md new file mode 100644 index 0000000..e58f78c --- /dev/null +++ b/purchase_price_review_status/README.md @@ -0,0 +1,9 @@ +# Purchase Price Review Status + +Adds a boolean field on purchase orders to indicate whether purchase prices were reviewed against receipts. + +It decorates list views according to these rules: + +- Green: not fully received and prices reviewed. +- Red: not fully received and prices not reviewed. +- Default color: fully received (unchanged behavior). diff --git a/purchase_price_review_status/__init__.py b/purchase_price_review_status/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/purchase_price_review_status/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_price_review_status/__manifest__.py b/purchase_price_review_status/__manifest__.py new file mode 100644 index 0000000..3c0df01 --- /dev/null +++ b/purchase_price_review_status/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2026 Criptomart +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Purchase Price Review Status", + "version": "16.0.1.0.0", + "summary": "Track if purchase prices were reviewed and color PO/receipt lists", + "license": "AGPL-3", + "author": "Criptomart", + "website": "https://criptomart.net", + "depends": ["purchase_stock"], + "data": [ + "views/purchase_order_views.xml", + "views/stock_picking_views.xml", + ], + "installable": True, +} diff --git a/purchase_price_review_status/i18n/es.po b/purchase_price_review_status/i18n/es.po new file mode 100644 index 0000000..36d5adc --- /dev/null +++ b/purchase_price_review_status/i18n/es.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_price_review_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-04-02 00:00+0000\n" +"PO-Revision-Date: 2026-04-02 00:00+0000\n" +"Last-Translator: \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" + +#. module: purchase_price_review_status +#: model:ir.model.fields,field_description:purchase_price_review_status.field_purchase_order__prices_reviewed +#: model:ir.model.fields,field_description:purchase_price_review_status.field_stock_picking__purchase_prices_reviewed +msgid "Purchase Prices Reviewed" +msgstr "Precios de Compra Revisados" + +#. module: purchase_price_review_status +#: model:ir.model.fields,help:purchase_price_review_status.field_purchase_order__prices_reviewed +msgid "Indicates whether purchase prices were reviewed against the receipt." +msgstr "Indica si los precios de compra fueron revisados con la recepción." + +#. module: purchase_price_review_status +#: model_terms:ir.ui.view,arch_db:purchase_price_review_status.view_purchase_order_filter_price_review +#: model_terms:ir.ui.view,arch_db:purchase_price_review_status.purchase_order_view_search_price_review +msgid "Prices Not Reviewed" +msgstr "Precios No Revisados" + +#. module: purchase_price_review_status +#: model_terms:ir.ui.view,arch_db:purchase_price_review_status.view_picking_internal_search_price_review +msgid "Purchase Prices Not Reviewed" +msgstr "Precios de Compra No Revisados" diff --git a/purchase_price_review_status/i18n/purchase_price_review_status.pot b/purchase_price_review_status/i18n/purchase_price_review_status.pot new file mode 100644 index 0000000..f97265d --- /dev/null +++ b/purchase_price_review_status/i18n/purchase_price_review_status.pot @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_price_review_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-04-02 00:00+0000\n" +"PO-Revision-Date: 2026-04-02 00:00+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: purchase_price_review_status +#: model:ir.model.fields,field_description:purchase_price_review_status.field_purchase_order__prices_reviewed +#: model:ir.model.fields,field_description:purchase_price_review_status.field_stock_picking__purchase_prices_reviewed +msgid "Purchase Prices Reviewed" +msgstr "" + +#. module: purchase_price_review_status +#: model:ir.model.fields,help:purchase_price_review_status.field_purchase_order__prices_reviewed +msgid "Indicates whether purchase prices were reviewed against the receipt." +msgstr "" + +#. module: purchase_price_review_status +#: model_terms:ir.ui.view,arch_db:purchase_price_review_status.view_purchase_order_filter_price_review +#: model_terms:ir.ui.view,arch_db:purchase_price_review_status.purchase_order_view_search_price_review +msgid "Prices Not Reviewed" +msgstr "" + +#. module: purchase_price_review_status +#: model_terms:ir.ui.view,arch_db:purchase_price_review_status.view_picking_internal_search_price_review +msgid "Purchase Prices Not Reviewed" +msgstr "" diff --git a/purchase_price_review_status/models/__init__.py b/purchase_price_review_status/models/__init__.py new file mode 100644 index 0000000..d2e1293 --- /dev/null +++ b/purchase_price_review_status/models/__init__.py @@ -0,0 +1,2 @@ +from . import purchase_order +from . import stock_picking diff --git a/purchase_price_review_status/models/purchase_order.py b/purchase_price_review_status/models/purchase_order.py new file mode 100644 index 0000000..06f017f --- /dev/null +++ b/purchase_price_review_status/models/purchase_order.py @@ -0,0 +1,11 @@ +from odoo import fields, models + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + prices_reviewed = fields.Boolean( + string="Purchase Prices Reviewed", + default=False, + help="Indicates whether purchase prices were reviewed against the receipt.", + ) diff --git a/purchase_price_review_status/models/stock_picking.py b/purchase_price_review_status/models/stock_picking.py new file mode 100644 index 0000000..1c8511b --- /dev/null +++ b/purchase_price_review_status/models/stock_picking.py @@ -0,0 +1,12 @@ +from odoo import fields, models + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + purchase_prices_reviewed = fields.Boolean( + related="purchase_id.prices_reviewed", + string="Purchase Prices Reviewed", + readonly=True, + store=False, + ) diff --git a/purchase_price_review_status/views/purchase_order_views.xml b/purchase_price_review_status/views/purchase_order_views.xml new file mode 100644 index 0000000..1d49ce6 --- /dev/null +++ b/purchase_price_review_status/views/purchase_order_views.xml @@ -0,0 +1,93 @@ + + + + + purchase.order.form.price.review + purchase.order + + + + + + + + + + purchase.order.view.tree.price.review + purchase.order + + + + receipt_status != 'full' and prices_reviewed + receipt_status != 'full' and not prices_reviewed + + + + + + + + + + purchase.order.tree.price.review + purchase.order + + + + receipt_status != 'full' and prices_reviewed + receipt_status != 'full' and not prices_reviewed + + + + + + + + + + purchase.order.kpis.tree.price.review + purchase.order + + + + receipt_status != 'full' and prices_reviewed + receipt_status != 'full' and not prices_reviewed + + + + + + + + + + purchase.order.filter.price.review + purchase.order + + + + + + + + + + purchase.order.view.search.price.review + purchase.order + + + + + + + + + diff --git a/purchase_price_review_status/views/stock_picking_views.xml b/purchase_price_review_status/views/stock_picking_views.xml new file mode 100644 index 0000000..b281490 --- /dev/null +++ b/purchase_price_review_status/views/stock_picking_views.xml @@ -0,0 +1,39 @@ + + + + + stock.picking.tree.price.review + stock.picking + + + + picking_type_code == 'incoming' and state not in ('done', 'cancel') and purchase_id and purchase_prices_reviewed + picking_type_code == 'incoming' and state not in ('done', 'cancel') and purchase_id and not purchase_prices_reviewed + + + + + + + + + + stock.picking.internal.search.price.review + stock.picking + + + + + + + + +