Merge lp:~unifield-team/unifield-server/us-1694 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4121
Proposed branch: lp:~unifield-team/unifield-server/us-1694
Merge into: lp:unifield-server
Diff against target: 68 lines (+1/-40)
2 files modified
bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako (+1/-1)
bin/addons/tender_flow/report/tender_rfq_comparison_xls.py (+0/-39)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-1694
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+313322@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako'
--- bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako 2016-12-05 15:18:05 +0000
+++ bin/addons/tender_flow/report/tender_rfq_comparison_xls.mako 2016-12-15 08:33:29 +0000
@@ -541,7 +541,7 @@
541 <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Details')}:</Data></Cell>541 <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Details')}:</Data></Cell>
542 <Cell ss:StyleID="sData"><Data ss:Type="String">${o.details or ''|x}</Data></Cell>542 <Cell ss:StyleID="sData"><Data ss:Type="String">${o.details or ''|x}</Data></Cell>
543 <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Currency')}:</Data></Cell>543 <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Currency')}:</Data></Cell>
544 <Cell ss:StyleID="sData"><Data ss:Type="String">${get_same_and_default_currency(o)[1].name or ''|x}</Data></Cell>544 <Cell ss:StyleID="sData"><Data ss:Type="String">${o.company_id.currency_id.name or ''|x}</Data></Cell>
545 <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Tender Priority')}:</Data></Cell>545 <Cell ss:StyleID="sTitle" ss:MergeAcross="1"><Data ss:Type="String">${_('Tender Priority')}:</Data></Cell>
546 <Cell ss:StyleID="sData"><Data ss:Type="String">${getSel(o, 'priority')|x}</Data></Cell>546 <Cell ss:StyleID="sData"><Data ss:Type="String">${getSel(o, 'priority')|x}</Data></Cell>
547 </Row>547 </Row>
548548
=== modified file 'bin/addons/tender_flow/report/tender_rfq_comparison_xls.py'
--- bin/addons/tender_flow/report/tender_rfq_comparison_xls.py 2016-12-05 15:15:27 +0000
+++ bin/addons/tender_flow/report/tender_rfq_comparison_xls.py 2016-12-15 08:33:29 +0000
@@ -17,8 +17,6 @@
17 super(tender_rfq_comparison, self).__init__(cr, uid, name, context=context)17 super(tender_rfq_comparison, self).__init__(cr, uid, name, context=context)
18 self.localcontext.update({18 self.localcontext.update({
19 'get_compare_lines': self.get_compare_lines,19 'get_compare_lines': self.get_compare_lines,
20 'gen_line_link': self.gen_line_link,
21 'get_same_and_default_currency': self.get_same_and_default_currency,
22 })20 })
2321
24 def get_compare_lines(self, tender_obj):22 def get_compare_lines(self, tender_obj):
@@ -85,42 +83,5 @@
8583
86 return lines84 return lines
8785
88 def get_same_and_default_currency(self, tender_obj):
89
90 if tender_obj == 'draft' or not tender_obj.rfq_ids:
91 return (True, self.localcontext['company'].currency_id)
92
93 current_cur = False
94
95 for rfq in tender_obj.rfq_ids:
96 next_cur = rfq.currency_id
97 if current_cur and current_cur.id != next_cur.id:
98 return (False, self.localcontext['company'].currency_id)
99 current_cur = rfq.currency_id
100 return (True, current_cur)
101
102 def gen_line_link(self, tender_obj):
103 link_line_supp = {}
104
105 same_cur, currency = self.get_same_and_default_currency(tender_obj)
106 cur_obj = self.pool.get('res.currency')
107
108 if tender_obj.rfq_ids:
109 # fine we have rfqs
110 for rfq in tender_obj.rfq_ids:
111 for line in rfq.order_line:
112 data = {'notes': line.notes, 'price_unit': line.price_unit}
113 if not same_cur:
114 data['price_unit'] = cur_obj.compute(self.cr, self.uid, line.currency_id.id, currency.id, line.price_unit, round=True)
115
116 link_line_supp.setdefault(line.product_id.id, {}).setdefault(rfq.partner_id.id, data)
117 elif tender_obj.supplier_ids:
118 for line in tender_obj.tender_line_ids:
119 link_line_supp[line.product_id.id] = {}
120 for supp in tender_obj.supplier_ids:
121 link_line_supp[line.product_id.id][supp.id] = {}
122
123 return link_line_supp
124
12586
126SpreadsheetReport('report.tender_rfq_comparison_xls', 'tender', 'tender_flow/report/tender_rfq_comparison_xls.mako', parser=tender_rfq_comparison)87SpreadsheetReport('report.tender_rfq_comparison_xls', 'tender', 'tender_flow/report/tender_rfq_comparison_xls.mako', parser=tender_rfq_comparison)

Subscribers

People subscribed via source and target branches

to all changes: