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