diff --git a/jikimo_frontend/__manifest__.py b/jikimo_frontend/__manifest__.py index 5808f8eb..2711118a 100644 --- a/jikimo_frontend/__manifest__.py +++ b/jikimo_frontend/__manifest__.py @@ -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', ], diff --git a/jikimo_frontend/static/src/css/list_border_styles.css b/jikimo_frontend/static/src/css/list_border_styles.css new file mode 100644 index 00000000..bca5499e --- /dev/null +++ b/jikimo_frontend/static/src/css/list_border_styles.css @@ -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; +} \ No newline at end of file diff --git a/sf_dlm/data/product_data.xml b/sf_dlm/data/product_data.xml index 9b562fbb..95d19c39 100644 --- a/sf_dlm/data/product_data.xml +++ b/sf_dlm/data/product_data.xml @@ -1,6 +1,6 @@ - + 坯料 坯料 @@ -35,10 +35,15 @@ 功能刀具 - - 业务平台 - - + + + + + + + + + 功能刀具 diff --git a/sf_manufacturing/data/stock_data.xml b/sf_manufacturing/data/stock_data.xml index 74d02b4a..6bd0fe53 100644 --- a/sf_manufacturing/data/stock_data.xml +++ b/sf_manufacturing/data/stock_data.xml @@ -1,6 +1,13 @@ + + 工序编码规则 + mrp.routing.workcenter + 4 + + + YourCompany Sequence ocout WH/OCOUT/ diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 0ce21c8f..8eb17dfd 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -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() @@ -574,4 +575,4 @@ class MrpProduction(models.Model): 'domain': [('id', 'in', backorders.ids)], 'view_mode': 'tree,form', }) - return action \ No newline at end of file + return action diff --git a/sf_manufacturing/models/mrp_routing_workcenter.py b/sf_manufacturing/models/mrp_routing_workcenter.py index d989f233..8bb9733b 100644 --- a/sf_manufacturing/models/mrp_routing_workcenter.py +++ b/sf_manufacturing/models/mrp_routing_workcenter.py @@ -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) - # 排产的时候, 根据坯料的长宽高比对一下机床的最大加工尺寸.不符合就不要分配给这个加工中心(机床). # 工单对应的工作中心,根据工序中的工作中心去匹配, # 如果只配置了一个工作中心,则默认采用该工作中心; diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index e1589bd9..1434078e 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -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), diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index 7632686f..7711e4fe 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -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 diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index 509cf473..5c7f9cc0 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -53,6 +53,7 @@ + custom.mrp.production.form mrp.production @@ -61,23 +62,151 @@ draft,confirmed,progress,pending_processing,completed,done - - - - - - + + +
+ + +