Skip to content

Commit

Permalink
Merge pull request #58 from CompassionCH/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
ecino authored Mar 9, 2018
2 parents 1b2f8fa + d2b575e commit 94ca916
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def process_reconciliation(self, counterpart_aml_dicts=None,
counterparts, self.env['account.move.line'])
index = 0
for mv_line_dict in new_aml_dicts:
# Add partner_id if missing from mvl_data
mv_line_dict['partner_id'] = partner_id
if mv_line_dict.get('product_id'):
# Create invoice
if partner_id in partner_inv_data:
Expand Down Expand Up @@ -208,7 +210,7 @@ def _find_open_invoice(self, mv_line_dicts):
for mv_line_dict in mv_line_dicts:
amount = mv_line_dict['credit']
inv_lines |= invoice_line_obj.search([
('partner_id', '=', mv_line_dict.get('partner_id')),
('partner_id', 'child_of', mv_line_dict.get('partner_id')),
('invoice_id.state', 'in', ('open', 'draft')),
('product_id', '=', mv_line_dict.get('product_id')),
('price_subtotal', '=', amount)])
Expand Down
5 changes: 3 additions & 2 deletions account_statement_completion/models/completion_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get_from_move_line_ref(self, stmts_vals, st_line):
partner = move_lines[0].partner_id

if partner:
res['partner_id'] = partner.id
res['partner_id'] = partner.commercial_partner_id.id

return res

Expand All @@ -141,5 +141,6 @@ def get_from_payment_line(self, stmt_vals, st_line):
('name', '=', ref)
], limit=1, order='date desc')
if payment_line:
res['partner_id'] = payment_line.partner_id.id
res['partner_id'] = payment_line.partner_id.\
commercial_partner_id.id
return res

0 comments on commit 94ca916

Please sign in to comment.