changeset 0c1d38a143c9 in modules/purchase_request_quotation:6.4
details:
https://hg.tryton.org/modules/purchase_request_quotation?cmd=changeset&node=0c1d38a143c9
description:
Reuse existing join in order_quotation_state
issue11865
review421911003
(grafted from 009d7282cf9d1cdf1990236886416abcb11544c9)
diffstat:
purchase.py | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (23 lines):
diff -r aef11adad97e -r 0c1d38a143c9 purchase.py
--- a/purchase.py Sat Nov 05 17:51:12 2022 +0100
+++ b/purchase.py Tue Nov 08 00:41:12 2022 +0100
@@ -315,11 +315,14 @@
def order_quotation_state(tables):
pool = Pool()
Quotation = pool.get('purchase.request.quotation')
- quotation_line, _ = tables[None]
- quotation = Quotation.__table__()
- tables['purchase.request.quotation'] = {
- None: (quotation, quotation_line.quotation == quotation.id),
- }
+ table, _ = tables[None]
+ if 'quotation' not in tables:
+ quotation = Quotation.__table__()
+ tables['quotation'] = {
+ None: (quotation, table.quotation == quotation.id),
+ }
+ else:
+ quotation, _ = tables['quotation'][None]
return [Case((quotation.state == 'received', 0), else_=1),
quotation.state]