物料需求计划管理

This commit is contained in:
guanhuan
2025-06-25 15:01:02 +08:00
parent 8a953a1417
commit deda36a0f9
3 changed files with 6 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ class SfProductionDemandPlan(models.Model):
('50', '待下达生产'), ('50', '待下达生产'),
('60', '已下达'), ('60', '已下达'),
('100', '取消'), ('100', '取消'),
], string='状态', compute='_compute_status', store=True, readonly=False) ], string='状态', default='30', compute='_compute_status', store=True)
demand_plan_id = fields.Many2one(comodel_name="sf.demand.plan", demand_plan_id = fields.Many2one(comodel_name="sf.demand.plan",
string="物料需求", readonly=True) string="物料需求", readonly=True)
sale_order_id = fields.Many2one(comodel_name="sale.order", sale_order_id = fields.Many2one(comodel_name="sale.order",
@@ -85,8 +85,7 @@ class SfProductionDemandPlan(models.Model):
order_state = fields.Selection( order_state = fields.Selection(
string='订单状态', string='订单状态',
related='sale_order_line_id.state') related='sale_order_line_id.state')
route_id = fields.Many2one('stock.route', string='路线', related='sale_order_line_id.route_id', store=True) route_ids = fields.Many2many('stock.route', 'stock_route_demand_plan', 'demand_plan_id', 'route_id', '库存路线',
route_ids = fields.Many2many('stock.route', 'stock_route_demand_plan', 'demand_plan_id', 'route_id', '路线',
domain=[('demand_plan_selectable', '=', True)], compute='_compute_route_ids', domain=[('demand_plan_selectable', '=', True)], compute='_compute_route_ids',
store=True) store=True)
contract_date = fields.Date('合同日期', related='sale_order_id.contract_date') contract_date = fields.Date('合同日期', related='sale_order_id.contract_date')

View File

@@ -21,7 +21,7 @@
<field name="part_name"/> <field name="part_name"/>
<field name="part_number"/> <field name="part_number"/>
<field name="is_incoming_material"/> <field name="is_incoming_material"/>
<field name="supply_method"/> <field name="supply_method" attrs="{'readonly': [('status', '!=', '30')]}"/>
<field name="product_uom_qty"/> <field name="product_uom_qty"/>
<field name="deadline_of_delivery"/> <field name="deadline_of_delivery"/>
<field name="inventory_quantity_auto_apply"/> <field name="inventory_quantity_auto_apply"/>
@@ -38,7 +38,7 @@
<field name="sale_order_id" optional="hide"/> <field name="sale_order_id" optional="hide"/>
<field name="sale_order_line_number" optional="hide"/> <field name="sale_order_line_number" optional="hide"/>
<field name="order_state"/> <field name="order_state"/>
<field name="route_ids" widget="many2many_tags" optional="hide" readonly="0" <field name="route_ids" widget="many2many_tags" optional="hide"
context="{'demand_plan_search_stock_route_id': id}"/> context="{'demand_plan_search_stock_route_id': id}"/>
<field name="contract_date"/> <field name="contract_date"/>
<field name="date_order"/> <field name="date_order"/>

View File

@@ -41,8 +41,8 @@
<field name="line_ids"> <field name="line_ids">
<tree editable="bottom" delete="false"> <tree editable="bottom" delete="false">
<field name="status"/> <field name="status"/>
<field name="supply_method"/> <field name="supply_method" attrs="{'readonly': [('status', '!=', '30')]}"/>
<!--field name="库存路线"/>--> <field name="route_ids" widget="many2many_tags" optional="hide"/>
<!--<field name="需求位置"/>--> <!--<field name="需求位置"/>-->
<!--<field name="bom"/>--> <!--<field name="bom"/>-->
<field name="plan_uom_qty"/> <field name="plan_uom_qty"/>