Merge lp:~unifield-team/unifield-server/us-3478-3479 into lp:unifield-server
- us-3478-3479
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 4589 |
Proposed branch: | lp:~unifield-team/unifield-server/us-3478-3479 |
Merge into: | lp:unifield-server |
Diff against target: |
1859 lines (+1497/-40) 31 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+214/-0) bin/addons/procurement_request/__openerp__.py (+1/-0) bin/addons/procurement_request/procurement_request.py (+34/-4) bin/addons/procurement_request/procurement_request_line_wizard.xml (+25/-0) bin/addons/procurement_request/procurement_request_view.xml (+7/-0) bin/addons/procurement_request/wizard/__init__.py (+1/-0) bin/addons/procurement_request/wizard/procurement_request_line_wizard.py (+44/-0) bin/addons/purchase/purchase_order_line.py (+8/-13) bin/addons/purchase/purchase_workflow.py (+4/-0) bin/addons/purchase_followup/__init__.py (+1/-0) bin/addons/purchase_followup/__openerp__.py (+3/-1) bin/addons/purchase_followup/report/__init__.py (+1/-0) bin/addons/purchase_followup/report/po_track_changes_report.py (+92/-0) bin/addons/purchase_followup/report/po_track_changes_report.xml (+18/-0) bin/addons/purchase_followup/report/po_track_changes_report_xls.mako (+299/-0) bin/addons/purchase_followup/wizard/__init__.py (+22/-0) bin/addons/purchase_followup/wizard/po_track_changes_wizard.py (+130/-0) bin/addons/purchase_followup/wizard/po_track_changes_wizard_view.xml (+39/-0) bin/addons/sale/sale_order.py (+1/-1) bin/addons/sale/sale_workflow.py (+1/-0) bin/addons/sales_followup/__openerp__.py (+2/-0) bin/addons/sales_followup/report/__init__.py (+1/-0) bin/addons/sales_followup/report/ir_track_changes_report.py (+73/-0) bin/addons/sales_followup/report/ir_track_changes_report.xml (+18/-0) bin/addons/sales_followup/report/ir_track_changes_report_xls.mako (+283/-0) bin/addons/sales_followup/wizard/__init__.py (+1/-0) bin/addons/sales_followup/wizard/ir_track_changes_wizard.py (+130/-0) bin/addons/sales_followup/wizard/ir_track_changes_wizard_view.xml (+39/-0) bin/addons/sourcing/procurement_order.py (+2/-0) bin/addons/sourcing/sale_order_line.py (+3/-0) bin/addons/sourcing/sourcing_view.xml (+0/-21) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-3478-3479 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+332845@code.launchpad.net |
Commit message
Description of the change
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
1 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
2 | --- bin/addons/msf_profile/i18n/fr_MF.po 2017-10-09 16:01:14 +0000 | |||
3 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2017-10-26 10:06:24 +0000 | |||
4 | @@ -99629,3 +99629,217 @@ | |||
5 | 99629 | #, python-format | 99629 | #, python-format |
6 | 99630 | msgid "You can't delete this FX rate as the period \"%s\" isn't in Draft state." | 99630 | msgid "You can't delete this FX rate as the period \"%s\" isn't in Draft state." |
7 | 99631 | msgstr "Vous ne pouvez pas supprimer ce taux de change car la période \"%s\" n'est pas en statut Brouillon." | 99631 | msgstr "Vous ne pouvez pas supprimer ce taux de change car la période \"%s\" n'est pas en statut Brouillon." |
8 | 99632 | |||
9 | 99633 | #. modules: purchase, purchase_override, procurement_request | ||
10 | 99634 | #: field:sale.order.line,original_price:0 | ||
11 | 99635 | #: field:purchase.order.line,original_price:0 | ||
12 | 99636 | #: field:purchase.order.merged.line,original_price:0 | ||
13 | 99637 | msgid "Original Price" | ||
14 | 99638 | msgstr "Prix d'Origine" | ||
15 | 99639 | |||
16 | 99640 | #. modules: purchase, purchase_override, procurement_request | ||
17 | 99641 | #: field:sale.order.line,original_product:0 | ||
18 | 99642 | #: field:purchase.order.line,original_product:0 | ||
19 | 99643 | #: field:purchase.order.merged.line,original_product:0 | ||
20 | 99644 | msgid "Original Product" | ||
21 | 99645 | msgstr "Produit d'Origine" | ||
22 | 99646 | |||
23 | 99647 | #. modules: purchase, purchase_override, procurement_request | ||
24 | 99648 | #: field:sale.order.line,original_uom:0 | ||
25 | 99649 | #: field:purchase.order.line,original_uom:0 | ||
26 | 99650 | #: field:purchase.order.merged.line,original_uom:0 | ||
27 | 99651 | msgid "Original UoM" | ||
28 | 99652 | msgstr "UdM d'Origine" | ||
29 | 99653 | |||
30 | 99654 | #. modules: purchase, purchase_followup, purchase_override | ||
31 | 99655 | #: field:purchase.order.line,original_currency_id:0 | ||
32 | 99656 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:244 | ||
33 | 99657 | #: field:purchase.order.merged.line,original_currency_id:0 | ||
34 | 99658 | msgid "Original Currency" | ||
35 | 99659 | msgstr "Devise d'Origine" | ||
36 | 99660 | |||
37 | 99661 | #. modules: purchase, purchase_override, procurement_request | ||
38 | 99662 | #: field:sale.order.line,original_changed:0 | ||
39 | 99663 | #: field:purchase.order.line,original_changed:0 | ||
40 | 99664 | #: field:purchase.order.merged.line,original_changed:0 | ||
41 | 99665 | msgid "Changed" | ||
42 | 99666 | msgstr "Changé" | ||
43 | 99667 | |||
44 | 99668 | #. modules: sales_followup, purchase, purchase_followup, purchase_override, procurement_request | ||
45 | 99669 | #: field:sale.order.line,original_qty:0 | ||
46 | 99670 | #: field:purchase.order.line,original_qty:0 | ||
47 | 99671 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:239 | ||
48 | 99672 | #: field:purchase.order.merged.line,original_qty:0 | ||
49 | 99673 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:231 | ||
50 | 99674 | msgid "Original Qty" | ||
51 | 99675 | msgstr "Qté d'Origine" | ||
52 | 99676 | |||
53 | 99677 | #. module: sales_followup | ||
54 | 99678 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:236 | ||
55 | 99679 | msgid "Original Subtotal" | ||
56 | 99680 | msgstr "Sous-Total d'Origine" | ||
57 | 99681 | |||
58 | 99682 | #. module: purchase_followup | ||
59 | 99683 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:246 | ||
60 | 99684 | msgid "Original Price in functional currency" | ||
61 | 99685 | msgstr "Prix d'Origine en devise fonctionnelle" | ||
62 | 99686 | |||
63 | 99687 | #. modules: sales_followup, purchase_followup | ||
64 | 99688 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:240 | ||
65 | 99689 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:232 | ||
66 | 99690 | msgid "Original UoM" | ||
67 | 99691 | msgstr "UdM d'Origine" | ||
68 | 99692 | |||
69 | 99693 | #. modules: sales_followup, purchase_followup | ||
70 | 99694 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:236 | ||
71 | 99695 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:228 | ||
72 | 99696 | msgid "Original Code" | ||
73 | 99697 | msgstr "Code d'Origine" | ||
74 | 99698 | |||
75 | 99699 | #. modules: sales_followup, purchase_followup | ||
76 | 99700 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:243 | ||
77 | 99701 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:234 | ||
78 | 99702 | msgid "Original Unit Price" | ||
79 | 99703 | msgstr "Prix Unitaire d'Origine" | ||
80 | 99704 | |||
81 | 99705 | #. module: purchase_followup | ||
82 | 99706 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:248 | ||
83 | 99707 | msgid "Original Subtotal (functional currency)" | ||
84 | 99708 | msgstr "Sous-Total d'Origine (devise fonctionnelle)" | ||
85 | 99709 | |||
86 | 99710 | #. modules: sales_followup, purchase_followup | ||
87 | 99711 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:241 | ||
88 | 99712 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:233 | ||
89 | 99713 | msgid "Unit Price" | ||
90 | 99714 | msgstr "Prix Unitaire" | ||
91 | 99715 | |||
92 | 99716 | #. modules: sales_followup, purchase_followup | ||
93 | 99717 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:231 | ||
94 | 99718 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:223 | ||
95 | 99719 | msgid "Order ref" | ||
96 | 99720 | msgstr "Ref commande" | ||
97 | 99721 | |||
98 | 99722 | #. modules: sales_followup, purchase_followup | ||
99 | 99723 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:192 | ||
100 | 99724 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:184 | ||
101 | 99725 | msgid "Address:" | ||
102 | 99726 | msgstr "Adresse:" | ||
103 | 99727 | |||
104 | 99728 | #. modules: sales_followup, purchase_followup | ||
105 | 99729 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:181 | ||
106 | 99730 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:173 | ||
107 | 99731 | msgid "Name:" | ||
108 | 99732 | msgstr "Nom:" | ||
109 | 99733 | |||
110 | 99734 | #. modules: sales_followup, purchase_followup | ||
111 | 99735 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:249 | ||
112 | 99736 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:237 | ||
113 | 99737 | msgid "Modification comment" | ||
114 | 99738 | msgstr "Commentaire de modification" | ||
115 | 99739 | |||
116 | 99740 | #. module: sales_followup | ||
117 | 99741 | #: model:ir.actions.report.xml,name:sales_followup.report_ir_track_changes_xls | ||
118 | 99742 | msgid "Internal Request Track Changes Excel Export" | ||
119 | 99743 | msgstr "Export Excel du Suivi des Changements des Demandes Internes" | ||
120 | 99744 | |||
121 | 99745 | #. modules: sales_followup, purchase_followup | ||
122 | 99746 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:176 | ||
123 | 99747 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:168 | ||
124 | 99748 | msgid "Instance information" | ||
125 | 99749 | msgstr "Informations sur l'instance" | ||
126 | 99750 | |||
127 | 99751 | #. modules: sales_followup, purchase_followup | ||
128 | 99752 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:206 | ||
129 | 99753 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:198 | ||
130 | 99754 | msgid "Order Ref:" | ||
131 | 99755 | msgstr "Ref Commande:" | ||
132 | 99756 | |||
133 | 99757 | #. modules: sales_followup, purchase_followup | ||
134 | 99758 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:213 | ||
135 | 99759 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:205 | ||
136 | 99760 | msgid "Date of the request:" | ||
137 | 99761 | msgstr "Date de la requête:" | ||
138 | 99762 | |||
139 | 99763 | #. modules: sales_followup, purchase_followup | ||
140 | 99764 | #: code:addons/purchase_followup/wizard/po_track_changes_wizard.py:94 | ||
141 | 99765 | #: code:addons/sales_followup/wizard/ir_track_changes_wizard.py:94 | ||
142 | 99766 | #, python-format | ||
143 | 99767 | msgid "No data found with these parameters" | ||
144 | 99768 | msgstr "Aucune donnée n'a été trouvée avec ces paramètres" | ||
145 | 99769 | |||
146 | 99770 | #. module: sales_followup | ||
147 | 99771 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:235 | ||
148 | 99772 | msgid "Subtotal" | ||
149 | 99773 | msgstr "Sous-Total" | ||
150 | 99774 | |||
151 | 99775 | #. modules: sales_followup, purchase_followup | ||
152 | 99776 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:195 | ||
153 | 99777 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:187 | ||
154 | 99778 | msgid "Date end:" | ||
155 | 99779 | msgstr "Date de fin:" | ||
156 | 99780 | |||
157 | 99781 | #. modules: sales_followup | ||
158 | 99782 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:229 | ||
159 | 99783 | #, python-format | ||
160 | 99784 | msgid "Qty" | ||
161 | 99785 | msgstr "Qté" | ||
162 | 99786 | |||
163 | 99787 | #. modules: sales_followup, purchase_followup | ||
164 | 99788 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:178 | ||
165 | 99789 | #: view:po.track.changes.wizard:0 | ||
166 | 99790 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:170 | ||
167 | 99791 | #: view:ir.track.changes.wizard:0 | ||
168 | 99792 | msgid "Request parameters" | ||
169 | 99793 | msgstr "Paramètres de la requête" | ||
170 | 99794 | |||
171 | 99795 | #. modules: sales_followup, purchase_followup | ||
172 | 99796 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:184 | ||
173 | 99797 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:176 | ||
174 | 99798 | msgid "Date start:" | ||
175 | 99799 | msgstr "Date de départ:" | ||
176 | 99800 | |||
177 | 99801 | #. module: sales_followup | ||
178 | 99802 | #: model:ir.actions.act_window,name:sales_followup.action_ir_track_changes_wizard | ||
179 | 99803 | #: model:ir.ui.menu,name:sales_followup.menu_ir_track_changes | ||
180 | 99804 | msgid "IR Track Changes" | ||
181 | 99805 | msgstr "Suivi Changements Demandes Internes" | ||
182 | 99806 | |||
183 | 99807 | #. modules: sales_followup, purchase_followup | ||
184 | 99808 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:232 | ||
185 | 99809 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:224 | ||
186 | 99810 | #, python-format | ||
187 | 99811 | msgid "Status" | ||
188 | 99812 | msgstr "État" | ||
189 | 99813 | |||
190 | 99814 | #. module: purchase_followup | ||
191 | 99815 | #: model:ir.actions.act_window,name:purchase_followup.action_po_track_changes_wizard | ||
192 | 99816 | #: model:ir.ui.menu,name:purchase_followup.menu_po_track_changes | ||
193 | 99817 | msgid "PO Track Changes" | ||
194 | 99818 | msgstr "Suivi Changements Bons de Commande" | ||
195 | 99819 | |||
196 | 99820 | #. module: purchase_followup | ||
197 | 99821 | #: model:ir.actions.report.xml,name:purchase_followup.report_po_track_changes_xls | ||
198 | 99822 | msgid "Purchase Order Track Changes Excel Export" | ||
199 | 99823 | msgstr "Export Excel du Suivi des Changements des Bons de Commande" | ||
200 | 99824 | |||
201 | 99825 | #. module: purchase_followup | ||
202 | 99826 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:245 | ||
203 | 99827 | msgid "Price in functional currency" | ||
204 | 99828 | msgstr "Prix dans la devise fonctionnelle" | ||
205 | 99829 | |||
206 | 99830 | #. modules: purchase_followup | ||
207 | 99831 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:242 | ||
208 | 99832 | msgid "Currency" | ||
209 | 99833 | msgstr "Devise" | ||
210 | 99834 | |||
211 | 99835 | #. module: purchase_followup | ||
212 | 99836 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:247 | ||
213 | 99837 | msgid "Subtotal (functional currency)" | ||
214 | 99838 | msgstr "Sous-Total (devise fonctionnelle)" | ||
215 | 99839 | |||
216 | 99840 | #. modules: purchase, purchase_override, sale | ||
217 | 99841 | #: field:purchase.order.line,modification_comment:0 | ||
218 | 99842 | #: field:purchase.order.merged.line,modification_comment:0 | ||
219 | 99843 | #: field:sale.order.line,modification_comment:0 | ||
220 | 99844 | msgid "Modification Comment" | ||
221 | 99845 | msgstr "Commentaire de Modification" | ||
222 | 99632 | 99846 | ||
223 | === modified file 'bin/addons/procurement_request/__openerp__.py' | |||
224 | --- bin/addons/procurement_request/__openerp__.py 2017-09-28 14:05:02 +0000 | |||
225 | +++ bin/addons/procurement_request/__openerp__.py 2017-10-26 10:06:24 +0000 | |||
226 | @@ -45,6 +45,7 @@ | |||
227 | 45 | 'procurement_request_sequence.xml', | 45 | 'procurement_request_sequence.xml', |
228 | 46 | 'procurement_request_wizard.xml', | 46 | 'procurement_request_wizard.xml', |
229 | 47 | 'procurement_request_report.xml', | 47 | 'procurement_request_report.xml', |
230 | 48 | 'procurement_request_line_wizard.xml', | ||
231 | 48 | 'wizard/wizard_import_list_view.xml', | 49 | 'wizard/wizard_import_list_view.xml', |
232 | 49 | ], | 50 | ], |
233 | 50 | 'demo_xml': [ | 51 | 'demo_xml': [ |
234 | 51 | 52 | ||
235 | === modified file 'bin/addons/procurement_request/procurement_request.py' | |||
236 | --- bin/addons/procurement_request/procurement_request.py 2017-10-03 16:01:45 +0000 | |||
237 | +++ bin/addons/procurement_request/procurement_request.py 2017-10-26 10:06:24 +0000 | |||
238 | @@ -694,15 +694,44 @@ | |||
239 | 694 | 694 | ||
240 | 695 | for line in self.browse(cr, uid, ids, context=context): | 695 | for line in self.browse(cr, uid, ids, context=context): |
241 | 696 | changed = False | 696 | changed = False |
246 | 697 | if line.modification_comment or (line.original_qty and line.original_price and line.original_uom): | 697 | if line.modification_comment or (line.original_qty and line.product_uom_qty != line.original_qty): |
247 | 698 | if line.modification_comment or line.product_uom_qty != line.original_qty \ | 698 | changed = True |
244 | 699 | or line.price_unit != line.original_price or line.product_uom != line.original_uom: | ||
245 | 700 | changed = True | ||
248 | 701 | 699 | ||
249 | 702 | res[line.id] = changed | 700 | res[line.id] = changed |
250 | 703 | 701 | ||
251 | 704 | return res | 702 | return res |
252 | 705 | 703 | ||
253 | 704 | def button_view_changed(self, cr, uid, ids, context=None): | ||
254 | 705 | """ | ||
255 | 706 | Launch wizard to display line information | ||
256 | 707 | """ | ||
257 | 708 | if not context: | ||
258 | 709 | context = {} | ||
259 | 710 | if isinstance(ids, (int, long)): | ||
260 | 711 | ids = [ids] | ||
261 | 712 | |||
262 | 713 | wiz_obj = self.pool.get('procurement.request.line.wizard') | ||
263 | 714 | cols = ['product_id', 'original_product', 'product_uom_qty', 'original_qty', 'price_unit', | ||
264 | 715 | 'original_price', 'product_uom', 'original_uom', 'modification_comment'] | ||
265 | 716 | sol = self.read(cr, uid, ids[0], cols, context=context) | ||
266 | 717 | wiz_id = wiz_obj.create(cr, uid, sol, context=context) | ||
267 | 718 | |||
268 | 719 | context.update({ | ||
269 | 720 | 'active_id': ids[0], | ||
270 | 721 | 'active_ids': ids, | ||
271 | 722 | }) | ||
272 | 723 | |||
273 | 724 | return { | ||
274 | 725 | 'name': _('Original Data Internal Request Line'), | ||
275 | 726 | 'type': 'ir.actions.act_window', | ||
276 | 727 | 'res_model': 'procurement.request.line.wizard', | ||
277 | 728 | 'view_type': 'form', | ||
278 | 729 | 'view_mode': 'form', | ||
279 | 730 | 'target': 'new', | ||
280 | 731 | 'res_id': [wiz_id], | ||
281 | 732 | 'context': context, | ||
282 | 733 | } | ||
283 | 734 | |||
284 | 706 | _columns = { | 735 | _columns = { |
285 | 707 | 'cost_price': fields.float(string='Cost price', digits_compute=dp.get_precision('Sale Price Computation')), | 736 | 'cost_price': fields.float(string='Cost price', digits_compute=dp.get_precision('Sale Price Computation')), |
286 | 708 | 'procurement_request': fields.boolean(string='Internal Request', readonly=True), | 737 | 'procurement_request': fields.boolean(string='Internal Request', readonly=True), |
287 | @@ -715,6 +744,7 @@ | |||
288 | 715 | 'product_id_ok': fields.function(_get_product_id_ok, type="boolean", method=True, string='Product defined?', help='for if true the button "configurator" is hidden'), | 744 | 'product_id_ok': fields.function(_get_product_id_ok, type="boolean", method=True, string='Product defined?', help='for if true the button "configurator" is hidden'), |
289 | 716 | 'product_ok': fields.boolean('Product selected'), | 745 | 'product_ok': fields.boolean('Product selected'), |
290 | 717 | 'comment_ok': fields.boolean('Comment written'), | 746 | 'comment_ok': fields.boolean('Comment written'), |
291 | 747 | 'original_product': fields.many2one('product.product', 'Original Product'), | ||
292 | 718 | 'original_qty': fields.float('Original Qty'), | 748 | 'original_qty': fields.float('Original Qty'), |
293 | 719 | 'original_price': fields.float('Original Price'), | 749 | 'original_price': fields.float('Original Price'), |
294 | 720 | 'original_uom': fields.many2one('product.uom', 'Original UOM'), | 750 | 'original_uom': fields.many2one('product.uom', 'Original UOM'), |
295 | 721 | 751 | ||
296 | === added file 'bin/addons/procurement_request/procurement_request_line_wizard.xml' | |||
297 | --- bin/addons/procurement_request/procurement_request_line_wizard.xml 1970-01-01 00:00:00 +0000 | |||
298 | +++ bin/addons/procurement_request/procurement_request_line_wizard.xml 2017-10-26 10:06:24 +0000 | |||
299 | @@ -0,0 +1,25 @@ | |||
300 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
301 | 2 | <openerp> | ||
302 | 3 | <data> | ||
303 | 4 | <record model="ir.ui.view" id="procurement_request_line_wizard_form"> | ||
304 | 5 | <field name="name">procurement.request.line.wizard.form"</field> | ||
305 | 6 | <field name="model">procurement.request.line.wizard</field> | ||
306 | 7 | <field name="type">form</field> | ||
307 | 8 | <field name="arch" type='xml'> | ||
308 | 9 | <form string="Original Data Internal Request Line"> | ||
309 | 10 | <field name="product_id" colspan="2"/> | ||
310 | 11 | <field name="original_product" colspan="2"/> | ||
311 | 12 | <field name="product_uom_qty" colspan="2"/> | ||
312 | 13 | <field name="original_qty" colspan="2"/> | ||
313 | 14 | <field name="price_unit" colspan="2"/> | ||
314 | 15 | <field name="original_price" colspan="2"/> | ||
315 | 16 | <field name="product_uom" colspan="2"/> | ||
316 | 17 | <field name="original_uom" colspan="2"/> | ||
317 | 18 | <field name="modification_comment" colspan="4"/> | ||
318 | 19 | <newline/> | ||
319 | 20 | <button icon="gtk-cancel" special="cancel" string="Close Wizard" colspan="4"/> | ||
320 | 21 | </form> | ||
321 | 22 | </field> | ||
322 | 23 | </record> | ||
323 | 24 | </data> | ||
324 | 25 | </openerp> | ||
325 | 0 | \ No newline at end of file | 26 | \ No newline at end of file |
326 | 1 | 27 | ||
327 | === modified file 'bin/addons/procurement_request/procurement_request_view.xml' | |||
328 | --- bin/addons/procurement_request/procurement_request_view.xml 2017-10-16 09:46:36 +0000 | |||
329 | +++ bin/addons/procurement_request/procurement_request_view.xml 2017-10-26 10:06:24 +0000 | |||
330 | @@ -9,6 +9,7 @@ | |||
331 | 9 | <field name="priority" eval="250" /> | 9 | <field name="priority" eval="250" /> |
332 | 10 | <field name="arch" type="xml"> | 10 | <field name="arch" type="xml"> |
333 | 11 | <form string="Internal Request"> | 11 | <form string="Internal Request"> |
334 | 12 | <field name="sourcing_trace_ok" invisible="1" /> | ||
335 | 12 | <group colspan="6" attrs="{'invisible': [('state', 'not in', ['validated', 'validated_p'])]}"> | 13 | <group colspan="6" attrs="{'invisible': [('state', 'not in', ['validated', 'validated_p'])]}"> |
336 | 13 | <html> | 14 | <html> |
337 | 14 | <p style="text-align:center; color: red; font-weight: bold; font-size: 1.2em;"> | 15 | <p style="text-align:center; color: red; font-weight: bold; font-size: 1.2em;"> |
338 | @@ -34,6 +35,7 @@ | |||
339 | 34 | <field name="fo_to_resource" invisible="1" /> | 35 | <field name="fo_to_resource" invisible="1" /> |
340 | 35 | <field name="parent_order_name" attrs="{'invisible': [('fo_to_resource', '=', False)]}" /> | 36 | <field name="parent_order_name" attrs="{'invisible': [('fo_to_resource', '=', False)]}" /> |
341 | 36 | </group> | 37 | </group> |
342 | 38 | |||
343 | 37 | <notebook colspan="5"> | 39 | <notebook colspan="5"> |
344 | 38 | <page string="Products"> | 40 | <page string="Products"> |
345 | 39 | <button colspan="4" string="Round Qty to SoQ" type="object" name="round_to_soq" icon="gtk-execute" attrs="{'invisible': [('state', '!=', 'draft')]}" /> | 41 | <button colspan="4" string="Round Qty to SoQ" type="object" name="round_to_soq" icon="gtk-execute" attrs="{'invisible': [('state', '!=', 'draft')]}" /> |
346 | @@ -66,6 +68,8 @@ | |||
347 | 66 | icon="terp-go-week" /> | 68 | icon="terp-go-week" /> |
348 | 67 | <field name="product_uom_qty" on_change="onchange_uom(product_id, product_uom, product_uom_qty)" /> | 69 | <field name="product_uom_qty" on_change="onchange_uom(product_id, product_uom, product_uom_qty)" /> |
349 | 68 | <field name="original_changed" readonly="1"/> | 70 | <field name="original_changed" readonly="1"/> |
350 | 71 | <button name="button_view_changed" string="View Current/Original" type="object" icon="terp-stock_zoom" | ||
351 | 72 | attrs="{'invisible': [('original_changed', '=', False)]}"/> | ||
352 | 69 | <field name="price_unit"/> | 73 | <field name="price_unit"/> |
353 | 70 | <field name="notes" /> | 74 | <field name="notes" /> |
354 | 71 | <field name="display_resourced_orig_line" /> | 75 | <field name="display_resourced_orig_line" /> |
355 | @@ -122,6 +126,9 @@ | |||
356 | 122 | <page string="Notes"> | 126 | <page string="Notes"> |
357 | 123 | <field name="notes" nolabel="1" /> | 127 | <field name="notes" nolabel="1" /> |
358 | 124 | </page> | 128 | </page> |
359 | 129 | <page string="Sourcing Logs" attrs="{'invisible': [('sourcing_trace_ok', '=', False)]}"> | ||
360 | 130 | <field name="sourcing_trace" colspan="4" nolabel="1" /> | ||
361 | 131 | </page> | ||
362 | 125 | </notebook> | 132 | </notebook> |
363 | 126 | </form> | 133 | </form> |
364 | 127 | </field> | 134 | </field> |
365 | 128 | 135 | ||
366 | === modified file 'bin/addons/procurement_request/wizard/__init__.py' | |||
367 | --- bin/addons/procurement_request/wizard/__init__.py 2011-05-13 14:36:09 +0000 | |||
368 | +++ bin/addons/procurement_request/wizard/__init__.py 2017-10-26 10:06:24 +0000 | |||
369 | @@ -23,6 +23,7 @@ | |||
370 | 23 | import wizard_list_to_order | 23 | import wizard_list_to_order |
371 | 24 | import wizard_list_to_rfq | 24 | import wizard_list_to_rfq |
372 | 25 | import wizard_import_list | 25 | import wizard_import_list |
373 | 26 | import procurement_request_line_wizard | ||
374 | 26 | 27 | ||
375 | 27 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 28 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
376 | 28 | 29 | ||
377 | 29 | 30 | ||
378 | === added file 'bin/addons/procurement_request/wizard/procurement_request_line_wizard.py' | |||
379 | --- bin/addons/procurement_request/wizard/procurement_request_line_wizard.py 1970-01-01 00:00:00 +0000 | |||
380 | +++ bin/addons/procurement_request/wizard/procurement_request_line_wizard.py 2017-10-26 10:06:24 +0000 | |||
381 | @@ -0,0 +1,44 @@ | |||
382 | 1 | # -*- coding: utf-8 -*- | ||
383 | 2 | ############################################################################## | ||
384 | 3 | # | ||
385 | 4 | # OpenERP, Open Source Management Solution | ||
386 | 5 | # Copyright (C) 2011 TeMPO Consulting, MSF | ||
387 | 6 | # | ||
388 | 7 | # This program is free software: you can redistribute it and/or modify | ||
389 | 8 | # it under the terms of the GNU Affero General Public License as | ||
390 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
391 | 10 | # License, or (at your option) any later version. | ||
392 | 11 | # | ||
393 | 12 | # This program is distributed in the hope that it will be useful, | ||
394 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
395 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
396 | 15 | # GNU Affero General Public License for more details. | ||
397 | 16 | # | ||
398 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
399 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
400 | 19 | # | ||
401 | 20 | ############################################################################## | ||
402 | 21 | |||
403 | 22 | from osv import osv | ||
404 | 23 | from osv import fields | ||
405 | 24 | |||
406 | 25 | |||
407 | 26 | class procurement_request_line_wizard(osv.osv_memory): | ||
408 | 27 | _name = 'procurement.request.line.wizard' | ||
409 | 28 | _description = 'Original Data Internal Request line' | ||
410 | 29 | |||
411 | 30 | _columns = { | ||
412 | 31 | 'id': fields.integer('id'), | ||
413 | 32 | 'product_id': fields.many2one('product.product', 'Current Product', readonly=True), | ||
414 | 33 | 'original_product': fields.many2one('product.product', 'Original Product', readonly=True), | ||
415 | 34 | 'product_uom_qty': fields.float('Current Qty', readonly=True), | ||
416 | 35 | 'original_qty': fields.float('Original Qty', readonly=True), | ||
417 | 36 | 'price_unit': fields.float('Current Price', readonly=True), | ||
418 | 37 | 'original_price': fields.float('Original Price', readonly=True), | ||
419 | 38 | 'product_uom': fields.many2one('product.uom', 'Current UOM', readonly=True), | ||
420 | 39 | 'original_uom': fields.many2one('product.uom', 'Original UOM', readonly=True), | ||
421 | 40 | 'modification_comment': fields.char('Modification Comment', size=1024, readonly=True), | ||
422 | 41 | } | ||
423 | 42 | |||
424 | 43 | |||
425 | 44 | procurement_request_line_wizard() | ||
426 | 0 | 45 | ||
427 | === modified file 'bin/addons/purchase/purchase_order_line.py' | |||
428 | --- bin/addons/purchase/purchase_order_line.py 2017-10-20 12:24:56 +0000 | |||
429 | +++ bin/addons/purchase/purchase_order_line.py 2017-10-26 10:06:24 +0000 | |||
430 | @@ -259,15 +259,8 @@ | |||
431 | 259 | 259 | ||
432 | 260 | for line in self.browse(cr, uid, ids, context=context): | 260 | for line in self.browse(cr, uid, ids, context=context): |
433 | 261 | changed = False | 261 | changed = False |
443 | 262 | if line.modification_comment\ | 262 | if line.modification_comment or (line.original_qty and line.product_qty != line.original_qty): |
444 | 263 | or (line.original_qty and line.original_price and line.original_uom and line.original_currency_id): | 263 | changed = True |
436 | 264 | if line.modification_comment or line.product_qty != line.original_qty \ | ||
437 | 265 | or line.price_unit != line.original_price or line.product_uom != line.original_uom\ | ||
438 | 266 | or line.currency_id != line.original_currency_id: | ||
439 | 267 | changed = True | ||
440 | 268 | elif line.original_qty and line.original_uom and not line.original_price: # From IR | ||
441 | 269 | if line.original_qty != line.product_qty or line.original_uom.id != line.product_uom.id: | ||
442 | 270 | changed = True | ||
445 | 271 | 264 | ||
446 | 272 | res[line.id] = changed | 265 | res[line.id] = changed |
447 | 273 | return res | 266 | return res |
448 | @@ -488,10 +481,10 @@ | |||
449 | 488 | # not replacing the po_state from sale_followup - should ? | 481 | # not replacing the po_state from sale_followup - should ? |
450 | 489 | 'po_state_stored': fields.related('order_id', 'state', type='selection', selection=PURCHASE_ORDER_STATE_SELECTION, string='Po State', readonly=True,), | 482 | 'po_state_stored': fields.related('order_id', 'state', type='selection', selection=PURCHASE_ORDER_STATE_SELECTION, string='Po State', readonly=True,), |
451 | 490 | 'po_partner_type_stored': fields.related('order_id', 'partner_type', type='selection', selection=PARTNER_TYPE, string='Po Partner Type', readonly=True,), | 483 | 'po_partner_type_stored': fields.related('order_id', 'partner_type', type='selection', selection=PARTNER_TYPE, string='Po Partner Type', readonly=True,), |
453 | 491 | 484 | 'original_product': fields.many2one('product.product', 'Original Product'), | |
454 | 492 | 'original_qty': fields.float('Original Qty'), | 485 | 'original_qty': fields.float('Original Qty'), |
455 | 493 | 'original_price': fields.float('Original Price'), | 486 | 'original_price': fields.float('Original Price'), |
457 | 494 | 'original_uom': fields.many2one('product.uom', 'Original UOM'), | 487 | 'original_uom': fields.many2one('product.uom', 'Original UoM'), |
458 | 495 | 'original_currency_id': fields.many2one('res.currency', 'Original Currency'), | 488 | 'original_currency_id': fields.many2one('res.currency', 'Original Currency'), |
459 | 496 | 'modification_comment': fields.char('Modification Comment', size=1024), | 489 | 'modification_comment': fields.char('Modification Comment', size=1024), |
460 | 497 | 'original_changed': fields.function(_check_changed, method=True, string='Changed', type='boolean'), | 490 | 'original_changed': fields.function(_check_changed, method=True, string='Changed', type='boolean'), |
461 | @@ -1058,6 +1051,8 @@ | |||
462 | 1058 | if vals.get('linked_sol_id'): | 1051 | if vals.get('linked_sol_id'): |
463 | 1059 | sol_comment = self.pool.get('sale.order.line').read(cr, uid, vals.get('linked_sol_id'), ['comment'], context=context)['comment'] | 1052 | sol_comment = self.pool.get('sale.order.line').read(cr, uid, vals.get('linked_sol_id'), ['comment'], context=context)['comment'] |
464 | 1060 | vals.update({'comment': sol_comment}) | 1053 | vals.update({'comment': sol_comment}) |
465 | 1054 | if not product_id and not vals.get('name'): # US-3530 | ||
466 | 1055 | vals.update({'name': 'None'}) | ||
467 | 1061 | 1056 | ||
468 | 1062 | # add the database Id to the sync_order_line_db_id | 1057 | # add the database Id to the sync_order_line_db_id |
469 | 1063 | po_line_id = super(purchase_order_line, self).create(cr, uid, vals, context=context) | 1058 | po_line_id = super(purchase_order_line, self).create(cr, uid, vals, context=context) |
470 | @@ -1127,9 +1122,9 @@ | |||
471 | 1127 | 1122 | ||
472 | 1128 | default.update({'state': 'draft', 'move_ids': [], 'invoiced': 0, 'invoice_lines': [], 'commitment_line_ids': []}) | 1123 | default.update({'state': 'draft', 'move_ids': [], 'invoiced': 0, 'invoice_lines': [], 'commitment_line_ids': []}) |
473 | 1129 | 1124 | ||
475 | 1130 | for field in ['origin', 'move_dest_id', 'original_qty', 'original_price', 'original_uom', 'original_currency_id', 'modification_comment', 'sync_linked_sol']: | 1125 | for field in ['origin', 'move_dest_id', 'original_product', 'original_qty', 'original_price', 'original_uom', 'original_currency_id', 'modification_comment', 'sync_linked_sol']: |
476 | 1131 | if field not in default: | 1126 | if field not in default: |
478 | 1132 | default[field]= False | 1127 | default[field] = False |
479 | 1133 | 1128 | ||
480 | 1134 | default.update({'sync_order_line_db_id': False, 'set_as_sourced_n': False, 'set_as_validated_n': False, 'linked_sol_id': False, 'link_so_id': False}) | 1129 | default.update({'sync_order_line_db_id': False, 'set_as_sourced_n': False, 'set_as_validated_n': False, 'linked_sol_id': False, 'link_so_id': False}) |
481 | 1135 | 1130 | ||
482 | 1136 | 1131 | ||
483 | === modified file 'bin/addons/purchase/purchase_workflow.py' | |||
484 | --- bin/addons/purchase/purchase_workflow.py 2017-10-18 07:20:45 +0000 | |||
485 | +++ bin/addons/purchase/purchase_workflow.py 2017-10-26 10:06:24 +0000 | |||
486 | @@ -333,6 +333,10 @@ | |||
487 | 333 | 'original_price': pol.price_unit, | 333 | 'original_price': pol.price_unit, |
488 | 334 | 'original_currency_id': pol.currency_id.id | 334 | 'original_currency_id': pol.currency_id.id |
489 | 335 | } | 335 | } |
490 | 336 | |||
491 | 337 | if not pol.original_product: | ||
492 | 338 | line_update['original_product'] = pol.product_id.id | ||
493 | 339 | |||
494 | 336 | if not pol.original_qty: | 340 | if not pol.original_qty: |
495 | 337 | line_update['original_qty'] = pol.product_qty | 341 | line_update['original_qty'] = pol.product_qty |
496 | 338 | 342 | ||
497 | 339 | 343 | ||
498 | === modified file 'bin/addons/purchase_followup/__init__.py' | |||
499 | --- bin/addons/purchase_followup/__init__.py 2017-09-28 12:19:50 +0000 | |||
500 | +++ bin/addons/purchase_followup/__init__.py 2017-10-26 10:06:24 +0000 | |||
501 | @@ -21,5 +21,6 @@ | |||
502 | 21 | 21 | ||
503 | 22 | import purchase_followup | 22 | import purchase_followup |
504 | 23 | import report | 23 | import report |
505 | 24 | import wizard | ||
506 | 24 | 25 | ||
507 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 26 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
508 | 26 | 27 | ||
509 | === modified file 'bin/addons/purchase_followup/__openerp__.py' | |||
510 | --- bin/addons/purchase_followup/__openerp__.py 2017-10-09 21:06:10 +0000 | |||
511 | +++ bin/addons/purchase_followup/__openerp__.py 2017-10-26 10:06:24 +0000 | |||
512 | @@ -35,7 +35,9 @@ | |||
513 | 35 | 'init_xml' : [ ], | 35 | 'init_xml' : [ ], |
514 | 36 | "update_xml": [ | 36 | "update_xml": [ |
515 | 37 | "purchase_followup_view.xml", | 37 | "purchase_followup_view.xml", |
517 | 38 | "report/purchase_follow_up_report.xml" | 38 | "report/purchase_follow_up_report.xml", |
518 | 39 | "report/po_track_changes_report.xml", | ||
519 | 40 | "wizard/po_track_changes_wizard_view.xml", | ||
520 | 39 | ], | 41 | ], |
521 | 40 | 'demo_xml' : [ ], | 42 | 'demo_xml' : [ ], |
522 | 41 | 'test': [ | 43 | 'test': [ |
523 | 42 | 44 | ||
524 | === modified file 'bin/addons/purchase_followup/report/__init__.py' | |||
525 | --- bin/addons/purchase_followup/report/__init__.py 2014-05-07 14:04:54 +0000 | |||
526 | +++ bin/addons/purchase_followup/report/__init__.py 2017-10-26 10:06:24 +0000 | |||
527 | @@ -1,1 +1,2 @@ | |||
528 | 1 | import purchase_follow_up_report | 1 | import purchase_follow_up_report |
529 | 2 | import po_track_changes_report | ||
530 | 2 | 3 | ||
531 | === added file 'bin/addons/purchase_followup/report/po_track_changes_report.py' | |||
532 | --- bin/addons/purchase_followup/report/po_track_changes_report.py 1970-01-01 00:00:00 +0000 | |||
533 | +++ bin/addons/purchase_followup/report/po_track_changes_report.py 2017-10-26 10:06:24 +0000 | |||
534 | @@ -0,0 +1,92 @@ | |||
535 | 1 | # -*- coding: utf-8 -*- | ||
536 | 2 | ############################################################################## | ||
537 | 3 | # | ||
538 | 4 | # OpenERP, Open Source Management Solution | ||
539 | 5 | # Copyright (C) 2011 TeMPO Consulting, MSF. All Rights Reserved | ||
540 | 6 | # | ||
541 | 7 | # This program is free software: you can redistribute it and/or modify | ||
542 | 8 | # it under the terms of the GNU Affero General Public License as | ||
543 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
544 | 10 | # License, or (at your option) any later version. | ||
545 | 11 | # | ||
546 | 12 | # This program is distributed in the hope that it will be useful, | ||
547 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
548 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
549 | 15 | # GNU Affero General Public License for more details. | ||
550 | 16 | # | ||
551 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
552 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
553 | 19 | # | ||
554 | 20 | ############################################################################## | ||
555 | 21 | |||
556 | 22 | |||
557 | 23 | import time | ||
558 | 24 | from report import report_sxw | ||
559 | 25 | from spreadsheet_xml.spreadsheet_xml_write import SpreadsheetReport | ||
560 | 26 | |||
561 | 27 | |||
562 | 28 | class po_track_changes_report_parser(report_sxw.rml_parse): | ||
563 | 29 | def __init__(self, cr, uid, name, context=None): | ||
564 | 30 | super(po_track_changes_report_parser, self).__init__(cr, uid, name, context=context) | ||
565 | 31 | self.cr = cr | ||
566 | 32 | self.uid = uid | ||
567 | 33 | self.user_company = self._get_user_company() | ||
568 | 34 | self.localcontext.update({ | ||
569 | 35 | 'time': time, | ||
570 | 36 | 'getLines': self._get_po_lines, | ||
571 | 37 | 'userCompany': self.user_company, | ||
572 | 38 | 'computeCurrency': self._compute_currency | ||
573 | 39 | }) | ||
574 | 40 | |||
575 | 41 | def _get_po_lines(self, report): | ||
576 | 42 | ''' | ||
577 | 43 | Return the lines for the report | ||
578 | 44 | ''' | ||
579 | 45 | result = [] | ||
580 | 46 | for line in report.po_line_ids: | ||
581 | 47 | result.append(self.pool.get('purchase.order.line').browse(self.cr, self.uid, line)) | ||
582 | 48 | |||
583 | 49 | return sorted(result, key=lambda r: (r['order_id']['name']), reverse=True) | ||
584 | 50 | |||
585 | 51 | def _get_user_company(self): | ||
586 | 52 | ''' | ||
587 | 53 | Return user's current company | ||
588 | 54 | ''' | ||
589 | 55 | return self.pool.get('res.users').browse(self.cr, self.uid, self.uid).company_id | ||
590 | 56 | |||
591 | 57 | def _compute_currency(self, pol, original=False): | ||
592 | 58 | ''' | ||
593 | 59 | Compute an amount of a given currency to the instance's currency | ||
594 | 60 | ''' | ||
595 | 61 | currency_obj = self.pool.get('res.currency') | ||
596 | 62 | |||
597 | 63 | from_currency_id = pol.currency_id.id | ||
598 | 64 | if original and pol.original_currency_id: | ||
599 | 65 | from_currency_id = pol.original_currency_id.id | ||
600 | 66 | |||
601 | 67 | context = {'date': pol.date_planned} | ||
602 | 68 | to_currency_id = self.user_company['currency_id'].id | ||
603 | 69 | |||
604 | 70 | if from_currency_id == to_currency_id: | ||
605 | 71 | return round(pol.price_unit, 2) | ||
606 | 72 | |||
607 | 73 | return round(currency_obj.compute(self.cr, self.uid, from_currency_id, to_currency_id, pol.price_unit, round=False, context=context), 2) | ||
608 | 74 | |||
609 | 75 | |||
610 | 76 | class po_track_changes_report_xls(SpreadsheetReport): | ||
611 | 77 | def __init__(self, name, table, rml=False, parser=report_sxw.rml_parse, | ||
612 | 78 | header='external', store=False): | ||
613 | 79 | super(po_track_changes_report_xls, self).__init__(name, table, | ||
614 | 80 | rml=rml, parser=parser, header=header, store=store) | ||
615 | 81 | |||
616 | 82 | def create(self, cr, uid, ids, data, context=None): | ||
617 | 83 | a = super(po_track_changes_report_xls, self).create(cr, uid, ids, | ||
618 | 84 | data, context) | ||
619 | 85 | return (a[0], 'xls') | ||
620 | 86 | |||
621 | 87 | po_track_changes_report_xls( | ||
622 | 88 | 'report.po.track.changes.report_xls', | ||
623 | 89 | 'po.track.changes.wizard', | ||
624 | 90 | 'addons/purchase_followup/report/po_track_changes_report_xls.mako', | ||
625 | 91 | parser=po_track_changes_report_parser, | ||
626 | 92 | header=False) | ||
627 | 0 | 93 | ||
628 | === added file 'bin/addons/purchase_followup/report/po_track_changes_report.xml' | |||
629 | --- bin/addons/purchase_followup/report/po_track_changes_report.xml 1970-01-01 00:00:00 +0000 | |||
630 | +++ bin/addons/purchase_followup/report/po_track_changes_report.xml 2017-10-26 10:06:24 +0000 | |||
631 | @@ -0,0 +1,18 @@ | |||
632 | 1 | <?xml version="1.0" encoding="utf-8" ?> | ||
633 | 2 | <openerp> | ||
634 | 3 | <data> | ||
635 | 4 | |||
636 | 5 | <report | ||
637 | 6 | id="report_po_track_changes_xls" | ||
638 | 7 | name="po.track.changes.report_xls" | ||
639 | 8 | model="po.track.changes.wizard" | ||
640 | 9 | string="Purchase Order Track Changes Excel Export" | ||
641 | 10 | file="purchase_followup/report/po_track_changes_report_xls.mako" | ||
642 | 11 | report_type="webkit" | ||
643 | 12 | header="False" | ||
644 | 13 | auto="False" | ||
645 | 14 | menu="False" | ||
646 | 15 | /> | ||
647 | 16 | |||
648 | 17 | </data> | ||
649 | 18 | </openerp> | ||
650 | 0 | 19 | ||
651 | === added file 'bin/addons/purchase_followup/report/po_track_changes_report_xls.mako' | |||
652 | --- bin/addons/purchase_followup/report/po_track_changes_report_xls.mako 1970-01-01 00:00:00 +0000 | |||
653 | +++ bin/addons/purchase_followup/report/po_track_changes_report_xls.mako 2017-10-26 10:06:24 +0000 | |||
654 | @@ -0,0 +1,299 @@ | |||
655 | 1 | <?xml version="1.0"?> | ||
656 | 2 | <?mso-application progid="Excel.Sheet"?> | ||
657 | 3 | <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" | ||
658 | 4 | xmlns:o="urn:schemas-microsoft-com:office:office" | ||
659 | 5 | xmlns:x="urn:schemas-microsoft-com:office:excel" | ||
660 | 6 | xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" | ||
661 | 7 | xmlns:html="http://www.w3.org/TR/REC-html40"> | ||
662 | 8 | <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> | ||
663 | 9 | <Author>Unifield</Author> | ||
664 | 10 | <LastAuthor>MSFUser</LastAuthor> | ||
665 | 11 | <Created>2014-04-16T22:36:07Z</Created> | ||
666 | 12 | <Company>Medecins Sans Frontieres</Company> | ||
667 | 13 | <Version>11.9999</Version> | ||
668 | 14 | </DocumentProperties> | ||
669 | 15 | <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> | ||
670 | 16 | <WindowHeight>11640</WindowHeight> | ||
671 | 17 | <WindowWidth>15480</WindowWidth> | ||
672 | 18 | <WindowTopX>120</WindowTopX> | ||
673 | 19 | <WindowTopY>75</WindowTopY> | ||
674 | 20 | <ProtectStructure>False</ProtectStructure> | ||
675 | 21 | <ProtectWindows>False</ProtectWindows> | ||
676 | 22 | </ExcelWorkbook> | ||
677 | 23 | <Styles> | ||
678 | 24 | <Style ss:ID="ssCell"> | ||
679 | 25 | <Alignment ss:Vertical="Top" ss:WrapText="1"/> | ||
680 | 26 | <Font ss:Bold="1" /> | ||
681 | 27 | </Style> | ||
682 | 28 | <Style ss:ID="ssCellBlue"> | ||
683 | 29 | <Alignment ss:Vertical="Top" ss:WrapText="1"/> | ||
684 | 30 | <Font ss:Color="#0000FF" /> | ||
685 | 31 | </Style> | ||
686 | 32 | |||
687 | 33 | <!-- File header --> | ||
688 | 34 | <Style ss:ID="big_header"> | ||
689 | 35 | <Font x:Family="Swiss" ss:Size="14" ss:Bold="1"/> | ||
690 | 36 | </Style> | ||
691 | 37 | <Style ss:ID="file_header"> | ||
692 | 38 | <Font ss:Size="9" /> | ||
693 | 39 | <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/> | ||
694 | 40 | </Style> | ||
695 | 41 | |||
696 | 42 | <!-- Line header --> | ||
697 | 43 | <Style ss:ID="line_header"> | ||
698 | 44 | <Borders> | ||
699 | 45 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
700 | 46 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
701 | 47 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
702 | 48 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
703 | 49 | </Borders> | ||
704 | 50 | <Font x:Family="Swiss" ss:Size="8" ss:Bold="1"/> | ||
705 | 51 | <Interior/> | ||
706 | 52 | </Style> | ||
707 | 53 | <Style ss:ID="line_header_orange"> | ||
708 | 54 | <Borders> | ||
709 | 55 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
710 | 56 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
711 | 57 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
712 | 58 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
713 | 59 | </Borders> | ||
714 | 60 | <Font x:Family="Swiss" ss:Size="8" ss:Bold="1"/> | ||
715 | 61 | <Interior ss:Color="#F79646" ss:Pattern="Solid"/> | ||
716 | 62 | </Style> | ||
717 | 63 | |||
718 | 64 | <!-- Lines --> | ||
719 | 65 | <Style ss:ID="line_left"> | ||
720 | 66 | <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> | ||
721 | 67 | <Borders> | ||
722 | 68 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
723 | 69 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
724 | 70 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
725 | 71 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
726 | 72 | </Borders> | ||
727 | 73 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
728 | 74 | </Style> | ||
729 | 75 | <Style ss:ID="line_right"> | ||
730 | 76 | <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> | ||
731 | 77 | <Borders> | ||
732 | 78 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
733 | 79 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
734 | 80 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
735 | 81 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
736 | 82 | </Borders> | ||
737 | 83 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
738 | 84 | <NumberFormat ss:Format="#,##0.00"/> | ||
739 | 85 | </Style> | ||
740 | 86 | <Style ss:ID="line_center"> | ||
741 | 87 | <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> | ||
742 | 88 | <Borders> | ||
743 | 89 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
744 | 90 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
745 | 91 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
746 | 92 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
747 | 93 | </Borders> | ||
748 | 94 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
749 | 95 | <NumberFormat ss:Format="#,##0.00"/> | ||
750 | 96 | </Style> | ||
751 | 97 | <Style ss:ID="line_center_no_digits"> | ||
752 | 98 | <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> | ||
753 | 99 | <Borders> | ||
754 | 100 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
755 | 101 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
756 | 102 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
757 | 103 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
758 | 104 | </Borders> | ||
759 | 105 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
760 | 106 | </Style> | ||
761 | 107 | <Style ss:ID="line_left_date"> | ||
762 | 108 | <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> | ||
763 | 109 | <NumberFormat ss:Format="Short Date" /> | ||
764 | 110 | <Borders> | ||
765 | 111 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
766 | 112 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
767 | 113 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
768 | 114 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
769 | 115 | </Borders> | ||
770 | 116 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
771 | 117 | </Style> | ||
772 | 118 | <Style ss:ID="short_date"> | ||
773 | 119 | <Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1" /> | ||
774 | 120 | <NumberFormat ss:Format="Short Date" /> | ||
775 | 121 | <Font ss:Color="#0000FF" /> | ||
776 | 122 | </Style> | ||
777 | 123 | </Styles> | ||
778 | 124 | |||
779 | 125 | |||
780 | 126 | % for r in objects: | ||
781 | 127 | <ss:Worksheet ss:Name="IR Follow Up per Location"> | ||
782 | 128 | <Table x:FullColumns="1" x:FullRows="1"> | ||
783 | 129 | ## Order ref | ||
784 | 130 | <Column ss:AutoFitWidth="1" ss:Width="145.75" /> | ||
785 | 131 | ## Status | ||
786 | 132 | <Column ss:AutoFitWidth="1" ss:Width="160.75" /> | ||
787 | 133 | ## Item | ||
788 | 134 | <Column ss:AutoFitWidth="1" ss:Width="30.0" /> | ||
789 | 135 | ## Product code | ||
790 | 136 | <Column ss:AutoFitWidth="1" ss:Width="70.25" /> | ||
791 | 137 | ## Product description | ||
792 | 138 | <Column ss:AutoFitWidth="1" ss:Width="250.25" /> | ||
793 | 139 | ## Original Product code | ||
794 | 140 | <Column ss:AutoFitWidth="1" ss:Width="70.25" /> | ||
795 | 141 | ## Qty | ||
796 | 142 | <Column ss:AutoFitWidth="1" ss:Width="58.75" /> | ||
797 | 143 | ## UoM | ||
798 | 144 | <Column ss:AutoFitWidth="1" ss:Width="58.75" /> | ||
799 | 145 | ## Original Qty | ||
800 | 146 | <Column ss:AutoFitWidth="1" ss:Width="63.75" /> | ||
801 | 147 | ## Original UoM | ||
802 | 148 | <Column ss:AutoFitWidth="1" ss:Width="63.75" /> | ||
803 | 149 | ## Price | ||
804 | 150 | <Column ss:AutoFitWidth="1" ss:Width="75.75" /> | ||
805 | 151 | ## Currency | ||
806 | 152 | <Column ss:AutoFitWidth="1" ss:Width="58.75" /> | ||
807 | 153 | ## Original Price | ||
808 | 154 | <Column ss:AutoFitWidth="1" ss:Width="85.75" /> | ||
809 | 155 | ## Original Currency | ||
810 | 156 | <Column ss:AutoFitWidth="1" ss:Width="90.75" /> | ||
811 | 157 | ## Price in functional currency | ||
812 | 158 | <Column ss:AutoFitWidth="1" ss:Width="130.75" /> | ||
813 | 159 | ## Original Price in functional currency | ||
814 | 160 | <Column ss:AutoFitWidth="1" ss:Width="160.75" /> | ||
815 | 161 | ## Subtotal (functional currency) | ||
816 | 162 | <Column ss:AutoFitWidth="1" ss:Width="140.25" /> | ||
817 | 163 | ## Original Subtotal (functional currency) | ||
818 | 164 | <Column ss:AutoFitWidth="1" ss:Width="170.25" /> | ||
819 | 165 | ## Modification comment | ||
820 | 166 | <Column ss:AutoFitWidth="1" ss:Width="209.25" /> | ||
821 | 167 | |||
822 | 168 | <Row ss:Height="18"> | ||
823 | 169 | <Cell ss:StyleID="big_header"><Data ss:Type="String">INTERNAL REQUEST Track Changes report</Data><NamedCell ss:Name="Print_Area"/></Cell> | ||
824 | 170 | </Row> | ||
825 | 171 | |||
826 | 172 | <Row ss:Height="10"></Row> | ||
827 | 173 | |||
828 | 174 | ## WORKSHEET HEADER | ||
829 | 175 | <Row> | ||
830 | 176 | <Cell ss:StyleID="file_header" ss:MergeAcross="1"><Data ss:Type="String">${_('Instance information')|x}</Data></Cell> | ||
831 | 177 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
832 | 178 | <Cell ss:StyleID="file_header" ss:MergeAcross="4"><Data ss:Type="String">${_('Request parameters')|x}</Data></Cell> | ||
833 | 179 | </Row> | ||
834 | 180 | <Row> | ||
835 | 181 | <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Name:')|x}</Data></Cell> | ||
836 | 182 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.instance_id.instance or '-'|x}</Data></Cell> | ||
837 | 183 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
838 | 184 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String">${_('Date start:')|x}</Data></Cell> | ||
839 | 185 | % if isDate(r.start_date): | ||
840 | 186 | <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${r.start_date|n}T00:00:00.000</Data></Cell> | ||
841 | 187 | % else: | ||
842 | 188 | <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> | ||
843 | 189 | % endif | ||
844 | 190 | </Row> | ||
845 | 191 | <Row> | ||
846 | 192 | <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Address:')|x}</Data></Cell> | ||
847 | 193 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.partner_id.name or '-'|x}</Data></Cell> | ||
848 | 194 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
849 | 195 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String">${_('Date end:')|x}</Data></Cell> | ||
850 | 196 | % if isDate(r.end_date): | ||
851 | 197 | <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${r.end_date|n}T00:00:00.000</Data></Cell> | ||
852 | 198 | % else: | ||
853 | 199 | <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> | ||
854 | 200 | % endif | ||
855 | 201 | </Row> | ||
856 | 202 | <Row> | ||
857 | 203 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
858 | 204 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.partner_id.address[0].street or ''|x}</Data></Cell> | ||
859 | 205 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
860 | 206 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String">${_('Order Ref:')|x}</Data></Cell> | ||
861 | 207 | <Cell ss:StyleID="ssCellBlue" ss:MergeAcross="2"><Data ss:Type="String">${r.po_id.id and r.po_id.name or '-'|x}</Data></Cell> | ||
862 | 208 | </Row> | ||
863 | 209 | <Row> | ||
864 | 210 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
865 | 211 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.partner_id.address[0].zip|x} ${r.company_id.partner_id.address[0].city|x}</Data></Cell> | ||
866 | 212 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
867 | 213 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String">${_('Date of the request:')|x}</Data></Cell> | ||
868 | 214 | % if r.report_date and isDateTime(r.report_date): | ||
869 | 215 | <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${r.report_date[0:10]|n}T${r.report_date[11:19]|n}.000</Data></Cell> | ||
870 | 216 | % else: | ||
871 | 217 | <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> | ||
872 | 218 | % endif | ||
873 | 219 | </Row> | ||
874 | 220 | <Row> | ||
875 | 221 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
876 | 222 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.partner_id.address[0].country_id and r.company_id.partner_id.address[0].country_id.name or ''|x}</Data></Cell> | ||
877 | 223 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
878 | 224 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String"></Data></Cell> | ||
879 | 225 | <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> | ||
880 | 226 | </Row> | ||
881 | 227 | |||
882 | 228 | <Row></Row> | ||
883 | 229 | |||
884 | 230 | <Row> | ||
885 | 231 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Order ref')|x}</Data></Cell> | ||
886 | 232 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Status')|x}</Data></Cell> | ||
887 | 233 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Item')|x}</Data></Cell> | ||
888 | 234 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Code')|x}</Data></Cell> | ||
889 | 235 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Description')|x}</Data></Cell> | ||
890 | 236 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Original Code')|x}</Data></Cell> | ||
891 | 237 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Qty')|x}</Data></Cell> | ||
892 | 238 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('UoM')|x}</Data></Cell> | ||
893 | 239 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Original Qty')|x}</Data></Cell> | ||
894 | 240 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Original UoM')|x}</Data></Cell> | ||
895 | 241 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Unit Price')|x}</Data></Cell> | ||
896 | 242 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Currency')|x}</Data></Cell> | ||
897 | 243 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Original Unit Price')|x}</Data></Cell> | ||
898 | 244 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Original Currency')|x}</Data></Cell> | ||
899 | 245 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Price in functional currency')|x}</Data></Cell> | ||
900 | 246 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Original Price in functional currency')|x}</Data></Cell> | ||
901 | 247 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Subtotal (functional currency)')|x}</Data></Cell> | ||
902 | 248 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Original Subtotal (functional currency)')|x}</Data></Cell> | ||
903 | 249 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Modification comment')|x}</Data></Cell> | ||
904 | 250 | </Row> | ||
905 | 251 | |||
906 | 252 | % for line in getLines(r): | ||
907 | 253 | <Row ss:Height="11.25"> | ||
908 | 254 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.order_id.name|x}</Data></Cell> | ||
909 | 255 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.state|x}</Data></Cell> | ||
910 | 256 | <Cell ss:StyleID="line_center_no_digits"><Data ss:Type="Number">${line.line_number|x}</Data></Cell> | ||
911 | 257 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.product_id.default_code or ''|x}</Data></Cell> | ||
912 | 258 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.name|x}</Data></Cell> | ||
913 | 259 | % if line.original_product and line.product_id.default_code != line.original_product.default_code: | ||
914 | 260 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.original_product.default_code or ''|x}</Data></Cell> | ||
915 | 261 | % else: | ||
916 | 262 | <Cell ss:StyleID="line_left"><Data ss:Type="String"></Data></Cell> | ||
917 | 263 | % endif | ||
918 | 264 | <Cell ss:StyleID="line_left"><Data ss:Type="Number">${line.product_qty|x}</Data></Cell> | ||
919 | 265 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.product_uom.name|x}</Data></Cell> | ||
920 | 266 | <Cell ss:StyleID="line_left"><Data ss:Type="Number">${line.original_qty or 0|x}</Data></Cell> | ||
921 | 267 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.original_uom.name or ''|x}</Data></Cell> | ||
922 | 268 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${line.price_unit|x}</Data></Cell> | ||
923 | 269 | <Cell ss:StyleID="line_center"><Data ss:Type="String">${line.currency_id.name|x}</Data></Cell> | ||
924 | 270 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${line.original_price or 0|x}</Data></Cell> | ||
925 | 271 | <Cell ss:StyleID="line_center"><Data ss:Type="String">${line.original_currency_id and line.original_currency_id.name or ''|x}</Data></Cell> | ||
926 | 272 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${computeCurrency(line, False)|x}</Data></Cell> | ||
927 | 273 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${computeCurrency(line, True)|x}</Data></Cell> | ||
928 | 274 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${computeCurrency(line, False) * line.product_qty|x}</Data></Cell> | ||
929 | 275 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${computeCurrency(line, True) * line.original_qty|x}</Data></Cell> | ||
930 | 276 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.modification_comment or ''|x}</Data></Cell> | ||
931 | 277 | </Row> | ||
932 | 278 | % endfor | ||
933 | 279 | |||
934 | 280 | </Table> | ||
935 | 281 | |||
936 | 282 | <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> | ||
937 | 283 | <PageSetup> | ||
938 | 284 | <Layout x:Orientation="Landscape"/> | ||
939 | 285 | <Footer x:Data="Page &P of &N"/> | ||
940 | 286 | </PageSetup> | ||
941 | 287 | <Selected/> | ||
942 | 288 | <Panes> | ||
943 | 289 | <Pane> | ||
944 | 290 | <Number>3</Number> | ||
945 | 291 | <ActiveRow>21</ActiveRow> | ||
946 | 292 | </Pane> | ||
947 | 293 | </Panes> | ||
948 | 294 | <ProtectObjects>False</ProtectObjects> | ||
949 | 295 | <ProtectScenarios>False</ProtectScenarios> | ||
950 | 296 | </WorksheetOptions> | ||
951 | 297 | </ss:Worksheet> | ||
952 | 298 | % endfor | ||
953 | 299 | </Workbook> | ||
954 | 0 | 300 | ||
955 | === added directory 'bin/addons/purchase_followup/wizard' | |||
956 | === added file 'bin/addons/purchase_followup/wizard/__init__.py' | |||
957 | --- bin/addons/purchase_followup/wizard/__init__.py 1970-01-01 00:00:00 +0000 | |||
958 | +++ bin/addons/purchase_followup/wizard/__init__.py 2017-10-26 10:06:24 +0000 | |||
959 | @@ -0,0 +1,22 @@ | |||
960 | 1 | # -*- coding: utf-8 -*- | ||
961 | 2 | ############################################################################## | ||
962 | 3 | # | ||
963 | 4 | # OpenERP, Open Source Management Solution | ||
964 | 5 | # Copyright (C) 2011 TeMPO Consulting, MSF | ||
965 | 6 | # | ||
966 | 7 | # This program is free software: you can redistribute it and/or modify | ||
967 | 8 | # it under the terms of the GNU Affero General Public License as | ||
968 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
969 | 10 | # License, or (at your option) any later version. | ||
970 | 11 | # | ||
971 | 12 | # This program is distributed in the hope that it will be useful, | ||
972 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
973 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
974 | 15 | # GNU Affero General Public License for more details. | ||
975 | 16 | # | ||
976 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
977 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
978 | 19 | # | ||
979 | 20 | ############################################################################## | ||
980 | 21 | |||
981 | 22 | import po_track_changes_wizard | ||
982 | 0 | 23 | ||
983 | === added file 'bin/addons/purchase_followup/wizard/po_track_changes_wizard.py' | |||
984 | --- bin/addons/purchase_followup/wizard/po_track_changes_wizard.py 1970-01-01 00:00:00 +0000 | |||
985 | +++ bin/addons/purchase_followup/wizard/po_track_changes_wizard.py 2017-10-26 10:06:24 +0000 | |||
986 | @@ -0,0 +1,130 @@ | |||
987 | 1 | # -*- coding: utf-8 -*- | ||
988 | 2 | ############################################################################## | ||
989 | 3 | # | ||
990 | 4 | # OpenERP, Open Source Management Solution | ||
991 | 5 | # Copyright (C) 2011 TeMPO Consulting, MSF | ||
992 | 6 | # | ||
993 | 7 | # This program is free software: you can redistribute it and/or modify | ||
994 | 8 | # it under the terms of the GNU Affero General Public License as | ||
995 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
996 | 10 | # License, or (at your option) any later version. | ||
997 | 11 | # | ||
998 | 12 | # This program is distributed in the hope that it will be useful, | ||
999 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1000 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1001 | 15 | # GNU Affero General Public License for more details. | ||
1002 | 16 | # | ||
1003 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
1004 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1005 | 19 | # | ||
1006 | 20 | ############################################################################## | ||
1007 | 21 | |||
1008 | 22 | from osv import osv | ||
1009 | 23 | from osv import fields | ||
1010 | 24 | from tools.translate import _ | ||
1011 | 25 | |||
1012 | 26 | import time | ||
1013 | 27 | |||
1014 | 28 | |||
1015 | 29 | class po_track_changes_wizard(osv.osv_memory): | ||
1016 | 30 | _name = 'po.track.changes.wizard' | ||
1017 | 31 | _rec_name = 'report_date' | ||
1018 | 32 | _order = 'report_date desc' | ||
1019 | 33 | |||
1020 | 34 | _columns = { | ||
1021 | 35 | 'report_date': fields.datetime( | ||
1022 | 36 | string='Date of the demand', | ||
1023 | 37 | readonly=True, | ||
1024 | 38 | ), | ||
1025 | 39 | 'company_id': fields.many2one( | ||
1026 | 40 | 'res.company', | ||
1027 | 41 | string='Company', | ||
1028 | 42 | readonly=True, | ||
1029 | 43 | ), | ||
1030 | 44 | 'start_date': fields.date( | ||
1031 | 45 | string='Start date', | ||
1032 | 46 | ), | ||
1033 | 47 | 'end_date': fields.date( | ||
1034 | 48 | string='End date', | ||
1035 | 49 | ), | ||
1036 | 50 | 'po_line_ids': fields.text( | ||
1037 | 51 | string='Purchase Orders Lines', | ||
1038 | 52 | readonly=True | ||
1039 | 53 | ), | ||
1040 | 54 | 'po_id': fields.many2one( | ||
1041 | 55 | 'purchase.order', | ||
1042 | 56 | string='Purchase Order Ref.', | ||
1043 | 57 | ), | ||
1044 | 58 | } | ||
1045 | 59 | |||
1046 | 60 | _defaults = { | ||
1047 | 61 | 'report_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), | ||
1048 | 62 | 'company_id': lambda self, cr, uid, ids, c={}: self.pool.get('res.users').browse(cr, uid, uid).company_id.id, | ||
1049 | 63 | } | ||
1050 | 64 | |||
1051 | 65 | def get_values(self, cr, uid, ids, context=None): | ||
1052 | 66 | ''' | ||
1053 | 67 | Retrieve the data according to values in wizard | ||
1054 | 68 | ''' | ||
1055 | 69 | po_line_obj = self.pool.get('purchase.order.line') | ||
1056 | 70 | |||
1057 | 71 | if context is None: | ||
1058 | 72 | context = {} | ||
1059 | 73 | |||
1060 | 74 | if isinstance(ids, (int, long)): | ||
1061 | 75 | ids = [ids] | ||
1062 | 76 | |||
1063 | 77 | for wizard in self.browse(cr, uid, ids, context=context): | ||
1064 | 78 | po_domain = [] | ||
1065 | 79 | |||
1066 | 80 | if wizard.start_date: | ||
1067 | 81 | po_domain.append(('create_date', '>=', wizard.start_date)) | ||
1068 | 82 | |||
1069 | 83 | if wizard.end_date: | ||
1070 | 84 | po_domain.append(('create_date', '<=', wizard.end_date)) | ||
1071 | 85 | |||
1072 | 86 | if wizard.po_id: | ||
1073 | 87 | po_domain.append(('order_id', '=', wizard.po_id.id)) | ||
1074 | 88 | |||
1075 | 89 | po_line_ids = po_line_obj.search(cr, uid, po_domain, context=context) | ||
1076 | 90 | |||
1077 | 91 | if not po_line_ids: | ||
1078 | 92 | raise osv.except_osv( | ||
1079 | 93 | _('Error'), | ||
1080 | 94 | _('No data found with these parameters'), | ||
1081 | 95 | ) | ||
1082 | 96 | |||
1083 | 97 | self.write(cr, uid, [wizard.id], {'po_line_ids': po_line_ids}, context=context) | ||
1084 | 98 | |||
1085 | 99 | return True | ||
1086 | 100 | |||
1087 | 101 | def print_excel(self, cr, uid, ids, context=None): | ||
1088 | 102 | ''' | ||
1089 | 103 | Retrieve the data according to values in wizard | ||
1090 | 104 | and print the report in Excel format. | ||
1091 | 105 | ''' | ||
1092 | 106 | if context is None: | ||
1093 | 107 | context = {} | ||
1094 | 108 | |||
1095 | 109 | if isinstance(ids, (int, long)): | ||
1096 | 110 | ids = [ids] | ||
1097 | 111 | |||
1098 | 112 | self.get_values(cr, uid, ids, context=context) | ||
1099 | 113 | |||
1100 | 114 | background_id = self.pool.get('memory.background.report').create(cr, uid, { | ||
1101 | 115 | 'file_name': 'PURCHASE ORDER Track Changes report', | ||
1102 | 116 | 'report_name': 'po.track.changes.report_xls', | ||
1103 | 117 | }, context=context) | ||
1104 | 118 | context['background_id'] = background_id | ||
1105 | 119 | context['background_time'] = 3 | ||
1106 | 120 | |||
1107 | 121 | data = {'ids': ids, 'context': context} | ||
1108 | 122 | return { | ||
1109 | 123 | 'type': 'ir.actions.report.xml', | ||
1110 | 124 | 'report_name': 'po.track.changes.report_xls', | ||
1111 | 125 | 'datas': data, | ||
1112 | 126 | 'context': context, | ||
1113 | 127 | } | ||
1114 | 128 | |||
1115 | 129 | |||
1116 | 130 | po_track_changes_wizard() | ||
1117 | 0 | 131 | ||
1118 | === added file 'bin/addons/purchase_followup/wizard/po_track_changes_wizard_view.xml' | |||
1119 | --- bin/addons/purchase_followup/wizard/po_track_changes_wizard_view.xml 1970-01-01 00:00:00 +0000 | |||
1120 | +++ bin/addons/purchase_followup/wizard/po_track_changes_wizard_view.xml 2017-10-26 10:06:24 +0000 | |||
1121 | @@ -0,0 +1,39 @@ | |||
1122 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
1123 | 2 | <openerp> | ||
1124 | 3 | |||
1125 | 4 | <data> | ||
1126 | 5 | |||
1127 | 6 | <record id="po_track_changes_wizard_form_view" model="ir.ui.view"> | ||
1128 | 7 | <field name="name">po.track.changes.wizard.form.view</field> | ||
1129 | 8 | <field name="model">po.track.changes.wizard</field> | ||
1130 | 9 | <field name="type">form</field> | ||
1131 | 10 | <field name="arch" type="xml"> | ||
1132 | 11 | <form string="PURCHASE ORDER Track Changes"> | ||
1133 | 12 | <separator colspan="4" string="Request parameters" /> | ||
1134 | 13 | <field name="start_date" /> | ||
1135 | 14 | <field name="end_date" /> | ||
1136 | 15 | <field name="po_id" /> | ||
1137 | 16 | <separator colspan="4" string="Actions" /> | ||
1138 | 17 | <button name="print_excel" string="Excel report" icon="gtk-print" type="object" colspan="4" /> | ||
1139 | 18 | </form> | ||
1140 | 19 | </field> | ||
1141 | 20 | </record> | ||
1142 | 21 | |||
1143 | 22 | <record id="action_po_track_changes_wizard" model="ir.actions.act_window"> | ||
1144 | 23 | <field name="name">PO Track Changes</field> | ||
1145 | 24 | <field name="res_model">po.track.changes.wizard</field> | ||
1146 | 25 | <field name="view_type">form</field> | ||
1147 | 26 | <field name="view_mode">form</field> | ||
1148 | 27 | <field name="target">new</field> | ||
1149 | 28 | </record> | ||
1150 | 29 | |||
1151 | 30 | <menuitem | ||
1152 | 31 | id="menu_po_track_changes" | ||
1153 | 32 | action="action_po_track_changes_wizard" | ||
1154 | 33 | parent="purchase.menu_procurement_management" | ||
1155 | 34 | sequence="2" | ||
1156 | 35 | /> | ||
1157 | 36 | |||
1158 | 37 | </data> | ||
1159 | 38 | |||
1160 | 39 | </openerp> | ||
1161 | 0 | 40 | ||
1162 | === modified file 'bin/addons/sale/sale_order.py' | |||
1163 | --- bin/addons/sale/sale_order.py 2017-10-19 07:42:45 +0000 | |||
1164 | +++ bin/addons/sale/sale_order.py 2017-10-26 10:06:24 +0000 | |||
1165 | @@ -2104,7 +2104,7 @@ | |||
1166 | 2104 | 'set_as_sourced_n': False, | 2104 | 'set_as_sourced_n': False, |
1167 | 2105 | }) | 2105 | }) |
1168 | 2106 | 2106 | ||
1170 | 2107 | for x in ['modification_comment', 'original_qty', 'original_price', 'original_uom', 'sync_linked_pol', 'resourced_original_line']: | 2107 | for x in ['modification_comment', 'original_product', 'original_qty', 'original_price', 'original_uom', 'sync_linked_pol', 'resourced_original_line']: |
1171 | 2108 | if x not in default: | 2108 | if x not in default: |
1172 | 2109 | default[x] = False | 2109 | default[x] = False |
1173 | 2110 | 2110 | ||
1174 | 2111 | 2111 | ||
1175 | === modified file 'bin/addons/sale/sale_workflow.py' | |||
1176 | --- bin/addons/sale/sale_workflow.py 2017-10-13 14:36:52 +0000 | |||
1177 | +++ bin/addons/sale/sale_workflow.py 2017-10-26 10:06:24 +0000 | |||
1178 | @@ -345,6 +345,7 @@ | |||
1179 | 345 | to_write['type'] = 'make_to_stock' | 345 | to_write['type'] = 'make_to_stock' |
1180 | 346 | 346 | ||
1181 | 347 | elif sol.procurement_request: # in case of IR | 347 | elif sol.procurement_request: # in case of IR |
1182 | 348 | to_write['original_product'] = sol.product_id.id | ||
1183 | 348 | to_write['original_qty'] = sol.product_uom_qty | 349 | to_write['original_qty'] = sol.product_uom_qty |
1184 | 349 | to_write['original_price'] = sol.price_unit | 350 | to_write['original_price'] = sol.price_unit |
1185 | 350 | to_write['original_uom'] = sol.product_uom.id | 351 | to_write['original_uom'] = sol.product_uom.id |
1186 | 351 | 352 | ||
1187 | === modified file 'bin/addons/sales_followup/__openerp__.py' | |||
1188 | --- bin/addons/sales_followup/__openerp__.py 2017-09-28 14:05:02 +0000 | |||
1189 | +++ bin/addons/sales_followup/__openerp__.py 2017-10-26 10:06:24 +0000 | |||
1190 | @@ -44,8 +44,10 @@ | |||
1191 | 44 | "sale_followup_view.xml", | 44 | "sale_followup_view.xml", |
1192 | 45 | "report/sale_follow_up_report.xml", | 45 | "report/sale_follow_up_report.xml", |
1193 | 46 | "report/ir_follow_up_location_report.xml", | 46 | "report/ir_follow_up_location_report.xml", |
1194 | 47 | "report/ir_track_changes_report.xml", | ||
1195 | 47 | "wizard/sale_followup_multi_wizard_view.xml", | 48 | "wizard/sale_followup_multi_wizard_view.xml", |
1196 | 48 | "wizard/ir_followup_location_wizard_view.xml", | 49 | "wizard/ir_followup_location_wizard_view.xml", |
1197 | 50 | "wizard/ir_track_changes_wizard_view.xml", | ||
1198 | 49 | ], | 51 | ], |
1199 | 50 | "demo_xml": [ | 52 | "demo_xml": [ |
1200 | 51 | ], | 53 | ], |
1201 | 52 | 54 | ||
1202 | === modified file 'bin/addons/sales_followup/report/__init__.py' | |||
1203 | --- bin/addons/sales_followup/report/__init__.py 2017-08-18 14:31:17 +0000 | |||
1204 | +++ bin/addons/sales_followup/report/__init__.py 2017-10-26 10:06:24 +0000 | |||
1205 | @@ -22,3 +22,4 @@ | |||
1206 | 22 | import sale_follow_up_report | 22 | import sale_follow_up_report |
1207 | 23 | import sale_follow_up_report_multi | 23 | import sale_follow_up_report_multi |
1208 | 24 | import ir_follow_up_location_report | 24 | import ir_follow_up_location_report |
1209 | 25 | import ir_track_changes_report | ||
1210 | 25 | 26 | ||
1211 | === added file 'bin/addons/sales_followup/report/ir_track_changes_report.py' | |||
1212 | --- bin/addons/sales_followup/report/ir_track_changes_report.py 1970-01-01 00:00:00 +0000 | |||
1213 | +++ bin/addons/sales_followup/report/ir_track_changes_report.py 2017-10-26 10:06:24 +0000 | |||
1214 | @@ -0,0 +1,73 @@ | |||
1215 | 1 | # -*- coding: utf-8 -*- | ||
1216 | 2 | ############################################################################## | ||
1217 | 3 | # | ||
1218 | 4 | # OpenERP, Open Source Management Solution | ||
1219 | 5 | # Copyright (C) 2011 TeMPO Consulting, MSF. All Rights Reserved | ||
1220 | 6 | # | ||
1221 | 7 | # This program is free software: you can redistribute it and/or modify | ||
1222 | 8 | # it under the terms of the GNU Affero General Public License as | ||
1223 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
1224 | 10 | # License, or (at your option) any later version. | ||
1225 | 11 | # | ||
1226 | 12 | # This program is distributed in the hope that it will be useful, | ||
1227 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1228 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1229 | 15 | # GNU Affero General Public License for more details. | ||
1230 | 16 | # | ||
1231 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
1232 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1233 | 19 | # | ||
1234 | 20 | ############################################################################## | ||
1235 | 21 | |||
1236 | 22 | |||
1237 | 23 | import time | ||
1238 | 24 | from report import report_sxw | ||
1239 | 25 | from spreadsheet_xml.spreadsheet_xml_write import SpreadsheetReport | ||
1240 | 26 | |||
1241 | 27 | |||
1242 | 28 | class ir_track_changes_report_parser(report_sxw.rml_parse): | ||
1243 | 29 | def __init__(self, cr, uid, name, context=None): | ||
1244 | 30 | super(ir_track_changes_report_parser, self).__init__(cr, uid, name, context=context) | ||
1245 | 31 | self.cr = cr | ||
1246 | 32 | self.uid = uid | ||
1247 | 33 | self.user_company = self._get_user_company() | ||
1248 | 34 | self.localcontext.update({ | ||
1249 | 35 | 'time': time, | ||
1250 | 36 | 'getLines': self._get_ir_lines, | ||
1251 | 37 | 'userCompany': self.user_company, | ||
1252 | 38 | }) | ||
1253 | 39 | |||
1254 | 40 | def _get_ir_lines(self, report): | ||
1255 | 41 | ''' | ||
1256 | 42 | Return the lines for the report | ||
1257 | 43 | ''' | ||
1258 | 44 | result = [] | ||
1259 | 45 | for line in report.order_line_ids: | ||
1260 | 46 | result.append(self.pool.get('sale.order.line').browse(self.cr, self.uid, line)) | ||
1261 | 47 | |||
1262 | 48 | return sorted(result, key=lambda r: (r['order_id']['name']), reverse=True) | ||
1263 | 49 | |||
1264 | 50 | def _get_user_company(self): | ||
1265 | 51 | ''' | ||
1266 | 52 | Return user's current company | ||
1267 | 53 | ''' | ||
1268 | 54 | return self.pool.get('res.users').browse(self.cr, self.uid, self.uid).company_id | ||
1269 | 55 | |||
1270 | 56 | |||
1271 | 57 | class ir_track_changes_report_xls(SpreadsheetReport): | ||
1272 | 58 | def __init__(self, name, table, rml=False, parser=report_sxw.rml_parse, | ||
1273 | 59 | header='external', store=False): | ||
1274 | 60 | super(ir_track_changes_report_xls, self).__init__(name, table, | ||
1275 | 61 | rml=rml, parser=parser, header=header, store=store) | ||
1276 | 62 | |||
1277 | 63 | def create(self, cr, uid, ids, data, context=None): | ||
1278 | 64 | a = super(ir_track_changes_report_xls, self).create(cr, uid, ids, | ||
1279 | 65 | data, context) | ||
1280 | 66 | return (a[0], 'xls') | ||
1281 | 67 | |||
1282 | 68 | ir_track_changes_report_xls( | ||
1283 | 69 | 'report.ir.track.changes.report_xls', | ||
1284 | 70 | 'ir.track.changes.wizard', | ||
1285 | 71 | 'addons/sales_followup/report/ir_track_changes_report_xls.mako', | ||
1286 | 72 | parser=ir_track_changes_report_parser, | ||
1287 | 73 | header=False) | ||
1288 | 0 | 74 | ||
1289 | === added file 'bin/addons/sales_followup/report/ir_track_changes_report.xml' | |||
1290 | --- bin/addons/sales_followup/report/ir_track_changes_report.xml 1970-01-01 00:00:00 +0000 | |||
1291 | +++ bin/addons/sales_followup/report/ir_track_changes_report.xml 2017-10-26 10:06:24 +0000 | |||
1292 | @@ -0,0 +1,18 @@ | |||
1293 | 1 | <?xml version="1.0" encoding="utf-8" ?> | ||
1294 | 2 | <openerp> | ||
1295 | 3 | <data> | ||
1296 | 4 | |||
1297 | 5 | <report | ||
1298 | 6 | id="report_ir_track_changes_xls" | ||
1299 | 7 | name="ir.track.changes.report_xls" | ||
1300 | 8 | model="ir.track.changes.wizard" | ||
1301 | 9 | string="Internal Request Track Changes Excel Export" | ||
1302 | 10 | file="sales_followup/report/ir_track_changes_report_xls.mako" | ||
1303 | 11 | report_type="webkit" | ||
1304 | 12 | header="False" | ||
1305 | 13 | auto="False" | ||
1306 | 14 | menu="False" | ||
1307 | 15 | /> | ||
1308 | 16 | |||
1309 | 17 | </data> | ||
1310 | 18 | </openerp> | ||
1311 | 0 | 19 | ||
1312 | === added file 'bin/addons/sales_followup/report/ir_track_changes_report_xls.mako' | |||
1313 | --- bin/addons/sales_followup/report/ir_track_changes_report_xls.mako 1970-01-01 00:00:00 +0000 | |||
1314 | +++ bin/addons/sales_followup/report/ir_track_changes_report_xls.mako 2017-10-26 10:06:24 +0000 | |||
1315 | @@ -0,0 +1,283 @@ | |||
1316 | 1 | <?xml version="1.0"?> | ||
1317 | 2 | <?mso-application progid="Excel.Sheet"?> | ||
1318 | 3 | <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" | ||
1319 | 4 | xmlns:o="urn:schemas-microsoft-com:office:office" | ||
1320 | 5 | xmlns:x="urn:schemas-microsoft-com:office:excel" | ||
1321 | 6 | xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" | ||
1322 | 7 | xmlns:html="http://www.w3.org/TR/REC-html40"> | ||
1323 | 8 | <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> | ||
1324 | 9 | <Author>Unifield</Author> | ||
1325 | 10 | <LastAuthor>MSFUser</LastAuthor> | ||
1326 | 11 | <Created>2014-04-16T22:36:07Z</Created> | ||
1327 | 12 | <Company>Medecins Sans Frontieres</Company> | ||
1328 | 13 | <Version>11.9999</Version> | ||
1329 | 14 | </DocumentProperties> | ||
1330 | 15 | <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> | ||
1331 | 16 | <WindowHeight>11640</WindowHeight> | ||
1332 | 17 | <WindowWidth>15480</WindowWidth> | ||
1333 | 18 | <WindowTopX>120</WindowTopX> | ||
1334 | 19 | <WindowTopY>75</WindowTopY> | ||
1335 | 20 | <ProtectStructure>False</ProtectStructure> | ||
1336 | 21 | <ProtectWindows>False</ProtectWindows> | ||
1337 | 22 | </ExcelWorkbook> | ||
1338 | 23 | <Styles> | ||
1339 | 24 | <Style ss:ID="ssCell"> | ||
1340 | 25 | <Alignment ss:Vertical="Top" ss:WrapText="1"/> | ||
1341 | 26 | <Font ss:Bold="1" /> | ||
1342 | 27 | </Style> | ||
1343 | 28 | <Style ss:ID="ssCellBlue"> | ||
1344 | 29 | <Alignment ss:Vertical="Top" ss:WrapText="1"/> | ||
1345 | 30 | <Font ss:Color="#0000FF" /> | ||
1346 | 31 | </Style> | ||
1347 | 32 | |||
1348 | 33 | <!-- File header --> | ||
1349 | 34 | <Style ss:ID="big_header"> | ||
1350 | 35 | <Font x:Family="Swiss" ss:Size="14" ss:Bold="1"/> | ||
1351 | 36 | </Style> | ||
1352 | 37 | <Style ss:ID="file_header"> | ||
1353 | 38 | <Font ss:Size="9" /> | ||
1354 | 39 | <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/> | ||
1355 | 40 | </Style> | ||
1356 | 41 | |||
1357 | 42 | <!-- Line header --> | ||
1358 | 43 | <Style ss:ID="line_header"> | ||
1359 | 44 | <Borders> | ||
1360 | 45 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1361 | 46 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1362 | 47 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1363 | 48 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1364 | 49 | </Borders> | ||
1365 | 50 | <Font x:Family="Swiss" ss:Size="8" ss:Bold="1"/> | ||
1366 | 51 | <Interior/> | ||
1367 | 52 | </Style> | ||
1368 | 53 | <Style ss:ID="line_header_orange"> | ||
1369 | 54 | <Borders> | ||
1370 | 55 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1371 | 56 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1372 | 57 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1373 | 58 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1374 | 59 | </Borders> | ||
1375 | 60 | <Font x:Family="Swiss" ss:Size="8" ss:Bold="1"/> | ||
1376 | 61 | <Interior ss:Color="#F79646" ss:Pattern="Solid"/> | ||
1377 | 62 | </Style> | ||
1378 | 63 | |||
1379 | 64 | <!-- Lines --> | ||
1380 | 65 | <Style ss:ID="line_left"> | ||
1381 | 66 | <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> | ||
1382 | 67 | <Borders> | ||
1383 | 68 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1384 | 69 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1385 | 70 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1386 | 71 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1387 | 72 | </Borders> | ||
1388 | 73 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
1389 | 74 | </Style> | ||
1390 | 75 | <Style ss:ID="line_right"> | ||
1391 | 76 | <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> | ||
1392 | 77 | <Borders> | ||
1393 | 78 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1394 | 79 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1395 | 80 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1396 | 81 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1397 | 82 | </Borders> | ||
1398 | 83 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
1399 | 84 | <NumberFormat ss:Format="#,##0.00"/> | ||
1400 | 85 | </Style> | ||
1401 | 86 | <Style ss:ID="line_center"> | ||
1402 | 87 | <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> | ||
1403 | 88 | <Borders> | ||
1404 | 89 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1405 | 90 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1406 | 91 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1407 | 92 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1408 | 93 | </Borders> | ||
1409 | 94 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
1410 | 95 | <NumberFormat ss:Format="#,##0.00"/> | ||
1411 | 96 | </Style> | ||
1412 | 97 | <Style ss:ID="line_center_no_digits"> | ||
1413 | 98 | <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> | ||
1414 | 99 | <Borders> | ||
1415 | 100 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1416 | 101 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1417 | 102 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1418 | 103 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1419 | 104 | </Borders> | ||
1420 | 105 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
1421 | 106 | </Style> | ||
1422 | 107 | <Style ss:ID="line_left_date"> | ||
1423 | 108 | <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> | ||
1424 | 109 | <NumberFormat ss:Format="Short Date" /> | ||
1425 | 110 | <Borders> | ||
1426 | 111 | <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1427 | 112 | <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1428 | 113 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1429 | 114 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> | ||
1430 | 115 | </Borders> | ||
1431 | 116 | <Font ss:Size="8" ss:Color="#0000FF"/> | ||
1432 | 117 | </Style> | ||
1433 | 118 | <Style ss:ID="short_date"> | ||
1434 | 119 | <Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1" /> | ||
1435 | 120 | <NumberFormat ss:Format="Short Date" /> | ||
1436 | 121 | <Font ss:Color="#0000FF" /> | ||
1437 | 122 | </Style> | ||
1438 | 123 | </Styles> | ||
1439 | 124 | |||
1440 | 125 | |||
1441 | 126 | % for r in objects: | ||
1442 | 127 | <ss:Worksheet ss:Name="IR Follow Up per Location"> | ||
1443 | 128 | <Table x:FullColumns="1" x:FullRows="1"> | ||
1444 | 129 | ## Order ref | ||
1445 | 130 | <Column ss:AutoFitWidth="1" ss:Width="80.0" /> | ||
1446 | 131 | ## Status | ||
1447 | 132 | <Column ss:AutoFitWidth="1" ss:Width="160.75" /> | ||
1448 | 133 | ## Item | ||
1449 | 134 | <Column ss:AutoFitWidth="1" ss:Width="30.0" /> | ||
1450 | 135 | ## Product code | ||
1451 | 136 | <Column ss:AutoFitWidth="1" ss:Width="70.25" /> | ||
1452 | 137 | ## Product description | ||
1453 | 138 | <Column ss:AutoFitWidth="1" ss:Width="250.25" /> | ||
1454 | 139 | ## Original Product code | ||
1455 | 140 | <Column ss:AutoFitWidth="1" ss:Width="70.25" /> | ||
1456 | 141 | ## Qty | ||
1457 | 142 | <Column ss:AutoFitWidth="1" ss:Width="58.75" /> | ||
1458 | 143 | ## UoM | ||
1459 | 144 | <Column ss:AutoFitWidth="1" ss:Width="58.75" /> | ||
1460 | 145 | ## Original Qty | ||
1461 | 146 | <Column ss:AutoFitWidth="1" ss:Width="63.75" /> | ||
1462 | 147 | ## Original UoM | ||
1463 | 148 | <Column ss:AutoFitWidth="1" ss:Width="63.75" /> | ||
1464 | 149 | ## Price | ||
1465 | 150 | <Column ss:AutoFitWidth="1" ss:Width="75.75" /> | ||
1466 | 151 | ## Original Price | ||
1467 | 152 | <Column ss:AutoFitWidth="1" ss:Width="85.75" /> | ||
1468 | 153 | ## Subtotal | ||
1469 | 154 | <Column ss:AutoFitWidth="1" ss:Width="85.75" /> | ||
1470 | 155 | ## Original Subtotal | ||
1471 | 156 | <Column ss:AutoFitWidth="1" ss:Width="75.25" /> | ||
1472 | 157 | ## Modification comment | ||
1473 | 158 | <Column ss:AutoFitWidth="1" ss:Width="209.25" /> | ||
1474 | 159 | |||
1475 | 160 | <Row ss:Height="18"> | ||
1476 | 161 | <Cell ss:StyleID="big_header"><Data ss:Type="String">INTERNAL REQUEST Track Changes report</Data><NamedCell ss:Name="Print_Area"/></Cell> | ||
1477 | 162 | </Row> | ||
1478 | 163 | |||
1479 | 164 | <Row ss:Height="10"></Row> | ||
1480 | 165 | |||
1481 | 166 | ## WORKSHEET HEADER | ||
1482 | 167 | <Row> | ||
1483 | 168 | <Cell ss:StyleID="file_header" ss:MergeAcross="1"><Data ss:Type="String">${_('Instance information')|x}</Data></Cell> | ||
1484 | 169 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1485 | 170 | <Cell ss:StyleID="file_header" ss:MergeAcross="4"><Data ss:Type="String">${_('Request parameters')|x}</Data></Cell> | ||
1486 | 171 | </Row> | ||
1487 | 172 | <Row> | ||
1488 | 173 | <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Name:')|x}</Data></Cell> | ||
1489 | 174 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.instance_id.instance or '-'|x}</Data></Cell> | ||
1490 | 175 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1491 | 176 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String">${_('Date start:')|x}</Data></Cell> | ||
1492 | 177 | % if isDate(r.start_date): | ||
1493 | 178 | <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${r.start_date|n}T00:00:00.000</Data></Cell> | ||
1494 | 179 | % else: | ||
1495 | 180 | <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> | ||
1496 | 181 | % endif | ||
1497 | 182 | </Row> | ||
1498 | 183 | <Row> | ||
1499 | 184 | <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Address:')|x}</Data></Cell> | ||
1500 | 185 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.partner_id.name or '-'|x}</Data></Cell> | ||
1501 | 186 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1502 | 187 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String">${_('Date end:')|x}</Data></Cell> | ||
1503 | 188 | % if isDate(r.end_date): | ||
1504 | 189 | <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${r.end_date|n}T00:00:00.000</Data></Cell> | ||
1505 | 190 | % else: | ||
1506 | 191 | <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> | ||
1507 | 192 | % endif | ||
1508 | 193 | </Row> | ||
1509 | 194 | <Row> | ||
1510 | 195 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1511 | 196 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.partner_id.address[0].street or ''|x}</Data></Cell> | ||
1512 | 197 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1513 | 198 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String">${_('Order Ref:')|x}</Data></Cell> | ||
1514 | 199 | <Cell ss:StyleID="ssCellBlue" ss:MergeAcross="2"><Data ss:Type="String">${r.order_id.id and r.order_id.name or '-'|x}</Data></Cell> | ||
1515 | 200 | </Row> | ||
1516 | 201 | <Row> | ||
1517 | 202 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1518 | 203 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.partner_id.address[0].zip|x} ${r.company_id.partner_id.address[0].city|x}</Data></Cell> | ||
1519 | 204 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1520 | 205 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String">${_('Date of the request:')|x}</Data></Cell> | ||
1521 | 206 | % if r.report_date and isDateTime(r.report_date): | ||
1522 | 207 | <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${r.report_date[0:10]|n}T${r.report_date[11:19]|n}.000</Data></Cell> | ||
1523 | 208 | % else: | ||
1524 | 209 | <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> | ||
1525 | 210 | % endif | ||
1526 | 211 | </Row> | ||
1527 | 212 | <Row> | ||
1528 | 213 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1529 | 214 | <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${r.company_id.partner_id.address[0].country_id and r.company_id.partner_id.address[0].country_id.name or ''|x}</Data></Cell> | ||
1530 | 215 | <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> | ||
1531 | 216 | <Cell ss:StyleID="ssCell" ss:MergeAcross="1"><Data ss:Type="String"></Data></Cell> | ||
1532 | 217 | <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> | ||
1533 | 218 | </Row> | ||
1534 | 219 | |||
1535 | 220 | <Row></Row> | ||
1536 | 221 | |||
1537 | 222 | <Row> | ||
1538 | 223 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Order ref')|x}</Data></Cell> | ||
1539 | 224 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Status')|x}</Data></Cell> | ||
1540 | 225 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Item')|x}</Data></Cell> | ||
1541 | 226 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Code')|x}</Data></Cell> | ||
1542 | 227 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Description')|x}</Data></Cell> | ||
1543 | 228 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Original Code')|x}</Data></Cell> | ||
1544 | 229 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Qty')|x}</Data></Cell> | ||
1545 | 230 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('UoM')|x}</Data></Cell> | ||
1546 | 231 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Original Qty')|x}</Data></Cell> | ||
1547 | 232 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Original UoM')|x}</Data></Cell> | ||
1548 | 233 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Unit Price')|x}</Data></Cell> | ||
1549 | 234 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Original Unit Price')|x}</Data></Cell> | ||
1550 | 235 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Subtotal')|x}</Data></Cell> | ||
1551 | 236 | <Cell ss:StyleID="line_header_orange"><Data ss:Type="String">${_('Original Subtotal')|x}</Data></Cell> | ||
1552 | 237 | <Cell ss:StyleID="line_header"><Data ss:Type="String">${_('Modification comment')|x}</Data></Cell> | ||
1553 | 238 | </Row> | ||
1554 | 239 | |||
1555 | 240 | % for line in getLines(r): | ||
1556 | 241 | <Row ss:Height="11.25"> | ||
1557 | 242 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.order_id.name|x}</Data></Cell> | ||
1558 | 243 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.state|x}</Data></Cell> | ||
1559 | 244 | <Cell ss:StyleID="line_center_no_digits"><Data ss:Type="Number">${line.line_number|x}</Data></Cell> | ||
1560 | 245 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.product_id.default_code or ''|x}</Data></Cell> | ||
1561 | 246 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.name|x}</Data></Cell> | ||
1562 | 247 | % if line.original_product and line.product_id.default_code != line.original_product.default_code: | ||
1563 | 248 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.original_product.default_code or ''|x}</Data></Cell> | ||
1564 | 249 | % else: | ||
1565 | 250 | <Cell ss:StyleID="line_left"><Data ss:Type="String"></Data></Cell> | ||
1566 | 251 | % endif | ||
1567 | 252 | <Cell ss:StyleID="line_left"><Data ss:Type="Number">${line.product_uom_qty|x}</Data></Cell> | ||
1568 | 253 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.product_uom.name|x}</Data></Cell> | ||
1569 | 254 | <Cell ss:StyleID="line_left"><Data ss:Type="Number">${line.original_qty or 0|x}</Data></Cell> | ||
1570 | 255 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.original_uom.name or ''|x}</Data></Cell> | ||
1571 | 256 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${line.price_unit|x}</Data></Cell> | ||
1572 | 257 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${line.original_price or 0|x}</Data></Cell> | ||
1573 | 258 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${line.price_unit * line.product_uom_qty|x}</Data></Cell> | ||
1574 | 259 | <Cell ss:StyleID="line_center"><Data ss:Type="Number">${line.original_price * line.original_qty|x}</Data></Cell> | ||
1575 | 260 | <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.modification_comment or ''|x}</Data></Cell> | ||
1576 | 261 | </Row> | ||
1577 | 262 | % endfor | ||
1578 | 263 | |||
1579 | 264 | </Table> | ||
1580 | 265 | |||
1581 | 266 | <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> | ||
1582 | 267 | <PageSetup> | ||
1583 | 268 | <Layout x:Orientation="Landscape"/> | ||
1584 | 269 | <Footer x:Data="Page &P of &N"/> | ||
1585 | 270 | </PageSetup> | ||
1586 | 271 | <Selected/> | ||
1587 | 272 | <Panes> | ||
1588 | 273 | <Pane> | ||
1589 | 274 | <Number>3</Number> | ||
1590 | 275 | <ActiveRow>17</ActiveRow> | ||
1591 | 276 | </Pane> | ||
1592 | 277 | </Panes> | ||
1593 | 278 | <ProtectObjects>False</ProtectObjects> | ||
1594 | 279 | <ProtectScenarios>False</ProtectScenarios> | ||
1595 | 280 | </WorksheetOptions> | ||
1596 | 281 | </ss:Worksheet> | ||
1597 | 282 | % endfor | ||
1598 | 283 | </Workbook> | ||
1599 | 0 | 284 | ||
1600 | === modified file 'bin/addons/sales_followup/wizard/__init__.py' | |||
1601 | --- bin/addons/sales_followup/wizard/__init__.py 2017-08-18 14:31:17 +0000 | |||
1602 | +++ bin/addons/sales_followup/wizard/__init__.py 2017-10-26 10:06:24 +0000 | |||
1603 | @@ -21,3 +21,4 @@ | |||
1604 | 21 | 21 | ||
1605 | 22 | import sale_followup_multi_wizard | 22 | import sale_followup_multi_wizard |
1606 | 23 | import ir_followup_location_wizard | 23 | import ir_followup_location_wizard |
1607 | 24 | import ir_track_changes_wizard | ||
1608 | 24 | 25 | ||
1609 | === added file 'bin/addons/sales_followup/wizard/ir_track_changes_wizard.py' | |||
1610 | --- bin/addons/sales_followup/wizard/ir_track_changes_wizard.py 1970-01-01 00:00:00 +0000 | |||
1611 | +++ bin/addons/sales_followup/wizard/ir_track_changes_wizard.py 2017-10-26 10:06:24 +0000 | |||
1612 | @@ -0,0 +1,130 @@ | |||
1613 | 1 | # -*- coding: utf-8 -*- | ||
1614 | 2 | ############################################################################## | ||
1615 | 3 | # | ||
1616 | 4 | # OpenERP, Open Source Management Solution | ||
1617 | 5 | # Copyright (C) 2011 TeMPO Consulting, MSF | ||
1618 | 6 | # | ||
1619 | 7 | # This program is free software: you can redistribute it and/or modify | ||
1620 | 8 | # it under the terms of the GNU Affero General Public License as | ||
1621 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
1622 | 10 | # License, or (at your option) any later version. | ||
1623 | 11 | # | ||
1624 | 12 | # This program is distributed in the hope that it will be useful, | ||
1625 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1626 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1627 | 15 | # GNU Affero General Public License for more details. | ||
1628 | 16 | # | ||
1629 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
1630 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1631 | 19 | # | ||
1632 | 20 | ############################################################################## | ||
1633 | 21 | |||
1634 | 22 | from osv import osv | ||
1635 | 23 | from osv import fields | ||
1636 | 24 | from tools.translate import _ | ||
1637 | 25 | |||
1638 | 26 | import time | ||
1639 | 27 | |||
1640 | 28 | |||
1641 | 29 | class ir_track_changes_wizard(osv.osv_memory): | ||
1642 | 30 | _name = 'ir.track.changes.wizard' | ||
1643 | 31 | _rec_name = 'report_date' | ||
1644 | 32 | _order = 'report_date desc' | ||
1645 | 33 | |||
1646 | 34 | _columns = { | ||
1647 | 35 | 'report_date': fields.datetime( | ||
1648 | 36 | string='Date of the demand', | ||
1649 | 37 | readonly=True, | ||
1650 | 38 | ), | ||
1651 | 39 | 'company_id': fields.many2one( | ||
1652 | 40 | 'res.company', | ||
1653 | 41 | string='Company', | ||
1654 | 42 | readonly=True, | ||
1655 | 43 | ), | ||
1656 | 44 | 'start_date': fields.date( | ||
1657 | 45 | string='Start date', | ||
1658 | 46 | ), | ||
1659 | 47 | 'end_date': fields.date( | ||
1660 | 48 | string='End date', | ||
1661 | 49 | ), | ||
1662 | 50 | 'order_line_ids': fields.text( | ||
1663 | 51 | string='Orders Lines', | ||
1664 | 52 | readonly=True | ||
1665 | 53 | ), | ||
1666 | 54 | 'order_id': fields.many2one( | ||
1667 | 55 | 'sale.order', | ||
1668 | 56 | string='Order Ref.', | ||
1669 | 57 | ), | ||
1670 | 58 | } | ||
1671 | 59 | |||
1672 | 60 | _defaults = { | ||
1673 | 61 | 'report_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), | ||
1674 | 62 | 'company_id': lambda self, cr, uid, ids, c={}: self.pool.get('res.users').browse(cr, uid, uid).company_id.id, | ||
1675 | 63 | } | ||
1676 | 64 | |||
1677 | 65 | def get_values(self, cr, uid, ids, context=None): | ||
1678 | 66 | ''' | ||
1679 | 67 | Retrieve the data according to values in wizard | ||
1680 | 68 | ''' | ||
1681 | 69 | ir_line_obj = self.pool.get('sale.order.line') | ||
1682 | 70 | |||
1683 | 71 | if context is None: | ||
1684 | 72 | context = {} | ||
1685 | 73 | |||
1686 | 74 | if isinstance(ids, (int, long)): | ||
1687 | 75 | ids = [ids] | ||
1688 | 76 | |||
1689 | 77 | for wizard in self.browse(cr, uid, ids, context=context): | ||
1690 | 78 | ir_domain = [('procurement_request', '=', 't')] | ||
1691 | 79 | |||
1692 | 80 | if wizard.start_date: | ||
1693 | 81 | ir_domain.append(('create_date', '>=', wizard.start_date)) | ||
1694 | 82 | |||
1695 | 83 | if wizard.end_date: | ||
1696 | 84 | ir_domain.append(('create_date', '<=', wizard.end_date)) | ||
1697 | 85 | |||
1698 | 86 | if wizard.order_id: | ||
1699 | 87 | ir_domain.append(('order_id', '=', wizard.order_id.id)) | ||
1700 | 88 | |||
1701 | 89 | ir_line_ids = ir_line_obj.search(cr, uid, ir_domain, context=context) | ||
1702 | 90 | |||
1703 | 91 | if not ir_line_ids: | ||
1704 | 92 | raise osv.except_osv( | ||
1705 | 93 | _('Error'), | ||
1706 | 94 | _('No data found with these parameters'), | ||
1707 | 95 | ) | ||
1708 | 96 | |||
1709 | 97 | self.write(cr, uid, [wizard.id], {'order_line_ids': ir_line_ids}, context=context) | ||
1710 | 98 | |||
1711 | 99 | return True | ||
1712 | 100 | |||
1713 | 101 | def print_excel(self, cr, uid, ids, context=None): | ||
1714 | 102 | ''' | ||
1715 | 103 | Retrieve the data according to values in wizard | ||
1716 | 104 | and print the report in Excel format. | ||
1717 | 105 | ''' | ||
1718 | 106 | if context is None: | ||
1719 | 107 | context = {} | ||
1720 | 108 | |||
1721 | 109 | if isinstance(ids, (int, long)): | ||
1722 | 110 | ids = [ids] | ||
1723 | 111 | |||
1724 | 112 | self.get_values(cr, uid, ids, context=context) | ||
1725 | 113 | |||
1726 | 114 | background_id = self.pool.get('memory.background.report').create(cr, uid, { | ||
1727 | 115 | 'file_name': 'INTERNAL REQUEST Track Changes report', | ||
1728 | 116 | 'report_name': 'ir.track.changes.report_xls', | ||
1729 | 117 | }, context=context) | ||
1730 | 118 | context['background_id'] = background_id | ||
1731 | 119 | context['background_time'] = 3 | ||
1732 | 120 | |||
1733 | 121 | data = {'ids': ids, 'context': context} | ||
1734 | 122 | return { | ||
1735 | 123 | 'type': 'ir.actions.report.xml', | ||
1736 | 124 | 'report_name': 'ir.track.changes.report_xls', | ||
1737 | 125 | 'datas': data, | ||
1738 | 126 | 'context': context, | ||
1739 | 127 | } | ||
1740 | 128 | |||
1741 | 129 | |||
1742 | 130 | ir_track_changes_wizard() | ||
1743 | 0 | 131 | ||
1744 | === added file 'bin/addons/sales_followup/wizard/ir_track_changes_wizard_view.xml' | |||
1745 | --- bin/addons/sales_followup/wizard/ir_track_changes_wizard_view.xml 1970-01-01 00:00:00 +0000 | |||
1746 | +++ bin/addons/sales_followup/wizard/ir_track_changes_wizard_view.xml 2017-10-26 10:06:24 +0000 | |||
1747 | @@ -0,0 +1,39 @@ | |||
1748 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
1749 | 2 | <openerp> | ||
1750 | 3 | |||
1751 | 4 | <data> | ||
1752 | 5 | |||
1753 | 6 | <record id="ir_track_changes_wizard_form_view" model="ir.ui.view"> | ||
1754 | 7 | <field name="name">ir.track.changes.wizard.form.view</field> | ||
1755 | 8 | <field name="model">ir.track.changes.wizard</field> | ||
1756 | 9 | <field name="type">form</field> | ||
1757 | 10 | <field name="arch" type="xml"> | ||
1758 | 11 | <form string="INTERNAL REQUEST Track Changes"> | ||
1759 | 12 | <separator colspan="4" string="Request parameters" /> | ||
1760 | 13 | <field name="start_date" /> | ||
1761 | 14 | <field name="end_date" /> | ||
1762 | 15 | <field name="order_id" domain="[('procurement_request', '=', 't')]" /> | ||
1763 | 16 | <separator colspan="4" string="Actions" /> | ||
1764 | 17 | <button name="print_excel" string="Excel report" icon="gtk-print" type="object" colspan="4" /> | ||
1765 | 18 | </form> | ||
1766 | 19 | </field> | ||
1767 | 20 | </record> | ||
1768 | 21 | |||
1769 | 22 | <record id="action_ir_track_changes_wizard" model="ir.actions.act_window"> | ||
1770 | 23 | <field name="name">IR Track Changes</field> | ||
1771 | 24 | <field name="res_model">ir.track.changes.wizard</field> | ||
1772 | 25 | <field name="view_type">form</field> | ||
1773 | 26 | <field name="view_mode">form</field> | ||
1774 | 27 | <field name="target">new</field> | ||
1775 | 28 | </record> | ||
1776 | 29 | |||
1777 | 30 | <menuitem | ||
1778 | 31 | id="menu_ir_track_changes" | ||
1779 | 32 | action="action_ir_track_changes_wizard" | ||
1780 | 33 | parent="base.menu_sales" | ||
1781 | 34 | sequence="3" | ||
1782 | 35 | /> | ||
1783 | 36 | |||
1784 | 37 | </data> | ||
1785 | 38 | |||
1786 | 39 | </openerp> | ||
1787 | 0 | 40 | ||
1788 | === modified file 'bin/addons/sourcing/procurement_order.py' | |||
1789 | --- bin/addons/sourcing/procurement_order.py 2017-10-02 14:14:09 +0000 | |||
1790 | +++ bin/addons/sourcing/procurement_order.py 2017-10-26 10:06:24 +0000 | |||
1791 | @@ -114,6 +114,8 @@ | |||
1792 | 114 | line.update({'origin': origin_line.order_id.name}) | 114 | line.update({'origin': origin_line.order_id.name}) |
1793 | 115 | if origin_line.stock_take_date: | 115 | if origin_line.stock_take_date: |
1794 | 116 | line.update({'stock_take_date': origin_line.stock_take_date}) | 116 | line.update({'stock_take_date': origin_line.stock_take_date}) |
1795 | 117 | if origin_line.original_product: | ||
1796 | 118 | line.update({'original_product': origin_line.original_product.id}) | ||
1797 | 117 | if origin_line.original_qty: | 119 | if origin_line.original_qty: |
1798 | 118 | line.update({'original_qty': origin_line.original_qty}) | 120 | line.update({'original_qty': origin_line.original_qty}) |
1799 | 119 | if origin_line.original_uom: | 121 | if origin_line.original_uom: |
1800 | 120 | 122 | ||
1801 | === modified file 'bin/addons/sourcing/sale_order_line.py' | |||
1802 | --- bin/addons/sourcing/sale_order_line.py 2017-10-19 14:06:34 +0000 | |||
1803 | +++ bin/addons/sourcing/sale_order_line.py 2017-10-26 10:06:24 +0000 | |||
1804 | @@ -1700,6 +1700,7 @@ | |||
1805 | 1700 | pol_values['name'] = sourcing_line.comment | 1700 | pol_values['name'] = sourcing_line.comment |
1806 | 1701 | if sourcing_line.procurement_request: | 1701 | if sourcing_line.procurement_request: |
1807 | 1702 | pol_values.update({ | 1702 | pol_values.update({ |
1808 | 1703 | 'original_product': sourcing_line.original_product.id, | ||
1809 | 1703 | 'original_qty': sourcing_line.original_qty, | 1704 | 'original_qty': sourcing_line.original_qty, |
1810 | 1704 | 'original_uom': sourcing_line.original_uom.id, | 1705 | 'original_uom': sourcing_line.original_uom.id, |
1811 | 1705 | }) | 1706 | }) |
1812 | @@ -1734,6 +1735,7 @@ | |||
1813 | 1734 | } | 1735 | } |
1814 | 1735 | if sourcing_line.procurement_request: | 1736 | if sourcing_line.procurement_request: |
1815 | 1736 | rfq_line_values.update({ | 1737 | rfq_line_values.update({ |
1816 | 1738 | 'original_product': sourcing_line.original_product.id, | ||
1817 | 1737 | 'original_qty': sourcing_line.original_qty, | 1739 | 'original_qty': sourcing_line.original_qty, |
1818 | 1738 | 'original_uom': sourcing_line.original_uom.id, | 1740 | 'original_uom': sourcing_line.original_uom.id, |
1819 | 1739 | }) | 1741 | }) |
1820 | @@ -1762,6 +1764,7 @@ | |||
1821 | 1762 | } | 1764 | } |
1822 | 1763 | if sourcing_line.procurement_request: | 1765 | if sourcing_line.procurement_request: |
1823 | 1764 | tender_values.update({ | 1766 | tender_values.update({ |
1824 | 1767 | 'original_product': sourcing_line.original_product.id, | ||
1825 | 1765 | 'original_qty': sourcing_line.original_qty, | 1768 | 'original_qty': sourcing_line.original_qty, |
1826 | 1766 | 'original_uom': sourcing_line.original_uom.id, | 1769 | 'original_uom': sourcing_line.original_uom.id, |
1827 | 1767 | }) | 1770 | }) |
1828 | 1768 | 1771 | ||
1829 | === modified file 'bin/addons/sourcing/sourcing_view.xml' | |||
1830 | --- bin/addons/sourcing/sourcing_view.xml 2017-10-04 06:36:54 +0000 | |||
1831 | +++ bin/addons/sourcing/sourcing_view.xml 2017-10-26 10:06:24 +0000 | |||
1832 | @@ -3,27 +3,6 @@ | |||
1833 | 3 | <data> | 3 | <data> |
1834 | 4 | 4 | ||
1835 | 5 | 5 | ||
1836 | 6 | <record id="view_internal_request_form" model="ir.ui.view"> | ||
1837 | 7 | <field name="name">view.internal.request.form</field> | ||
1838 | 8 | <field name="model">sale.order</field> | ||
1839 | 9 | <field name="type">form</field> | ||
1840 | 10 | <field name="priority" eval="500" /> | ||
1841 | 11 | <field name="inherit_id" ref="procurement_request.procurement_request_form_view" /> | ||
1842 | 12 | <field name="arch" type="xml"> | ||
1843 | 13 | <data> | ||
1844 | 14 | <xpath expr="/form" position="inside"> | ||
1845 | 15 | <field name="sourcing_trace_ok" invisible="1" /> | ||
1846 | 16 | </xpath> | ||
1847 | 17 | |||
1848 | 18 | <xpath expr="/form//notebook" position="inside"> | ||
1849 | 19 | <page string="Sourcing Logs" attrs="{'invisible': [('sourcing_trace_ok', '=', False)]}"> | ||
1850 | 20 | <field name="sourcing_trace" colspan="4" nolabel="1" /> | ||
1851 | 21 | </page> | ||
1852 | 22 | </xpath> | ||
1853 | 23 | </data> | ||
1854 | 24 | </field> | ||
1855 | 25 | </record> | ||
1856 | 26 | |||
1857 | 27 | <record id="sourcing_line_normal_form_view" model="ir.ui.view"> | 6 | <record id="sourcing_line_normal_form_view" model="ir.ui.view"> |
1858 | 28 | <field name="name">sale.order.line.sourcing.form</field> | 7 | <field name="name">sale.order.line.sourcing.form</field> |
1859 | 29 | <field name="model">sale.order.line</field> | 8 | <field name="model">sale.order.line</field> |