Skip to content

Commit

Permalink
FIX two stupid bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via authored and V3st1g3 committed Dec 11, 2024
1 parent e94165a commit f69cfcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions account_invoice_import/wizard/account_invoice_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def update_invoice_lines(self, parsed_inv, invoice, seller):
'line': eline,
'price_unit': price_unit,
})
compare_res = self.compare_lines(
compare_res = self.env['business.document.import'].compare_lines(
existing_lines, parsed_inv['lines'], chatter, seller=seller)
for eline, cdict in compare_res['to_update'].iteritems():
write_vals = {}
Expand Down Expand Up @@ -522,8 +522,7 @@ def update_invoice_lines(self, parsed_inv, invoice, seller):
to_create_label = []
for add in compare_res['to_add']:
line_vals = self._prepare_create_invoice_line(
add['product'], add['uom'], add['import_line'])
line_vals['invoice_id'] = invoice.id
add['product'], add['uom'], add['import_line'], invoice)
new_line = ailo.create(line_vals)
to_create_label.append('%s %s x %s' % (
new_line.quantity,
Expand All @@ -534,7 +533,7 @@ def update_invoice_lines(self, parsed_inv, invoice, seller):
return True

@api.model
def _prepare_create_order_line(self, product, uom, import_line, invoice):
def _prepare_create_invoice_line(self, product, uom, import_line, invoice):
ailo = self.env['account.invoice.line']
vals = ailo.product_id_change(
product.id, uom.id, qty=import_line['qty'], type='in_invoice',
Expand All @@ -546,6 +545,7 @@ def _prepare_create_order_line(self, product, uom, import_line, invoice):
'product_id': product.id,
'price_unit': import_line.get('price_unit'),
'quantity': import_line['qty'],
'invoice_id': invoice.id,
})
return vals

Expand Down

0 comments on commit f69cfcf

Please sign in to comment.