[IMP] scrap_reason_code: define product categories allowed for each code

Also redefine reason code form view a bit.
This commit is contained in:
Lois Rilo
2023-05-18 15:59:47 +02:00
parent 0fe97c277d
commit d1e1b8a997
6 changed files with 123 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
# Copyright (C) 2019 IBM Corp.
# Copyright (C) 2019 Open Source Integrators
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
@@ -16,3 +17,10 @@ class ScrapReasonCode(models.Model):
string="Scrap Location",
domain="[('scrap_location', '=', True)]",
)
product_category_ids = fields.Many2many(
string="Allowed Product Categories",
comodel_name="product.category",
help="Indicate the cateogories of products that can use this reason code "
"when doing a scrap. If left empy, this reason code can be used "
"with any product.",
)