mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Initial ideas of having product level 'Planning Policy' for grouping and limiting where items can be planned from and how.
This commit is contained in:
22
sale_planner/models/product.py
Normal file
22
sale_planner/models/product.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
property_planning_policy_id = fields.Many2one('sale.order.planning.policy', company_dependent=True,
|
||||
string="Order Planner Policy",
|
||||
help="The Order Planner Policy to use when making a sale order planner.")
|
||||
|
||||
@api.multi
|
||||
def get_planning_policy(self):
|
||||
self.ensure_one()
|
||||
return self.property_planning_policy_id or self.categ_id.property_planning_policy_categ_id
|
||||
|
||||
|
||||
class ProductCategory(models.Model):
|
||||
_inherit = 'product.category'
|
||||
|
||||
property_planning_policy_categ_id = fields.Many2one('sale.order.planning.policy', company_dependent=True,
|
||||
string="Order Planner Policy",
|
||||
help="The Order Planner Policy to use when making a sale order planner.")
|
||||
Reference in New Issue
Block a user