Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug
# Conflicts: # sf_warehouse/views/view.xml
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
# 'jikimo_frontend/static/src/list/custom_import.js',
|
||||
# 'jikimo_frontend/static/src/list/custom_width.js',
|
||||
'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;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<data>
|
||||
<record id="product_category_embryo_sf" model="product.category">
|
||||
<field name="name">坯料</field>
|
||||
<field name="type">坯料</field>
|
||||
@@ -35,10 +35,15 @@
|
||||
<field name="type">功能刀具</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_bfm" model="res.partner">
|
||||
<field name="name">业务平台</field>
|
||||
<!-- <field name="company_id" ref="base.main_company"/>-->
|
||||
</record>
|
||||
<!-- <record id="res_partner_bfm" model="res.partner">-->
|
||||
<!-- <field name="name">业务平台</field>-->
|
||||
<!-- <!– <field name="company_id" ref="base.main_company"/>–>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!-- <record id="res_users_bfm" model="res.users">-->
|
||||
<!-- <field name="name">业务平台</field>-->
|
||||
<!-- <field name="partner_id" ref="res_partner_bfm"/>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="product_functional_tool_sf" model="product.product">
|
||||
<field name="name">功能刀具</field>
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="sequence_routing_workcenter" model="ir.sequence">
|
||||
<field name="name">工序编码规则</field>
|
||||
<field name="code">mrp.routing.workcenter</field>
|
||||
<field name="padding">4</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="sequence_stock_picking_out" model="ir.sequence">
|
||||
<field name="name">YourCompany Sequence ocout</field>
|
||||
<field name="prefix">WH/OCOUT/</field>
|
||||
|
||||
@@ -8,8 +8,6 @@ from odoo.exceptions import UserError
|
||||
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_is_zero
|
||||
|
||||
|
||||
class MrpProduction(models.Model):
|
||||
_inherit = 'mrp.production'
|
||||
@@ -162,7 +160,6 @@ class MrpProduction(models.Model):
|
||||
logging.info('fetchCNC error:%s' % e)
|
||||
raise UserError("cnc程序获取编程单失败,请联系管理员")
|
||||
|
||||
|
||||
# 维修模块按钮
|
||||
def button_maintenance_req(self):
|
||||
self.ensure_one()
|
||||
@@ -489,7 +486,7 @@ class MrpProduction(models.Model):
|
||||
self._reset_work_order_sequence()
|
||||
return True
|
||||
|
||||
#修改标记已完成方法
|
||||
# 修改标记已完成方法
|
||||
def button_mark_done1(self):
|
||||
self._button_mark_done_sanity_checks()
|
||||
|
||||
@@ -506,7 +503,6 @@ class MrpProduction(models.Model):
|
||||
productions_not_to_backorder = self
|
||||
productions_to_backorder = self.env['mrp.production']
|
||||
|
||||
|
||||
backorders = productions_to_backorder and productions_to_backorder._split_productions()
|
||||
backorders = backorders - productions_to_backorder
|
||||
|
||||
@@ -514,13 +510,16 @@ class MrpProduction(models.Model):
|
||||
productions_to_backorder._post_inventory(cancel_backorder=True)
|
||||
|
||||
# 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()
|
||||
|
||||
# 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
|
||||
# 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',
|
||||
'product_uom_qty': 0.0,
|
||||
})
|
||||
@@ -546,8 +545,10 @@ class MrpProduction(models.Model):
|
||||
'res_id': self.id,
|
||||
'target': 'main',
|
||||
}
|
||||
if self.user_has_groups('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 self.user_has_groups(
|
||||
'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 any(mo.show_allocation for mo in self):
|
||||
action = self.action_view_reception_report()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import logging
|
||||
from odoo import fields, models
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class ResMrpRoutingWorkcenter(models.Model):
|
||||
@@ -21,13 +22,17 @@ class ResMrpRoutingWorkcenter(models.Model):
|
||||
bom_id = fields.Many2one('mrp.bom', required=False)
|
||||
surface_technics_id = fields.Many2one('sf.production.process', string="表面工艺")
|
||||
|
||||
def generate_code(self):
|
||||
return self.env['ir.sequence'].next_by_code('mrp.routing.workcenter')
|
||||
|
||||
code = fields.Char('编码', default=generate_code)
|
||||
|
||||
# 获得当前登陆者公司
|
||||
def get_company_id(self):
|
||||
self.company_id = self.env.user.company_id.id
|
||||
|
||||
company_id = fields.Many2one('res.company', compute="get_company_id", related=False)
|
||||
|
||||
|
||||
# 排产的时候, 根据坯料的长宽高比对一下机床的最大加工尺寸.不符合就不要分配给这个加工中心(机床).
|
||||
# 工单对应的工作中心,根据工序中的工作中心去匹配,
|
||||
# 如果只配置了一个工作中心,则默认采用该工作中心;
|
||||
|
||||
@@ -232,7 +232,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'processing_panel': k,
|
||||
'quality_point_ids': route.route_workcenter_id.quality_point_ids,
|
||||
'routing_type': route.routing_type,
|
||||
'work_state': '' if not route.routing_type == '获取CNC加工程序' else '待发起',
|
||||
'work_state': '待发起',
|
||||
'workcenter_id': self.env['mrp.routing.workcenter'].get_workcenter(route.workcenter_ids.ids,
|
||||
route.routing_type,
|
||||
production.product_id),
|
||||
|
||||
@@ -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_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_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
|
||||
|
||||
|
@@ -53,6 +53,7 @@
|
||||
</record>
|
||||
|
||||
<!-- 增加权限相关的按钮 -->
|
||||
<!-- 制造订单的操作按钮只让制造用户可见 -->
|
||||
<record id="custom_mrp_production_form_view" model="ir.ui.view">
|
||||
<field name="name">custom.mrp.production.form</field>
|
||||
<field name="model">mrp.production</field>
|
||||
@@ -61,23 +62,151 @@
|
||||
<xpath expr="//field[@name='state']" position="attributes">
|
||||
<attribute name="statusbar_visible">draft,confirmed,progress,pending_processing,completed,done</attribute>
|
||||
</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">
|
||||
<field name="programming_no"/>
|
||||
<field name="work_state" invisible="1"/>
|
||||
<field name="programming_state"/>
|
||||
</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>
|
||||
</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"> -->
|
||||
<!-- <field name="name">custom.mrp.production.form</field> -->
|
||||
<!-- <field name="model">mrp.production</field> -->
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
<field name="model">mrp.routing.workcenter</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_routing_workcenter_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="before">
|
||||
<field name="code" readonly="1"/>
|
||||
</field>
|
||||
<field name="workcenter_id" position="replace">
|
||||
<field name="workcenter_ids" widget="many2many_tags" string="工作中心" required="0"/>
|
||||
<field name="surface_technics_id"
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_cancel" position="before">
|
||||
<button name="button_maintenance_req" type="object" string="维修请求"/>
|
||||
</button>
|
||||
<!-- <button name="action_cancel" position="before"> -->
|
||||
<!-- <button name="button_maintenance_req" type="object" string="维修请求"/> -->
|
||||
<!-- </button> -->
|
||||
<div name="button_box" position="inside">
|
||||
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
||||
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
||||
@@ -376,9 +376,9 @@
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_cancel" position="before">
|
||||
<button name="button_maintenance_req" type="object" string="维修请求"/>
|
||||
</button>
|
||||
<!-- <button name="action_cancel" position="before"> -->
|
||||
<!-- <button name="button_maintenance_req" type="object" string="维修请求"/> -->
|
||||
<!-- </button> -->
|
||||
<div name="button_box" position="inside">
|
||||
<button name="open_maintenance_request_mo" type="object" class="oe_stat_button" icon="fa-wrench"
|
||||
attrs="{'invisible': [('maintenance_count', '=', 0)]}"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# 'security/rules.xml',
|
||||
'wizard/action_plan_some.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
|
||||
record.state = 'done'
|
||||
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
|
||||
print('mrp_production_ids', mrp_production_ids)
|
||||
for i in mrp_production_ids:
|
||||
@@ -276,6 +280,10 @@ class sf_production_plan(models.Model):
|
||||
self.production_line_id = False
|
||||
aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)])
|
||||
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
|
||||
|
||||
def liucheng_cs(self):
|
||||
|
||||
@@ -36,21 +36,21 @@
|
||||
</record>
|
||||
|
||||
<!-- 增加权限相关的按钮 -->
|
||||
<record id="custom_product_template_form_view" model="ir.ui.view">
|
||||
<field name="name">custom.product.template.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//form//header" position="inside">
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <record id="custom_product_template_form_view" model="ir.ui.view"> -->
|
||||
<!-- <field name="name">custom.product.template.form</field> -->
|
||||
<!-- <field name="model">product.template</field> -->
|
||||
<!-- <field name="inherit_id" ref="product.product_template_form_view"/> -->
|
||||
<!-- <field name="arch" type="xml"> -->
|
||||
<!-- <xpath expr="//form//header" position="inside"> -->
|
||||
<!-- <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_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>
|
||||
</field>
|
||||
</record>
|
||||
<!-- </xpath> -->
|
||||
<!-- </field> -->
|
||||
<!-- </record> -->
|
||||
|
||||
<!-- 增加权限相关的按钮 -->
|
||||
<record id="custom_mrp_bom_form_view" model="ir.ui.view">
|
||||
|
||||
@@ -7,6 +7,19 @@ from odoo.exceptions import UserError
|
||||
class ReSaleOrder(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
state = fields.Selection(
|
||||
selection=[
|
||||
('draft', "报价"),
|
||||
('sent', "报价已发送"),
|
||||
('sale', "销售订单"),
|
||||
('done', "已锁定"),
|
||||
('cancel', '已废弃'),
|
||||
],
|
||||
string="状态",
|
||||
readonly=True, copy=False, index=True,
|
||||
tracking=3,
|
||||
default='draft')
|
||||
|
||||
deadline_of_delivery = fields.Date('订单交期', tracking=True)
|
||||
person_of_delivery = fields.Char('交货人')
|
||||
telephone_of_delivery = fields.Char('交货人电话号码')
|
||||
@@ -37,7 +50,8 @@ class ReSaleOrder(models.Model):
|
||||
'name': self.env['ir.sequence'].next_by_code('sale.order', sequence_date=now_time),
|
||||
'partner_id': partner.id,
|
||||
'check_status': 'approved',
|
||||
'state': 'draft',
|
||||
'state': 'sale',
|
||||
'user_id': partner.user_id.id,
|
||||
'person_of_delivery': delivery_name,
|
||||
'telephone_of_delivery': delivery_telephone,
|
||||
'address_of_delivery': delivery_address,
|
||||
@@ -59,11 +73,12 @@ class ReSaleOrder(models.Model):
|
||||
self.check_status = 'pending'
|
||||
|
||||
def get_customer(self):
|
||||
customer = self.env['res.partner'].search([('name', '=', '业务平台')])
|
||||
customer = self.env['res.partner'].search([('name', '=', '业务平台')], limit=1, order='id asc')
|
||||
if customer:
|
||||
return customer
|
||||
else:
|
||||
partner = self.env['res.partner'].create({'name': '业务平台'})
|
||||
self.env['res.users'].create({'name': '业务平台', 'partner_id': partner.id})
|
||||
return partner
|
||||
|
||||
# 业务平台分配工厂时在创建完产品后再创建销售明细信息
|
||||
@@ -79,7 +94,7 @@ class ReSaleOrder(models.Model):
|
||||
'product_uom_qty': item['number'],
|
||||
'model_glb_file': base64.b64decode(item['model_file']),
|
||||
}
|
||||
return self.env['sale.order.line'].create(vals)
|
||||
return self.env['sale.order.line'].with_context(skip_procurement=True).create(vals)
|
||||
|
||||
@api.constrains('order_line')
|
||||
def check_order_line(self):
|
||||
@@ -113,10 +128,22 @@ class RePurchaseOrder(models.Model):
|
||||
|
||||
check_status = fields.Selection([('pending', '待审核'), ('approved', '已审核'), ('fail', '不通过')], '审核状态')
|
||||
remark = fields.Text('备注')
|
||||
user_id = fields.Many2one(
|
||||
'res.users', string='买家', index=True, tracking=True,
|
||||
compute='_compute_user_id',
|
||||
store=True)
|
||||
|
||||
def button_confirming(self):
|
||||
self.write({'state': 'purchase', 'check_status': 'pending'})
|
||||
|
||||
@api.depends('partner_id')
|
||||
def _compute_user_id(self):
|
||||
if not self.user_id:
|
||||
if self.partner_id:
|
||||
self.user_id = self.partner_id.purchase_user_id.id
|
||||
else:
|
||||
self.user_id = self.env.user.id
|
||||
|
||||
@api.constrains('order_line')
|
||||
def check_order_line(self):
|
||||
for item in self:
|
||||
|
||||
@@ -12,7 +12,7 @@ access_product_product_group_sale_salemanager,product_product_group_sale_saleman
|
||||
access_product_product_group_sale_director,product_product_group_sale_director,product.model_product_product,sf_base.group_sale_director,1,1,1,0
|
||||
access_product_product_group_purchase,product_product_group_purchase,product.model_product_product,sf_base.group_purchase,1,0,0,0
|
||||
access_product_product_group_purchase_director,product_product_group_purchase_director,product.model_product_product,sf_base.group_purchase_director,1,1,1,0
|
||||
access_product_template_group_sale_salemanager,product_product_group_sale_salemanager,product.model_product_template,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_product_template_group_sale_salemanager,product_template_group_sale_salemanager,product.model_product_template,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_product_template_group_sale_director,product_template_group_sale_director,product.model_product_template,sf_base.group_sale_director,1,1,1,0
|
||||
access_product_template_group_purchase,product_template_group_purchase,product.model_product_template,sf_base.group_purchase,1,0,0,0
|
||||
access_product_template_group_purchase_director,product_template_group_purchase_director,product.model_product_template,sf_base.group_purchase_director,1,1,1,0
|
||||
@@ -20,8 +20,8 @@ access_product_template_group_plan_dispatch,product_template_group_plan_dispatch
|
||||
access_product_template_group_plan_director,product_template_group_plan_director,product.model_product_template,sf_base.group_plan_director,1,1,1,0
|
||||
access_stock_picking_group_sale_salemanager,stock_picking_group_sale_salemanager,stock.model_stock_picking,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_stock_picking_group_sale_director,stock_picking_group_sale_director,stock.model_stock_picking,sf_base.group_sale_director,1,0,0,0
|
||||
access_stock_picking_group_purchase,stock_picking_group_purchase,stock.model_stock_picking,sf_base.group_purchase,1,0,0,0
|
||||
access_stock_picking_group_purchase_director,stock_picking_group_purchase_director,stock.model_stock_picking,sf_base.group_purchase_director,1,0,0,0
|
||||
access_stock_picking_group_purchase,stock_picking_group_purchase,stock.model_stock_picking,sf_base.group_purchase,1,1,1,0
|
||||
access_stock_picking_group_purchase_director,stock_picking_group_purchase_director,stock.model_stock_picking,sf_base.group_purchase_director,1,1,1,0
|
||||
access_account_move_group_sale_salemanager,account_move_group_sale_salemanager,account.model_account_move,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_account_move_group_sale_director,account_move_group_sale_director,account.model_account_move,sf_base.group_sale_director,1,0,0,0
|
||||
access_resource_resource_group_sale_director,resource_resource_group_sale_director,resource.model_resource_resource,sf_base.group_sale_director,1,1,1,0
|
||||
@@ -33,8 +33,8 @@ access_mrp_bom_group_quality,mrp_bom_group_quality,mrp.model_mrp_bom,sf_base.gro
|
||||
access_mrp_bom_group_quality_director,mrp_bom_group_quality_director,mrp.model_mrp_bom,sf_base.group_quality_director,1,0,0,0
|
||||
access_stock_move_group_sale_salemanager,stock_move_group_sale_salemanager,stock.model_stock_move,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_stock_move_group_sale_director,stock_move_group_sale_director,stock.model_stock_move,sf_base.group_sale_director,1,0,0,0
|
||||
access_stock_move_group_purchase,stock_move_group_purchase,stock.model_stock_move,sf_base.group_purchase,1,0,0,0
|
||||
access_stock_move_group_purchase_director,stock_move_group_purchase_director,stock.model_stock_move,sf_base.group_purchase_director,1,0,0,0
|
||||
access_stock_move_group_purchase,stock_move_group_purchase,stock.model_stock_move,sf_base.group_purchase,1,1,1,0
|
||||
access_stock_move_group_purchase_director,stock_move_group_purchase_director,stock.model_stock_move,sf_base.group_purchase_director,1,1,1,0
|
||||
access_stock_warehouse_orderpoint_group_sale_salemanager,stock_warehouse_orderpoint_group_sale_salemanager,stock.model_stock_warehouse_orderpoint,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_stock_warehouse_orderpoint_group_sale_director,stock_warehouse_orderpoint_group_sale_director,stock.model_stock_warehouse_orderpoint,sf_base.group_sale_director,1,0,0,0
|
||||
access_stock_warehouse_orderpoint_group_purchase,stock_warehouse_orderpoint_group_purchase,stock.model_stock_warehouse_orderpoint,sf_base.group_purchase,1,1,0,0
|
||||
@@ -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_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_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
|
||||
|
||||
|
@@ -11,14 +11,14 @@
|
||||
</field>
|
||||
<field name="currency_id" position="after">
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <field name="state"/>-->
|
||||
<!-- <field name="state"/>-->
|
||||
<field name="remark" attrs="{'readonly': ['&',('state', 'in', ['purchase']),('check_status','in',
|
||||
['pending','approved'])]}"/>
|
||||
</field>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="after">
|
||||
<button name="sf_sale.action_purchase_order_check_wizard" string="审核" type="action"
|
||||
context="{'default_order_id':active_id}" groups="sf_base.group_purchase_director"
|
||||
attrs="{'invisible': ['&',('check_status','in', ['approved',False]),('state', 'in', ['purchase'])]}"
|
||||
attrs="{'invisible': ['&',('check_status','in', ['approved',False,'fail']),('state', 'in', ['purchase'])]}"
|
||||
class="oe_highlight"/>
|
||||
|
||||
</xpath>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<xpath expr="//form/header/button[@name='action_confirm'][2]" position="replace">
|
||||
<button name="action_confirm" data-hotkey="v"
|
||||
string="确认" type="object" context="{'validate_analytic': True}"
|
||||
attrs="{'invisible': ['|','&',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel'])]}"/>
|
||||
attrs="{'invisible': ['|','&',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&','&',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel']),('schedule_status', 'not in', False)]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_cancel']" position="attributes">
|
||||
<attribute name="attrs">{'invisible': ['|',('state', 'in', ['cancel']),('check_status', 'in',
|
||||
@@ -237,6 +237,9 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="sale.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<form position="attributes">
|
||||
<attribute name="delete">False</attribute>
|
||||
</form>
|
||||
<field name="categ_id" position="replace">
|
||||
<field name='categ_id' invisible="1"/>
|
||||
</field>
|
||||
|
||||
@@ -240,7 +240,7 @@ class FunctionalToolWarning(models.Model):
|
||||
class StockMoveLine(models.Model):
|
||||
_inherit = 'stock.move.line'
|
||||
_description = '功能刀具出入库记录'
|
||||
_order = 'install_tool_time desc'
|
||||
# _order = 'install_tool_time desc'
|
||||
|
||||
functional_tool_name_id = fields.Many2one('sf.functional.tool.assembly', string='功能刀具名称')
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', store=True,
|
||||
|
||||
@@ -567,30 +567,6 @@ class SfPickingType(models.Model):
|
||||
self.check_state = 'enable'
|
||||
|
||||
|
||||
class SfProductCategory(models.Model):
|
||||
_inherit = 'product.category'
|
||||
|
||||
check_state = fields.Selection([
|
||||
('enable', '启用'),
|
||||
('close', '关闭')
|
||||
], string='审核状态', default='close')
|
||||
|
||||
def action_check(self):
|
||||
self.check_state = 'enable'
|
||||
|
||||
|
||||
class SfUomCategory(models.Model):
|
||||
_inherit = 'uom.category'
|
||||
|
||||
check_state = fields.Selection([
|
||||
('enable', '启用'),
|
||||
('close', '关闭')
|
||||
], string='审核状态', default='close')
|
||||
|
||||
def action_check(self):
|
||||
self.check_state = 'enable'
|
||||
|
||||
|
||||
class SfBarcodeNomenclature(models.Model):
|
||||
_inherit = 'barcode.nomenclature'
|
||||
|
||||
|
||||
@@ -37,5 +37,41 @@
|
||||
</field>
|
||||
</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>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user