@@ -337,18 +337,21 @@ def sales_team(self, record):
337337 team = self .options .storeview .team_id
338338 if team :
339339 return {'team_id' : team .id }
340+ return {}
340341
341342 @mapping
342343 def analytic_account_id (self , record ):
343344 analytic_account_id = self .options .storeview .account_analytic_id
344345 if analytic_account_id :
345346 return {'analytic_account_id' : analytic_account_id .id }
347+ return {}
346348
347349 @mapping
348350 def fiscal_position (self , record ):
349351 fiscal_position = self .options .storeview .fiscal_position_id
350352 if fiscal_position :
351353 return {'fiscal_position_id' : fiscal_position .id }
354+ return {}
352355
353356 @mapping
354357 def warehouse_id (self , record ):
@@ -358,6 +361,7 @@ def warehouse_id(self, record):
358361 'warehouse_id' : warehouse .id ,
359362 'company_id' : warehouse .company_id .id ,
360363 }
364+ return {}
361365
362366 # partner_id, partner_invoice_id, partner_shipping_id
363367 # are done in the importer
@@ -744,6 +748,10 @@ def discount_amount(self, record):
744748 discount = 100 * discount_value / row_total
745749 else :
746750 discount = 100 * discount_value / (row_total + discount_value )
751+ elif discount_value > 0 and row_total == 0 :
752+ discount = 100
753+
754+ discount = min (discount , 100 )
747755 result = {'discount' : discount }
748756 return result
749757
0 commit comments