Accept Merge Request #1969: (feature/mrp_bug_fixed -> develop)

Merge Request: 采购申请跳转到采购单,不默认筛选询价单

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1969?initial=true
This commit is contained in:
胡尧
2025-03-25 17:10:17 +08:00
committed by Coding

View File

@@ -1,4 +1,5 @@
import re
import ast
from odoo import models, fields, api
@@ -20,6 +21,13 @@ class PurchaseRequest(models.Model):
if pr.state != 'draft' and pr.rule_new_add:
pr.rule_new_add = False
def action_view_purchase_order(self):
action = super(PurchaseRequest, self).action_view_purchase_order()
origin_context = ast.literal_eval(action['context'])
if 'search_default_draft' in origin_context:
origin_context.pop('search_default_draft')
action['context'] = origin_context
return action
class PurchaseRequestLine(models.Model):
_inherit = 'purchase.request.line'