Merge lp:~camptocamp/openerp-connector-magento/7.0-cod-1271537 into lp:~openerp-connector-core-editors/openerp-connector-magento/7.0

Proposed by Guewen Baconnier @ Camptocamp
Status: Merged
Merged at revision: 953
Proposed branch: lp:~camptocamp/openerp-connector-magento/7.0-cod-1271537
Merge into: lp:~openerp-connector-core-editors/openerp-connector-magento/7.0
Diff against target: 59 lines (+5/-26)
1 file modified
magentoerpconnect/sale.py (+5/-26)
To merge this branch: bzr merge lp:~camptocamp/openerp-connector-magento/7.0-cod-1271537
Reviewer Review Type Date Requested Status
Jan-Philipp Fischer (community) tested Approve
OpenERP Connector Core Editors Pending
Review via email: mp+202680@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Jan-Philipp Fischer (jan-philipp-fischer) wrote :

Tested and seems to be working. Approved.

review: Approve (tested)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Thanks for your review!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'magentoerpconnect/sale.py'
--- magentoerpconnect/sale.py 2014-01-14 11:00:20 +0000
+++ magentoerpconnect/sale.py 2014-01-22 14:37:42 +0000
@@ -686,13 +686,13 @@
686686
687 def _add_shipping_line(self, map_record, values):687 def _add_shipping_line(self, map_record, values):
688 record = map_record.source688 record = map_record.source
689 amount_incl = float(record.get('base_shipping_incl_tax', 0.0))689 amount_incl = float(record.get('base_shipping_incl_tax') or 0.0)
690 amount_excl = float(record.get('shipping_amount', 0.0))690 amount_excl = float(record.get('shipping_amount') or 0.0)
691 if not (amount_incl or amount_excl):691 if not (amount_incl or amount_excl):
692 return values692 return values
693 line_builder = self.get_connector_unit_for_model(MagentoShippingLineBuilder)693 line_builder = self.get_connector_unit_for_model(MagentoShippingLineBuilder)
694 if self.options.tax_include:694 if self.options.tax_include:
695 discount = float(record.get('shipping_discount_amount', 0.0))695 discount = float(record.get('shipping_discount_amount') or 0.0)
696 line_builder.price_unit = (amount_incl - discount)696 line_builder.price_unit = (amount_incl - discount)
697 else:697 else:
698 line_builder.price_unit = amount_excl698 line_builder.price_unit = amount_excl
@@ -708,8 +708,8 @@
708708
709 def _add_cash_on_delivery_line(self, map_record, values):709 def _add_cash_on_delivery_line(self, map_record, values):
710 record = map_record.source710 record = map_record.source
711 amount_excl = float(record.get('cod_fee', 0.0))711 amount_excl = float(record.get('cod_fee') or 0.0)
712 amount_incl = float(record.get('cod_tax_amount', 0.0))712 amount_incl = float(record.get('cod_tax_amount') or 0.0)
713 if not (amount_excl or amount_incl):713 if not (amount_excl or amount_incl):
714 return values714 return values
715 line_builder = self.get_connector_unit_for_model(MagentoCashOnDeliveryLineBuilder)715 line_builder = self.get_connector_unit_for_model(MagentoCashOnDeliveryLineBuilder)
@@ -778,27 +778,6 @@
778 return {'payment_method_id': method_id}778 return {'payment_method_id': method_id}
779779
780 @mapping780 @mapping
781 def cod_fee(self, record): # cash on delivery
782 # TODO Map Me (sic)
783 pass
784
785 @mapping
786 def gift_cert_amount(self, record):
787 if 'gift_cert_amount' in record:
788 result = {'gift_certificates_amount': record['gift_cert_amount']}
789 else:
790 result = {}
791 return result
792
793 @mapping
794 def gift_cert_code(self, record):
795 if 'gift_cert_code' in record:
796 result = {'gift_certificates_code': record['gift_cert_code']}
797 else:
798 result = {}
799 return result
800
801 @mapping
802 def shipping_method(self, record):781 def shipping_method(self, record):
803 session = self.session782 session = self.session
804 ifield = record.get('shipping_method')783 ifield = record.get('shipping_method')