purchase_order_product_recommendation_supermarket: add filter products by main supplier
This commit is contained in:
parent
524e3d643c
commit
f775050ea8
5 changed files with 38 additions and 1 deletions
|
|
@ -8,7 +8,7 @@
|
|||
"license": "AGPL-3",
|
||||
"author": "Criptomart",
|
||||
"website": "https://criptomart.net",
|
||||
"depends": ["purchase_order_product_recommendation"],
|
||||
"depends": ["purchase_order_product_recommendation", "product_main_seller"],
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
"wizards/purchase_order_recommendation.xml",
|
||||
|
|
|
|||
|
|
@ -532,6 +532,20 @@ msgstr ""
|
|||
"Cantidad de productos comprados durante el periodo (Entre la fecha de inicio"
|
||||
" y fecha final)."
|
||||
|
||||
#. module: purchase_order_product_recommendation_supermarket
|
||||
#: model:ir.model.fields,field_description:purchase_order_product_recommendation_supermarket.field_purchase_order_recommendation__filter_by_main_seller
|
||||
msgid "Only main vendor products"
|
||||
msgstr "Solo productos del proveedor principal"
|
||||
|
||||
#. module: purchase_order_product_recommendation_supermarket
|
||||
#: model:ir.model.fields,help:purchase_order_product_recommendation_supermarket.field_purchase_order_recommendation__filter_by_main_seller
|
||||
msgid ""
|
||||
"If enabled, only products whose main vendor matches the purchase order "
|
||||
"vendor will be recommended."
|
||||
msgstr ""
|
||||
"Si está activado, solo se recomendarán productos cuyo proveedor principal "
|
||||
"coincida con el proveedor del pedido de compra."
|
||||
|
||||
#. module: purchase_order_product_recommendation_supermarket
|
||||
#: model:ir.model.fields,field_description:purchase_order_product_recommendation_supermarket.field_purchase_order_recommendation_line__units_scrapped
|
||||
msgid "Units Scrapped"
|
||||
|
|
|
|||
|
|
@ -458,6 +458,18 @@ msgstr ""
|
|||
msgid "Units Received"
|
||||
msgstr ""
|
||||
|
||||
#. module: purchase_order_product_recommendation_supermarket
|
||||
#: model:ir.model.fields,field_description:purchase_order_product_recommendation_supermarket.field_purchase_order_recommendation__filter_by_main_seller
|
||||
msgid "Only main vendor products"
|
||||
msgstr ""
|
||||
|
||||
#. module: purchase_order_product_recommendation_supermarket
|
||||
#: model:ir.model.fields,help:purchase_order_product_recommendation_supermarket.field_purchase_order_recommendation__filter_by_main_seller
|
||||
msgid ""
|
||||
"If enabled, only products whose main vendor matches the purchase order "
|
||||
"vendor will be recommended."
|
||||
msgstr ""
|
||||
|
||||
#. module: purchase_order_product_recommendation_supermarket
|
||||
#: model:ir.model.fields,field_description:purchase_order_product_recommendation_supermarket.field_purchase_order_recommendation_line__units_scrapped
|
||||
msgid "Units Scrapped"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ class PurchaseOrderRecommendationSupermarketWizard(models.TransientModel):
|
|||
default=False,
|
||||
help="If disabled, the previous period (same number of days immediately preceding) is NOT queried. This saves a read_group on stock move lines and skips zero-stock day analysis for that window.",
|
||||
)
|
||||
filter_by_main_seller = fields.Boolean(
|
||||
string="Only main vendor products",
|
||||
default=False,
|
||||
help="If enabled, only products whose main vendor matches the purchase order vendor will be recommended.",
|
||||
)
|
||||
total_days = fields.Integer(
|
||||
string="Total days",
|
||||
compute="_compute_total_days",
|
||||
|
|
@ -306,6 +311,11 @@ class PurchaseOrderRecommendationSupermarketWizard(models.TransientModel):
|
|||
products = products.filtered(
|
||||
lambda x: x.categ_id.id in self.product_category_ids.ids
|
||||
)
|
||||
if self.filter_by_main_seller:
|
||||
partner = self.order_id.partner_id.commercial_partner_id
|
||||
products = products.filtered(
|
||||
lambda x: x.product_tmpl_id.main_seller_id == partner
|
||||
)
|
||||
return products
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
<field name="date_last_order" />
|
||||
</field>
|
||||
<field name="show_all_products" position="after">
|
||||
<field name="filter_by_main_seller" />
|
||||
<field name="order_by_packages" />
|
||||
<field name="ignore_zero_stock_days" />
|
||||
<field name="include_previous_period" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue