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

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
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+337539@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py'
--- bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2018-03-02 16:53:19 +0000
+++ bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2018-03-27 07:15:50 +0000
@@ -46,7 +46,7 @@
4646
4747
48NB_OF_HEADER_LINES = 2048NB_OF_HEADER_LINES = 20
49NB_LINES_COLUMNS = 1949NB_LINES_COLUMNS = 20
5050
5151
52PRODUCT_CODE_ID = {}52PRODUCT_CODE_ID = {}
@@ -80,8 +80,8 @@
80HEADER_COLUMNS = [(1, _('Order Reference'), 'mandatory'),80HEADER_COLUMNS = [(1, _('Order Reference'), 'mandatory'),
81 (5, _('Supplier Reference'), 'optionnal'),81 (5, _('Supplier Reference'), 'optionnal'),
82 (9, _('Ready To Ship Date'), 'optionnal'),82 (9, _('Ready To Ship Date'), 'optionnal'),
83 (16, _('Shipment Date'), 'optionnal'),83 (14, _('Shipment Date'), 'optionnal'),
84 (20, _('Message ESC'), 'optionnal')84 (18, _('Message ESC'), 'optionnal')
85 ]85 ]
8686
8787
@@ -448,7 +448,7 @@
448 'product_code', 'product_name',448 'product_code', 'product_name',
449 'product_qty', 'product_uom',449 'product_qty', 'product_uom',
450 'price_unit', 'currency_id',450 'price_unit', 'currency_id',
451 'origin', 'comment', 'date_planned',451 'origin', 'stock_take_date','comment', 'date_planned',
452 'confirmed_delivery_date',452 'confirmed_delivery_date',
453 'nomen_manda_0', 'nomen_manda_1',453 'nomen_manda_0', 'nomen_manda_1',
454 'nomen_manda_2',454 'nomen_manda_2',
@@ -687,11 +687,14 @@
687 # Line 6: Details687 # Line 6: Details
688 # Nothing to do688 # Nothing to do
689689
690 # Line 7: Delivery Requested Date690 # Line 7: Stock take date
691 # Nothing to do691 # Nothing to do
692692
693 # Line 8: Transport mode693 # Line 8: Delivery Requested Date
694 transport_mode = values.get(8, [])[1]694 # Nothing to do
695
696 # Line 9: Transport mode
697 transport_mode = values.get(9, [])[1]
695 if transport_mode:698 if transport_mode:
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)
697 for x in transport_select['imp_transport_mode']['selection']:700 for x in transport_select['imp_transport_mode']['selection']:
@@ -700,13 +703,13 @@
700 break703 break
701 else:704 else:
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])
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 \
704a valid transport mode. Valid transport modes: %s') % (transport_mode, possible_mode)707a valid transport mode. Valid transport modes: %s') % (transport_mode, possible_mode)
705 values_header_errors.append(err_msg)708 values_header_errors.append(err_msg)
706709
707710
708 # Line 9: RTS Date711 # Line 10: RTS Date
709 rts_date = values.get(9, [])[1]712 rts_date = values.get(10, [])[1]
710 if rts_date:713 if rts_date:
711 if type(rts_date) == type(DateTime.now()):714 if type(rts_date) == type(DateTime.now()):
712 rts_date = rts_date.strftime('%Y-%m-%d')715 rts_date = rts_date.strftime('%Y-%m-%d')
@@ -716,30 +719,24 @@
716 time.strptime(rts_date, '%Y-%m-%d')719 time.strptime(rts_date, '%Y-%m-%d')
717 header_values['imp_ready_to_ship_date'] = rts_date720 header_values['imp_ready_to_ship_date'] = rts_date
718 except:721 except:
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 \
720 a valid date. A date must be formatted like \'YYYY-MM-DD\'') % rts_date723 a valid date. A date must be formatted like \'YYYY-MM-DD\'') % rts_date
721 values_header_errors.append(err_msg)724 values_header_errors.append(err_msg)
722725
723 # Line 10: Address name726 # Line 11: Delivery address name
724 # Nothing to do727 # Nothing to do
725728
726 # Line 11: Address street729 # Line 12: Delivery address
727 # Nothing to do730 # Nothing to do
728731
729 # Line 12: Address street 2732 # Line 13: Customer address name
730 # Nothing to do733 # Nothing to do
731734
732 # Line 13: Zip735 # Line 14: Customer address
733 # Nothing to do736 # Nothing to do
734737
735 # Line 14: City738 # Line 15: Shipment date
736 # Nothing to do739 shipment_date = values.get(15, [])[1]
737
738 # Line 15: Country
739 # Nothing to do
740
741 # Line 16: Shipment date
742 shipment_date = values.get(16, [])[1]
743 if shipment_date:740 if shipment_date:
744 if type(shipment_date) == type(DateTime.now()):741 if type(shipment_date) == type(DateTime.now()):
745 shipment_date = shipment_date.strftime('%Y-%m-%d')742 shipment_date = shipment_date.strftime('%Y-%m-%d')
@@ -749,25 +746,27 @@
749 time.strptime(shipment_date, '%Y-%m-%d')746 time.strptime(shipment_date, '%Y-%m-%d')
750 header_values['imp_shipment_date'] = shipment_date747 header_values['imp_shipment_date'] = shipment_date
751 except:748 except:
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 \
753 a valid date. A date must be formatted like \'YYYY-MM-DD\'') % shipment_date750 a valid date. A date must be formatted like \'YYYY-MM-DD\'') % shipment_date
754 values_header_errors.append(err_msg)751 values_header_errors.append(err_msg)
755752
756 # Line 17: Notes753 # Line 16: Notes
757 # UFTP-59754 # UFTP-59
758 if wiz.filetype != 'excel':755 if wiz.filetype != 'excel':
759 header_values['imp_notes'] = values.get(17, [])[1]756 header_values['imp_notes'] = values.get(16, [])[1]
760757
761 # Line 18: Origin758 # Line 17: Origin
762 # Nothing to do759 # Nothing to do
763760
764 # Line 19: Project Ref.761 # Line 18: Project Ref.
765 # Nothing to do762 # Nothing to do
766763
767 # Line 20: Message ESC Header764 # Line 19: Message ESC Header
768 if wiz.filetype != 'excel':765 if wiz.filetype != 'excel':
769 header_values['imp_message_esc'] = values.get(20, [])[1]766 header_values['imp_message_esc'] = values.get(19, [])[1]
770767
768 # Line 20: Sourcing group
769 # Nothing to do
771770
772 '''771 '''
773 The header values have been imported, start the importation of772 The header values have been imported, start the importation of
@@ -1351,7 +1350,7 @@
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)
13521351
1353 # Comment1352 # Comment
1354 write_vals['imp_comment'] = values[14] and values[14].strip()1353 write_vals['imp_comment'] = values[15] and values[15].strip()
13551354
1356 # External Ref.1355 # External Ref.
1357 write_vals['imp_external_ref'] = values[1]1356 write_vals['imp_external_ref'] = values[1]
@@ -1486,7 +1485,7 @@
1486 write_vals['type_change'] = 'error'1485 write_vals['type_change'] = 'error'
14871486
1488 # Delivery Requested Date1487 # Delivery Requested Date
1489 drd_value = values[9]1488 drd_value = values[10]
1490 if drd_value and type(drd_value) == type(DateTime.now()):1489 if drd_value and type(drd_value) == type(DateTime.now()):
1491 write_vals['imp_drd'] = drd_value.strftime('%Y-%m-%d')1490 write_vals['imp_drd'] = drd_value.strftime('%Y-%m-%d')
1492 elif drd_value and isinstance(drd_value, str):1491 elif drd_value and isinstance(drd_value, str):
@@ -1503,7 +1502,7 @@
1503 write_vals['type_change'] = 'error'1502 write_vals['type_change'] = 'error'
15041503
1505 # Delivery Confirmed Date1504 # Delivery Confirmed Date
1506 dcd_value = values[10]1505 dcd_value = values[11]
1507 if dcd_value and type(dcd_value) == type(DateTime.now()):1506 if dcd_value and type(dcd_value) == type(DateTime.now()):
1508 write_vals['imp_dcd'] = dcd_value.strftime('%Y-%m-%d')1507 write_vals['imp_dcd'] = dcd_value.strftime('%Y-%m-%d')
1509 elif dcd_value and isinstance(dcd_value, str):1508 elif dcd_value and isinstance(dcd_value, str):
@@ -1520,12 +1519,12 @@
1520 write_vals['type_change'] = 'error'1519 write_vals['type_change'] = 'error'
15211520
1522 # Project Ref.1521 # Project Ref.
1523 write_vals['imp_project_ref'] = values[16]1522 write_vals['imp_project_ref'] = values[17]
15241523
1525 # Message ESC11524 # Message ESC1
1526 write_vals['imp_esc1'] = values[17]1525 write_vals['imp_esc1'] = values[18]
1527 # Message ESC21526 # Message ESC2
1528 write_vals['imp_esc2'] = values[18]1527 write_vals['imp_esc2'] = values[19]
15291528
1530 if line.error_msg:1529 if line.error_msg:
1531 write_vals['type_change'] = 'error'1530 write_vals['type_change'] = 'error'
15321531
=== modified file 'bin/addons/msf_supply_doc_export/msf_supply_doc_export.py'
--- bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2017-11-06 10:23:04 +0000
+++ bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2018-03-27 07:15:50 +0000
@@ -126,9 +126,15 @@
126 context = {}126 context = {}
127 context['lang'] = 'en_MF'127 context['lang'] = 'en_MF'
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)
129 self.cr = cr
130 self.uid = uid
129 self.localcontext.update({131 self.localcontext.update({
130 'time': time,132 'time': time,
131 'maxADLines': self.get_max_ad_lines,133 'maxADLines': self.get_max_ad_lines,
134 'getInstanceName': self.getInstanceName,
135 'getCustomerAddress': self.getCustomerAddress,
136 'getInstanceAddress': self.getInstanceAddress,
137 'getContactName': self.getContactName,
132 })138 })
133139
134 def set_context(self, objects, data, ids, report_type = None):140 def set_context(self, objects, data, ids, report_type = None):
@@ -144,6 +150,29 @@
144150
145 return max_ad_lines151 return max_ad_lines
146152
153 def getInstanceName(self):
154 return self.pool.get('res.users').browse(self.cr, self.uid, self.uid).company_id.instance_id.instance
155
156 def getInstanceAddress(self):
157 part_addr_id = self.pool.get('res.partner.address').search(self.cr, self.uid, [('partner_id', '=', self.uid)], limit=1)
158 part_addr = False
159 if part_addr_id:
160 part_addr = self.pool.get('res.partner.address').browse(self.cr, self.uid, part_addr_id)[0]
161 return part_addr.name if part_addr else ''
162
163 def getCustomerAddress(self, customer_id):
164 part_addr_obj = self.pool.get('res.partner.address')
165 part_addr_id = part_addr_obj.search(self.cr, self.uid, [('partner_id', '=', customer_id)], limit=1)[0]
166
167 return part_addr_obj.browse(self.cr, self.uid, part_addr_id).name
168
169 def getContactName(self, addr_id):
170 res = ''
171 if addr_id:
172 res = self.pool.get('res.partner.address').read(self.cr, self.uid, addr_id)['name']
173 return res
174
175
147SpreadsheetReport('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)176SpreadsheetReport('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)
148177
149# VALIDATE PURCHASE ORDER (Pure XML)178# VALIDATE PURCHASE ORDER (Pure XML)
@@ -153,9 +182,15 @@
153 context = {}182 context = {}
154 context['lang'] = 'en_MF'183 context['lang'] = 'en_MF'
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)
185 self.cr = cr
186 self.uid = uid
156 self.localcontext.update({187 self.localcontext.update({
157 'time': time,188 'time': time,
158 'maxADLines': self.get_max_ad_lines,189 'maxADLines': self.get_max_ad_lines,
190 'getInstanceName': self.getInstanceName,
191 'getCustomerAddress': self.getCustomerAddress,
192 'getContactName': self.getContactName,
193 'getInstanceAddress': self.getInstanceAddress,
159 })194 })
160195
161 def set_context(self, objects, data, ids, report_type = None):196 def set_context(self, objects, data, ids, report_type = None):
@@ -171,6 +206,29 @@
171206
172 return max_ad_lines207 return max_ad_lines
173208
209 def getInstanceName(self):
210 return self.pool.get('res.users').browse(self.cr, self.uid, self.uid).company_id.instance_id.instance
211
212 def getCustomerAddress(self, customer_id):
213 part_addr_obj = self.pool.get('res.partner.address')
214 part_addr_id = part_addr_obj.search(self.cr, self.uid, [('partner_id', '=', customer_id)], limit=1)[0]
215
216 return part_addr_obj.browse(self.cr, self.uid, part_addr_id).name
217
218 def getContactName(self, addr_id):
219 res = ''
220 if addr_id:
221 res = self.pool.get('res.partner.address').read(self.cr, self.uid, addr_id)['name']
222 return res
223
224 def getInstanceAddress(self):
225 part_addr_id = self.pool.get('res.partner.address').search(self.cr, self.uid, [('partner_id', '=', self.uid)], limit=1)
226 part_addr = False
227 if part_addr_id:
228 part_addr = self.pool.get('res.partner.address').browse(self.cr, self.uid, part_addr_id)[0]
229 return part_addr.name if part_addr else ''
230
231
174class validated_purchase_order_report_xml(WebKitParser):232class validated_purchase_order_report_xml(WebKitParser):
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):
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)
177235
=== modified file 'bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako'
--- bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako 2017-11-17 09:11:27 +0000
+++ bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xls.mako 2018-03-27 07:15:50 +0000
@@ -103,6 +103,10 @@
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>
104 </Row>104 </Row>
105 <Row>105 <Row>
106 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Stock Take Date')}</Data></Cell>
107 <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${o.stock_take_date|n}T00:00:00.000</Data></Cell>
108 </Row>
109 <Row>
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>
107 % if isDate(o.delivery_requested_date):111 % if isDate(o.delivery_requested_date):
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>
@@ -123,28 +127,28 @@
123 % endif127 % endif
124 </Row>128 </Row>
125 <Row>129 <Row>
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>
131 % if o.order_type == 'direct':
132 <Cell ss:StyleID="line" ><Data ss:Type="String">${getContactName(o.dest_address_id.id) or ''|x}</Data></Cell>
133 % else:
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>
128 </Row>135 % endif
129 <Row>136 </Row>
130 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Address street')}</Data></Cell>137 <Row>
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>
132 </Row>139 % if o.order_type == 'direct':
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>
134 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Address street 2')}</Data></Cell>141 % else:
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>
136 </Row>143 % endif
137 <Row>144 </Row>
138 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Zip')}</Data></Cell>145 <Row>
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>
140 </Row>147 <Cell ss:StyleID="line" ><Data ss:Type="String">${getInstanceAddress() or ''|x}</Data></Cell>
141 <Row>148 </Row>
142 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('City')}</Data></Cell>149 <Row>
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>
144 </Row>151 <Cell ss:StyleID="line" ><Data ss:Type="String">${getInstanceName()|x}</Data></Cell>
145 <Row>
146 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Country')}</Data></Cell>
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>
148 </Row>152 </Row>
149 <Row>153 <Row>
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>
@@ -170,6 +174,10 @@
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>
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>
172 </Row>176 </Row>
177 <Row>
178 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Sourcing group')}</Data></Cell>
179 <Cell ss:StyleID="line" ><Data ss:Type="String">${o.related_sourcing_id and o.related_sourcing_id.name or ''|x}</Data></Cell>
180 </Row>
173181
174 % if need_ad and o.analytic_distribution_id:182 % if need_ad and o.analytic_distribution_id:
175 <Row>183 <Row>
@@ -219,6 +227,7 @@
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>
220 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Currency*')}</Data></Cell>228 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Currency*')}</Data></Cell>
221 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Origin*')}</Data></Cell>229 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Origin*')}</Data></Cell>
230 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Stock Take Date')}</Data></Cell>
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>
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>
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>
@@ -256,6 +265,7 @@
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>
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>
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>
268 <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${line.stock_take_date|n}T00:00:00.000</Data></Cell>
259 % if isDate(line.date_planned):269 % if isDate(line.date_planned):
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>
261 % elif isDate(o.delivery_requested_date):271 % elif isDate(o.delivery_requested_date):
262272
=== modified file 'bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako'
--- bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako 2017-11-17 09:15:40 +0000
+++ bin/addons/msf_supply_doc_export/report/report_validated_purchase_order_xml.mako 2018-03-27 07:15:50 +0000
@@ -12,6 +12,7 @@
12 % endif12 % endif
13 <field name="partner_ref">${o.partner_ref or ''|x}</field>13 <field name="partner_ref">${o.partner_ref or ''|x}</field>
14 <field name="details">${o.details or ''|x}</field>14 <field name="details">${o.details or ''|x}</field>
15 <field name="stock_take_date">${o.stock_take_date or ''|x}</field>
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'):
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>
17 % else:18 % else:
@@ -24,14 +25,18 @@
24 <field name="ready_to_ship_date"></field>25 <field name="ready_to_ship_date"></field>
25 % endif26 % endif
26 <field name="dest_address_id" key="name,parent.partner_id">27 <field name="dest_address_id" key="name,parent.partner_id">
27 <field name="name">${o.dest_address_id and o.dest_address_id.name or ''|x}</field>28 % if o.order_type == 'direct':
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>
29 <field name="street2">${o.dest_address_id and o.dest_address_id.street2 or ''|x}</field>30 % else:
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>
31 <field name="city">${o.dest_address_id and o.dest_address_id.city or ''|x}</field>32 % endif
32 <field name="country_id" key="name">33 % if o.order_type == 'direct':
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>
34 </field>35 % else:
36 <field name="delivery_address">${getInstanceName()|x}</field>
37 % endif
38 <field name="customer_name">${getInstanceAddress() or ''|x}</field>
39 <field name="customer_address">${getInstanceName()|x}</field>
35 </field>40 </field>
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'):
37 <field name="shipment_date">${o.shipment_date|n}</field>42 <field name="shipment_date">${o.shipment_date|n}</field>
@@ -42,6 +47,7 @@
42 <field name="origin">${o.origin or ''|x}</field>47 <field name="origin">${o.origin or ''|x}</field>
43 <field name="project_ref">${o.fnct_project_ref or ''|x}</field>48 <field name="project_ref">${o.fnct_project_ref or ''|x}</field>
44 <field name="message_esc">${o.message_esc or ''|x}</field>49 <field name="message_esc">${o.message_esc or ''|x}</field>
50 <field name="related_sourcing_id">${o.related_sourcing_id and o.related_sourcing_id.name or ''|x}</field>
45 <field name="analytic_distribution_id">51 <field name="analytic_distribution_id">
46 % if need_ad and o.analytic_distribution_id:52 % if need_ad and o.analytic_distribution_id:
47 % for ccl in o.analytic_distribution_id.cost_center_lines:53 % for ccl in o.analytic_distribution_id.cost_center_lines:
@@ -71,6 +77,7 @@
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>
72 </field>78 </field>
73 <field name="origin">${l.origin or ''|x}</field>79 <field name="origin">${l.origin or ''|x}</field>
80 <field name="stock_take_date">${l.stock_take_date or ''|x}</field>
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'):
75 <field name="date_planned">${l.date_planned|n}</field>82 <field name="date_planned">${l.date_planned|n}</field>
76 % else:83 % else:
7784
=== modified file 'bin/addons/purchase/purchase_order.py'
--- bin/addons/purchase/purchase_order.py 2018-02-22 14:23:17 +0000
+++ bin/addons/purchase/purchase_order.py 2018-03-27 07:15:50 +0000
@@ -646,8 +646,8 @@
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),
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),
648648
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"),
650 'dest_address_id':fields.many2one('res.partner.address', 'Destination Address',650 'dest_address_id': fields.many2one('res.partner.address', 'Destination Address',
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." \
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."
653 ),653 ),

Subscribers

People subscribed via source and target branches

to all changes: