diff --git a/jikimo_purchase_request/models/mrp_production.py b/jikimo_purchase_request/models/mrp_production.py index 6250c79e..680e3c61 100644 --- a/jikimo_purchase_request/models/mrp_production.py +++ b/jikimo_purchase_request/models/mrp_production.py @@ -39,7 +39,6 @@ class MrpProduction(models.Model): mrp_names = self.env['mrp.production'].search([('origin', '=', self.origin)]).mapped('name') pr_ids = self.env['purchase.request'].sudo().search([('origin', 'in', mrp_names)]) - action = { 'res_model': 'purchase.request', 'type': 'ir.actions.act_window', @@ -52,7 +51,7 @@ class MrpProduction(models.Model): else: action.update({ 'name': _("从 %s生成采购请求单", self.name), - 'domain': [('id', 'in', pr_ids)], + 'domain': [('id', 'in', pr_ids.ids)], 'view_mode': 'tree,form', }) return action diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index 086412fa..0b83b685 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -89,9 +89,9 @@ class SfProductionDemandPlan(models.Model): string='订单状态', related='sale_order_line_id.state') route_id = fields.Many2one('stock.route', string='路线', related='sale_order_line_id.route_id', store=True) - contract_date = fields.Date('合同日期') + contract_date = fields.Date('合同日期', related='sale_order_id.contract_date') date_order = fields.Datetime('下单日期', related='sale_order_id.date_order') - contract_code = fields.Char('合同号') + contract_code = fields.Char('合同号', related='sale_order_id.contract_code') plan_remark = fields.Text("计划备注") material_check = fields.Selection([ ('0', "未齐套"), diff --git a/sf_demand_plan/views/demand_plan.xml b/sf_demand_plan/views/demand_plan.xml index 587bb2ce..e68a46f6 100644 --- a/sf_demand_plan/views/demand_plan.xml +++ b/sf_demand_plan/views/demand_plan.xml @@ -3,7 +3,8 @@ sf.production.demand.plan.tree sf.production.demand.plan - +