Merge lp:~unifield-team/unifield-server/us-4027 into lp:unifield-server
- us-4027
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 4831 |
Proposed branch: | lp:~unifield-team/unifield-server/us-4027 |
Merge into: | lp:unifield-server |
Diff against target: |
456 lines (+156/-82) 5 files modified
bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py (+50/-51) bin/addons/msf_supply_doc_export/msf_supply_doc_export.py (+58/-0) bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako (+31/-21) bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako (+15/-8) bin/addons/purchase/purchase_order.py (+2/-2) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-4027 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+337539@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_doc_import/wizard/wizard_po_simulation_screen.py' | |||
2 | --- bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2018-03-02 16:53:19 +0000 | |||
3 | +++ bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2018-03-27 07:15:50 +0000 | |||
4 | @@ -46,7 +46,7 @@ | |||
5 | 46 | 46 | ||
6 | 47 | 47 | ||
7 | 48 | NB_OF_HEADER_LINES = 20 | 48 | NB_OF_HEADER_LINES = 20 |
9 | 49 | NB_LINES_COLUMNS = 19 | 49 | NB_LINES_COLUMNS = 20 |
10 | 50 | 50 | ||
11 | 51 | 51 | ||
12 | 52 | PRODUCT_CODE_ID = {} | 52 | PRODUCT_CODE_ID = {} |
13 | @@ -80,8 +80,8 @@ | |||
14 | 80 | HEADER_COLUMNS = [(1, _('Order Reference'), 'mandatory'), | 80 | HEADER_COLUMNS = [(1, _('Order Reference'), 'mandatory'), |
15 | 81 | (5, _('Supplier Reference'), 'optionnal'), | 81 | (5, _('Supplier Reference'), 'optionnal'), |
16 | 82 | (9, _('Ready To Ship Date'), 'optionnal'), | 82 | (9, _('Ready To Ship Date'), 'optionnal'), |
19 | 83 | (16, _('Shipment Date'), 'optionnal'), | 83 | (14, _('Shipment Date'), 'optionnal'), |
20 | 84 | (20, _('Message ESC'), 'optionnal') | 84 | (18, _('Message ESC'), 'optionnal') |
21 | 85 | ] | 85 | ] |
22 | 86 | 86 | ||
23 | 87 | 87 | ||
24 | @@ -448,7 +448,7 @@ | |||
25 | 448 | 'product_code', 'product_name', | 448 | 'product_code', 'product_name', |
26 | 449 | 'product_qty', 'product_uom', | 449 | 'product_qty', 'product_uom', |
27 | 450 | 'price_unit', 'currency_id', | 450 | 'price_unit', 'currency_id', |
29 | 451 | 'origin', 'comment', 'date_planned', | 451 | 'origin', 'stock_take_date','comment', 'date_planned', |
30 | 452 | 'confirmed_delivery_date', | 452 | 'confirmed_delivery_date', |
31 | 453 | 'nomen_manda_0', 'nomen_manda_1', | 453 | 'nomen_manda_0', 'nomen_manda_1', |
32 | 454 | 'nomen_manda_2', | 454 | 'nomen_manda_2', |
33 | @@ -687,11 +687,14 @@ | |||
34 | 687 | # Line 6: Details | 687 | # Line 6: Details |
35 | 688 | # Nothing to do | 688 | # Nothing to do |
36 | 689 | 689 | ||
42 | 690 | # Line 7: Delivery Requested Date | 690 | # Line 7: Stock take date |
43 | 691 | # Nothing to do | 691 | # Nothing to do |
44 | 692 | 692 | ||
45 | 693 | # Line 8: Transport mode | 693 | # Line 8: Delivery Requested Date |
46 | 694 | transport_mode = values.get(8, [])[1] | 694 | # Nothing to do |
47 | 695 | |||
48 | 696 | # Line 9: Transport mode | ||
49 | 697 | transport_mode = values.get(9, [])[1] | ||
50 | 695 | if transport_mode: | 698 | if transport_mode: |
51 | 696 | transport_select = self.fields_get(cr, uid, ['imp_transport_mode'], context=context) | 699 | transport_select = self.fields_get(cr, uid, ['imp_transport_mode'], context=context) |
52 | 697 | for x in transport_select['imp_transport_mode']['selection']: | 700 | for x in transport_select['imp_transport_mode']['selection']: |
53 | @@ -700,13 +703,13 @@ | |||
54 | 700 | break | 703 | break |
55 | 701 | else: | 704 | else: |
56 | 702 | possible_mode = ', '.join(x[1] for x in transport_select['imp_transport_mode']['selection'] if x[1]) | 705 | possible_mode = ', '.join(x[1] for x in transport_select['imp_transport_mode']['selection'] if x[1]) |
58 | 703 | err_msg = _('Line 8 of the file: The transport mode \'%s\' is not \ | 706 | err_msg = _('Line 9 of the file: The transport mode \'%s\' is not \ |
59 | 704 | a valid transport mode. Valid transport modes: %s') % (transport_mode, possible_mode) | 707 | a valid transport mode. Valid transport modes: %s') % (transport_mode, possible_mode) |
60 | 705 | values_header_errors.append(err_msg) | 708 | values_header_errors.append(err_msg) |
61 | 706 | 709 | ||
62 | 707 | 710 | ||
65 | 708 | # Line 9: RTS Date | 711 | # Line 10: RTS Date |
66 | 709 | rts_date = values.get(9, [])[1] | 712 | rts_date = values.get(10, [])[1] |
67 | 710 | if rts_date: | 713 | if rts_date: |
68 | 711 | if type(rts_date) == type(DateTime.now()): | 714 | if type(rts_date) == type(DateTime.now()): |
69 | 712 | rts_date = rts_date.strftime('%Y-%m-%d') | 715 | rts_date = rts_date.strftime('%Y-%m-%d') |
70 | @@ -716,30 +719,24 @@ | |||
71 | 716 | time.strptime(rts_date, '%Y-%m-%d') | 719 | time.strptime(rts_date, '%Y-%m-%d') |
72 | 717 | header_values['imp_ready_to_ship_date'] = rts_date | 720 | header_values['imp_ready_to_ship_date'] = rts_date |
73 | 718 | except: | 721 | except: |
75 | 719 | err_msg = _('Line 9 of the file: The date \'%s\' is not \ | 722 | err_msg = _('Line 10 of the file: The date \'%s\' is not \ |
76 | 720 | a valid date. A date must be formatted like \'YYYY-MM-DD\'') % rts_date | 723 | a valid date. A date must be formatted like \'YYYY-MM-DD\'') % rts_date |
77 | 721 | values_header_errors.append(err_msg) | 724 | values_header_errors.append(err_msg) |
78 | 722 | 725 | ||
99 | 723 | # Line 10: Address name | 726 | # Line 11: Delivery address name |
100 | 724 | # Nothing to do | 727 | # Nothing to do |
101 | 725 | 728 | ||
102 | 726 | # Line 11: Address street | 729 | # Line 12: Delivery address |
103 | 727 | # Nothing to do | 730 | # Nothing to do |
104 | 728 | 731 | ||
105 | 729 | # Line 12: Address street 2 | 732 | # Line 13: Customer address name |
106 | 730 | # Nothing to do | 733 | # Nothing to do |
107 | 731 | 734 | ||
108 | 732 | # Line 13: Zip | 735 | # Line 14: Customer address |
109 | 733 | # Nothing to do | 736 | # Nothing to do |
110 | 734 | 737 | ||
111 | 735 | # Line 14: City | 738 | # Line 15: Shipment date |
112 | 736 | # Nothing to do | 739 | shipment_date = values.get(15, [])[1] |
93 | 737 | |||
94 | 738 | # Line 15: Country | ||
95 | 739 | # Nothing to do | ||
96 | 740 | |||
97 | 741 | # Line 16: Shipment date | ||
98 | 742 | shipment_date = values.get(16, [])[1] | ||
113 | 743 | if shipment_date: | 740 | if shipment_date: |
114 | 744 | if type(shipment_date) == type(DateTime.now()): | 741 | if type(shipment_date) == type(DateTime.now()): |
115 | 745 | shipment_date = shipment_date.strftime('%Y-%m-%d') | 742 | shipment_date = shipment_date.strftime('%Y-%m-%d') |
116 | @@ -749,25 +746,27 @@ | |||
117 | 749 | time.strptime(shipment_date, '%Y-%m-%d') | 746 | time.strptime(shipment_date, '%Y-%m-%d') |
118 | 750 | header_values['imp_shipment_date'] = shipment_date | 747 | header_values['imp_shipment_date'] = shipment_date |
119 | 751 | except: | 748 | except: |
121 | 752 | err_msg = _('Line 9 of the file: The date \'%s\' is not \ | 749 | err_msg = _('Line 15 of the file: The date \'%s\' is not \ |
122 | 753 | a valid date. A date must be formatted like \'YYYY-MM-DD\'') % shipment_date | 750 | a valid date. A date must be formatted like \'YYYY-MM-DD\'') % shipment_date |
123 | 754 | values_header_errors.append(err_msg) | 751 | values_header_errors.append(err_msg) |
124 | 755 | 752 | ||
126 | 756 | # Line 17: Notes | 753 | # Line 16: Notes |
127 | 757 | # UFTP-59 | 754 | # UFTP-59 |
128 | 758 | if wiz.filetype != 'excel': | 755 | if wiz.filetype != 'excel': |
138 | 759 | header_values['imp_notes'] = values.get(17, [])[1] | 756 | header_values['imp_notes'] = values.get(16, [])[1] |
139 | 760 | 757 | ||
140 | 761 | # Line 18: Origin | 758 | # Line 17: Origin |
141 | 762 | # Nothing to do | 759 | # Nothing to do |
142 | 763 | 760 | ||
143 | 764 | # Line 19: Project Ref. | 761 | # Line 18: Project Ref. |
144 | 765 | # Nothing to do | 762 | # Nothing to do |
145 | 766 | 763 | ||
146 | 767 | # Line 20: Message ESC Header | 764 | # Line 19: Message ESC Header |
147 | 768 | if wiz.filetype != 'excel': | 765 | if wiz.filetype != 'excel': |
149 | 769 | header_values['imp_message_esc'] = values.get(20, [])[1] | 766 | header_values['imp_message_esc'] = values.get(19, [])[1] |
150 | 770 | 767 | ||
151 | 768 | # Line 20: Sourcing group | ||
152 | 769 | # Nothing to do | ||
153 | 771 | 770 | ||
154 | 772 | ''' | 771 | ''' |
155 | 773 | The header values have been imported, start the importation of | 772 | The header values have been imported, start the importation of |
156 | @@ -1351,7 +1350,7 @@ | |||
157 | 1351 | errors.append(_('PO line #%s has been confirmed or cancelled and consequently is not editable') % line.in_line_number) | 1350 | errors.append(_('PO line #%s has been confirmed or cancelled and consequently is not editable') % line.in_line_number) |
158 | 1352 | 1351 | ||
159 | 1353 | # Comment | 1352 | # Comment |
161 | 1354 | write_vals['imp_comment'] = values[14] and values[14].strip() | 1353 | write_vals['imp_comment'] = values[15] and values[15].strip() |
162 | 1355 | 1354 | ||
163 | 1356 | # External Ref. | 1355 | # External Ref. |
164 | 1357 | write_vals['imp_external_ref'] = values[1] | 1356 | write_vals['imp_external_ref'] = values[1] |
165 | @@ -1486,7 +1485,7 @@ | |||
166 | 1486 | write_vals['type_change'] = 'error' | 1485 | write_vals['type_change'] = 'error' |
167 | 1487 | 1486 | ||
168 | 1488 | # Delivery Requested Date | 1487 | # Delivery Requested Date |
170 | 1489 | drd_value = values[9] | 1488 | drd_value = values[10] |
171 | 1490 | if drd_value and type(drd_value) == type(DateTime.now()): | 1489 | if drd_value and type(drd_value) == type(DateTime.now()): |
172 | 1491 | write_vals['imp_drd'] = drd_value.strftime('%Y-%m-%d') | 1490 | write_vals['imp_drd'] = drd_value.strftime('%Y-%m-%d') |
173 | 1492 | elif drd_value and isinstance(drd_value, str): | 1491 | elif drd_value and isinstance(drd_value, str): |
174 | @@ -1503,7 +1502,7 @@ | |||
175 | 1503 | write_vals['type_change'] = 'error' | 1502 | write_vals['type_change'] = 'error' |
176 | 1504 | 1503 | ||
177 | 1505 | # Delivery Confirmed Date | 1504 | # Delivery Confirmed Date |
179 | 1506 | dcd_value = values[10] | 1505 | dcd_value = values[11] |
180 | 1507 | if dcd_value and type(dcd_value) == type(DateTime.now()): | 1506 | if dcd_value and type(dcd_value) == type(DateTime.now()): |
181 | 1508 | write_vals['imp_dcd'] = dcd_value.strftime('%Y-%m-%d') | 1507 | write_vals['imp_dcd'] = dcd_value.strftime('%Y-%m-%d') |
182 | 1509 | elif dcd_value and isinstance(dcd_value, str): | 1508 | elif dcd_value and isinstance(dcd_value, str): |
183 | @@ -1520,12 +1519,12 @@ | |||
184 | 1520 | write_vals['type_change'] = 'error' | 1519 | write_vals['type_change'] = 'error' |
185 | 1521 | 1520 | ||
186 | 1522 | # Project Ref. | 1521 | # Project Ref. |
188 | 1523 | write_vals['imp_project_ref'] = values[16] | 1522 | write_vals['imp_project_ref'] = values[17] |
189 | 1524 | 1523 | ||
190 | 1525 | # Message ESC1 | 1524 | # Message ESC1 |
192 | 1526 | write_vals['imp_esc1'] = values[17] | 1525 | write_vals['imp_esc1'] = values[18] |
193 | 1527 | # Message ESC2 | 1526 | # Message ESC2 |
195 | 1528 | write_vals['imp_esc2'] = values[18] | 1527 | write_vals['imp_esc2'] = values[19] |
196 | 1529 | 1528 | ||
197 | 1530 | if line.error_msg: | 1529 | if line.error_msg: |
198 | 1531 | write_vals['type_change'] = 'error' | 1530 | write_vals['type_change'] = 'error' |
199 | 1532 | 1531 | ||
200 | === modified file 'bin/addons/msf_supply_doc_export/msf_supply_doc_export.py' | |||
201 | --- bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2017-11-06 10:23:04 +0000 | |||
202 | +++ bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2018-03-27 07:15:50 +0000 | |||
203 | @@ -126,9 +126,15 @@ | |||
204 | 126 | context = {} | 126 | context = {} |
205 | 127 | context['lang'] = 'en_MF' | 127 | context['lang'] = 'en_MF' |
206 | 128 | super(validated_purchase_order_report_xls, self).__init__(cr, uid, name, context=context) | 128 | super(validated_purchase_order_report_xls, self).__init__(cr, uid, name, context=context) |
207 | 129 | self.cr = cr | ||
208 | 130 | self.uid = uid | ||
209 | 129 | self.localcontext.update({ | 131 | self.localcontext.update({ |
210 | 130 | 'time': time, | 132 | 'time': time, |
211 | 131 | 'maxADLines': self.get_max_ad_lines, | 133 | 'maxADLines': self.get_max_ad_lines, |
212 | 134 | 'getInstanceName': self.getInstanceName, | ||
213 | 135 | 'getCustomerAddress': self.getCustomerAddress, | ||
214 | 136 | 'getInstanceAddress': self.getInstanceAddress, | ||
215 | 137 | 'getContactName': self.getContactName, | ||
216 | 132 | }) | 138 | }) |
217 | 133 | 139 | ||
218 | 134 | def set_context(self, objects, data, ids, report_type = None): | 140 | def set_context(self, objects, data, ids, report_type = None): |
219 | @@ -144,6 +150,29 @@ | |||
220 | 144 | 150 | ||
221 | 145 | return max_ad_lines | 151 | return max_ad_lines |
222 | 146 | 152 | ||
223 | 153 | def getInstanceName(self): | ||
224 | 154 | return self.pool.get('res.users').browse(self.cr, self.uid, self.uid).company_id.instance_id.instance | ||
225 | 155 | |||
226 | 156 | def getInstanceAddress(self): | ||
227 | 157 | part_addr_id = self.pool.get('res.partner.address').search(self.cr, self.uid, [('partner_id', '=', self.uid)], limit=1) | ||
228 | 158 | part_addr = False | ||
229 | 159 | if part_addr_id: | ||
230 | 160 | part_addr = self.pool.get('res.partner.address').browse(self.cr, self.uid, part_addr_id)[0] | ||
231 | 161 | return part_addr.name if part_addr else '' | ||
232 | 162 | |||
233 | 163 | def getCustomerAddress(self, customer_id): | ||
234 | 164 | part_addr_obj = self.pool.get('res.partner.address') | ||
235 | 165 | part_addr_id = part_addr_obj.search(self.cr, self.uid, [('partner_id', '=', customer_id)], limit=1)[0] | ||
236 | 166 | |||
237 | 167 | return part_addr_obj.browse(self.cr, self.uid, part_addr_id).name | ||
238 | 168 | |||
239 | 169 | def getContactName(self, addr_id): | ||
240 | 170 | res = '' | ||
241 | 171 | if addr_id: | ||
242 | 172 | res = self.pool.get('res.partner.address').read(self.cr, self.uid, addr_id)['name'] | ||
243 | 173 | return res | ||
244 | 174 | |||
245 | 175 | |||
246 | 147 | SpreadsheetReport('report.validated.purchase.order_xls', 'purchase.order', 'addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako', parser=validated_purchase_order_report_xls) | 176 | SpreadsheetReport('report.validated.purchase.order_xls', 'purchase.order', 'addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako', parser=validated_purchase_order_report_xls) |
247 | 148 | 177 | ||
248 | 149 | # VALIDATE PURCHASE ORDER (Pure XML) | 178 | # VALIDATE PURCHASE ORDER (Pure XML) |
249 | @@ -153,9 +182,15 @@ | |||
250 | 153 | context = {} | 182 | context = {} |
251 | 154 | context['lang'] = 'en_MF' | 183 | context['lang'] = 'en_MF' |
252 | 155 | super(parser_validated_purchase_order_report_xml, self).__init__(cr, uid, name, context=context) | 184 | super(parser_validated_purchase_order_report_xml, self).__init__(cr, uid, name, context=context) |
253 | 185 | self.cr = cr | ||
254 | 186 | self.uid = uid | ||
255 | 156 | self.localcontext.update({ | 187 | self.localcontext.update({ |
256 | 157 | 'time': time, | 188 | 'time': time, |
257 | 158 | 'maxADLines': self.get_max_ad_lines, | 189 | 'maxADLines': self.get_max_ad_lines, |
258 | 190 | 'getInstanceName': self.getInstanceName, | ||
259 | 191 | 'getCustomerAddress': self.getCustomerAddress, | ||
260 | 192 | 'getContactName': self.getContactName, | ||
261 | 193 | 'getInstanceAddress': self.getInstanceAddress, | ||
262 | 159 | }) | 194 | }) |
263 | 160 | 195 | ||
264 | 161 | def set_context(self, objects, data, ids, report_type = None): | 196 | def set_context(self, objects, data, ids, report_type = None): |
265 | @@ -171,6 +206,29 @@ | |||
266 | 171 | 206 | ||
267 | 172 | return max_ad_lines | 207 | return max_ad_lines |
268 | 173 | 208 | ||
269 | 209 | def getInstanceName(self): | ||
270 | 210 | return self.pool.get('res.users').browse(self.cr, self.uid, self.uid).company_id.instance_id.instance | ||
271 | 211 | |||
272 | 212 | def getCustomerAddress(self, customer_id): | ||
273 | 213 | part_addr_obj = self.pool.get('res.partner.address') | ||
274 | 214 | part_addr_id = part_addr_obj.search(self.cr, self.uid, [('partner_id', '=', customer_id)], limit=1)[0] | ||
275 | 215 | |||
276 | 216 | return part_addr_obj.browse(self.cr, self.uid, part_addr_id).name | ||
277 | 217 | |||
278 | 218 | def getContactName(self, addr_id): | ||
279 | 219 | res = '' | ||
280 | 220 | if addr_id: | ||
281 | 221 | res = self.pool.get('res.partner.address').read(self.cr, self.uid, addr_id)['name'] | ||
282 | 222 | return res | ||
283 | 223 | |||
284 | 224 | def getInstanceAddress(self): | ||
285 | 225 | part_addr_id = self.pool.get('res.partner.address').search(self.cr, self.uid, [('partner_id', '=', self.uid)], limit=1) | ||
286 | 226 | part_addr = False | ||
287 | 227 | if part_addr_id: | ||
288 | 228 | part_addr = self.pool.get('res.partner.address').browse(self.cr, self.uid, part_addr_id)[0] | ||
289 | 229 | return part_addr.name if part_addr else '' | ||
290 | 230 | |||
291 | 231 | |||
292 | 174 | class validated_purchase_order_report_xml(WebKitParser): | 232 | class validated_purchase_order_report_xml(WebKitParser): |
293 | 175 | def __init__(self, name, table, rml=False, parser=report_sxw.rml_parse, header='external', store=False): | 233 | def __init__(self, name, table, rml=False, parser=report_sxw.rml_parse, header='external', store=False): |
294 | 176 | WebKitParser.__init__(self, name, table, rml=rml, parser=parser, header=header, store=store) | 234 | WebKitParser.__init__(self, name, table, rml=rml, parser=parser, header=header, store=store) |
295 | 177 | 235 | ||
296 | === modified file 'bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako' | |||
297 | --- bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako 2017-11-17 09:11:27 +0000 | |||
298 | +++ bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako 2018-03-27 07:15:50 +0000 | |||
299 | @@ -103,6 +103,10 @@ | |||
300 | 103 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.details or ''|x}</Data></Cell> | 103 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.details or ''|x}</Data></Cell> |
301 | 104 | </Row> | 104 | </Row> |
302 | 105 | <Row> | 105 | <Row> |
303 | 106 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Stock Take Date')}</Data></Cell> | ||
304 | 107 | <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${o.stock_take_date|n}T00:00:00.000</Data></Cell> | ||
305 | 108 | </Row> | ||
306 | 109 | <Row> | ||
307 | 106 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Delivery Requested Date')}</Data></Cell> | 110 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Delivery Requested Date')}</Data></Cell> |
308 | 107 | % if isDate(o.delivery_requested_date): | 111 | % if isDate(o.delivery_requested_date): |
309 | 108 | <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${o.delivery_requested_date|n}T00:00:00.000</Data></Cell> | 112 | <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${o.delivery_requested_date|n}T00:00:00.000</Data></Cell> |
310 | @@ -123,28 +127,28 @@ | |||
311 | 123 | % endif | 127 | % endif |
312 | 124 | </Row> | 128 | </Row> |
313 | 125 | <Row> | 129 | <Row> |
315 | 126 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Address name')}</Data></Cell> | 130 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Delivery address name')}</Data></Cell> |
316 | 131 | % if o.order_type == 'direct': | ||
317 | 132 | <Cell ss:StyleID="line" ><Data ss:Type="String">${getContactName(o.dest_address_id.id) or ''|x}</Data></Cell> | ||
318 | 133 | % else: | ||
319 | 127 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.dest_address_id and o.dest_address_id.name or ''|x}</Data></Cell> | 134 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.dest_address_id and o.dest_address_id.name or ''|x}</Data></Cell> |
340 | 128 | </Row> | 135 | % endif |
341 | 129 | <Row> | 136 | </Row> |
342 | 130 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Address street')}</Data></Cell> | 137 | <Row> |
343 | 131 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.dest_address_id and o.dest_address_id.street or ''|x}</Data></Cell> | 138 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Delivery address')}</Data></Cell> |
344 | 132 | </Row> | 139 | % if o.order_type == 'direct': |
345 | 133 | <Row> | 140 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.dest_partner_id and o.dest_partner_id.name or ''|x}</Data></Cell> |
346 | 134 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Address street 2')}</Data></Cell> | 141 | % else: |
347 | 135 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.dest_address_id and o.dest_address_id.street2 or ''|x}</Data></Cell> | 142 | <Cell ss:StyleID="line" ><Data ss:Type="String">${getInstanceName()|x}</Data></Cell> |
348 | 136 | </Row> | 143 | % endif |
349 | 137 | <Row> | 144 | </Row> |
350 | 138 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Zip')}</Data></Cell> | 145 | <Row> |
351 | 139 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.dest_address_id and o.dest_address_id.zip or ''|x}</Data></Cell> | 146 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Customer address name')}</Data></Cell> |
352 | 140 | </Row> | 147 | <Cell ss:StyleID="line" ><Data ss:Type="String">${getInstanceAddress() or ''|x}</Data></Cell> |
353 | 141 | <Row> | 148 | </Row> |
354 | 142 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('City')}</Data></Cell> | 149 | <Row> |
355 | 143 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.dest_address_id and o.dest_address_id.city or ''|x}</Data></Cell> | 150 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Customer address')}</Data></Cell> |
356 | 144 | </Row> | 151 | <Cell ss:StyleID="line" ><Data ss:Type="String">${getInstanceName()|x}</Data></Cell> |
337 | 145 | <Row> | ||
338 | 146 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Country')}</Data></Cell> | ||
339 | 147 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.dest_address_id and o.dest_address_id.country_id and o.dest_address_id.country_id.name or ''|x}</Data></Cell> | ||
357 | 148 | </Row> | 152 | </Row> |
358 | 149 | <Row> | 153 | <Row> |
359 | 150 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Shipment Date')}</Data></Cell> | 154 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Shipment Date')}</Data></Cell> |
360 | @@ -170,6 +174,10 @@ | |||
361 | 170 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Message ESC Header')}</Data></Cell> | 174 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Message ESC Header')}</Data></Cell> |
362 | 171 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.message_esc or ''|x}</Data></Cell> | 175 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.message_esc or ''|x}</Data></Cell> |
363 | 172 | </Row> | 176 | </Row> |
364 | 177 | <Row> | ||
365 | 178 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Sourcing group')}</Data></Cell> | ||
366 | 179 | <Cell ss:StyleID="line" ><Data ss:Type="String">${o.related_sourcing_id and o.related_sourcing_id.name or ''|x}</Data></Cell> | ||
367 | 180 | </Row> | ||
368 | 173 | 181 | ||
369 | 174 | % if need_ad and o.analytic_distribution_id: | 182 | % if need_ad and o.analytic_distribution_id: |
370 | 175 | <Row> | 183 | <Row> |
371 | @@ -219,6 +227,7 @@ | |||
372 | 219 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Price Unit*')}</Data></Cell> | 227 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Price Unit*')}</Data></Cell> |
373 | 220 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Currency*')}</Data></Cell> | 228 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Currency*')}</Data></Cell> |
374 | 221 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Origin*')}</Data></Cell> | 229 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Origin*')}</Data></Cell> |
375 | 230 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Stock Take Date')}</Data></Cell> | ||
376 | 222 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Delivery requested date')}</Data></Cell> | 231 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Delivery requested date')}</Data></Cell> |
377 | 223 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Delivery confirmed date*')}</Data></Cell> | 232 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Delivery confirmed date*')}</Data></Cell> |
378 | 224 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Nomen Name')}</Data></Cell> | 233 | <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Nomen Name')}</Data></Cell> |
379 | @@ -256,6 +265,7 @@ | |||
380 | 256 | <Cell ss:StyleID="line" ><Data ss:Type="Number">${(line.price_unit or 0.00)|x}</Data></Cell> | 265 | <Cell ss:StyleID="line" ><Data ss:Type="Number">${(line.price_unit or 0.00)|x}</Data></Cell> |
381 | 257 | <Cell ss:StyleID="line" ><Data ss:Type="String">${(o.pricelist_id.currency_id.name or '')|x}</Data></Cell> | 266 | <Cell ss:StyleID="line" ><Data ss:Type="String">${(o.pricelist_id.currency_id.name or '')|x}</Data></Cell> |
382 | 258 | <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.origin or '')|x}</Data></Cell> | 267 | <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.origin or '')|x}</Data></Cell> |
383 | 268 | <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${line.stock_take_date|n}T00:00:00.000</Data></Cell> | ||
384 | 259 | % if isDate(line.date_planned): | 269 | % if isDate(line.date_planned): |
385 | 260 | <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${line.date_planned|n}T00:00:00.000</Data></Cell> | 270 | <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${line.date_planned|n}T00:00:00.000</Data></Cell> |
386 | 261 | % elif isDate(o.delivery_requested_date): | 271 | % elif isDate(o.delivery_requested_date): |
387 | 262 | 272 | ||
388 | === modified file 'bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako' | |||
389 | --- bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako 2017-11-17 09:15:40 +0000 | |||
390 | +++ bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako 2018-03-27 07:15:50 +0000 | |||
391 | @@ -12,6 +12,7 @@ | |||
392 | 12 | % endif | 12 | % endif |
393 | 13 | <field name="partner_ref">${o.partner_ref or ''|x}</field> | 13 | <field name="partner_ref">${o.partner_ref or ''|x}</field> |
394 | 14 | <field name="details">${o.details or ''|x}</field> | 14 | <field name="details">${o.details or ''|x}</field> |
395 | 15 | <field name="stock_take_date">${o.stock_take_date or ''|x}</field> | ||
396 | 15 | % if o.delivery_requested_date and o.delivery_requested_date not in (False, 'False'): | 16 | % if o.delivery_requested_date and o.delivery_requested_date not in (False, 'False'): |
397 | 16 | <field name="delivery_requested_date">${o.delivery_requested_date or ''|n}</field> | 17 | <field name="delivery_requested_date">${o.delivery_requested_date or ''|n}</field> |
398 | 17 | % else: | 18 | % else: |
399 | @@ -24,14 +25,18 @@ | |||
400 | 24 | <field name="ready_to_ship_date"></field> | 25 | <field name="ready_to_ship_date"></field> |
401 | 25 | % endif | 26 | % endif |
402 | 26 | <field name="dest_address_id" key="name,parent.partner_id"> | 27 | <field name="dest_address_id" key="name,parent.partner_id"> |
411 | 27 | <field name="name">${o.dest_address_id and o.dest_address_id.name or ''|x}</field> | 28 | % if o.order_type == 'direct': |
412 | 28 | <field name="street">${o.dest_address_id and o.dest_address_id.street or ''|x}</field> | 29 | <field name="delivery_name">${getContactName(o.dest_address_id.id) or ''|x}</field> |
413 | 29 | <field name="street2">${o.dest_address_id and o.dest_address_id.street2 or ''|x}</field> | 30 | % else: |
414 | 30 | <field name="zip">${o.dest_address_id and o.dest_address_id.zip or ''|x}</field> | 31 | <field name="delivery_name">${o.dest_address_id and o.dest_address_id.name or ''|x}</field> |
415 | 31 | <field name="city">${o.dest_address_id and o.dest_address_id.city or ''|x}</field> | 32 | % endif |
416 | 32 | <field name="country_id" key="name"> | 33 | % if o.order_type == 'direct': |
417 | 33 | <field name="name">${o.dest_address_id and o.dest_address_id.country_id and o.dest_address_id.country_id.name or ''|x}</field> | 34 | <field name="delivery_address">${o.dest_partner_id and o.dest_partner_id.name or ''|x}</field> |
418 | 34 | </field> | 35 | % else: |
419 | 36 | <field name="delivery_address">${getInstanceName()|x}</field> | ||
420 | 37 | % endif | ||
421 | 38 | <field name="customer_name">${getInstanceAddress() or ''|x}</field> | ||
422 | 39 | <field name="customer_address">${getInstanceName()|x}</field> | ||
423 | 35 | </field> | 40 | </field> |
424 | 36 | % if o.shipment_date and o.shipment_date not in (False, 'False'): | 41 | % if o.shipment_date and o.shipment_date not in (False, 'False'): |
425 | 37 | <field name="shipment_date">${o.shipment_date|n}</field> | 42 | <field name="shipment_date">${o.shipment_date|n}</field> |
426 | @@ -42,6 +47,7 @@ | |||
427 | 42 | <field name="origin">${o.origin or ''|x}</field> | 47 | <field name="origin">${o.origin or ''|x}</field> |
428 | 43 | <field name="project_ref">${o.fnct_project_ref or ''|x}</field> | 48 | <field name="project_ref">${o.fnct_project_ref or ''|x}</field> |
429 | 44 | <field name="message_esc">${o.message_esc or ''|x}</field> | 49 | <field name="message_esc">${o.message_esc or ''|x}</field> |
430 | 50 | <field name="related_sourcing_id">${o.related_sourcing_id and o.related_sourcing_id.name or ''|x}</field> | ||
431 | 45 | <field name="analytic_distribution_id"> | 51 | <field name="analytic_distribution_id"> |
432 | 46 | % if need_ad and o.analytic_distribution_id: | 52 | % if need_ad and o.analytic_distribution_id: |
433 | 47 | % for ccl in o.analytic_distribution_id.cost_center_lines: | 53 | % for ccl in o.analytic_distribution_id.cost_center_lines: |
434 | @@ -71,6 +77,7 @@ | |||
435 | 71 | <field name="name">${l.currency_id and l.currency_id.name or ''|x}</field> | 77 | <field name="name">${l.currency_id and l.currency_id.name or ''|x}</field> |
436 | 72 | </field> | 78 | </field> |
437 | 73 | <field name="origin">${l.origin or ''|x}</field> | 79 | <field name="origin">${l.origin or ''|x}</field> |
438 | 80 | <field name="stock_take_date">${l.stock_take_date or ''|x}</field> | ||
439 | 74 | % if l.date_planned and l.date_planned not in (False, 'False'): | 81 | % if l.date_planned and l.date_planned not in (False, 'False'): |
440 | 75 | <field name="date_planned">${l.date_planned|n}</field> | 82 | <field name="date_planned">${l.date_planned|n}</field> |
441 | 76 | % else: | 83 | % else: |
442 | 77 | 84 | ||
443 | === modified file 'bin/addons/purchase/purchase_order.py' | |||
444 | --- bin/addons/purchase/purchase_order.py 2018-02-22 14:23:17 +0000 | |||
445 | +++ bin/addons/purchase/purchase_order.py 2018-03-27 07:15:50 +0000 | |||
446 | @@ -646,8 +646,8 @@ | |||
447 | 646 | 'customer_ref': fields.function(_get_customer_ref, fnct_search=_src_customer_ref, method=True, string='Customer Ref.', type='text', store=False), | 646 | 'customer_ref': fields.function(_get_customer_ref, fnct_search=_src_customer_ref, method=True, string='Customer Ref.', type='text', store=False), |
448 | 647 | 'line_count': fields.function(_get_line_count, method=True, type='integer', string="Line count", store=False), | 647 | 'line_count': fields.function(_get_line_count, method=True, type='integer', string="Line count", store=False), |
449 | 648 | 648 | ||
452 | 649 | 'date_approve':fields.date('Date Approved', readonly=1, select=True, help="Date on which purchase order has been approved"), | 649 | 'date_approve': fields.date('Date Approved', readonly=1, select=True, help="Date on which purchase order has been approved"), |
453 | 650 | 'dest_address_id':fields.many2one('res.partner.address', 'Destination Address', | 650 | 'dest_address_id': fields.many2one('res.partner.address', 'Destination Address', |
454 | 651 | help="Put an address if you want to deliver directly from the supplier to the customer." \ | 651 | help="Put an address if you want to deliver directly from the supplier to the customer." \ |
455 | 652 | "In this case, it will remove the warehouse link and set the customer location." | 652 | "In this case, it will remove the warehouse link and set the customer location." |
456 | 653 | ), | 653 | ), |