Skip to content
Permalink
Browse files

fixup dbe review

  • Loading branch information...
jem-odoo committed Mar 26, 2019
1 parent 64a87f8 commit e241c4362763b6f11b4720011df6c64414bbde82
Showing with 3 additions and 8 deletions.
  1. +3 −8 addons/sale/models/account_move.py
@@ -27,8 +27,7 @@ def _prepare_analytic_line(self):
map_sale_line_per_move = move_to_reinvoice._sale_create_reinvoice_sale_line()

for values in values_list:
move_line_id = values.get('move_id')
sale_line = map_sale_line_per_move.get(move_line_id)
sale_line = map_sale_line_per_move.get(values.get('move_id'))
if sale_line:
values['so_line'] = sale_line.id

@@ -83,8 +82,7 @@ def _sale_create_reinvoice_sale_line(self):
('is_expense', '=', True),
], limit=1)
if sale_line: # found existing one, so keep the browse record
map_move_sale_line[move_line.id] = sale_line
existing_sale_line_cache[map_entry_key] = sale_line
map_move_sale_line[move_line.id] = existing_sale_line_cache[map_entry_key] = sale_line
else: # should be create, so use the index of creation values instead of browse record
# save value to create it
sale_line_values_to_create.append(move_line._sale_prepare_sale_line_values(sale_order, price))
@@ -130,10 +128,7 @@ def _sale_determine_order(self):
mapping[sale_order.analytic_account_id.id] = sale_order

# map of AAL index with the SO on which it needs to be reinvoiced. Maybe be None if no SO found
result = {}
for move_line in self:
result[move_line.id] = mapping.get(move_line.analytic_account_id.id)
return result
return {move_line.id: mapping.get(move_line.analytic_account_id.id) for move_line in self}

@api.multi
def _sale_prepare_sale_line_values(self, order, price):

0 comments on commit e241c43

Please sign in to comment.
You can’t perform that action at this time.