Compare commits

...

8 Commits

Author SHA1 Message Date
胡尧
b704f99a29 删除plm模块代码 2025-07-07 14:59:48 +08:00
胡尧
8b3eef1256 新增 2025-07-07 11:59:14 +08:00
禹翔辉
c6c4331c0b Accept Merge Request #2267: (feature/调拨单质检 -> develop)
Merge Request: 处理  成品出库单创建欠单后生成的调拨单详情页中质量检查智能按钮默认展示为通过状态  问题

Created By: @禹翔辉
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2267
2025-07-04 13:49:35 +08:00
yuxianghui
10c6f59f52 处理 成品出库单创建欠单后生成的调拨单详情页中质量检查智能按钮默认展示为通过状态 问题 2025-07-04 13:48:16 +08:00
胡尧
b23e50daa6 Accept Merge Request #2266: (feature/6711 -> develop)
Merge Request: 解决采购申请创建的采购单取消后导致后续单据无法就绪的问题

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2266?initial=true
2025-07-02 17:32:14 +08:00
胡尧
4615f1576f 解决采购申请创建的采购单取消后导致后续单据无法就绪的问题 2025-07-02 17:31:43 +08:00
胡尧
20df1c0365 Accept Merge Request #2265: (release/release_2.15 -> develop)
Merge Request: 需求计划列表字段位置变动

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2265
2025-07-01 17:57:16 +08:00
胡尧
c8f1676de9 解决采购申请创建的采购单取消后导致调拨单不能就绪的问题 2025-07-01 17:55:07 +08:00
4 changed files with 47 additions and 5 deletions

View File

@@ -94,12 +94,20 @@ class PurchaseOrder(models.Model):
def button_cancel(self): def button_cancel(self):
""" """
将取消的采购订单关联的库存移动撤销 1. 先将采购订单行与目标库存移动断开链接避免采购单取消后调拨单被调整为mts的问题
2. 取消采购订单
3. 将采购订单行与目标库存移动重新建立链接
""" """
move_ids = self.order_line.move_dest_ids.filtered(lambda move: move.state != 'done' and not move.scrapped) created_purchase_request_line_ids = {}
if self.order_line.move_dest_ids.created_purchase_request_line_id:
move_ids = self.order_line.move_dest_ids.filtered(lambda move: move.state != 'done' and not move.scrapped)
created_purchase_request_line_ids = {move.id: move.created_purchase_request_line_id for move in move_ids}
self.order_line.write({'move_dest_ids': [(5, 0, 0)]})
res =super(PurchaseOrder, self).button_cancel() res =super(PurchaseOrder, self).button_cancel()
if move_ids.mapped('created_purchase_request_line_id'): for move_id, created_purchase_request_line_id in created_purchase_request_line_ids.items():
move_ids.write({'state': 'waiting', 'is_done': False}) self.env['stock.move'].browse(move_id).created_purchase_request_line_id = created_purchase_request_line_id
# if move_ids.mapped('created_purchase_request_line_id'):
# move_ids.write({'state': 'waiting', 'is_done': False})
return res return res
def write(self, vals): def write(self, vals):

View File

@@ -22,6 +22,7 @@
'data/report_actions.xml', 'data/report_actions.xml',
'views/view.xml', 'views/view.xml',
'views/quality_cnc_test_view.xml', 'views/quality_cnc_test_view.xml',
'views/stock_picking.xml',
'views/mrp_workorder.xml', 'views/mrp_workorder.xml',
'views/quality_check_view.xml', 'views/quality_check_view.xml',
'views/quality_company.xml', 'views/quality_company.xml',

View File

@@ -1,24 +1,29 @@
import logging import logging
from odoo import api, models from odoo import api, models, fields
from odoo.exceptions import ValidationError, UserError from odoo.exceptions import ValidationError, UserError
class StockPicking(models.Model): class StockPicking(models.Model):
_inherit = 'stock.picking' _inherit = 'stock.picking'
whether_show_quality_check = fields.Boolean('是否显示质量检测按钮', default=True)
def _compute_check(self): def _compute_check(self):
super()._compute_check() super()._compute_check()
for picking in self: for picking in self:
picking_to_quality = picking.get_picking_to_quality() picking_to_quality = picking.get_picking_to_quality()
if not picking_to_quality: if not picking_to_quality:
picking.quality_check_todo = False picking.quality_check_todo = False
picking.whether_show_quality_check = False
break break
else: else:
picking.whether_show_quality_check = True
need_quality_line = picking.get_need_quality_line(picking_to_quality) need_quality_line = picking.get_need_quality_line(picking_to_quality)
if not need_quality_line or all(not line.get('need_done_check_ids') for line in need_quality_line): if not need_quality_line or all(not line.get('need_done_check_ids') for line in need_quality_line):
picking.quality_check_todo = False picking.quality_check_todo = False
def check_quality(self): def check_quality(self):
self.ensure_one() self.ensure_one()
# checkable_products = self.mapped('move_line_ids').mapped('product_id') # checkable_products = self.mapped('move_line_ids').mapped('product_id')

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="stock_picking_view_form_inherit_quality_sf_quality" model="ir.ui.view">
<field name="name">stock.picking.view.form.sf.quality</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="quality_control.stock_picking_view_form_inherit_quality"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<field name="whether_show_quality_check" invisible="1"/>
</xpath>
<xpath expr="//button[@name='action_open_quality_check_picking'][1]" position="attributes">
<attribute name="attrs">{'invisible': ['|', '|','|', ('check_ids', '=', []), ('quality_check_fail', '=',
True), ('quality_check_todo', '!=', True), ('whether_show_quality_check', '!=', True)]}
</attribute>
</xpath>
<xpath expr="//button[@name='action_open_quality_check_picking'][2]" position="attributes">
<attribute name="attrs">{'invisible': ['|', '|','|', ('check_ids', '=', []), ('quality_check_fail', '=',
True), ('quality_check_todo', '=', True), ('whether_show_quality_check', '!=', True)]}
</attribute>
</xpath>
<xpath expr="//button[@name='action_open_quality_check_picking'][3]" position="attributes">
<attribute name="attrs">{'invisible': ['|', '|',('check_ids', '=', []), ('quality_check_fail', '!=',
True), ('whether_show_quality_check', '!=', True)]}
</attribute>
</xpath>
</field>
</record>
</odoo>