diff --git a/partner_time_to_pay/__manifest__.py b/partner_time_to_pay/__manifest__.py index 69933da6f..b11a3a808 100644 --- a/partner_time_to_pay/__manifest__.py +++ b/partner_time_to_pay/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Partner Time to Pay", "summary": "Add receivables and payables statistics to partners", - "version": "15.0.1.2.0", + "version": "16.0.1.0.0", "license": "AGPL-3", "development_status": "Beta", "author": "Open Source Integrators, Odoo Community Association (OCA), Moduon", diff --git a/partner_time_to_pay/models/account_move.py b/partner_time_to_pay/models/account_move.py index 84a855041..f0a8060ee 100644 --- a/partner_time_to_pay/models/account_move.py +++ b/partner_time_to_pay/models/account_move.py @@ -22,8 +22,8 @@ def _compute_full_reconcile_payment_date(self): if move.payment_state in in_payment_states: if not move.full_reconcile_payment_date: valid_accounts = move.line_ids.filtered( - lambda ml: ml.account_id.user_type_id.type - in {"receivable", "payable"} + lambda ml: ml.account_id.account_type + in {"asset_receivable", "liability_payable"} ).mapped("account_id") reconciled_moves = ( aml_model.search( diff --git a/partner_time_to_pay/tests/test_partner_time_to_pay.py b/partner_time_to_pay/tests/test_partner_time_to_pay.py index dc6d154f9..0fc7b64a3 100644 --- a/partner_time_to_pay/tests/test_partner_time_to_pay.py +++ b/partner_time_to_pay/tests/test_partner_time_to_pay.py @@ -24,13 +24,12 @@ def setUp(self): } ) self.time_to_pay_days = 10 - product = self.env.ref("product.product_product_4") # Create invoice for last year move_form_ly = Form(am_model.with_context(default_move_type="out_invoice")) move_form_ly.partner_id = self.partner.child_ids[0] move_form_ly.invoice_date = today - timedelta(days=365) with move_form_ly.invoice_line_ids.new() as line_form_ly: - line_form_ly.product_id = product + line_form_ly.name = "Inv Line Partner Time To Pay LY" line_form_ly.price_unit = 100.0 line_form_ly.quantity = 10.0 invoice_ly = move_form_ly.save() @@ -50,7 +49,7 @@ def setUp(self): move_form_ty.partner_id = self.partner.child_ids[0] move_form_ty.invoice_date = today with move_form_ty.invoice_line_ids.new() as line_form_ty: - line_form_ty.product_id = product + line_form_ly.name = "Inv Line Partner Time To Pay TY" line_form_ty.price_unit = 100.0 line_form_ty.quantity = 10.0 invoice_ty = move_form_ty.save()