1、采购单详情页添加销售订单号关联字段,关联跳转至对应销售订单;2、采购页面优化
This commit is contained in:
@@ -222,8 +222,6 @@ class ReSaleOrder(models.Model):
|
||||
return action
|
||||
|
||||
|
||||
|
||||
|
||||
class ResaleOrderLine(models.Model):
|
||||
_inherit = 'sale.order.line'
|
||||
|
||||
@@ -283,6 +281,19 @@ class RePurchaseOrder(models.Model):
|
||||
purchase_type = fields.Selection([('standard', '标准采购'), ('consignment', '委外加工')], string='采购类型',
|
||||
default='standard')
|
||||
|
||||
origin_sale_id = fields.Many2one('sale.order', string='销售订单号', compute='_compute_origin_sale_id')
|
||||
|
||||
@api.depends('order_line.move_dest_ids.group_id.mrp_production_ids',
|
||||
'order_line.move_ids.move_dest_ids.group_id.mrp_production_ids')
|
||||
def _compute_origin_sale_id(self):
|
||||
for purchase in self:
|
||||
productions_ids = purchase._get_mrp_productions()
|
||||
if productions_ids:
|
||||
if productions_ids[0].sale_order_id:
|
||||
purchase.origin_sale_id = productions_ids[0].sale_order_id.id
|
||||
continue
|
||||
purchase.origin_sale_id = False
|
||||
|
||||
@api.depends('partner_id')
|
||||
def _compute_user_id(self):
|
||||
if not self.user_id:
|
||||
|
||||
Reference in New Issue
Block a user