采购申请跳转到采购单,不默认筛选询价单
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
import ast
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
@@ -20,6 +21,13 @@ class PurchaseRequest(models.Model):
|
|||||||
if pr.state != 'draft' and pr.rule_new_add:
|
if pr.state != 'draft' and pr.rule_new_add:
|
||||||
pr.rule_new_add = False
|
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):
|
class PurchaseRequestLine(models.Model):
|
||||||
_inherit = 'purchase.request.line'
|
_inherit = 'purchase.request.line'
|
||||||
|
|||||||
Reference in New Issue
Block a user