Merge branch 'refs/heads/release/release_2.7' into feature/part_number
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
'version': '0.1',
|
'version': '0.1',
|
||||||
|
|
||||||
# any module necessary for this one to work correctly
|
# 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
|
# always loaded
|
||||||
'data': [
|
'data': [
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
from . import upload_file_wizard
|
from . import upload_file_wizard
|
||||||
|
from . import comment_wizard
|
||||||
15
jikimo_purchase_tier_validation/wizards/comment_wizard.py
Normal file
15
jikimo_purchase_tier_validation/wizards/comment_wizard.py
Normal 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
|
||||||
@@ -330,7 +330,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def _get_surface_technics_purchase_ids(self):
|
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 = self.env['purchase.order'].search(domain)
|
||||||
purchase_orders_id = self.env['purchase.order']
|
purchase_orders_id = self.env['purchase.order']
|
||||||
for po in purchase_orders:
|
for po in purchase_orders:
|
||||||
@@ -1058,16 +1058,18 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
and workorder.production_id.schedule_state == '已排'
|
and workorder.production_id.schedule_state == '已排'
|
||||||
and len(workorder.production_id.picking_ids.filtered(
|
and len(workorder.production_id.picking_ids.filtered(
|
||||||
lambda w: w.state not in ['done', 'cancel'])) == 0):
|
lambda w: w.state not in ['done', 'cancel'])) == 0):
|
||||||
|
workorder.state = 'ready'
|
||||||
if workorder.is_subcontract is True:
|
if workorder.is_subcontract is True:
|
||||||
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
||||||
if purchase_orders_id.state == 'purchase':
|
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
|
continue
|
||||||
else:
|
continue
|
||||||
workorder.state = 'waiting'
|
else:
|
||||||
continue
|
workorder.state = 'waiting'
|
||||||
else:
|
|
||||||
workorder.state = 'ready'
|
|
||||||
continue
|
continue
|
||||||
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
|
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
|
||||||
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
|
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':
|
if workorder.state != 'waiting':
|
||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
continue
|
continue
|
||||||
if workorder.production_id.programming_state == '已编程' and workorder.technology_design_id.routing_tag != 'special':
|
if workorder.production_id.programming_state == '已编程':
|
||||||
workorder.state = 'ready'
|
workorder.state = 'ready'
|
||||||
elif workorder.state != 'waiting':
|
elif workorder.state != 'waiting':
|
||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
@@ -1091,12 +1093,17 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
if workorder.is_subcontract is False:
|
if workorder.is_subcontract is False:
|
||||||
workorder.state = 'ready'
|
workorder.state = 'ready'
|
||||||
else:
|
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()
|
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
||||||
if purchase_orders_id:
|
if purchase_orders_id:
|
||||||
workorder.state = 'ready' if purchase_orders_id.state == 'purchase' else 'waiting'
|
if purchase_orders_id.state == 'purchase':
|
||||||
else:
|
move_out = workorder.move_subcontract_workorder_ids[1]
|
||||||
workorder.state = 'waiting'
|
for mo in move_out:
|
||||||
|
if mo.state != 'done':
|
||||||
|
mo.write({'state': 'assigned', 'production_id': False})
|
||||||
|
|
||||||
# 重写工单开始按钮方法
|
# 重写工单开始按钮方法
|
||||||
def button_start(self):
|
def button_start(self):
|
||||||
|
|||||||
@@ -207,8 +207,9 @@ class WorkpieceDeliveryWizard(models.TransientModel):
|
|||||||
workorder.production_line_id.id != self.production_ids[0].production_line_id.id):
|
workorder.production_line_id.id != self.production_ids[0].production_line_id.id):
|
||||||
raise UserError(f'该rfid对应的制造订单号为{workorder.production_id.name}的目的生产线不一致')
|
raise UserError(f'该rfid对应的制造订单号为{workorder.production_id.name}的目的生产线不一致')
|
||||||
|
|
||||||
# 调用打印成品条码方法
|
if workorder.routing_type == '解除装夹':
|
||||||
workorder.print_method()
|
# 调用打印成品条码方法
|
||||||
|
workorder.print_method()
|
||||||
|
|
||||||
# 将对象添加到对应的同模型且是多对多类型里
|
# 将对象添加到对应的同模型且是多对多类型里
|
||||||
self.production_ids |= workorder.production_id
|
self.production_ids |= workorder.production_id
|
||||||
|
|||||||
@@ -2023,6 +2023,11 @@ msgstr "<span class=\"o_stat_text\">损失</span>"
|
|||||||
msgid "<span class=\"o_stat_text\">Maintenance</span>"
|
msgid "<span class=\"o_stat_text\">Maintenance</span>"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: sf_manufacturing
|
||||||
|
#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__confirmed
|
||||||
|
msgid "待排程"
|
||||||
|
msgstr "待排程"
|
||||||
|
|
||||||
#. module: mrp
|
#. 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_product_form_view_bom_button
|
||||||
#: model_terms:ir.ui.view,arch_db:mrp.product_template_form_view_bom_button
|
#: model_terms:ir.ui.view,arch_db:mrp.product_template_form_view_bom_button
|
||||||
|
|||||||
Reference in New Issue
Block a user