Merge lp:~dorian-kemps/unifield-server/US-4274 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4920
Proposed branch: lp:~dorian-kemps/unifield-server/US-4274
Merge into: lp:unifield-server
Diff against target: 1425 lines (+585/-272)
16 files modified
bin/addons/delivery_mechanism/delivery_mechanism.py (+1/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+139/-0)
bin/addons/msf_supply_doc_export/msf_supply_doc_export.py (+7/-2)
bin/addons/msf_supply_doc_export/report/report_po_follow_up.rml (+53/-37)
bin/addons/msf_supply_doc_export/report/report_po_follow_up_xls.mako (+48/-17)
bin/addons/sales_followup/report/ir_follow_up_location_report.py (+19/-36)
bin/addons/sales_followup/report/ir_follow_up_location_report.rml (+57/-47)
bin/addons/sales_followup/report/ir_follow_up_location_report_xls.mako (+8/-3)
bin/addons/sales_followup/report/sale_follow_up_multi_report.rml (+68/-42)
bin/addons/sales_followup/report/sale_follow_up_multi_report_xls.mako (+140/-42)
bin/addons/sales_followup/report/sale_follow_up_report_multi.py (+34/-22)
bin/addons/sales_followup/wizard/ir_followup_location_wizard.py (+5/-11)
bin/addons/sales_followup/wizard/ir_followup_location_wizard_view.xml (+0/-1)
bin/addons/sales_followup/wizard/sale_followup_multi_wizard.py (+5/-11)
bin/addons/sales_followup/wizard/sale_followup_multi_wizard_view.xml (+0/-1)
bin/addons/stock_override/stock.py (+1/-0)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-4274
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+343388@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/delivery_mechanism/delivery_mechanism.py'
--- bin/addons/delivery_mechanism/delivery_mechanism.py 2018-04-20 07:14:38 +0000
+++ bin/addons/delivery_mechanism/delivery_mechanism.py 2018-05-17 08:41:16 +0000
@@ -1142,6 +1142,7 @@
1142 sol_to_relink = self.pool.get('sale.order.line').search(cr, uid, [1142 sol_to_relink = self.pool.get('sale.order.line').search(cr, uid, [
1143 ('product_uom_qty', '=', out_move.product_qty - uom_partial_qty),1143 ('product_uom_qty', '=', out_move.product_qty - uom_partial_qty),
1144 ('line_number', '=', out_move.sale_line_id.line_number),1144 ('line_number', '=', out_move.sale_line_id.line_number),
1145 ('order_id', '=', out_move.picking_id.sale_id.id),
1145 ], context=context)1146 ], context=context)
1146 if sol_to_relink:1147 if sol_to_relink:
1147 move_values.update({'sale_line_id': sol_to_relink[0],})1148 move_values.update({'sale_line_id': sol_to_relink[0],})
11481149
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2018-04-27 09:58:55 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-05-17 08:41:16 +0000
@@ -107535,6 +107535,132 @@
107535msgid "The account %s - %s cannot be used as Account Payable."107535msgid "The account %s - %s cannot be used as Account Payable."
107536msgstr "Le compte %s - %s ne peut pas être utilisé comme Compte Fournisseur."107536msgstr "Le compte %s - %s ne peut pas être utilisé comme Compte Fournisseur."
107537107537
107538#. modules: msf_supply_doc_export, sales_followup
107539#: report:po.follow.up_rml:0
107540#: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:280
107541#: report:ir.follow.up.location.report_pdf:0
107542#: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:231
107543#: report:sales.follow.up.multi.report_pdf:0
107544msgid "Line Status"
107545msgstr "Statut de la ligne"
107546
107547#. module: sales_followup
107548#: field:ir.followup.location.wizard,cancel_ok:0
107549#: field:sale.followup.multi.wizard,cancel_ok:0
107550msgid "Cancelled"
107551msgstr "Annulé"
107552
107553#. modules: purchase, purchase_override, sale
107554#: selection:purchase.order.line,state:0
107555#: selection:purchase.order.merged.line,state:0
107556#: selection:sale.order.line,state:0
107557msgid "Cancelled-r"
107558msgstr "Annulé-r"
107559
107560#. modules: msf_order_date, purchase, documents_done, sale, purchase_override, stock_forecast, purchase_allocation_report, sourcing
107561#: selection:documents.done.wizard,display_state:0
107562#: selection:sale.order.line,so_state_stored:0
107563#: selection:purchase.order,state:0
107564#: selection:purchase.order.line,order_state_purchase_order_line:0
107565#: selection:purchase.order.line,po_state_stored:0
107566#: selection:purchase.order.line.allocation.report,state:0
107567#: selection:purchase.order.merged.line,order_state_purchase_order_line:0
107568#: selection:purchase.order.merged.line,po_state_stored:0
107569#: selection:sale.order,state:0
107570#: selection:sale.order,state_hidden_sale_order:0
107571#: selection:sale.order.leave.close,order_state:0
107572#: selection:sale.report,state:0
107573#: selection:sale.order.line,sale_order_state:0
107574#: selection:stock.forecast.line,state:0
107575msgid "Draft-p"
107576msgstr "Brouillon-p"
107577
107578#. modules: msf_order_date, purchase, documents_done, sale, purchase_override, stock_forecast, purchase_allocation_report, sourcing
107579#: selection:documents.done.wizard,display_state:0
107580#: selection:sale.order.line,so_state_stored:0
107581#: selection:purchase.order,state:0
107582#: selection:purchase.order.line,order_state_purchase_order_line:0
107583#: selection:purchase.order.line,po_state_stored:0
107584#: selection:purchase.order.line.allocation.report,state:0
107585#: selection:purchase.order.merged.line,order_state_purchase_order_line:0
107586#: selection:purchase.order.merged.line,po_state_stored:0
107587#: selection:sale.order,state:0
107588#: selection:sale.order,state_hidden_sale_order:0
107589#: selection:sale.order.leave.close,order_state:0
107590#: selection:sale.report,state:0
107591#: selection:sale.order.line,sale_order_state:0
107592#: selection:stock.forecast.line,state:0
107593msgid "Validated-p"
107594msgstr "Validé-p"
107595
107596#. modules: purchase, purchase_override
107597#: selection:purchase.order.line,state:0
107598#: selection:purchase.order.merged.line,state:0
107599msgid "Validated-n"
107600msgstr "Validé-n"
107601
107602#. modules: purchase, purchase_override, sale
107603#: selection:purchase.order.line,state:0
107604#: selection:purchase.order.merged.line,state:0
107605#: selection:sale.order.line,state:0
107606msgid "Sourced-v"
107607msgstr "Sourcé-v"
107608
107609#. modules: msf_order_date, purchase, documents_done, sale, purchase_override, stock_forecast, purchase_allocation_report, sourcing
107610#: selection:documents.done.wizard,display_state:0
107611#: selection:sale.order.line,so_state_stored:0
107612#: selection:purchase.order,state:0
107613#: selection:purchase.order.line,order_state_purchase_order_line:0
107614#: selection:purchase.order.line,po_state_stored:0
107615#: selection:purchase.order.line.allocation.report,state:0
107616#: selection:purchase.order.merged.line,order_state_purchase_order_line:0
107617#: selection:purchase.order.merged.line,po_state_stored:0
107618#: selection:sale.order,state:0
107619#: selection:sale.order,state_hidden_sale_order:0
107620#: selection:sale.order.leave.close,order_state:0
107621#: selection:sale.report,state:0
107622#: selection:sale.order.line,sale_order_state:0
107623#: selection:stock.forecast.line,state:0
107624msgid "Sourced-p"
107625msgstr "Sourcé-p"
107626
107627#. modules: purchase, purchase_override, sale
107628#: selection:purchase.order.line,state:0
107629#: selection:purchase.order.merged.line,state:0
107630#: selection:sale.order.line,state:0
107631msgid "Sourced-n"
107632msgstr "Sourcé-n"
107633
107634#. module: sale
107635#: field:sale.order.line,set_as_sourced_n:0
107636msgid "Sourced-n line"
107637msgstr "Ligne sourcée-n"
107638
107639#. modules: purchase, purchase_override, sale
107640#: selection:purchase.order.line,state:0
107641#: selection:purchase.order.merged.line,state:0
107642#: selection:sale.order.line,state:0
107643msgid "Sourced-sy"
107644msgstr "Sourcé-sy"
107645
107646#. modules: msf_order_date, purchase, documents_done, sale, purchase_override, stock_forecast, purchase_allocation_report, sourcing
107647#: selection:documents.done.wizard,display_state:0
107648#: selection:sale.order.line,so_state_stored:0
107649#: selection:purchase.order,state:0
107650#: selection:purchase.order.line,order_state_purchase_order_line:0
107651#: selection:purchase.order.line,po_state_stored:0
107652#: selection:purchase.order.line.allocation.report,state:0
107653#: selection:purchase.order.merged.line,order_state_purchase_order_line:0
107654#: selection:purchase.order.merged.line,po_state_stored:0
107655#: selection:sale.order,state:0
107656#: selection:sale.order,state_hidden_sale_order:0
107657#: selection:sale.order.leave.close,order_state:0
107658#: selection:sale.report,state:0
107659#: selection:sale.order.line,sale_order_state:0
107660#: selection:stock.forecast.line,state:0
107661msgid "Confirmed-p"
107662msgstr "Confirmé-p"
107663
107538#. module: account_mcdb107664#. module: account_mcdb
107539#: field:account.mcdb,display_mcdb_load_button:0107665#: field:account.mcdb,display_mcdb_load_button:0
107540msgid "Display the Load button"107666msgid "Display the Load button"
@@ -107673,3 +107799,16 @@
107673#: sql_constraint:account.move.line:0107799#: sql_constraint:account.move.line:0
107674msgid "Wrong credit or debit value in booking currency!"107800msgid "Wrong credit or debit value in booking currency!"
107675msgstr "Valeur de crédit ou débit erronée en devise d'enregistrement !"107801msgstr "Valeur de crédit ou débit erronée en devise d'enregistrement !"
107802
107803#. module: sales_followup
107804#: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:281
107805#: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:230
107806msgid "Doc. Status"
107807msgstr "Statut du Doc."
107808
107809#. modules: msf_supply_doc_export, sales_followup
107810#: report:po.follow.up_rml:0
107811#: report:ir.follow.up.location.report_pdf:0
107812#: report:sales.follow.up.multi.report_pdf:0
107813msgid "Doc. Status:"
107814msgstr "Statut du Doc.:"
107676107815
=== modified file 'bin/addons/msf_supply_doc_export/msf_supply_doc_export.py'
--- bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2018-04-19 07:36:42 +0000
+++ bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2018-05-17 08:41:16 +0000
@@ -485,6 +485,7 @@
485 report_line['order_ref'] = ''485 report_line['order_ref'] = ''
486 report_line['order_created'] = ''486 report_line['order_created'] = ''
487 report_line['order_confirmed_date'] = ''487 report_line['order_confirmed_date'] = ''
488 report_line['raw_state'] = analytic_line.get('raw_state')
488 report_line['line_status'] = ''489 report_line['line_status'] = ''
489 report_line['state'] = ''490 report_line['state'] = ''
490 report_line['order_status'] = ''491 report_line['order_status'] = ''
@@ -542,6 +543,7 @@
542 'order_ref': order.name or '',543 'order_ref': order.name or '',
543 'order_created': order.date_order or '',544 'order_created': order.date_order or '',
544 'order_confirmed_date': order.delivery_confirmed_date or '',545 'order_confirmed_date': order.delivery_confirmed_date or '',
546 'raw_state': line.state,
545 'line_status': get_sel(self.cr, self.uid, 'purchase.order.line', 'state', line.state, {}) or '',547 'line_status': get_sel(self.cr, self.uid, 'purchase.order.line', 'state', line.state, {}) or '',
546 'state': line.state_to_display or '',548 'state': line.state_to_display or '',
547 'order_status': self._get_states().get(order.state, ''),549 'order_status': self._get_states().get(order.state, ''),
@@ -567,6 +569,7 @@
567 'order_ref': order.name or '',569 'order_ref': order.name or '',
568 'order_created': order.date_order or '',570 'order_created': order.date_order or '',
569 'order_confirmed_date': order.delivery_confirmed_date or '',571 'order_confirmed_date': order.delivery_confirmed_date or '',
572 'raw_state': line.state,
570 'order_status': self._get_states().get(order.state, ''),573 'order_status': self._get_states().get(order.state, ''),
571 'line_status': first_line and get_sel(self.cr, self.uid, 'purchase.order.line', 'state', line.state, {}) or '',574 'line_status': first_line and get_sel(self.cr, self.uid, 'purchase.order.line', 'state', line.state, {}) or '',
572 'state': line.state_to_display or '',575 'state': line.state_to_display or '',
@@ -598,6 +601,7 @@
598 'order_ref': order.name or '',601 'order_ref': order.name or '',
599 'order_created': order.date_order or '',602 'order_created': order.date_order or '',
600 'order_confirmed_date': order.delivery_confirmed_date or '',603 'order_confirmed_date': order.delivery_confirmed_date or '',
604 'raw_state': line.state,
601 'order_status': self._get_states().get(order.state, ''),605 'order_status': self._get_states().get(order.state, ''),
602 'line_status': first_line and get_sel(self.cr, self.uid, 'purchase.order.line', 'state', line.state, {}) or '',606 'line_status': first_line and get_sel(self.cr, self.uid, 'purchase.order.line', 'state', line.state, {}) or '',
603 'state': line.state_to_display or '',607 'state': line.state_to_display or '',
@@ -629,6 +633,7 @@
629 'order_ref': order.name or '',633 'order_ref': order.name or '',
630 'order_created': order.date_order or '',634 'order_created': order.date_order or '',
631 'order_confirmed_date': order.delivery_confirmed_date or '',635 'order_confirmed_date': order.delivery_confirmed_date or '',
636 'raw_state': line.state,
632 'order_status': self._get_states().get(order.state, ''),637 'order_status': self._get_states().get(order.state, ''),
633 'line_status': get_sel(self.cr, self.uid, 'purchase.order.line', 'state', line.state, {}) or '',638 'line_status': get_sel(self.cr, self.uid, 'purchase.order.line', 'state', line.state, {}) or '',
634 'state': line.state_to_display or '',639 'state': line.state_to_display or '',
@@ -657,7 +662,7 @@
657 dist_id = po_line.order_id.analytic_distribution_id.id # get it from the header662 dist_id = po_line.order_id.analytic_distribution_id.id # get it from the header
658 ccdl_ids = ccdl_obj.search(self.cr, self.uid, [('distribution_id','=',dist_id)])663 ccdl_ids = ccdl_obj.search(self.cr, self.uid, [('distribution_id','=',dist_id)])
659 ccdl_rows = ccdl_obj.browse(self.cr, self.uid, ccdl_ids)664 ccdl_rows = ccdl_obj.browse(self.cr, self.uid, ccdl_ids)
660 dist_lines = [{'cost_center': ccdl.analytic_id.code,'destination': ccdl.destination_id.code} for ccdl in ccdl_rows]665 dist_lines = [{'cost_center': ccdl.analytic_id.code,'destination': ccdl.destination_id.code, 'raw_state': po_line.state} for ccdl in ccdl_rows]
661 if not dist_lines:666 if not dist_lines:
662 dist_lines = [{'cost_center': '','destination': ''}]667 dist_lines = [{'cost_center': '','destination': ''}]
663 return dist_lines668 return dist_lines
@@ -690,7 +695,7 @@
690 return self.datas.get('report_header')[1]695 return self.datas.get('report_header')[1]
691696
692 def getPOLineHeaders(self):697 def getPOLineHeaders(self):
693 return ['Order Ref', 'Item','Code','Description','Qty ordered','UoM','Qty received','IN','Qty backorder','Unit Price','IN unit price', 'Created', 'Confirmed Delivery', 'Line State', 'Order State', 'Destination','Cost Center']698 return ['Order Ref', 'Item', 'Code', 'Description', 'Qty ordered', 'UoM', 'Qty received', 'IN', 'Qty backorder', 'Unit Price', 'IN unit price', 'Created', 'Confirmed Delivery', 'Doc. Status', 'Line Status', 'Destination', 'Cost Center']
694699
695700
696701
697702
=== modified file 'bin/addons/msf_supply_doc_export/report/report_po_follow_up.rml'
--- bin/addons/msf_supply_doc_export/report/report_po_follow_up.rml 2018-04-19 07:36:42 +0000
+++ bin/addons/msf_supply_doc_export/report/report_po_follow_up.rml 2018-05-17 08:41:16 +0000
@@ -34,8 +34,11 @@
34 <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10"/>34 <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10"/>
35 <paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/>35 <paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/>
36 <paraStyle name="P4" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>36 <paraStyle name="P4" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
37 <paraStyle name="P4Grey" textColor="#747474" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
37 <paraStyle name="P4Center" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/>38 <paraStyle name="P4Center" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/>
39 <paraStyle name="P4CenterGrey" textColor="#747474" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER"/>
38 <paraStyle name="P4Left" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>40 <paraStyle name="P4Left" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
41 <paraStyle name="P4LeftGrey" textColor="#747474" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT"/>
39 <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10"/>42 <paraStyle name="P5" fontName="Helvetica" fontSize="8.0" leading="10"/>
40 <paraStyle name="Standard" fontName="Helvetica"/>43 <paraStyle name="Standard" fontName="Helvetica"/>
41 <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>44 <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
@@ -60,7 +63,7 @@
60 <td><para style="P2">Report Run Date: [[getRunParmsRML('run_date')]]</para></td>63 <td><para style="P2">Report Run Date: [[getRunParmsRML('run_date')]]</para></td>
61 <td><para style="P2">PO Date From: [[getRunParmsRML('date_from')]]</para></td>64 <td><para style="P2">PO Date From: [[getRunParmsRML('date_from')]]</para></td>
62 <td><para style="P2">PO Date To: [[getRunParmsRML('date_thru')]]</para></td>65 <td><para style="P2">PO Date To: [[getRunParmsRML('date_thru')]]</para></td>
63 <td><para style="P2">PO State: [[getRunParmsRML('state')]]</para></td>66 <td><para style="P2">Doc. Status: [[getRunParmsRML('state')]]</para></td>
64 <td><para style="P2">Supplier: [[getRunParmsRML('supplier')]]</para></td> 67 <td><para style="P2">Supplier: [[getRunParmsRML('supplier')]]</para></td>
65 </tr> 68 </tr>
66 </blockTable>69 </blockTable>
@@ -119,49 +122,62 @@
119 <para style="P3">Cost Center</para>122 <para style="P3">Cost Center</para>
120 </td>123 </td>
121 <td>124 <td>
122 <para style="P3">State</para>125 <para style="P3">Line Status</para>
123 </td>126 </td>
124 </tr>127 </tr>
125 <tr>128 <tr>
126 <para style="P4">[[ repeatIn(getPOLines(o.id), 'line') ]]</para>129 <para style="P4">[[ repeatIn(getPOLines(o.id), 'line') ]]</para>
127 <td>130 <td>
128 <para style="P4Center">[[ line['item'] ]]</para>131 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['item'] or removeParentNode('para') ]]</para>
129 </td>132 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['item'] or removeParentNode('para') ]]</para>
130 <td>133 </td>
131 <para style="P4Left">[[ line['code'] ]]</para>134 <td>
132 </td>135 <para style="P4Left">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['code'] or removeParentNode('para') ]]</para>
133 <td>136 <para style="P4LeftGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['code'] or removeParentNode('para') ]]</para>
134 <para style="P4Left">[[ line['description'] ]]</para>137 </td>
135 </td>138 <td>
136 <td>139 <para style="P4Left">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['description'] or removeParentNode('para') ]]</para>
137 <para style="P4Center">[[ line['qty_ordered'] ]]</para>140 <para style="P4LeftGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['description'] or removeParentNode('para') ]]</para>
138 </td>141 </td>
139 <td>142 <td>
140 <para style="P4Center">[[ line['uom'] ]]</para>143 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['qty_ordered'] or removeParentNode('para') ]]</para>
141 </td>144 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['qty_ordered'] or removeParentNode('para') ]]</para>
142 <td>145 </td>
143 <para style="P4Center">[[ line['qty_received'] ]]</para>146 <td>
144 </td>147 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['uom'] or removeParentNode('para') ]]</para>
145 <td>148 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['uom'] or removeParentNode('para') ]]</para>
146 <para style="P4Center">[[ line['in'] ]]</para>149 </td>
147 </td>150 <td>
148 <td>151 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['qty_received'] or removeParentNode('para') ]]</para>
149 <para style="P4Center">[[ line['qty_backordered'] ]]</para>152 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['qty_received'] or removeParentNode('para') ]]</para>
150 </td>153 </td>
151 <td>154 <td>
152 <para style="P4Center">[[ line['unit_price'] ]]</para>155 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['in'] or removeParentNode('para') ]]</para>
153 </td>156 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['in'] or removeParentNode('para') ]]</para>
154 <td>157 </td>
155 <para style="P4Center">[[ line['in_unit_price'] ]]</para>158 <td>
156 </td>159 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['qty_backordered'] or removeParentNode('para') ]]</para>
157 <td>160 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['qty_backordered'] or removeParentNode('para') ]]</para>
158 <para style="P4Center">[[ line['destination'] ]]</para>161 </td>
159 </td>162 <td>
160 <td>163 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['unit_price'] or removeParentNode('para') ]]</para>
161 <para style="P4Center">[[ line['cost_centre'] ]]</para>164 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['unit_price'] or removeParentNode('para') ]]</para>
165 </td>
166 <td>
167 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['in_unit_price'] or removeParentNode('para') ]]</para>
168 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['in_unit_price'] or removeParentNode('para') ]]</para>
169 </td>
170 <td>
171 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['destination'] or removeParentNode('para') ]]</para>
172 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['destination'] or removeParentNode('para') ]]</para>
173 </td>
174 <td>
175 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['cost_centre'] or removeParentNode('para') ]]</para>
176 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['cost_centre'] or removeParentNode('para') ]]</para>
162 </td>177 </td>
163 <td>178 <td>
164 <para style="P4Center">[[ line['state'] ]]</para>179 <para style="P4Center">[[ line['raw_state'] not in ['cancel', 'cancel_r'] and line['state'] or removeParentNode('para') ]]</para>
180 <para style="P4CenterGrey">[[ line['raw_state'] in ['cancel', 'cancel_r'] and line['state'] or removeParentNode('para') ]]</para>
165 </td>181 </td>
166 </tr>182 </tr>
167 183
168184
=== modified file 'bin/addons/msf_supply_doc_export/report/report_po_follow_up_xls.mako'
--- bin/addons/msf_supply_doc_export/report/report_po_follow_up_xls.mako 2018-04-19 07:36:42 +0000
+++ bin/addons/msf_supply_doc_export/report/report_po_follow_up_xls.mako 2018-05-17 08:41:16 +0000
@@ -64,6 +64,17 @@
64 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />64 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
65 </Borders>65 </Borders>
66 </Style>66 </Style>
67
68 <Style ss:ID="line_grey">
69 <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
70 <Borders>
71 <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
72 <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
73 <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
74 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
75 </Borders>
76 <Font ss:Color="#747474"/>
77 </Style>
67 78
68 <Style ss:ID="short_date">79 <Style ss:ID="short_date">
69 <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>80 <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
@@ -137,23 +148,43 @@
137 148
138 % for line in getPOLines(o.id):149 % for line in getPOLines(o.id):
139 <Row ss:AutoFitHeight="1">150 <Row ss:AutoFitHeight="1">
140 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_ref'])|x}</Data></Cell>151 % if line['raw_state'] in ['cancel', 'cancel_r']:
141 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['item'])|x}</Data></Cell>152 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['order_ref'])|x}</Data></Cell>
142 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['code'])|x}</Data></Cell>153 <Cell ss:StyleID="line_grey"><Data ss:Type="Number">${(line['item'])|x}</Data></Cell>
143 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['description'])|x}</Data></Cell>154 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['code'])|x}</Data></Cell>
144 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_ordered'])|x}</Data></Cell>155 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['description'])|x}</Data></Cell>
145 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['uom'])|x}</Data></Cell>156 <Cell ss:StyleID="line_grey"><Data ss:Type="Number">${(line['qty_ordered'])|x}</Data></Cell>
146 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_received'])|x}</Data></Cell>157 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['uom'])|x}</Data></Cell>
147 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['in'])|x}</Data></Cell>158 <Cell ss:StyleID="line_grey"><Data ss:Type="Number">${(line['qty_received'])|x}</Data></Cell>
148 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_backordered'])|x}</Data></Cell>159 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['in'])|x}</Data></Cell>
149 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['unit_price'])|x}</Data></Cell>160 <Cell ss:StyleID="line_grey"><Data ss:Type="Number">${(line['qty_backordered'])|x}</Data></Cell>
150 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['in_unit_price'])|x}</Data></Cell>161 <Cell ss:StyleID="line_grey"><Data ss:Type="Number">${(line['unit_price'])|x}</Data></Cell>
151 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_created'])|x}</Data></Cell>162 <Cell ss:StyleID="line_grey"><Data ss:Type="Number">${(line['in_unit_price'])|x}</Data></Cell>
152 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_confirmed_date'])|x}</Data></Cell>163 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['order_created'])|x}</Data></Cell>
153 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['state'])|x}</Data></Cell>164 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['order_confirmed_date'])|x}</Data></Cell>
154 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_status'])|x}</Data></Cell>165 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['order_status'])|x}</Data></Cell>
155 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['destination'])|x}</Data></Cell>166 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['state'])|x}</Data></Cell>
156 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['cost_centre'])|x}</Data></Cell>167 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['destination'])|x}</Data></Cell>
168 <Cell ss:StyleID="line_grey"><Data ss:Type="String">${(line['cost_centre'])|x}</Data></Cell>
169 % else:
170 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_ref'])|x}</Data></Cell>
171 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['item'])|x}</Data></Cell>
172 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['code'])|x}</Data></Cell>
173 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['description'])|x}</Data></Cell>
174 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_ordered'])|x}</Data></Cell>
175 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['uom'])|x}</Data></Cell>
176 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_received'])|x}</Data></Cell>
177 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['in'])|x}</Data></Cell>
178 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_backordered'])|x}</Data></Cell>
179 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['unit_price'])|x}</Data></Cell>
180 <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['in_unit_price'])|x}</Data></Cell>
181 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_created'])|x}</Data></Cell>
182 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_confirmed_date'])|x}</Data></Cell>
183 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_status'])|x}</Data></Cell>
184 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['state'])|x}</Data></Cell>
185 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['destination'])|x}</Data></Cell>
186 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['cost_centre'])|x}</Data></Cell>
187 %endif
157 </Row>188 </Row>
158 % endfor189 % endfor
159 % endfor 190 % endfor
160191
=== modified file 'bin/addons/sales_followup/report/ir_follow_up_location_report.py'
--- bin/addons/sales_followup/report/ir_follow_up_location_report.py 2017-09-08 15:57:28 +0000
+++ bin/addons/sales_followup/report/ir_follow_up_location_report.py 2018-05-17 08:41:16 +0000
@@ -177,27 +177,15 @@
177 cdd = False177 cdd = False
178 from_stock = line.type == 'make_to_stock'178 from_stock = line.type == 'make_to_stock'
179 cancel_in_moves = []179 cancel_in_moves = []
180 if line.procurement_id and line.procurement_id.purchase_id:180 linked_pol = self.pool.get('purchase.order.line').search(self.cr, self.uid, [('linked_sol_id', '=', line.id)])
181 po_name = line.procurement_id.purchase_id.name181 if linked_pol:
182 cdd = line.procurement_id.purchase_id.delivery_confirmed_date182 linked_pol = self.pool.get('purchase.order.line').browse(self.cr, self.uid, linked_pol)[0]
183 cancel_in_moves = self.cancel_in_line(line.procurement_id.purchase_id.id, line.product_id.id)183 po_name = linked_pol.order_id.name
184 cdd = linked_pol.order_id.delivery_confirmed_date
185 cancel_in_moves = self.cancel_in_line(linked_pol.order_id.id, line.product_id.id)
184 if not cdd and line.order_id.delivery_confirmed_date:186 if not cdd and line.order_id.delivery_confirmed_date:
185 cdd = line.order_id.delivery_confirmed_date187 cdd = line.order_id.delivery_confirmed_date
186188
187
188 # fetch the move in case the line doesn't have move_ids
189 # if no move found for this line, it's set to False
190 # to display a grayed line when it is cancelled
191 current_line_state = line.state
192 if line.order_id.state == 'cancel':
193 current_line_state = 'cancel'
194 elif line.procurement_id.purchase_id and line.procurement_id.purchase_id.state == 'cancel':
195 current_line_state = 'cancel'
196 elif line.procurement_id.move_id and \
197 (line.procurement_id.move_id.state == 'cancel' or line.procurement_id.move_id.picking_id.state == 'cancel'):
198 current_line_state = 'cancel'
199
200
201 # cancel IN at line level: qty on IR line is adjusted189 # cancel IN at line level: qty on IR line is adjusted
202 # cancel all IN: qty on IR is untouched190 # cancel all IN: qty on IR is untouched
203 for cancel_in in cancel_in_moves:191 for cancel_in in cancel_in_moves:
@@ -213,13 +201,14 @@
213 if len(line.move_ids) == 0:201 if len(line.move_ids) == 0:
214 line_moves, int_name = self._get_move_from_line(line, line.product_id.id, line.order_id.name)202 line_moves, int_name = self._get_move_from_line(line, line.product_id.id, line.order_id.name)
215203
204 data = {
205 'state': line.state,
206 'state_display': line.state_to_display,
207 }
208
216 if len(line.move_ids) > 0:209 if len(line.move_ids) > 0:
217 for move in sorted(line.move_ids, cmp=lambda x, y: cmp(sort_state.get(x.state, 0), sort_state.get(y.state, 0)) or cmp(x.id, y.id)):210 for move in sorted(line.move_ids, cmp=lambda x, y: cmp(sort_state.get(x.state, 0), sort_state.get(y.state, 0)) or cmp(x.id, y.id)):
218 current_move_line_state = current_line_state211 m_type = move.state in ('cancel', 'cancel_r') or move.product_qty != 0.00 and move.picking_id.type == 'out'
219 if move.state == 'cancel' or move.picking_id.state == 'cancel':
220 current_move_line_state = 'cancel'
221
222 m_type = current_move_line_state == 'cancel' or move.product_qty != 0.00 and move.picking_id.type == 'out'
223 ppl = move.picking_id.subtype == 'packing' and move.picking_id.shipment_id and not self._is_returned(move)212 ppl = move.picking_id.subtype == 'packing' and move.picking_id.shipment_id and not self._is_returned(move)
224 ppl_not_shipped = move.picking_id.subtype == 'ppl' and move.picking_id.state not in ('cancel', 'done')213 ppl_not_shipped = move.picking_id.subtype == 'ppl' and move.picking_id.state not in ('cancel', 'done')
225 s_out = move.picking_id.subtype == 'standard' and move.location_dest_id.usage == 'customer'214 s_out = move.picking_id.subtype == 'standard' and move.location_dest_id.usage == 'customer'
@@ -238,7 +227,7 @@
238 delivery_order = move.picking_id.name227 delivery_order = move.picking_id.name
239 if move.picking_id.state != 'done':228 if move.picking_id.state != 'done':
240 delivery_order = '-'229 delivery_order = '-'
241 data = {230 data.update({
242 'po_name': po_name,231 'po_name': po_name,
243 'cdd': cdd,232 'cdd': cdd,
244 'line_number': line.line_number,233 'line_number': line.line_number,
@@ -247,10 +236,9 @@
247 'product_code': line.product_id.code or '-',236 'product_code': line.product_id.code or '-',
248 'is_delivered': False,237 'is_delivered': False,
249 'delivery_order': delivery_order,238 'delivery_order': delivery_order,
250 'current_line_state': current_move_line_state,
251 'packing': '-',239 'packing': '-',
252 'shipment': '-',240 'shipment': '-',
253 }241 })
254 if first_line:242 if first_line:
255 data.update({243 data.update({
256 'uom_id': line.product_uom.name,244 'uom_id': line.product_uom.name,
@@ -346,9 +334,6 @@
346 m_index += 1334 m_index += 1
347 elif line_moves and (len(line.move_ids) == 0 and line.procurement_id.move_id):335 elif line_moves and (len(line.move_ids) == 0 and line.procurement_id.move_id):
348 for line_move in line_moves:336 for line_move in line_moves:
349 if line_move.state == 'cancel' or line_move.picking_id.state == 'cancel':
350 current_line_state = 'cancel'
351
352 m_type = line_move.product_qty != 0.00337 m_type = line_move.product_qty != 0.00
353338
354 if m_type:339 if m_type:
@@ -363,7 +348,7 @@
363 delivery_order = int_name.get(line_move.id) or line_move.picking_id.name348 delivery_order = int_name.get(line_move.id) or line_move.picking_id.name
364 if 'INT' in line_move.picking_id.name and line_move.picking_id.state != 'done':349 if 'INT' in line_move.picking_id.name and line_move.picking_id.state != 'done':
365 delivery_order = '-'350 delivery_order = '-'
366 data = {351 data.update({
367 'po_name': po_name,352 'po_name': po_name,
368 'cdd': cdd,353 'cdd': cdd,
369 'line_number': line.line_number,354 'line_number': line.line_number,
@@ -372,8 +357,7 @@
372 'product_code': line.product_id.code or '-',357 'product_code': line.product_id.code or '-',
373 'is_delivered': False,358 'is_delivered': False,
374 'delivery_order': delivery_order,359 'delivery_order': delivery_order,
375 'current_line_state': current_line_state,360 })
376 }
377 if first_line:361 if first_line:
378 data.update({362 data.update({
379 'uom_id': line.product_uom.name,363 'uom_id': line.product_uom.name,
@@ -408,7 +392,7 @@
408 m_index += 1392 m_index += 1
409 else: # No move found393 else: # No move found
410 if first_line:394 if first_line:
411 data = {395 data.update({
412 'line_number': line.line_number,396 'line_number': line.line_number,
413 'line_comment': line.comment or '-',397 'line_comment': line.comment or '-',
414 'po_name': po_name,398 'po_name': po_name,
@@ -420,10 +404,9 @@
420 'delivered_qty': 0.00,404 'delivered_qty': 0.00,
421 'delivered_uom': '-',405 'delivered_uom': '-',
422 'delivery_order': '-',406 'delivery_order': '-',
423 'current_line_state': current_line_state,
424 'backordered_qty': line.product_uom_qty if line.order_id.state != 'cancel' else 0.00,407 'backordered_qty': line.product_uom_qty if line.order_id.state != 'cancel' else 0.00,
425 'cdd': cdd,408 'cdd': cdd,
426 }409 })
427 lines.append(data)410 lines.append(data)
428411
429 # Put the backorderd qty on the first line412 # Put the backorderd qty on the first line
@@ -444,7 +427,7 @@
444 lines[fl_index]['extra_qty'] = abs(bo_qty) if line.order_id.state != 'cancel' else 0.00427 lines[fl_index]['extra_qty'] = abs(bo_qty) if line.order_id.state != 'cancel' else 0.00
445428
446 for ln in lines:429 for ln in lines:
447 if only_bo and (ln.get('backordered_qty', 0.00) <= 0.00 or ln.get('current_line_state') == 'cancel'):430 if only_bo and (ln.get('backordered_qty', 0.00) <= 0.00 or line.state in ('cancel', 'cancel_r')):
448 continue431 continue
449 yield ln432 yield ln
450433
451434
=== modified file 'bin/addons/sales_followup/report/ir_follow_up_location_report.rml'
--- bin/addons/sales_followup/report/ir_follow_up_location_report.rml 2017-09-07 10:21:05 +0000
+++ bin/addons/sales_followup/report/ir_follow_up_location_report.rml 2018-05-17 08:41:16 +0000
@@ -182,7 +182,7 @@
182182
183 <section>183 <section>
184 [[ repeatIn(getOrders(r, only_bo=r.only_bo), 'o', 'section') ]]184 [[ repeatIn(getOrders(r, only_bo=r.only_bo), 'o', 'section') ]]
185 <blockTable colWidths="32.0,80.0,130.0,110.0,45.0,45.0,45.0,45.0,45.0,75.0,60.0,60.0" style="LinesTable" repeatRows="2">185 <blockTable colWidths="32.0,80.0,130.0,110.0,45.0,40.0,45.0,40.0,45.0,70.0,41.0,47.0,47.0" style="LinesTable" repeatRows="2">
186 <tr>186 <tr>
187 <td colspan="2">187 <td colspan="2">
188 <para style="Lines">Order ref:</para>188 <para style="Lines">Order ref:</para>
@@ -191,7 +191,7 @@
191 <para style="Lines">[[ o.name ]]</para>191 <para style="Lines">[[ o.name ]]</para>
192 </td>192 </td>
193 <td>193 <td>
194 <para style="Lines">Status: [[ getSel(o, 'state') ]]       Requestor: [[ o.requestor or '' ]]</para>194 <para style="Lines">Doc. Status: [[ getSel(o, 'state') ]]       Requestor: [[ o.requestor or '' ]]</para>
195 </td>195 </td>
196 <td>196 <td>
197 <para style="Lines">Location Requestor: [[ o.location_requestor_id.name ]]</para>197 <para style="Lines">Location Requestor: [[ o.location_requestor_id.name ]]</para>
@@ -220,6 +220,9 @@
220 <td>220 <td>
221 <para style="Lines"></para>221 <para style="Lines"></para>
222 </td>222 </td>
223 <td>
224 <para style="Lines"></para>
225 </td>
223 </tr>226 </tr>
224 <tr>227 <tr>
225 <td>228 <td>
@@ -253,6 +256,9 @@
253 <para style="Lines"><i>Delivery Order</i></para>256 <para style="Lines"><i>Delivery Order</i></para>
254 </td>257 </td>
255 <td>258 <td>
259 <para style="Lines"><i>Line Status</i></para>
260 </td>
261 <td>
256 <para style="Lines"><i>CDD</i></para>262 <para style="Lines"><i>CDD</i></para>
257 </td>263 </td>
258 <td>264 <td>
@@ -262,53 +268,57 @@
262 <tr>268 <tr>
263 [[ repeatIn(getLines(o, only_bo=r.only_bo), 'line') ]]269 [[ repeatIn(getLines(o, only_bo=r.only_bo), 'line') ]]
264 <td>270 <td>
265 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and line.get('line_number', '-') or removeParentNode('para') ]]</para>271 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('line_number', '-') or removeParentNode('para') ]]</para>
266 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and line.get('line_number', '-') or removeParentNode('para') ]]</para>272 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('line_number', '-') or removeParentNode('para') ]]</para>
267 </td>273 </td>
268 <td>274 <td>
269 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and line.get('product_code', '-') or removeParentNode('para') ]]</para>275 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('product_code', '-') or removeParentNode('para') ]]</para>
270 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and line.get('product_code', '-') or removeParentNode('para') ]]</para>276 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('product_code', '-') or removeParentNode('para') ]]</para>
271 </td>277 </td>
272 <td>278 <td>
273 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and line.get('product_name', '-') or removeParentNode('para') ]]</para>279 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('product_name', '-') or removeParentNode('para') ]]</para>
274 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and line.get('product_name', '-') or removeParentNode('para') ]]</para>280 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('product_name', '-') or removeParentNode('para') ]]</para>
275 </td>281 </td>
276 <td>282 <td>
277 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and line.get('line_comment', '-') or removeParentNode('para') ]]</para>283 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('line_comment', '-') or removeParentNode('para') ]]</para>
278 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and line.get('line_comment', '-') or removeParentNode('para') ]]</para>284 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('line_comment', '-') or removeParentNode('para') ]]</para>
279 </td>285 </td>
280 <td>286 <td>
281 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and (line.get('ordered_qty') and formatLang(line['ordered_qty']) or 'N/A') or removeParentNode('para') ]]</para>287 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('ordered_qty') and formatLang(line['ordered_qty']) or 'N/A') or removeParentNode('para') ]]</para>
282 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and (line.get('ordered_qty') and formatLang(line['ordered_qty']) or 'N/A') or removeParentNode('para') ]]</para>288 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('ordered_qty') and formatLang(line['ordered_qty']) or 'N/A') or removeParentNode('para') ]]</para>
283 </td>289 </td>
284 <td>290 <td>
285 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and line.get('uom_id', '-') or removeParentNode('para') ]]</para>291 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('uom_id', '-') or removeParentNode('para') ]]</para>
286 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and line.get('uom_id', '-') or removeParentNode('para') ]]</para>292 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('uom_id', '-') or removeParentNode('para') ]]</para>
287 </td>293 </td>
288 <td>294 <td>
289 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and formatLang(line.get('delivered_qty', 0.00)) or removeParentNode('para') ]]</para>295 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and formatLang(line.get('delivered_qty', 0.00)) or removeParentNode('para') ]]</para>
290 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and formatLang(line.get('delivered_qty', 0.00)) or removeParentNode('para') ]]</para>296 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and formatLang(line.get('delivered_qty', 0.00)) or removeParentNode('para') ]]</para>
291 </td>297 </td>
292 <td>298 <td>
293 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and line.get('delivered_uom', '-') or removeParentNode('para') ]]</para>299 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('delivered_uom', '-') or removeParentNode('para') ]]</para>
294 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and line.get('delivered_uom', '-') or removeParentNode('para') ]]</para>300 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('delivered_uom', '-') or removeParentNode('para') ]]</para>
295 </td>301 </td>
296 <td>302 <td>
297 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and (line.get('extra_qty', 0) == 0 and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]]</para>303 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) == 0 and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]]</para>
298 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and (line.get('extra_qty', 0) and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]] (+[[ formatLang(abs(line.get('extra_qty', 0.00))) ]])</para>304 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]] (+[[ formatLang(abs(line.get('extra_qty', 0.00))) ]])</para>
299 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and '-' or removeParentNode('para') ]]</para>305 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and '-' or removeParentNode('para') ]]</para>
300 </td>306 </td>
301 <td>307 <td>
302 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and line.get('delivery_order', '-') or removeParentNode('para') ]]</para>308 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('delivery_order', '-') or removeParentNode('para') ]]</para>
303 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and line.get('delivery_order', '-') or removeParentNode('para') ]]</para>309 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('delivery_order', '-') or removeParentNode('para') ]]</para>
304 </td>310 </td>
305 <td>311 <td>
306 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and (line.get('cdd', '') and formatLang(line['cdd'], date=True) or 'N/A') or removeParentNode('para') ]]</para>312 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('state_display', '-') or removeParentNode('para') ]]</para>
307 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and (line.get('cdd', '') and formatLang(line['cdd'], date=True) or 'N/A') or removeParentNode('para') ]]</para>313 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('state_display', '-') or removeParentNode('para') ]]</para>
314 </td>
315 <td>
316 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('cdd', '') and formatLang(line['cdd'], date=True) or 'N/A') or removeParentNode('para') ]]</para>
317 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('cdd', '') and formatLang(line['cdd'], date=True) or 'N/A') or removeParentNode('para') ]]</para>
308 </td>318 </td>
309 <td>319 <td>
310 <para style="LinesBlue">[[ line.get('current_line_state') != 'cancel' and (line.get('rts', '') and formatLang(line['rts'], date=True) or 'N/A') or removeParentNode('para') ]]</para>320 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('rts', '') and formatLang(line['rts'], date=True) or 'N/A') or removeParentNode('para') ]]</para>
311 <para style="LinesGrey">[[ line.get('current_line_state') == 'cancel' and (line.get('rts', '') and formatLang(line['rts'], date=True) or 'N/A') or removeParentNode('para') ]]</para>321 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('rts', '') and formatLang(line['rts'], date=True) or 'N/A') or removeParentNode('para') ]]</para>
312 </td>322 </td>
313 </tr>323 </tr>
314 </blockTable>324 </blockTable>
315325
=== modified file 'bin/addons/sales_followup/report/ir_follow_up_location_report_xls.mako'
--- bin/addons/sales_followup/report/ir_follow_up_location_report_xls.mako 2017-09-07 10:21:05 +0000
+++ bin/addons/sales_followup/report/ir_follow_up_location_report_xls.mako 2018-05-17 08:41:16 +0000
@@ -176,7 +176,9 @@
176 <Column ss:AutoFitWidth="1" ss:Width="100.0" />176 <Column ss:AutoFitWidth="1" ss:Width="100.0" />
177 ## PO ref177 ## PO ref
178 <Column ss:AutoFitWidth="1" ss:Width="150.0" />178 <Column ss:AutoFitWidth="1" ss:Width="150.0" />
179 ## Status179 ## Doc. Status
180 <Column ss:AutoFitWidth="1" ss:Width="60.75" />
181 ## Line Status
180 <Column ss:AutoFitWidth="1" ss:Width="60.75" />182 <Column ss:AutoFitWidth="1" ss:Width="60.75" />
181 ## Received183 ## Received
182 <Column ss:AutoFitWidth="1" ss:Width="54.75" />184 <Column ss:AutoFitWidth="1" ss:Width="54.75" />
@@ -276,7 +278,8 @@
276 _('Requestor'),278 _('Requestor'),
277 _('Origin'),279 _('Origin'),
278 _('PO ref'),280 _('PO ref'),
279 _('Status'),281 _('Doc. Status'),
282 _('Line Status'),
280 _('Received'),283 _('Received'),
281 _('RDD'),284 _('RDD'),
282 _('Item'),285 _('Item'),
@@ -303,13 +306,14 @@
303 % for o in getOrders(r):306 % for o in getOrders(r):
304 % for line in getLines(o):307 % for line in getLines(o):
305 <Row ss:Height="11.25">308 <Row ss:Height="11.25">
306 %if line.get('current_line_state', '') == 'cancel':309 %if line.get('state', '') in ['cancel', 'cancel_r']:
307 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.name|x}</Data></Cell>310 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.name|x}</Data></Cell>
308 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.location_requestor_id.name|x}</Data></Cell>311 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.location_requestor_id.name|x}</Data></Cell>
309 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.requestor or ''|x}</Data></Cell>312 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.requestor or ''|x}</Data></Cell>
310 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.origin or ''|x}</Data></Cell>313 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.origin or ''|x}</Data></Cell>
311 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('po_name', '')|x}</Data></Cell>314 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('po_name', '')|x}</Data></Cell>
312 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${getSel(o, 'state')|x}</Data></Cell>315 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${getSel(o, 'state')|x}</Data></Cell>
316 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('state_display', '-')|x}</Data></Cell>
313 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${saleUstr(formatLang(o.date_order, date=True))|x}</Data></Cell>317 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${saleUstr(formatLang(o.date_order, date=True))|x}</Data></Cell>
314 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.delivery_requested_date and saleUstr(formatLang(o.delivery_requested_date, date=True)) or ''|x}</Data></Cell>318 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.delivery_requested_date and saleUstr(formatLang(o.delivery_requested_date, date=True)) or ''|x}</Data></Cell>
315 <Cell ss:StyleID="line_center_grey"><Data ss:Type="String">${line.get('line_number', '-')|x}</Data></Cell>319 <Cell ss:StyleID="line_center_grey"><Data ss:Type="String">${line.get('line_number', '-')|x}</Data></Cell>
@@ -339,6 +343,7 @@
339 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.origin or ''|x}</Data></Cell>343 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.origin or ''|x}</Data></Cell>
340 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('po_name', '')|x}</Data></Cell>344 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('po_name', '')|x}</Data></Cell>
341 <Cell ss:StyleID="line_left"><Data ss:Type="String">${getSel(o, 'state')|x}</Data></Cell>345 <Cell ss:StyleID="line_left"><Data ss:Type="String">${getSel(o, 'state')|x}</Data></Cell>
346 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('state_display', '-')|x}</Data></Cell>
342 <Cell ss:StyleID="line_left"><Data ss:Type="String">${saleUstr(formatLang(o.date_order, date=True))|x}</Data></Cell>347 <Cell ss:StyleID="line_left"><Data ss:Type="String">${saleUstr(formatLang(o.date_order, date=True))|x}</Data></Cell>
343 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.delivery_requested_date and saleUstr(formatLang(o.delivery_requested_date, date=True)) or ''|x}</Data></Cell>348 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.delivery_requested_date and saleUstr(formatLang(o.delivery_requested_date, date=True)) or ''|x}</Data></Cell>
344 <Cell ss:StyleID="line_center"><Data ss:Type="String">${line.get('line_number', '-')|x}</Data></Cell>349 <Cell ss:StyleID="line_center"><Data ss:Type="String">${line.get('line_number', '-')|x}</Data></Cell>
345350
=== modified file 'bin/addons/sales_followup/report/sale_follow_up_multi_report.rml'
--- bin/addons/sales_followup/report/sale_follow_up_multi_report.rml 2017-09-22 15:31:55 +0000
+++ bin/addons/sales_followup/report/sale_follow_up_multi_report.rml 2018-05-17 08:41:16 +0000
@@ -66,6 +66,7 @@
66 <paraStyle name="Lines" fontName="Helvetica" fontSize="6.0" alignment="LEFT" leading="7.0" />66 <paraStyle name="Lines" fontName="Helvetica" fontSize="6.0" alignment="LEFT" leading="7.0" />
67 <paraStyle name="UnderLines" fontName="Helvetica-Bold" fontSize="6.0" alignment="LEFT" leading="7.0" />67 <paraStyle name="UnderLines" fontName="Helvetica-Bold" fontSize="6.0" alignment="LEFT" leading="7.0" />
68 <paraStyle name="LinesBlue" textColor="blue" fontName="Helvetica" fontSize="6.0" alignment="LEFT" leading="7.0" />68 <paraStyle name="LinesBlue" textColor="blue" fontName="Helvetica" fontSize="6.0" alignment="LEFT" leading="7.0" />
69 <paraStyle name="LinesGrey" textColor="#747474" fontName="Helvetica" fontSize="6.0" alignment="LEFT" leading="7.0" />
69 <paraStyle name="LinesGreen" textColor="green" fontName="Helvetica" fontSize="6.0" alignment="LEFT" leading="7.0" />70 <paraStyle name="LinesGreen" textColor="green" fontName="Helvetica" fontSize="6.0" alignment="LEFT" leading="7.0" />
70 71
71 </stylesheet>72 </stylesheet>
@@ -169,16 +170,16 @@
169170
170 <section>171 <section>
171 [[ repeatIn(getOrders(r, grouped=True, only_bo=r.only_bo), 'o', 'section') ]]172 [[ repeatIn(getOrders(r, grouped=True, only_bo=r.only_bo), 'o', 'section') ]]
172 <blockTable colWidths="32.0,90.0,150.0,50.0,30.0,50.0,50.0,50.0,50.0,60.0,60.0,50.0,50.0" style="LinesTable" repeatRows="2">173 <blockTable colWidths="32.0,80.0,135.0,45.0,30.0,50.0,50.0,50.0,50.0,41.0,55.0,60.0,47.0,47.0" style="LinesTable" repeatRows="2">
173 <tr>174 <tr>
174 <td colspan="2">175 <td colspan="2">
175 <para style="Lines">Order ref:</para>176 <para style="Lines">Order ref:</para>
176 </td>177 </td>
177 <td>178 <td>
178 <para style="Lines">[[ o.name ]]       Status: [[ getSel(o, 'state') ]]</para>179 <para style="Lines">[[ o.name ]]       </para>
179 </td>180 </td>
180 <td>181 <td>
181 <para style="Lines"></para>182 <para style="Lines">Doc. Status: [[ getSel(o, 'state') ]]</para>
182 </td>183 </td>
183 <td>184 <td>
184 <para style="Lines">Received: [[ formatLang(o.date_order, date=True) ]]</para>185 <para style="Lines">Received: [[ formatLang(o.date_order, date=True) ]]</para>
@@ -199,6 +200,9 @@
199 <para style="Lines"></para>200 <para style="Lines"></para>
200 </td>201 </td>
201 <td>202 <td>
203 <para style="Lines"></para>
204 </td>
205 <td>
202 <para style="Lines"># Items: [[ getProducts(o) ]]</para>206 <para style="Lines"># Items: [[ getProducts(o) ]]</para>
203 </td>207 </td>
204 <td>208 <td>
@@ -237,6 +241,9 @@
237 <para style="Lines"><i>Qty to deliver</i></para>241 <para style="Lines"><i>Qty to deliver</i></para>
238 </td>242 </td>
239 <td>243 <td>
244 <para style="Lines"><i>Line Status</i></para>
245 </td>
246 <td>
240 <para style="Lines"><i>Transport</i></para>247 <para style="Lines"><i>Transport</i></para>
241 </td>248 </td>
242 <td>249 <td>
@@ -252,45 +259,64 @@
252 <tr>259 <tr>
253 [[ repeatIn(getLines(o, grouped=True, only_bo=r.only_bo), 'line') ]]260 [[ repeatIn(getLines(o, grouped=True, only_bo=r.only_bo), 'line') ]]
254 <td>261 <td>
255 <para style="LinesBlue">[[ line.get('line_number', '-') ]]</para>262 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('line_number', '-') or removeParentNode('para') ]]</para>
256 </td>263 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('line_number', '-') or removeParentNode('para') ]]</para>
257 <td>264 </td>
258 <para style="LinesBlue">[[ line.get('product_code', '-') ]]</para>265 <td>
259 </td>266 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('product_code', '-') or removeParentNode('para') ]]</para>
260 <td>267 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('product_code', '-') or removeParentNode('para') ]]</para>
261 <para style="LinesBlue">[[ line.get('product_name', '-') ]]</para>268 </td>
262 </td>269 <td>
263 <td>270 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('product_name', '-') or removeParentNode('para') ]]</para>
264 <para style="LinesBlue">[[ line.get('ordered_qty') and formatLang(line['ordered_qty']) or 'N/A' ]]</para>271 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('product_name', '-') or removeParentNode('para') ]]</para>
265 </td>272 </td>
266 <td>273 <td>
267 <para style="LinesBlue">[[ line.get('uom_id', '-') ]]</para>274 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('ordered_qty') and formatLang(line['ordered_qty']) or 'N/A') or removeParentNode('para') ]]</para>
268 </td>275 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('ordered_qty') and formatLang(line['ordered_qty']) or 'N/A') or removeParentNode('para') ]]</para>
269 <td>276 </td>
270 <para style="LinesBlue">[[ formatLang(line.get('delivered_qty', 0.00)) ]]</para>277 <td>
271 </td>278 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('uom_id', '-') or removeParentNode('para') ]]</para>
272 <td>279 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('uom_id', '-') or removeParentNode('para') ]]</para>
273 <para style="LinesBlue">[[ line.get('delivered_uom', '') ]]</para>280 </td>
274 </td>281 <td>
275 <td>282 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and formatLang(line.get('delivered_qty', 0.00)) or removeParentNode('para') ]]</para>
276 <para style="LinesBlue">[[ line.get('packing', '') ]]</para>283 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and formatLang(line.get('delivered_qty', 0.00)) or removeParentNode('para') ]]</para>
277 </td>284 </td>
278 <td>285 <td>
279 <para style="LinesBlue">[[ line.get('extra_qty', 0) == 0 and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para') ]]</para>286 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('delivered_uom', '-') or removeParentNode('para') ]]</para>
280 <para style="LinesBlue">[[ line.get('extra_qty', 0) and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para') ]] (+[[ formatLang(abs(line.get('extra_qty', 0.00))) ]])</para>287 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('delivered_uom', '-') or removeParentNode('para') ]]</para>
281 </td>288 </td>
282 <td>289 <td>
283 <para style="LinesBlue">[[ line.get('transport', '') and getSel(line['transport'], 'transport_type') or '' ]]</para>290 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('packing', '-') or removeParentNode('para') ]]</para>
284 </td>291 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('packing', '-') or removeParentNode('para') ]]</para>
285 <td>292 </td>
286 <para style="LinesBlue">[[ not line.get('is_delivered') and line.get('shipment', '') or removeParentNode('para') ]]</para>293 <td>
287 <para style="LinesGreen">[[ line.get('is_delivered') and line.get('shipment', '') or removeParentNode('para') ]]</para>294 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) == 0 and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]]</para>
288 </td>295 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) == 0 and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]]</para>
289 <td>296 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]] (+[[ formatLang(abs(line.get('extra_qty', 0.00))) ]])</para>
290 <para style="LinesBlue">[[ line.get('eta', '') and formatLang(line['eta'], date=True) or 'N/A' ]]</para>297 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]] (+[[ formatLang(abs(line.get('extra_qty', 0.00))) ]])</para>
291 </td>298 </td>
292 <td>299 <td>
293 <para style="LinesBlue">[[ line.get('rts', '') and formatLang(line['rts'], date=True) or 'N/A' ]]</para>300 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('state_display', '-') or removeParentNode('para') ]]</para>
301 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('state_display', '-') or removeParentNode('para') ]]</para>
302 </td>
303 <td>
304 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('transport', '') and getSel(line['transport'], 'transport_type') or '-') or removeParentNode('para') ]]</para>
305 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('transport', '') and getSel(line['transport'], 'transport_type') or '-') or removeParentNode('para') ]]</para>
306 </td>
307 <td>
308 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (not line.get('is_delivered') and line.get('shipment', '') or removeParentNode('para')) or removeParentNode('para') ]]</para>
309 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (not line.get('is_delivered') and line.get('shipment', '') or removeParentNode('para')) or removeParentNode('para') ]]</para>
310 <para style="LinesGreen">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('is_delivered') and line.get('shipment', '') or removeParentNode('para')) or removeParentNode('para') ]]</para>
311 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('is_delivered') and line.get('shipment', '') or removeParentNode('para')) or removeParentNode('para') ]]</para>
312 </td>
313 <td>
314 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('eta', '') and formatLang(line['eta'], date=True) or 'N/A') or removeParentNode('para') ]]</para>
315 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('eta', '') and formatLang(line['eta'], date=True) or 'N/A') or removeParentNode('para') ]]</para>
316 </td>
317 <td>
318 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('rts', '') and formatLang(line['rts'], date=True) or 'N/A') or removeParentNode('para') ]]</para>
319 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('rts', '') and formatLang(line['rts'], date=True) or 'N/A') or removeParentNode('para') ]]</para>
294 </td>320 </td>
295 </tr>321 </tr>
296 </blockTable>322 </blockTable>
297323
=== modified file 'bin/addons/sales_followup/report/sale_follow_up_multi_report_xls.mako'
--- bin/addons/sales_followup/report/sale_follow_up_multi_report_xls.mako 2017-06-07 10:13:18 +0000
+++ bin/addons/sales_followup/report/sale_follow_up_multi_report_xls.mako 2018-05-17 08:41:16 +0000
@@ -111,6 +111,56 @@
111 <NumberFormat ss:Format="Short Date" />111 <NumberFormat ss:Format="Short Date" />
112 <Font ss:Color="#0000FF" />112 <Font ss:Color="#0000FF" />
113 </Style>113 </Style>
114
115 <Style ss:ID="line_left_grey">
116 <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
117 <Borders>
118 <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
119 <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
120 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
121 <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
122 </Borders>
123 <Font ss:Size="8" ss:Color="#747474"/>
124 </Style>
125 <Style ss:ID="line_right_grey">
126 <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>
127 <Borders>
128 <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
129 <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
130 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
131 <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
132 </Borders>
133 <Font ss:Size="8" ss:Color="#747474"/>
134 <NumberFormat ss:Format="#,##0.00"/>
135 </Style>
136 <Style ss:ID="line_center_grey">
137 <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
138 <Borders>
139 <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
140 <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
141 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
142 <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
143 </Borders>
144 <Font ss:Size="8" ss:Color="#747474"/>
145 <NumberFormat ss:Format="#,##0.00"/>
146 </Style>
147 <Style ss:ID="line_left_date_grey">
148 <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/>
149 <NumberFormat ss:Format="Short Date" />
150 <Borders>
151 <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
152 <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
153 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
154 <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
155 </Borders>
156 <Font ss:Size="8" ss:Color="#747474"/>
157 </Style>
158
159 <Style ss:ID="short_date_grey">
160 <Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1" />
161 <NumberFormat ss:Format="Short Date" />
162 <Font ss:Color="#747474" />
163 </Style>
114</Styles>164</Styles>
115165
116166
@@ -123,7 +173,9 @@
123 <Column ss:AutoFitWidth="1" ss:Width="170.0" />173 <Column ss:AutoFitWidth="1" ss:Width="170.0" />
124 ## PO ref174 ## PO ref
125 <Column ss:AutoFitWidth="1" ss:Width="150.0" />175 <Column ss:AutoFitWidth="1" ss:Width="150.0" />
126 ## Status176 ## Doc. Status
177 <Column ss:AutoFitWidth="1" ss:Width="60.75" />
178 ## Line Status
127 <Column ss:AutoFitWidth="1" ss:Width="60.75" />179 <Column ss:AutoFitWidth="1" ss:Width="60.75" />
128 ## Received180 ## Received
129 <Column ss:AutoFitWidth="1" ss:Width="54.75" />181 <Column ss:AutoFitWidth="1" ss:Width="54.75" />
@@ -225,7 +277,8 @@
225 _('Order ref'),277 _('Order ref'),
226 _('Customer ref'),278 _('Customer ref'),
227 _('PO ref'),279 _('PO ref'),
228 _('Status'),280 _('Doc. Status'),
281 _('Line Status'),
229 _('Received'),282 _('Received'),
230 _('RDD'),283 _('RDD'),
231 _('Item'),284 _('Item'),
@@ -254,46 +307,91 @@
254 % for o in getOrders(r):307 % for o in getOrders(r):
255 % for line in getLines(o, grouped=True):308 % for line in getLines(o, grouped=True):
256 <Row ss:Height="11.25">309 <Row ss:Height="11.25">
257 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.name|x}</Data></Cell>310 %if line.get('state', '') in ['cancel', 'cancel_r']:
258 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.client_order_ref or ''|x}</Data></Cell>311 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.name|x}</Data></Cell>
259 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('po_name', '')|x}</Data></Cell>312 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.client_order_ref or ''|x}</Data></Cell>
260 <Cell ss:StyleID="line_left"><Data ss:Type="String">${getSel(o, 'state')|x}</Data></Cell>313 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('po_name', '')|x}</Data></Cell>
261 <Cell ss:StyleID="line_left"><Data ss:Type="String">${saleUstr(formatLang(o.date_order, date=True))|x}</Data></Cell>314 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${getSel(o, 'state')|x}</Data></Cell>
262 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.delivery_requested_date and saleUstr(formatLang(o.delivery_requested_date, date=True)) or ''|x}</Data></Cell>315 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('state_display', '-')|x}</Data></Cell>
263 <Cell ss:StyleID="line_center"><Data ss:Type="String">${line.get('line_number', '-')|x}</Data></Cell>316 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${saleUstr(formatLang(o.date_order, date=True))|x}</Data></Cell>
264 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('product_code', '-') or ''|x}</Data></Cell>317 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${o.delivery_requested_date and saleUstr(formatLang(o.delivery_requested_date, date=True)) or ''|x}</Data></Cell>
265 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('product_name', '-') or ''|x}</Data></Cell>318 <Cell ss:StyleID="line_center_grey"><Data ss:Type="String">${line.get('line_number', '-')|x}</Data></Cell>
266 % if line.get('ordered_qty'):319 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('product_code', '-') or ''|x}</Data></Cell>
267 <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('ordered_qty')}</Data></Cell>320 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('product_name', '-') or ''|x}</Data></Cell>
268 % else:321 % if line.get('ordered_qty'):
269 <Cell ss:StyleID="line_left"><Data ss:Type="String">N/A</Data></Cell>322 <Cell ss:StyleID="line_right_grey"><Data ss:Type="Number">${line.get('ordered_qty')}</Data></Cell>
270 % endif323 % else:
271 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('uom_id', '-')|x}</Data></Cell>324 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">N/A</Data></Cell>
272 % if line.get('delivered_qty'):325 % endif
273 <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('delivered_qty')}</Data></Cell>326 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('uom_id', '-')|x}</Data></Cell>
274 % else:327 % if line.get('delivered_qty'):
275 <Cell ss:StyleID="line_left"><Data ss:Type="String">N/A</Data></Cell>328 <Cell ss:StyleID="line_right_grey"><Data ss:Type="Number">${line.get('delivered_qty')}</Data></Cell>
276 % endif329 % else:
277 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('delivered_uom', '')|x}</Data></Cell>330 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">N/A</Data></Cell>
278 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('packing', '')|x}</Data></Cell>331 % endif
279 % if line.get('extra_qty', False):332 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('delivered_uom', '')|x}</Data></Cell>
280 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('backordered_qty', 0.00)} (+${line.get('extra_qty', 0.00)|x})</Data></Cell>333 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('packing', '')|x}</Data></Cell>
281 % else:334 % if line.get('extra_qty', False):
282 <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('backordered_qty')}</Data></Cell>335 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('backordered_qty', 0.00)} (+${line.get('extra_qty', 0.00)|x})</Data></Cell>
283 % endif336 % else:
284 % if o.transport_type and o.transport_type not in (False, 'False', ''):337 <Cell ss:StyleID="line_right_grey"><Data ss:Type="Number">${line.get('backordered_qty')}</Data></Cell>
285 <Cell ss:StyleID="line_left"><Data ss:Type="String">${getSel(o, 'transport_type')|x}</Data></Cell>338 % endif
286 % else:339 % if o.transport_type and o.transport_type not in (False, 'False', ''):
287 <Cell ss:StyleID="line_left"><Data ss:Type="String"></Data></Cell>340 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${getSel(o, 'transport_type')|x}</Data></Cell>
288 % endif341 % else:
289 % if line.get('is_delivered'):342 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String"></Data></Cell>
290 <Cell ss:StyleID="line_left_green"><Data ss:Type="String">${line.get('shipment', '')|x}</Data></Cell>343 % endif
291 % else:344 % if line.get('is_delivered'):
292 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('shipment', '')|x}</Data></Cell>345 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('shipment', '')|x}</Data></Cell>
293 % endif346 % else:
294 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('cdd', False) not in (False, 'False') and saleUstr(formatLang(line.get('cdd'), date=True)) or ''|x}</Data></Cell>347 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('shipment', '')|x}</Data></Cell>
295 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('eta', False) not in (False, 'False') and saleUstr(formatLang(line.get('eta'), date=True)) or ''|x}</Data></Cell>348 % endif
296 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('rts', False) not in (False, 'False') and saleUstr(formatLang(line.get('rts'), date=True)) or ''|x}</Data></Cell>349 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('cdd', False) not in (False, 'False') and saleUstr(formatLang(line.get('cdd'), date=True)) or ''|x}</Data></Cell>
350 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('eta', False) not in (False, 'False') and saleUstr(formatLang(line.get('eta'), date=True)) or ''|x}</Data></Cell>
351 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('rts', False) not in (False, 'False') and saleUstr(formatLang(line.get('rts'), date=True)) or ''|x}</Data></Cell>
352 % else:
353 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.name|x}</Data></Cell>
354 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.client_order_ref or ''|x}</Data></Cell>
355 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('po_name', '')|x}</Data></Cell>
356 <Cell ss:StyleID="line_left"><Data ss:Type="String">${getSel(o, 'state')|x}</Data></Cell>
357 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('state_display', '-')|x}</Data></Cell>
358 <Cell ss:StyleID="line_left"><Data ss:Type="String">${saleUstr(formatLang(o.date_order, date=True))|x}</Data></Cell>
359 <Cell ss:StyleID="line_left"><Data ss:Type="String">${o.delivery_requested_date and saleUstr(formatLang(o.delivery_requested_date, date=True)) or ''|x}</Data></Cell>
360 <Cell ss:StyleID="line_center"><Data ss:Type="String">${line.get('line_number', '-')|x}</Data></Cell>
361 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('product_code', '-') or ''|x}</Data></Cell>
362 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('product_name', '-') or ''|x}</Data></Cell>
363 % if line.get('ordered_qty'):
364 <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('ordered_qty')}</Data></Cell>
365 % else:
366 <Cell ss:StyleID="line_left"><Data ss:Type="String">N/A</Data></Cell>
367 % endif
368 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('uom_id', '-')|x}</Data></Cell>
369 % if line.get('delivered_qty'):
370 <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('delivered_qty')}</Data></Cell>
371 % else:
372 <Cell ss:StyleID="line_left"><Data ss:Type="String">N/A</Data></Cell>
373 % endif
374 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('delivered_uom', '')|x}</Data></Cell>
375 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('packing', '')|x}</Data></Cell>
376 % if line.get('extra_qty', False):
377 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('backordered_qty', 0.00)} (+${line.get('extra_qty', 0.00)|x})</Data></Cell>
378 % else:
379 <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('backordered_qty')}</Data></Cell>
380 % endif
381 % if o.transport_type and o.transport_type not in (False, 'False', ''):
382 <Cell ss:StyleID="line_left"><Data ss:Type="String">${getSel(o, 'transport_type')|x}</Data></Cell>
383 % else:
384 <Cell ss:StyleID="line_left"><Data ss:Type="String"></Data></Cell>
385 % endif
386 % if line.get('is_delivered'):
387 <Cell ss:StyleID="line_left_green"><Data ss:Type="String">${line.get('shipment', '')|x}</Data></Cell>
388 % else:
389 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('shipment', '')|x}</Data></Cell>
390 % endif
391 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('cdd', False) not in (False, 'False') and saleUstr(formatLang(line.get('cdd'), date=True)) or ''|x}</Data></Cell>
392 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('eta', False) not in (False, 'False') and saleUstr(formatLang(line.get('eta'), date=True)) or ''|x}</Data></Cell>
393 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('rts', False) not in (False, 'False') and saleUstr(formatLang(line.get('rts'), date=True)) or ''|x}</Data></Cell>
394 % endif
297 </Row>395 </Row>
298 % endfor396 % endfor
299397
300398
=== modified file 'bin/addons/sales_followup/report/sale_follow_up_report_multi.py'
--- bin/addons/sales_followup/report/sale_follow_up_report_multi.py 2017-09-14 08:41:12 +0000
+++ bin/addons/sales_followup/report/sale_follow_up_report_multi.py 2018-05-17 08:41:16 +0000
@@ -121,7 +121,7 @@
121 fl_index = 0121 fl_index = 0
122 m_index = 0122 m_index = 0
123 bo_qty = line.product_uom_qty123 bo_qty = line.product_uom_qty
124 po_name = ''124 po_name = '-'
125 cdd = False125 cdd = False
126 linked_pol = self.pool.get('purchase.order.line').search(self.cr, self.uid, [('linked_sol_id', '=', line.id)])126 linked_pol = self.pool.get('purchase.order.line').search(self.cr, self.uid, [('linked_sol_id', '=', line.id)])
127 if linked_pol:127 if linked_pol:
@@ -131,12 +131,16 @@
131 if not cdd and line.order_id.delivery_confirmed_date:131 if not cdd and line.order_id.delivery_confirmed_date:
132 cdd = line.order_id.delivery_confirmed_date132 cdd = line.order_id.delivery_confirmed_date
133133
134 data = {
135 'state': line.state,
136 'state_display': line.state_to_display,
137 }
138
134 for move in line.move_ids:139 for move in line.move_ids:
135 m_type = move.product_qty != 0.00 and move.picking_id.type == 'out'140 m_type = move.product_qty != 0.00 and move.picking_id.type == 'out'
136 ppl = move.picking_id.subtype == 'packing' and move.picking_id.shipment_id and not self._is_returned(move)141 ppl = move.picking_id.subtype == 'packing' and move.picking_id.shipment_id and not self._is_returned(move)
137 ppl_not_shipped = move.picking_id.subtype == 'ppl' and move.picking_id.state not in ('cancel', 'done')142 ppl_not_shipped = move.picking_id.subtype == 'ppl' and move.picking_id.state not in ('cancel', 'done')
138 s_out = move.picking_id.subtype == 'standard' and move.state == 'done' and move.location_dest_id.usage == 'customer'143 s_out = move.picking_id.subtype == 'standard' and move.state == 'done' and move.location_dest_id.usage == 'customer'
139
140 if m_type and (ppl or s_out or ppl_not_shipped):144 if m_type and (ppl or s_out or ppl_not_shipped):
141 # bo_qty < 0 if we receipt (IN) more quantities then expected (FO):145 # bo_qty < 0 if we receipt (IN) more quantities then expected (FO):
142 bo_qty -= self.pool.get('product.uom')._compute_qty(146 bo_qty -= self.pool.get('product.uom')._compute_qty(
@@ -146,7 +150,7 @@
146 move.product_qty,150 move.product_qty,
147 line.product_uom.id,151 line.product_uom.id,
148 )152 )
149 data = {153 data.update({
150 'po_name': po_name,154 'po_name': po_name,
151 'cdd': cdd,155 'cdd': cdd,
152 'line_number': line.line_number,156 'line_number': line.line_number,
@@ -154,7 +158,7 @@
154 'product_code': line.product_id.code,158 'product_code': line.product_id.code,
155 'is_delivered': False,159 'is_delivered': False,
156 'backordered_qty': 0.00,160 'backordered_qty': 0.00,
157 }161 })
158 if first_line:162 if first_line:
159 data.update({163 data.update({
160 'uom_id': line.product_uom.name,164 'uom_id': line.product_uom.name,
@@ -169,15 +173,15 @@
169 is_delivered = False173 is_delivered = False
170 is_shipment_done = False174 is_shipment_done = False
171 if ppl:175 if ppl:
172 packing = move.picking_id.previous_step_id.name or ''176 packing = move.picking_id.previous_step_id.name or '-'
173 shipment = move.picking_id.shipment_id and move.picking_id.shipment_id.name or ''177 shipment = move.picking_id.shipment_id and move.picking_id.shipment_id.name or '-'
174 eta = datetime.strptime(move.picking_id.shipment_id.shipment_actual_date[0:10], '%Y-%m-%d')178 eta = datetime.strptime(move.picking_id.shipment_id.shipment_actual_date[0:10], '%Y-%m-%d')
175 eta += timedelta(days=line.order_id.partner_id.supplier_lt or 0.00)179 eta += timedelta(days=line.order_id.partner_id.supplier_lt or 0.00)
176 is_delivered = move.picking_id.shipment_id.state == 'delivered' or False180 is_delivered = move.picking_id.shipment_id.state == 'delivered' or False
177 is_shipment_done = move.picking_id.shipment_id.state == 'done' or False181 is_shipment_done = move.picking_id.shipment_id.state == 'done' or False
178 else:182 else:
179 packing = move.picking_id.name or ''183 packing = move.picking_id.name or '-'
180 shipment = ''184 shipment = '-'
181185
182 if not grouped:186 if not grouped:
183 key = (packing, shipment, move.product_uom.name)187 key = (packing, shipment, move.product_uom.name)
@@ -188,21 +192,21 @@
188 'shipment': shipment,192 'shipment': shipment,
189 'is_delivered': is_delivered,193 'is_delivered': is_delivered,
190 'delivered_qty': not only_bo and (is_shipment_done or is_delivered) and move.product_qty or 0.00,194 'delivered_qty': not only_bo and (is_shipment_done or is_delivered) and move.product_qty or 0.00,
191 'delivered_uom': not only_bo and (is_shipment_done or is_delivered) and move.product_uom.name or '',195 'delivered_uom': not only_bo and (is_shipment_done or is_delivered) and move.product_uom.name or '-',
192 'backordered_qty': not is_shipment_done and not is_delivered and line.order_id.state != 'cancel' and move.product_qty or 0.00,196 'backordered_qty': not is_shipment_done and not is_delivered and line.order_id.state != 'cancel' and move.product_qty or 0.00,
193 'rts': not only_bo and move.picking_id.shipment_id and move.picking_id.shipment_id.shipment_expected_date[0:10] or '',197 'rts': not only_bo and move.picking_id.shipment_id and move.picking_id.shipment_id.shipment_expected_date[0:10] or '',
194 'eta': not only_bo and eta and eta.strftime('%Y-%m-%d'),198 'eta': not only_bo and eta and eta.strftime('%Y-%m-%d'),
195 'transport': not only_bo and move.picking_id.shipment_id and move.picking_id.shipment_id.transport_type or '',199 'transport': not only_bo and move.picking_id.shipment_id and move.picking_id.shipment_id.transport_type,
196 })200 })
197 else:201 else:
198 if move.picking_id.type == 'out' and move.picking_id.subtype == 'packing':202 if move.picking_id.type == 'out' and move.picking_id.subtype == 'packing':
199 packing = move.picking_id.previous_step_id.name203 packing = move.picking_id.previous_step_id.name
200 shipment = move.picking_id.shipment_id.name or ''204 shipment = move.picking_id.shipment_id.name or '-'
201 is_shipment_done = move.picking_id.shipment_id.state == 'done'205 is_shipment_done = move.picking_id.shipment_id.state == 'done'
202 else:206 else:
203 shipment = move.picking_id.name or ''207 shipment = move.picking_id.name or '-'
204 is_shipment_done = move.picking_id.state == 'done'208 is_shipment_done = move.picking_id.state == 'done'
205 packing = ''209 packing = '-'
206 if not grouped:210 if not grouped:
207 key = (packing, False, move.product_uom.name)211 key = (packing, False, move.product_uom.name)
208 else:212 else:
@@ -211,18 +215,24 @@
211 data.update({215 data.update({
212 'packing': packing,216 'packing': packing,
213 'delivered_qty': is_shipment_done and move.product_qty or 0.00,217 'delivered_qty': is_shipment_done and move.product_qty or 0.00,
214 'delivered_uom': is_shipment_done and move.product_uom.name or '',218 'delivered_uom': is_shipment_done and move.product_uom.name or '-',
215 'rts': line.order_id.ready_to_ship_date,219 'rts': line.order_id.ready_to_ship_date,
216 'shipment': shipment,220 'shipment': shipment,
217 })221 })
218222
219 if key in keys:223 if key in keys and lines:
220 for rline in lines:224 for rline in lines:
221 if rline['packing'] == key[0] and rline['shipment'] == key[1] and rline['delivered_uom'] == key[2]:225 if rline['packing'] == key[0] and rline['shipment'] == key[1] and rline['delivered_uom'] == key[2]:
222 if not grouped or (grouped and line.line_number == key[3]):226 if not grouped or (grouped and line.line_number == key[3]):
223 rline.update({227 rline.update({
224 'delivered_qty': rline['delivered_qty'] + data['delivered_qty'],228 'delivered_qty': rline['delivered_qty'] + data['delivered_qty'],
225 })229 })
230 if rline['packing'] == key[0] and rline['shipment'] == key[1] and move.product_uom.name == key[2]\
231 and (ppl_not_shipped or not is_shipment_done):
232 if not grouped or (grouped and line.line_number == key[3]):
233 rline.update({
234 'backordered_qty': rline['backordered_qty'] + data['backordered_qty'],
235 })
226 else:236 else:
227 keys.append(key)237 keys.append(key)
228 lines.append(data)238 lines.append(data)
@@ -230,23 +240,25 @@
230 fl_index = m_index240 fl_index = m_index
231 m_index += 1241 m_index += 1
232242
243 # reset the data to prevent delivered_qty problem when line is split in PICK
244 data = {}
245
233 # No move found246 # No move found
234 if first_line:247 if first_line:
235 data = {248 data.update({
236 'line_number': line.line_number,249 'line_number': line.line_number,
237 'po_name': po_name,250 'po_name': po_name,
238 'product_code': line.product_id.default_code,251 'product_code': line.product_id.default_code,
239 'product_name': line.product_id.name,252 'product_name': line.product_id.name,
240 'uom_id': line.product_uom.name,253 'uom_id': line.product_uom.name,
241 'ordered_qty': line.product_uom_qty,254 'ordered_qty': line.product_uom_qty,
242 'rts': line.order_id.state not in ('draft', 'validated', 'cancel') and line.order_id.ready_to_ship_date or '',255 'rts': line.order_id.state not in ('draft', 'validated', 'cancel') and line.order_id.ready_to_ship_date,
243 'delivered_qty': 0.00,256 'delivered_qty': 0.00,
244 'delivered_uom': '',257 'delivered_uom': '-',
245 'backordered_qty': line.product_uom_qty if line.order_id.state != 'cancel' else 0.00,258 'backordered_qty': line.product_uom_qty if line.order_id.state != 'cancel' else 0.00,
246 'cdd': cdd,259 'cdd': cdd,
247 }260 })
248 lines.append(data)261 lines.append(data)
249
250 # Put the backorderd qty on the first line262 # Put the backorderd qty on the first line
251 if not lines:263 if not lines:
252 continue264 continue
@@ -266,8 +278,8 @@
266 })278 })
267 if not first_line:279 if not first_line:
268 lines[fl_index].update({280 lines[fl_index].update({
269 'shipment': '',281 'shipment': '-',
270 'packing': '',282 'packing': '-',
271 })283 })
272284
273 elif bo_qty < 0:285 elif bo_qty < 0:
274286
=== modified file 'bin/addons/sales_followup/wizard/ir_followup_location_wizard.py'
--- bin/addons/sales_followup/wizard/ir_followup_location_wizard.py 2017-08-22 12:23:43 +0000
+++ bin/addons/sales_followup/wizard/ir_followup_location_wizard.py 2018-05-17 08:41:16 +0000
@@ -81,14 +81,11 @@
81 'confirmed_ok': fields.boolean(81 'confirmed_ok': fields.boolean(
82 string='Confirmed',82 string='Confirmed',
83 ),83 ),
84 'exception_ok': fields.boolean(
85 string='Exception',
86 ),
87 'closed_ok': fields.boolean(84 'closed_ok': fields.boolean(
88 string='Closed',85 string='Closed',
89 ),86 ),
90 'cancel_ok': fields.boolean(87 'cancel_ok': fields.boolean(
91 string='Cancel',88 string='Cancelled',
92 ),89 ),
93 'only_bo': fields.boolean(90 'only_bo': fields.boolean(
94 string='Pending order lines only (PDF)',91 string='Pending order lines only (PDF)',
@@ -115,19 +112,16 @@
115 state_domain = []112 state_domain = []
116113
117 if wizard.draft_ok:114 if wizard.draft_ok:
118 state_domain.append('draft')115 state_domain.extend(['draft', 'draft_p'])
119116
120 if wizard.validated_ok:117 if wizard.validated_ok:
121 state_domain.extend(['validated', 'waiting_date'])118 state_domain.extend(['validated', 'validated_p'])
122119
123 if wizard.sourced_ok:120 if wizard.sourced_ok:
124 state_domain.append('sourced')121 state_domain.extend(['sourced', 'sourced_p'])
125122
126 if wizard.confirmed_ok:123 if wizard.confirmed_ok:
127 state_domain.extend(['manual', 'progress'])124 state_domain.extend(['confirmed', 'confirmed_p'])
128
129 if wizard.exception_ok:
130 state_domain.extend(['shipping_except', 'invoice_except'])
131125
132 if wizard.closed_ok:126 if wizard.closed_ok:
133 state_domain.append('done')127 state_domain.append('done')
134128
=== modified file 'bin/addons/sales_followup/wizard/ir_followup_location_wizard_view.xml'
--- bin/addons/sales_followup/wizard/ir_followup_location_wizard_view.xml 2017-08-22 15:47:17 +0000
+++ bin/addons/sales_followup/wizard/ir_followup_location_wizard_view.xml 2018-05-17 08:41:16 +0000
@@ -20,7 +20,6 @@
20 <field name="validated_ok" />20 <field name="validated_ok" />
21 <field name="sourced_ok" />21 <field name="sourced_ok" />
22 <field name="confirmed_ok" />22 <field name="confirmed_ok" />
23 <field name="exception_ok" />
24 <field name="closed_ok" />23 <field name="closed_ok" />
25 <field name="cancel_ok" />24 <field name="cancel_ok" />
26 </group>25 </group>
2726
=== modified file 'bin/addons/sales_followup/wizard/sale_followup_multi_wizard.py'
--- bin/addons/sales_followup/wizard/sale_followup_multi_wizard.py 2016-04-20 14:10:30 +0000
+++ bin/addons/sales_followup/wizard/sale_followup_multi_wizard.py 2018-05-17 08:41:16 +0000
@@ -88,14 +88,11 @@
88 'confirmed_ok': fields.boolean(88 'confirmed_ok': fields.boolean(
89 string='Confirmed',89 string='Confirmed',
90 ),90 ),
91 'exception_ok': fields.boolean(
92 string='Exception',
93 ),
94 'closed_ok': fields.boolean(91 'closed_ok': fields.boolean(
95 string='Closed',92 string='Closed',
96 ),93 ),
97 'cancel_ok': fields.boolean(94 'cancel_ok': fields.boolean(
98 string='Cancel',95 string='Cancelled',
99 ),96 ),
100 'only_bo': fields.boolean(97 'only_bo': fields.boolean(
101 string='Pending order lines only (PDF)',98 string='Pending order lines only (PDF)',
@@ -122,19 +119,16 @@
122 state_domain = []119 state_domain = []
123120
124 if wizard.draft_ok:121 if wizard.draft_ok:
125 state_domain.append('draft')122 state_domain.extend(['draft', 'draft_p'])
126123
127 if wizard.validated_ok:124 if wizard.validated_ok:
128 state_domain.extend(['validated', 'waiting_date'])125 state_domain.extend(['validated', 'validated_p'])
129126
130 if wizard.sourced_ok:127 if wizard.sourced_ok:
131 state_domain.append('sourced')128 state_domain.extend(['sourced', 'sourced_p'])
132129
133 if wizard.confirmed_ok:130 if wizard.confirmed_ok:
134 state_domain.extend(['manual', 'progress'])131 state_domain.extend(['confirmed', 'confirmed_p'])
135
136 if wizard.exception_ok:
137 state_domain.extend(['shipping_except', 'invoice_except'])
138132
139 if wizard.closed_ok:133 if wizard.closed_ok:
140 state_domain.append('done')134 state_domain.append('done')
141135
=== modified file 'bin/addons/sales_followup/wizard/sale_followup_multi_wizard_view.xml'
--- bin/addons/sales_followup/wizard/sale_followup_multi_wizard_view.xml 2016-04-20 14:10:30 +0000
+++ bin/addons/sales_followup/wizard/sale_followup_multi_wizard_view.xml 2018-05-17 08:41:16 +0000
@@ -20,7 +20,6 @@
20 <field name="validated_ok" />20 <field name="validated_ok" />
21 <field name="sourced_ok" />21 <field name="sourced_ok" />
22 <field name="confirmed_ok" />22 <field name="confirmed_ok" />
23 <field name="exception_ok" />
24 <field name="closed_ok" />23 <field name="closed_ok" />
25 <field name="cancel_ok" />24 <field name="cancel_ok" />
26 </group>25 </group>
2726
=== modified file 'bin/addons/stock_override/stock.py'
--- bin/addons/stock_override/stock.py 2017-11-13 08:37:20 +0000
+++ bin/addons/stock_override/stock.py 2018-05-17 08:41:16 +0000
@@ -1721,6 +1721,7 @@
1721 ('product_uom', '=', loc['uom_id']),1721 ('product_uom', '=', loc['uom_id']),
1722 ('line_number', '=', move['line_number']),1722 ('line_number', '=', move['line_number']),
1723 ('location_id', '=', loc['location_id']),1723 ('location_id', '=', loc['location_id']),
1724 ('sale_line_id', '=', move['sale_line_id'] and move['sale_line_id'][0] or False),
1724 ('location_dest_id', '=', move['location_dest_id'][0]),1725 ('location_dest_id', '=', move['location_dest_id'][0]),
1725 ('prodlot_id', '=', loc['prodlot_id'])],1726 ('prodlot_id', '=', loc['prodlot_id'])],
1726 context=context)1727 context=context)

Subscribers

People subscribed via source and target branches