Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
# 'jikimo_frontend/static/src/list/custom_import.js',
|
# 'jikimo_frontend/static/src/list/custom_import.js',
|
||||||
# 'jikimo_frontend/static/src/list/custom_width.js',
|
# 'jikimo_frontend/static/src/list/custom_width.js',
|
||||||
'jikimo_frontend/static/src/views/list_nums/extent_purchase.xml',
|
'jikimo_frontend/static/src/views/list_nums/extent_purchase.xml',
|
||||||
|
# 'jikimo_frontend/static/src/css/list_border_styles.css',
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
3
jikimo_frontend/static/src/css/list_border_styles.css
Normal file
3
jikimo_frontend/static/src/css/list_border_styles.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove){
|
||||||
|
border:1px solid #dee2e6 !important;
|
||||||
|
}
|
||||||
@@ -8,8 +8,6 @@ from odoo.exceptions import UserError
|
|||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
from odoo.tools import float_compare, float_round, float_is_zero, format_datetime
|
from odoo.tools import float_compare, float_round, float_is_zero, format_datetime
|
||||||
|
|
||||||
from odoo.tools import float_compare, float_is_zero
|
|
||||||
|
|
||||||
|
|
||||||
class MrpProduction(models.Model):
|
class MrpProduction(models.Model):
|
||||||
_inherit = 'mrp.production'
|
_inherit = 'mrp.production'
|
||||||
@@ -162,7 +160,6 @@ class MrpProduction(models.Model):
|
|||||||
logging.info('fetchCNC error:%s' % e)
|
logging.info('fetchCNC error:%s' % e)
|
||||||
raise UserError("cnc程序获取编程单失败,请联系管理员")
|
raise UserError("cnc程序获取编程单失败,请联系管理员")
|
||||||
|
|
||||||
|
|
||||||
# 维修模块按钮
|
# 维修模块按钮
|
||||||
def button_maintenance_req(self):
|
def button_maintenance_req(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
@@ -489,7 +486,7 @@ class MrpProduction(models.Model):
|
|||||||
self._reset_work_order_sequence()
|
self._reset_work_order_sequence()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
#修改标记已完成方法
|
# 修改标记已完成方法
|
||||||
def button_mark_done1(self):
|
def button_mark_done1(self):
|
||||||
self._button_mark_done_sanity_checks()
|
self._button_mark_done_sanity_checks()
|
||||||
|
|
||||||
@@ -506,7 +503,6 @@ class MrpProduction(models.Model):
|
|||||||
productions_not_to_backorder = self
|
productions_not_to_backorder = self
|
||||||
productions_to_backorder = self.env['mrp.production']
|
productions_to_backorder = self.env['mrp.production']
|
||||||
|
|
||||||
|
|
||||||
backorders = productions_to_backorder and productions_to_backorder._split_productions()
|
backorders = productions_to_backorder and productions_to_backorder._split_productions()
|
||||||
backorders = backorders - productions_to_backorder
|
backorders = backorders - productions_to_backorder
|
||||||
|
|
||||||
@@ -514,13 +510,16 @@ class MrpProduction(models.Model):
|
|||||||
productions_to_backorder._post_inventory(cancel_backorder=True)
|
productions_to_backorder._post_inventory(cancel_backorder=True)
|
||||||
|
|
||||||
# if completed products make other confirmed/partially_available moves available, assign them
|
# if completed products make other confirmed/partially_available moves available, assign them
|
||||||
done_move_finished_ids = (productions_to_backorder.move_finished_ids | productions_not_to_backorder.move_finished_ids).filtered(lambda m: m.state == 'done')
|
done_move_finished_ids = (
|
||||||
|
productions_to_backorder.move_finished_ids | productions_not_to_backorder.move_finished_ids).filtered(
|
||||||
|
lambda m: m.state == 'done')
|
||||||
done_move_finished_ids._trigger_assign()
|
done_move_finished_ids._trigger_assign()
|
||||||
|
|
||||||
# Moves without quantity done are not posted => set them as done instead of canceling. In
|
# Moves without quantity done are not posted => set them as done instead of canceling. In
|
||||||
# case the user edits the MO later on and sets some consumed quantity on those, we do not
|
# case the user edits the MO later on and sets some consumed quantity on those, we do not
|
||||||
# want the move lines to be canceled.
|
# want the move lines to be canceled.
|
||||||
(productions_not_to_backorder.move_raw_ids | productions_not_to_backorder.move_finished_ids).filtered(lambda x: x.state not in ('done', 'cancel')).write({
|
(productions_not_to_backorder.move_raw_ids | productions_not_to_backorder.move_finished_ids).filtered(
|
||||||
|
lambda x: x.state not in ('done', 'cancel')).write({
|
||||||
'state': 'done',
|
'state': 'done',
|
||||||
'product_uom_qty': 0.0,
|
'product_uom_qty': 0.0,
|
||||||
})
|
})
|
||||||
@@ -546,8 +545,10 @@ class MrpProduction(models.Model):
|
|||||||
'res_id': self.id,
|
'res_id': self.id,
|
||||||
'target': 'main',
|
'target': 'main',
|
||||||
}
|
}
|
||||||
if self.user_has_groups('mrp.group_mrp_reception_report') and self.picking_type_id.auto_show_reception_report:
|
if self.user_has_groups(
|
||||||
lines = self.move_finished_ids.filtered(lambda m: m.product_id.type == 'product' and m.state != 'cancel' and m.quantity_done and not m.move_dest_ids)
|
'mrp.group_mrp_reception_report') and self.picking_type_id.auto_show_reception_report:
|
||||||
|
lines = self.move_finished_ids.filtered(lambda
|
||||||
|
m: m.product_id.type == 'product' and m.state != 'cancel' and m.quantity_done and not m.move_dest_ids)
|
||||||
if lines:
|
if lines:
|
||||||
if any(mo.show_allocation for mo in self):
|
if any(mo.show_allocation for mo in self):
|
||||||
action = self.action_view_reception_report()
|
action = self.action_view_reception_report()
|
||||||
@@ -574,4 +575,4 @@ class MrpProduction(models.Model):
|
|||||||
'domain': [('id', 'in', backorders.ids)],
|
'domain': [('id', 'in', backorders.ids)],
|
||||||
'view_mode': 'tree,form',
|
'view_mode': 'tree,form',
|
||||||
})
|
})
|
||||||
return action
|
return action
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ access_mrp_production_split,access.mrp.production.split,mrp.model_mrp_production
|
|||||||
access_mrp_production_split_line,access.mrp.production.split.line,mrp.model_mrp_production_split_line,sf_base.group_sf_mrp_user,1,1,1,0
|
access_mrp_production_split_line,access.mrp.production.split.line,mrp.model_mrp_production_split_line,sf_base.group_sf_mrp_user,1,1,1,0
|
||||||
access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0
|
access_mrp_workcenter_capacity_manager,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0
|
||||||
|
|
||||||
access_mrp_production,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,1,1,0
|
access_mrp_production_group_plan_dispatch,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,1,0
|
access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,1,0
|
||||||
access_sf_production_line_group_plan_dispatch,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,0,0,0
|
access_sf_production_line_group_plan_dispatch,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_sf_production_line_group_plan_director,sf.production.line,model_sf_production_line,sf_base.group_plan_director,1,1,1,0
|
access_sf_production_line_group_plan_director,sf.production.line,model_sf_production_line,sf_base.group_plan_director,1,1,1,0
|
||||||
|
|||||||
|
@@ -53,6 +53,7 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 增加权限相关的按钮 -->
|
<!-- 增加权限相关的按钮 -->
|
||||||
|
<!-- 制造订单的操作按钮只让制造用户可见 -->
|
||||||
<record id="custom_mrp_production_form_view" model="ir.ui.view">
|
<record id="custom_mrp_production_form_view" model="ir.ui.view">
|
||||||
<field name="name">custom.mrp.production.form</field>
|
<field name="name">custom.mrp.production.form</field>
|
||||||
<field name="model">mrp.production</field>
|
<field name="model">mrp.production</field>
|
||||||
@@ -61,23 +62,151 @@
|
|||||||
<xpath expr="//field[@name='state']" position="attributes">
|
<xpath expr="//field[@name='state']" position="attributes">
|
||||||
<attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done</attribute>
|
<attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//form//header//button[@name='action_confirm']" position="after">
|
|
||||||
<field name="active" invisible="1"/>
|
|
||||||
<field name="check_status" invisible="1"/>
|
|
||||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
|
||||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
|
||||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
|
||||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//field[@name='user_id']" position="after">
|
<xpath expr="//field[@name='user_id']" position="after">
|
||||||
<field name="programming_no"/>
|
<field name="programming_no"/>
|
||||||
<field name="work_state" invisible="1"/>
|
<field name="work_state" invisible="1"/>
|
||||||
<field name="programming_state"/>
|
<field name="programming_state"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
||||||
|
<button name="action_cancel" type="object" string="取消" data-hotkey="z"
|
||||||
|
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', True)]}" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="(//header//button[@name='button_mark_done'])[1]" position="replace">
|
||||||
|
<button name="button_mark_done" attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '!=', [])]}" string="验证" type="object" class="oe_highlight"
|
||||||
|
confirm="There are no components to consume. Are you still sure you want to continue?" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="(//header//button[@name='button_mark_done'])[2]" position="replace">
|
||||||
|
<button name="button_mark_done" attrs="{'invisible': ['|', '|', ('state', 'in', ('draft', 'cancel', 'done', 'to_close')), ('qty_producing', '=', 0), ('move_raw_ids', '=', [])]}" string="Validate" type="object" class="oe_highlight" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="(//header//button[@name='button_mark_done'])[3]" position="replace">
|
||||||
|
<button name="button_mark_done" attrs="{'invisible': [
|
||||||
|
'|',
|
||||||
|
('move_raw_ids', '=', []),
|
||||||
|
'&',
|
||||||
|
'|',
|
||||||
|
('state', 'not in', ('confirmed', 'progress')),
|
||||||
|
('qty_producing', '!=', 0),
|
||||||
|
('state', '!=', 'to_close')]}" string="Mark as Done" type="object" class="oe_highlight" data-hotkey="g" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="(//header//button[@name='button_mark_done'])[4]" position="replace">
|
||||||
|
<button name="button_mark_done" attrs="{'invisible': [
|
||||||
|
'|',
|
||||||
|
('move_raw_ids', '!=', []),
|
||||||
|
'&',
|
||||||
|
'|',
|
||||||
|
('state', 'not in', ('confirmed', 'progress')),
|
||||||
|
('qty_producing', '!=', 0),
|
||||||
|
('state', '!=', 'to_close')]}" string="Mark as Done" type="object" class="oe_highlight" data-hotkey="g"
|
||||||
|
confirm="There are no components to consume. Are you still sure you want to continue?" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//header//button[@name='button_unplan']" position="replace">
|
||||||
|
<button name="button_unplan" type="object" string="取消安排" attrs="{'invisible': ['|', ('is_planned', '=', False), ('state', '=', 'cancel')]}" data-hotkey="x" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//header//button[@name='button_scrap']" position="replace">
|
||||||
|
<button name="button_scrap" type="object" string="报废" attrs="{'invisible': [('state', 'in', ('cancel', 'draft'))]}" data-hotkey="y" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='action_confirm']" position="replace">
|
||||||
|
<button name="action_confirm" attrs="{'invisible': [('state', '!=', 'draft')]}" string="Confirm" type="object" class="oe_highlight" data-hotkey="v" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='button_plan']" position="replace">
|
||||||
|
<button name="button_plan" attrs="{'invisible': ['|', '|', ('state', 'not in', ('confirmed', 'progress', 'to_close')), ('workorder_ids', '=', []), ('is_planned', '=', True)]}" type="object" string="Plan" class="oe_highlight" data-hotkey="x" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='action_assign']" position="replace">
|
||||||
|
<button name="action_assign" attrs="{'invisible': ['|', ('state', 'in', ('draft', 'done', 'cancel')), ('reserve_visible', '=', False)]}" string="Check availability" type="object" data-hotkey="q" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
|
||||||
|
<button name="do_unreserve" type="object" string="Unreserve" attrs="{'invisible': [('unreserve_visible', '=', False)]}" data-hotkey="w" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
|
||||||
|
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', False)]}" string="Unlock" groups="sf_base.group_sf_mrp_user" type="object" help="Unlock the manufacturing order to adjust what has been consumed or produced." data-hotkey="l"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='action_toggle_is_locked']" position="replace">
|
||||||
|
<button name="action_toggle_is_locked" attrs="{'invisible': ['|', ('show_lock', '=', False), ('is_locked', '=', True)]}" string="Lock" groups="sf_base.group_sf_mrp_user" type="object" help="Lock the manufacturing order to prevent changes to what has been consumed or produced." data-hotkey="l"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='action_serial_mass_produce_wizard']" position="replace">
|
||||||
|
<button name="action_serial_mass_produce_wizard" attrs="{'invisible': [('show_serial_mass_produce', '=', False)]}" string="Mass Produce" type="object" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
||||||
|
<button name="action_cancel" type="object" string="Cancel" data-hotkey="z"
|
||||||
|
attrs="{'invisible': ['|', '|', ('id', '=', False), ('state', 'in', ('done', 'cancel')), ('confirm_cancel', '=', False)]}"
|
||||||
|
confirm="Some product moves have already been confirmed, this manufacturing order can't be completely cancelled. Are you still sure you want to process ?" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
<xpath expr="//header//button[@name='button_unbuild']" position="replace">
|
||||||
|
<button name="button_unbuild" type="object" string="Unbuild" attrs="{'invisible': [('state', '!=', 'done')]}" data-hotkey="shift+v" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- 工单的操作按钮只让制造用户可见 -->
|
||||||
|
<record id="sf_mrp_production_workorder_tree_editable_view" model="ir.ui.view">
|
||||||
|
<field name="name">sf.mrp.production.workorder.tree.editable</field>
|
||||||
|
<field name="model">mrp.workorder</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//tree//button[@name='button_start']" position="replace">
|
||||||
|
<button name="button_start" type="object" string="Start" class="btn-success"
|
||||||
|
attrs="{'invisible': ['|', '|', '|', ('production_state','in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('state', 'in', ('done', 'cancel')), ('is_user_working', '!=', False)]}" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//tree//button[@name='button_pending']" position="replace">
|
||||||
|
<button name="button_pending" type="object" string="Pause" class="btn-warning"
|
||||||
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//tree//button[@name='button_finish']" position="replace">
|
||||||
|
<button name="button_finish" type="object" string="Done" class="btn-success"
|
||||||
|
attrs="{'invisible': ['|', '|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked'), ('is_user_working', '=', False)]}" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//tree//button[@name='%(mrp.act_mrp_block_workcenter_wo)d']" position="replace">
|
||||||
|
<button name="%(mrp.act_mrp_block_workcenter_wo)d" type="action" string="Block" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
|
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '=', 'blocked')]}" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//tree//button[@name='button_unblock']" position="replace">
|
||||||
|
<button name="button_unblock" type="object" string="Unblock" context="{'default_workcenter_id': workcenter_id}" class="btn-danger"
|
||||||
|
attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//tree//button[@name='action_open_wizard']" position="replace">
|
||||||
|
<button name="action_open_wizard" type="object" icon="fa-external-link" class="oe_edit_only"
|
||||||
|
title="Open Work Order"
|
||||||
|
context="{'default_workcenter_id': workcenter_id}" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 制造订单列表视图header内的按钮只让制造用户可见 -->
|
||||||
|
<record id="sf_mrp_production_tree_view" model="ir.ui.view">
|
||||||
|
<field name="name">sf.mrp.production.tree</field>
|
||||||
|
<field name="model">mrp.production</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//header//button[@name='button_plan']" position="replace">
|
||||||
|
<!-- <button name="button_plan" type="object" string="安排" groups="sf_base.group_sf_mrp_user"/> -->
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//header//button[@name='do_unreserve']" position="replace">
|
||||||
|
<button name="do_unreserve" type="object" string="取消保留" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//header//button[@name='action_cancel']" position="replace">
|
||||||
|
<button name="action_cancel" type="object" string="取消" groups="sf_base.group_sf_mrp_user"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <record id="custom_mrp_production_form_view" model="ir.ui.view"> -->
|
<!-- <record id="custom_mrp_production_form_view" model="ir.ui.view"> -->
|
||||||
<!-- <field name="name">custom.mrp.production.form</field> -->
|
<!-- <field name="name">custom.mrp.production.form</field> -->
|
||||||
<!-- <field name="model">mrp.production</field> -->
|
<!-- <field name="model">mrp.production</field> -->
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
<field name="model">mrp.production</field>
|
<field name="model">mrp.production</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<button name="action_cancel" position="before">
|
<!-- <button name="action_cancel" position="before"> -->
|
||||||
<button name="button_maintenance_req" type="object" string="维修请求"/>
|
<!-- <button name="button_maintenance_req" type="object" string="维修请求"/> -->
|
||||||
</button>
|
<!-- </button> -->
|
||||||
<div name="button_box" position="inside">
|
<div name="button_box" position="inside">
|
||||||
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
||||||
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
||||||
@@ -376,9 +376,9 @@
|
|||||||
<field name="model">mrp.production</field>
|
<field name="model">mrp.production</field>
|
||||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<button name="action_cancel" position="before">
|
<!-- <button name="action_cancel" position="before"> -->
|
||||||
<button name="button_maintenance_req" type="object" string="维修请求"/>
|
<!-- <button name="button_maintenance_req" type="object" string="维修请求"/> -->
|
||||||
</button>
|
<!-- </button> -->
|
||||||
<div name="button_box" position="inside">
|
<div name="button_box" position="inside">
|
||||||
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
||||||
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
# 'security/rules.xml',
|
# 'security/rules.xml',
|
||||||
'wizard/action_plan_some.xml',
|
'wizard/action_plan_some.xml',
|
||||||
'views/view.xml',
|
'views/view.xml',
|
||||||
'views/change_manufactuing.xml',
|
# 'views/change_manufactuing.xml',
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,10 @@ class sf_production_plan(models.Model):
|
|||||||
item.date_planned_start, item.date_planned_finished
|
item.date_planned_start, item.date_planned_finished
|
||||||
record.state = 'done'
|
record.state = 'done'
|
||||||
record.production_id.schedule_state = '已排'
|
record.production_id.schedule_state = '已排'
|
||||||
|
# self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to process'
|
||||||
|
sale_obj = self.env['sale.order'].search([('name', '=', record.origin)])
|
||||||
|
if 'S' in sale_obj.name:
|
||||||
|
sale_obj.schedule_status = 'to process'
|
||||||
mrp_production_ids = record.production_id._get_children().ids
|
mrp_production_ids = record.production_id._get_children().ids
|
||||||
print('mrp_production_ids', mrp_production_ids)
|
print('mrp_production_ids', mrp_production_ids)
|
||||||
for i in mrp_production_ids:
|
for i in mrp_production_ids:
|
||||||
@@ -276,6 +280,10 @@ class sf_production_plan(models.Model):
|
|||||||
self.production_line_id = False
|
self.production_line_id = False
|
||||||
aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)])
|
aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)])
|
||||||
aa.schedule_state = '未排'
|
aa.schedule_state = '未排'
|
||||||
|
# self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to shedule'
|
||||||
|
sale_obj = self.env['sale.order'].search([('name', '=', self.origin)])
|
||||||
|
if 'S' in sale_obj.name:
|
||||||
|
sale_obj.schedule_status = 'to schedule'
|
||||||
return self.date_planned_finished
|
return self.date_planned_finished
|
||||||
|
|
||||||
def liucheng_cs(self):
|
def liucheng_cs(self):
|
||||||
|
|||||||
@@ -36,21 +36,21 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- 增加权限相关的按钮 -->
|
<!-- 增加权限相关的按钮 -->
|
||||||
<record id="custom_product_template_form_view" model="ir.ui.view">
|
<!-- <record id="custom_product_template_form_view" model="ir.ui.view"> -->
|
||||||
<field name="name">custom.product.template.form</field>
|
<!-- <field name="name">custom.product.template.form</field> -->
|
||||||
<field name="model">product.template</field>
|
<!-- <field name="model">product.template</field> -->
|
||||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
<!-- <field name="inherit_id" ref="product.product_template_form_view"/> -->
|
||||||
<field name="arch" type="xml">
|
<!-- <field name="arch" type="xml"> -->
|
||||||
<xpath expr="//form//header" position="inside">
|
<!-- <xpath expr="//form//header" position="inside"> -->
|
||||||
<field name="active" invisible="1"/>
|
<!-- <field name="active" invisible="1"/> -->
|
||||||
<field name="check_status" invisible="1"/>
|
<!-- <field name="check_status" invisible="1"/> -->
|
||||||
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
<!-- <button name="archive" type="object" string="归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/> -->
|
||||||
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
<!-- <button name="unarchive" type="object" string="取消归档" icon="fa-archive" class="oe_highlight" attrs="{'invisible': [('active', '=', True)]}"/> -->
|
||||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
<!-- <button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/> -->
|
||||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||||
</xpath>
|
<!-- </xpath> -->
|
||||||
</field>
|
<!-- </field> -->
|
||||||
</record>
|
<!-- </record> -->
|
||||||
|
|
||||||
<!-- 增加权限相关的按钮 -->
|
<!-- 增加权限相关的按钮 -->
|
||||||
<record id="custom_mrp_bom_form_view" model="ir.ui.view">
|
<record id="custom_mrp_bom_form_view" model="ir.ui.view">
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ access_purchase_order_wizard_group_purchase_director,purchase_order_wizard_group
|
|||||||
access_crm_tag_group_sale_salemanager,crm_tag_group_sale_salemanager,sales_team.model_crm_tag,sf_base.group_sale_salemanager,1,0,0,0
|
access_crm_tag_group_sale_salemanager,crm_tag_group_sale_salemanager,sales_team.model_crm_tag,sf_base.group_sale_salemanager,1,0,0,0
|
||||||
access_crm_tag_group_sale_director,crm_tag_group_sale_director,sales_team.model_crm_tag,sf_base.group_sale_director,1,1,1,0
|
access_crm_tag_group_sale_director,crm_tag_group_sale_director,sales_team.model_crm_tag,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
access_sale_order,sale.order,sale.model_sale_order,sf_base.group_plan_dispatch,1,0,0,0
|
access_sale_order,sale.order,sale.model_sale_order,sf_base.group_plan_dispatch,1,1,0,0
|
||||||
access_res_partner_group_sale_salemanager,res_partner_group_sale_salemanager,base.model_res_partner,sf_base.group_sale_salemanager,1,0,1,0
|
access_res_partner_group_sale_salemanager,res_partner_group_sale_salemanager,base.model_res_partner,sf_base.group_sale_salemanager,1,0,1,0
|
||||||
access_res_partner_group_sale_director,res_partner_group_sale_director,base.model_res_partner,sf_base.group_sale_director,1,0,1,0
|
access_res_partner_group_sale_director,res_partner_group_sale_director,base.model_res_partner,sf_base.group_sale_director,1,0,1,0
|
||||||
access_res_partner_group_purchase,res_partner_group_purchase,base.model_res_partner,sf_base.group_purchase,1,0,1,0
|
access_res_partner_group_purchase,res_partner_group_purchase,base.model_res_partner,sf_base.group_purchase,1,0,1,0
|
||||||
|
|||||||
|
@@ -37,5 +37,41 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- 原生的按钮对base.user可见,这里修改为对库存用户可见 -->
|
||||||
|
<record id="sf_view_picking_form" model="ir.ui.view">
|
||||||
|
<field name="name">sf.view.picking.form</field>
|
||||||
|
<field name="model">stock.picking</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//form//header//button[@name='action_cancel']" position="replace">
|
||||||
|
<button name="action_cancel" attrs="{'invisible': [('state', 'not in', ('assigned', 'confirmed', 'draft', 'waiting'))]}" string="取消" groups="sf_warehouse.group_sf_stock_user" type="object" data-hotkey="z"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//form//header//button[@name='do_unreserve']" position="replace">
|
||||||
|
<button name="do_unreserve" string="取消保留" groups="sf_warehouse.group_sf_stock_user" type="object" attrs="{'invisible': ['|', '|', '|', ('picking_type_code', '=', 'incoming'), ('immediate_transfer', '=', True), '&', ('state', '!=', 'assigned'), ('move_type', '!=', 'one'), '&', ('state', 'not in', ('assigned', 'confirmed')), ('move_type', '=', 'one')]}" data-hotkey="w"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//form//header//button[@name='button_scrap']" position="replace">
|
||||||
|
<button name="button_scrap" groups="sf_warehouse.group_sf_stock_user" type="object" string="报废" attrs="{'invisible': ['|', '&', ('picking_type_code', '=', 'incoming'), ('state', '!=', 'done'), '&', ('picking_type_code', '=', 'outgoing'), ('state', '=', 'done')]}" data-hotkey="y"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//form//header//button[@name='action_assign']" position="replace">
|
||||||
|
<button name="action_assign" attrs="{'invisible': [('show_check_availability', '=', False)]}" string="检查可用量" type="object" class="oe_highlight" groups="sf_warehouse.group_sf_stock_user" data-hotkey="q"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//form//header//button[@name='%(stock.act_stock_return_picking)d']" position="replace">
|
||||||
|
<button name="%(stock.act_stock_return_picking)d" string="退回" attrs="{'invisible': [('state', '!=', 'done')]}" type="action" groups="sf_warehouse.group_sf_stock_user" data-hotkey="k"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="sf_stock_scrap_form_view" model="ir.ui.view">
|
||||||
|
<field name="name">sf.stock.scrap.form.view</field>
|
||||||
|
<field name="model">stock.scrap</field>
|
||||||
|
<field name="inherit_id" ref="stock.stock_scrap_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//header//button[@name='action_validate']" position="replace">
|
||||||
|
<button name="action_validate" states="draft" string="Validate" type="object" class="oe_highlight" context="{'not_unlink_on_discard': True}" data-hotkey="v" groups="sf_warehouse.group_sf_stock_user"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user