Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop
This commit is contained in:
@@ -331,7 +331,7 @@ class ToolInventory(models.Model):
|
|||||||
work_material = fields.Selection([('钢', '钢'), ('铝', '铝')], string='加工材料')
|
work_material = fields.Selection([('钢', '钢'), ('铝', '铝')], string='加工材料')
|
||||||
life_span = fields.Float('寿命(min)')
|
life_span = fields.Float('寿命(min)')
|
||||||
|
|
||||||
tool_groups_id = fields.Many2one('sf.tool.groups', string='刀具组')
|
tool_groups_id = fields.Many2one('sf.tool.groups', string='刀具组', required=True)
|
||||||
|
|
||||||
active = fields.Boolean('已归档', default=True)
|
active = fields.Boolean('已归档', default=True)
|
||||||
|
|
||||||
|
|||||||
@@ -555,9 +555,9 @@
|
|||||||
<field name="model">sf.tool.inventory</field>
|
<field name="model">sf.tool.inventory</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="功能刀具清单" create="1" edit="1" delete="0" editable="bottom">
|
<tree string="功能刀具清单" create="1" edit="1" delete="0" editable="bottom">
|
||||||
<field name="name"/>
|
<field name="name" attrs="{'readonly': [('id', '!=', False)]}"/>
|
||||||
<field name="functional_cutting_tool_model_id"/>
|
<field name="functional_cutting_tool_model_id"/>
|
||||||
<field name="tool_groups_id"/>
|
<field name="tool_groups_id" required="1" attrs="{'readonly': [('id', '!=', False)]}"/>
|
||||||
<field name="work_material"/>
|
<field name="work_material"/>
|
||||||
<field name="life_span"/>
|
<field name="life_span"/>
|
||||||
<field name="prefix" optional="hide"/>
|
<field name="prefix" optional="hide"/>
|
||||||
|
|||||||
@@ -581,6 +581,15 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
|
|
||||||
active = fields.Boolean(string='已归档', default=True)
|
active = fields.Boolean(string='已归档', default=True)
|
||||||
|
|
||||||
|
def action_open_reference1(self):
|
||||||
|
self.ensure_one()
|
||||||
|
return {
|
||||||
|
'res_model': self._name,
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'views': [[False, "form"]],
|
||||||
|
'res_id': self.id,
|
||||||
|
}
|
||||||
|
|
||||||
def put_start_preset(self):
|
def put_start_preset(self):
|
||||||
self.search([('start_preset_bool', '=', True)]).write({'start_preset_bool': False})
|
self.search([('start_preset_bool', '=', True)]).write({'start_preset_bool': False})
|
||||||
self.write({
|
self.write({
|
||||||
@@ -750,7 +759,8 @@ class FunctionalToolDismantle(models.Model):
|
|||||||
return 'GNDJ-CJD-%s-%s' % (datetime, num)
|
return 'GNDJ-CJD-%s-%s' % (datetime, num)
|
||||||
|
|
||||||
functional_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', required=True,
|
functional_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', required=True,
|
||||||
domain=[('functional_tool_status', '!=', '已拆除')])
|
domain=[('functional_tool_status', '!=', '已拆除'),
|
||||||
|
('current_location', '=', '刀具房')])
|
||||||
tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', store=True,
|
tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', store=True,
|
||||||
compute='_compute_functional_tool_num')
|
compute='_compute_functional_tool_num')
|
||||||
tool_groups_id = fields.Many2one('sf.tool.groups', '刀具组', compute='_compute_functional_tool_num', store=True)
|
tool_groups_id = fields.Many2one('sf.tool.groups', '刀具组', compute='_compute_functional_tool_num', store=True)
|
||||||
@@ -1028,7 +1038,7 @@ class ProductProduct(models.Model):
|
|||||||
'product_id': self.id,
|
'product_id': self.id,
|
||||||
'lot_id': lot_id.id,
|
'lot_id': lot_id.id,
|
||||||
'move_id': stock_move_id.id,
|
'move_id': stock_move_id.id,
|
||||||
'destination_location_id': shelf_location_id.id,
|
'destination_location_id': shelf_location_id.id if shelf_location_id else False,
|
||||||
'install_tool_time': fields.Datetime.now(),
|
'install_tool_time': fields.Datetime.now(),
|
||||||
'qty_done': 1.0,
|
'qty_done': 1.0,
|
||||||
'state': 'done',
|
'state': 'done',
|
||||||
|
|||||||
@@ -387,6 +387,22 @@ class StockMoveLine(models.Model):
|
|||||||
names = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
names = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
||||||
return categories.browse(names)
|
return categories.browse(names)
|
||||||
|
|
||||||
|
def action_open_reference1(self):
|
||||||
|
self.ensure_one()
|
||||||
|
if self.functional_tool_name_id:
|
||||||
|
action = self.functional_tool_name_id.action_open_reference1()
|
||||||
|
return action
|
||||||
|
elif self.move_id:
|
||||||
|
action = self.move_id.action_open_reference()
|
||||||
|
if action['res_model'] != 'stock.move':
|
||||||
|
return action
|
||||||
|
return {
|
||||||
|
'res_model': self._name,
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'views': [[False, "form"]],
|
||||||
|
'res_id': self.id,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class RealTimeDistributionOfFunctionalTools(models.Model):
|
class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||||
_name = 'sf.real.time.distribution.of.functional.tools'
|
_name = 'sf.real.time.distribution.of.functional.tools'
|
||||||
|
|||||||
@@ -477,7 +477,8 @@
|
|||||||
<field name="name">功能刀具出入库记录</field>
|
<field name="name">功能刀具出入库记录</field>
|
||||||
<field name="model">stock.move.line</field>
|
<field name="model">stock.move.line</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="功能刀具出入库记录" create="0" edit="0" delete="0">
|
<tree string="功能刀具出入库记录" create="0" edit="0" delete="0" default_order="id desc"
|
||||||
|
action="action_open_reference1" type="object">
|
||||||
<field name="reference" string="单据号"/>
|
<field name="reference" string="单据号"/>
|
||||||
<field name="lot_id" invisible="1"/>
|
<field name="lot_id" invisible="1"/>
|
||||||
<field name="rfid"/>
|
<field name="rfid"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user