Merge branch 'refs/heads/release/release_2.7' into feature/part_number

This commit is contained in:
liaodanlong
2025-01-06 11:20:44 +08:00
6 changed files with 45 additions and 16 deletions

View File

@@ -20,7 +20,7 @@
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['purchase', 'base_tier_validation', 'documents', 'purchase_request', 'account', 'purchase_order_approved'],
'depends': ['purchase', 'purchase_tier_validation', 'documents', 'purchase_request', 'account', 'purchase_order_approved'],
# always loaded
'data': [

View File

@@ -1 +1,2 @@
from . import upload_file_wizard
from . import upload_file_wizard
from . import comment_wizard

View File

@@ -0,0 +1,15 @@
from odoo import models, fields
class CommentWizard(models.TransientModel):
_inherit = "comment.wizard"
def add_comment(self):
rec = self.env[self.res_model].browse(self.res_id)
self.review_ids = rec.review_ids
result = super(CommentWizard, self).add_comment()
return result

View File

@@ -330,7 +330,7 @@ class ResMrpWorkOrder(models.Model):
return result
def _get_surface_technics_purchase_ids(self):
domain = [('origin', '=', self.production_id.name), ('purchase_type', '=', 'consignment')]
domain = [('origin', 'like', '%' + self.production_id.name + '%'), ('purchase_type', '=', 'consignment')]
purchase_orders = self.env['purchase.order'].search(domain)
purchase_orders_id = self.env['purchase.order']
for po in purchase_orders:
@@ -1058,16 +1058,18 @@ class ResMrpWorkOrder(models.Model):
and workorder.production_id.schedule_state == '已排'
and len(workorder.production_id.picking_ids.filtered(
lambda w: w.state not in ['done', 'cancel'])) == 0):
workorder.state = 'ready'
if workorder.is_subcontract is True:
purchase_orders_id = self._get_surface_technics_purchase_ids()
if purchase_orders_id.state == 'purchase':
workorder.state = 'ready'
move_out = workorder.move_subcontract_workorder_ids[1]
for mo in move_out:
if mo.state != 'done':
mo.write({'state': 'assigned', 'production_id': False})
continue
else:
workorder.state = 'waiting'
continue
else:
workorder.state = 'ready'
continue
else:
workorder.state = 'waiting'
continue
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
@@ -1076,7 +1078,7 @@ class ResMrpWorkOrder(models.Model):
if workorder.state != 'waiting':
workorder.state = 'waiting'
continue
if workorder.production_id.programming_state == '已编程' and workorder.technology_design_id.routing_tag != 'special':
if workorder.production_id.programming_state == '已编程':
workorder.state = 'ready'
elif workorder.state != 'waiting':
workorder.state = 'waiting'
@@ -1091,12 +1093,17 @@ class ResMrpWorkOrder(models.Model):
if workorder.is_subcontract is False:
workorder.state = 'ready'
else:
if len(workorder.production_id.picking_ids.filtered(
lambda w: w.state not in ['done',
'cancel'])) == 0 and workorder.production_id.programming_state == '已编程':
workorder.state = 'ready'
purchase_orders_id = self._get_surface_technics_purchase_ids()
if purchase_orders_id:
workorder.state = 'ready' if purchase_orders_id.state == 'purchase' else 'waiting'
else:
workorder.state = 'waiting'
if purchase_orders_id.state == 'purchase':
move_out = workorder.move_subcontract_workorder_ids[1]
for mo in move_out:
if mo.state != 'done':
mo.write({'state': 'assigned', 'production_id': False})
# 重写工单开始按钮方法
def button_start(self):

View File

@@ -207,8 +207,9 @@ class WorkpieceDeliveryWizard(models.TransientModel):
workorder.production_line_id.id != self.production_ids[0].production_line_id.id):
raise UserError(f'该rfid对应的制造订单号为{workorder.production_id.name}的目的生产线不一致')
# 调用打印成品条码方法
workorder.print_method()
if workorder.routing_type == '解除装夹':
# 调用打印成品条码方法
workorder.print_method()
# 将对象添加到对应的同模型且是多对多类型里
self.production_ids |= workorder.production_id

View File

@@ -2023,6 +2023,11 @@ msgstr "<span class=\"o_stat_text\">损失</span>"
msgid "<span class=\"o_stat_text\">Maintenance</span>"
msgstr ""
#. module: sf_manufacturing
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__confirmed
msgid "待排程"
msgstr "待排程"
#. module: mrp
#: model_terms:ir.ui.view,arch_db:mrp.product_product_form_view_bom_button
#: model_terms:ir.ui.view,arch_db:mrp.product_template_form_view_bom_button