changeset 009d7282cf9d in modules/purchase_request_quotation:default
details:
https://hg.tryton.org/modules/purchase_request_quotation?cmd=changeset&node=009d7282cf9d
description:
Reuse existing join in order_quotation_state
issue11865
review421911003
diffstat:
purchase.py | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diffs (23 lines):
diff -r 3fed9684f0d5 -r 009d7282cf9d purchase.py
--- a/purchase.py Mon Oct 31 17:19:40 2022 +0100
+++ b/purchase.py Tue Nov 08 00:41:12 2022 +0100
@@ -330,11 +330,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]