1、添加只有客供料入库单才能看见收货人/联系地址/电话号码等字段;
This commit is contained in:
@@ -689,6 +689,8 @@ class SfMaintenanceEquipment(models.Model):
|
||||
if next_date < date_now:
|
||||
next_date = date_now
|
||||
else:
|
||||
if not equipment.initial_action_date:
|
||||
raise ValidationError('重置保养日期不能为空!!!')
|
||||
next_date = equipment.initial_action_date + timedelta(days=equipment.period)
|
||||
equipment.next_action_date = next_date
|
||||
else:
|
||||
@@ -735,6 +737,8 @@ class SfMaintenanceEquipment(models.Model):
|
||||
if next_date < date_now:
|
||||
next_date = date_now
|
||||
else:
|
||||
if not equipment.initial_overhaul_date:
|
||||
raise ValidationError('重置维修日期不能为空')
|
||||
next_date = equipment.initial_overhaul_date + timedelta(days=equipment.overhaul_period)
|
||||
equipment.overhaul_date = next_date
|
||||
else:
|
||||
|
||||
@@ -554,7 +554,9 @@ class StockPicking(models.Model):
|
||||
|
||||
retrospect_ref = fields.Char('追溯参考', compute='_compute_move_ids', store=True)
|
||||
|
||||
@api.depends('move_ids')
|
||||
picking_type_sequence_code = fields.Char(related='picking_type_id.sequence_code')
|
||||
|
||||
@api.depends('move_ids', 'move_ids.product_id')
|
||||
def _compute_move_ids(self):
|
||||
for item in self:
|
||||
if item.move_ids:
|
||||
@@ -574,13 +576,14 @@ class StockPicking(models.Model):
|
||||
default_codes = ''
|
||||
if boms:
|
||||
for bom in boms:
|
||||
code = bom.product_tmpl_id.default_code.split('-')[-1]
|
||||
default_code = bom.product_tmpl_id.default_code.split(f'-{code}')[0]
|
||||
if default_code not in default_codes:
|
||||
if default_codes == '':
|
||||
default_codes = default_code
|
||||
else:
|
||||
default_codes = default_codes + ',' + default_code
|
||||
if bom.product_tmpl_id.default_code:
|
||||
code = bom.product_tmpl_id.default_code.split('-')[-1]
|
||||
default_code = bom.product_tmpl_id.default_code.split(f'-{code}')[0]
|
||||
if default_code not in default_codes:
|
||||
if default_codes == '':
|
||||
default_codes = default_code
|
||||
else:
|
||||
default_codes = default_codes + ',' + default_code
|
||||
item.retrospect_ref = default_codes
|
||||
elif item.picking_type_id.sequence_code in ['INT', 'PC']:
|
||||
pass
|
||||
|
||||
@@ -18,10 +18,13 @@
|
||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<field name="retrospect_ref"/>
|
||||
<field name="person_of_delivery"/>
|
||||
<field name="telephone_of_delivery"/>
|
||||
<field name="address_of_delivery"/>
|
||||
<field name="picking_type_sequence_code" invisible="1"/>
|
||||
<field name="retrospect_ref"
|
||||
attrs="{'invisible':[('picking_type_sequence_code','not in',['DL', 'INT', 'PC'])]}"/>
|
||||
<field name="person_of_delivery" attrs="{'invisible':[('picking_type_sequence_code','!=','DL')]}"/>
|
||||
<field name="telephone_of_delivery"
|
||||
attrs="{'invisible':[('picking_type_sequence_code','!=','DL')]}"/>
|
||||
<field name="address_of_delivery" attrs="{'invisible':[('picking_type_sequence_code','!=','DL')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user