Accept Merge Request #2184: (feature/齐套检查与下达生产 -> develop)
Merge Request: 修复多条采购申请跳转报错 Created By: @管欢 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @管欢 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2184
This commit is contained in:
@@ -39,7 +39,6 @@ class MrpProduction(models.Model):
|
|||||||
mrp_names = self.env['mrp.production'].search([('origin', '=', self.origin)]).mapped('name')
|
mrp_names = self.env['mrp.production'].search([('origin', '=', self.origin)]).mapped('name')
|
||||||
pr_ids = self.env['purchase.request'].sudo().search([('origin', 'in', mrp_names)])
|
pr_ids = self.env['purchase.request'].sudo().search([('origin', 'in', mrp_names)])
|
||||||
|
|
||||||
|
|
||||||
action = {
|
action = {
|
||||||
'res_model': 'purchase.request',
|
'res_model': 'purchase.request',
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
@@ -52,7 +51,7 @@ class MrpProduction(models.Model):
|
|||||||
else:
|
else:
|
||||||
action.update({
|
action.update({
|
||||||
'name': _("从 %s生成采购请求单", self.name),
|
'name': _("从 %s生成采购请求单", self.name),
|
||||||
'domain': [('id', 'in', pr_ids)],
|
'domain': [('id', 'in', pr_ids.ids)],
|
||||||
'view_mode': 'tree,form',
|
'view_mode': 'tree,form',
|
||||||
})
|
})
|
||||||
return action
|
return action
|
||||||
|
|||||||
@@ -89,9 +89,9 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
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_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')
|
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("计划备注")
|
plan_remark = fields.Text("计划备注")
|
||||||
material_check = fields.Selection([
|
material_check = fields.Selection([
|
||||||
('0', "未齐套"),
|
('0', "未齐套"),
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<field name="name">sf.production.demand.plan.tree</field>
|
<field name="name">sf.production.demand.plan.tree</field>
|
||||||
<field name="model">sf.production.demand.plan</field>
|
<field name="model">sf.production.demand.plan</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="需求计划" default_order="create_date desc" editable="bottom" class="demand_plan_tree">
|
<tree string="需求计划" default_order="sequence,create_date desc" editable="bottom"
|
||||||
|
class="demand_plan_tree">
|
||||||
<header>
|
<header>
|
||||||
<button string="打印" name="button_action_print" type="object"
|
<button string="打印" name="button_action_print" type="object"
|
||||||
class="btn-primary"/>
|
class="btn-primary"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user