1、采购订单form页买家改名为采购员;2、优化成品入库单的的坯料委外加工链接;
This commit is contained in:
@@ -29,6 +29,9 @@
|
|||||||
<xpath expr="//header/button[@name='button_cancel'][2]" position="attributes">
|
<xpath expr="//header/button[@name='button_cancel'][2]" position="attributes">
|
||||||
<attribute name="invisible">1</attribute>
|
<attribute name="invisible">1</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='user_id']" position="attributes">
|
||||||
|
<attribute name="string">采购员</attribute>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
|
||||||
<field name="partner_id" position="replace">
|
<field name="partner_id" position="replace">
|
||||||
|
|||||||
@@ -47,23 +47,23 @@ class StockPicking(models.Model):
|
|||||||
})
|
})
|
||||||
return action
|
return action
|
||||||
|
|
||||||
pro_out_purchase_count = fields.Integer('坯料外协单数量', compute='_compute_pro_out_purchase_count', store=True)
|
pro_out_purchase_count = fields.Integer('坯料委外单数量', compute='_compute_pro_out_purchase_count', store=True)
|
||||||
|
|
||||||
@api.depends('name')
|
@api.depends('name')
|
||||||
def _compute_pro_out_purchase_count(self):
|
def _compute_pro_out_purchase_count(self):
|
||||||
for sp in self:
|
for sp in self:
|
||||||
if sp:
|
if sp:
|
||||||
po_ids = self.env['purchase.order'].sudo().search([
|
po_ids = self.env['purchase.order'].sudo().search([
|
||||||
('origin', 'like', sp.name), ('purchase_type', '=', 'consignment')])
|
('origin', 'like', sp.name), ('purchase_type', '=', 'outsourcing')])
|
||||||
if po_ids:
|
if po_ids:
|
||||||
sp.pro_out_purchase_count = len(po_ids)
|
sp.pro_out_purchase_count = len(po_ids)
|
||||||
|
|
||||||
def pro_out_purchase_order(self):
|
def pro_out_purchase_order(self):
|
||||||
"""
|
"""
|
||||||
坯料外协
|
坯料委外
|
||||||
"""
|
"""
|
||||||
po_ids = self.env['purchase.order'].sudo().search([
|
po_ids = self.env['purchase.order'].sudo().search([
|
||||||
('origin', 'like', self.name), ('purchase_type', '=', 'consignment')])
|
('origin', 'like', self.name), ('purchase_type', '=', 'outsourcing')])
|
||||||
action = {
|
action = {
|
||||||
'res_model': 'purchase.order',
|
'res_model': 'purchase.order',
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
@@ -75,7 +75,7 @@ class StockPicking(models.Model):
|
|||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
action.update({
|
action.update({
|
||||||
'name': _("外协订单列表"),
|
'name': _("委外订单列表"),
|
||||||
'domain': [('id', 'in', po_ids.ids)],
|
'domain': [('id', 'in', po_ids.ids)],
|
||||||
'view_mode': 'tree,form',
|
'view_mode': 'tree,form',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
attrs="{'invisible': [('pro_out_purchase_count', '=', 0)]}">
|
attrs="{'invisible': [('pro_out_purchase_count', '=', 0)]}">
|
||||||
<div class="o_field_widget o_stat_info">
|
<div class="o_field_widget o_stat_info">
|
||||||
<span class="o_stat_value"><field name="pro_out_purchase_count"/></span>
|
<span class="o_stat_value"><field name="pro_out_purchase_count"/></span>
|
||||||
<span class="o_stat_text">坯料外协</span>
|
<span class="o_stat_text">坯料委外</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user