Accept Merge Request #1686: (feature/入库单优化 -> develop)

Merge Request: 1、采购订单form页买家改名为采购员;2、优化成品入库单的的坯料委外加工链接;

Created By: @禹翔辉
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1686
This commit is contained in:
禹翔辉
2024-12-31 08:57:15 +08:00
committed by Coding
3 changed files with 18 additions and 7 deletions

View File

@@ -29,7 +29,12 @@
<xpath expr="//header/button[@name='button_cancel'][2]" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">采购员</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="attributes">
<attribute name="string">源单据</attribute>
</xpath>
<field name="partner_id" position="replace">
<field name="partner_id" widget="res_partner_many2one" context="{'is_supplier': True }"/>
@@ -224,6 +229,9 @@
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">采购员</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="attributes">
<attribute name="string">源单据</attribute>
</xpath>
<xpath expr="//field[@name='activity_ids']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
@@ -281,6 +289,9 @@
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="string">采购员</attribute>
</xpath>
<xpath expr="//field[@name='origin']" position="attributes">
<attribute name="string">源单据</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="after">
<field name="delivery_warning" optional="show"/>
<field name="date_planned" string="最近交货日期" optional="show" widget="date"/>

View File

@@ -47,23 +47,23 @@ class StockPicking(models.Model):
})
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')
def _compute_pro_out_purchase_count(self):
for sp in self:
if sp:
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:
sp.pro_out_purchase_count = len(po_ids)
def pro_out_purchase_order(self):
"""
坯料外
坯料
"""
po_ids = self.env['purchase.order'].sudo().search([
('origin', 'like', self.name), ('purchase_type', '=', 'consignment')])
('origin', 'like', self.name), ('purchase_type', '=', 'outsourcing')])
action = {
'res_model': 'purchase.order',
'type': 'ir.actions.act_window',
@@ -75,7 +75,7 @@ class StockPicking(models.Model):
})
else:
action.update({
'name': _("订单列表"),
'name': _("外订单列表"),
'domain': [('id', 'in', po_ids.ids)],
'view_mode': 'tree,form',
})

View File

@@ -18,7 +18,7 @@
attrs="{'invisible': [('pro_out_purchase_count', '=', 0)]}">
<div class="o_field_widget o_stat_info">
<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>
</button>
</xpath>