diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index ca957bfb..651f7884 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -14,8 +14,8 @@ class SfProductionDemandPlan(models.Model): _description = 'sf_production_demand_plan' def get_location_id(self): - stock_location = self.env['stock.location'].sudo().search([('name', '=', '客户')], limit=1) - return stock_location.id + customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers') + return customer_location_id priority = fields.Selection(related='demand_plan_id.priority', string='优先级') status = fields.Selection([