Skip to content

Commit

Permalink
[FIX] sale_exception_credit_limit: credit taken consideration
Browse files Browse the repository at this point in the history
It was not counting draft invoices if they had a sale order linked.
Also happened with downpayments.
  • Loading branch information
jok-adhoc committed Jun 5, 2023
1 parent 9d23669 commit 43a20c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sale_exception_credit_limit/__manifest__.py
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Sale Exception Credit Limit',
'version': "16.0.1.1.0",
'version': "16.0.1.2.0",
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
Expand Down
3 changes: 2 additions & 1 deletion sale_exception_credit_limit/models/res_partner.py
Expand Up @@ -60,7 +60,8 @@ def _compute_credit_with_confirmed_orders(self):
('move_id.partner_id.commercial_partner_id', '=', self.commercial_partner_id.id),
('move_id.move_type', 'in', ['out_invoice', 'out_refund']),
('move_id.state', '=', 'draft'),
('sale_line_ids', '=', False)]
'|',('sale_line_ids', '=', False),
('sale_line_ids.order_id.invoice_status', '=', 'invoiced')]
draft_invoice_lines = self.env['account.move.line'].search(domain)
draft_invoice_lines_amount = 0.0
for line in draft_invoice_lines:
Expand Down

0 comments on commit 43a20c9

Please sign in to comment.