From 4d06d4c4839b6efd60220ab62b93ae0bcf116770 Mon Sep 17 00:00:00 2001 From: Carolina Fernandez Date: Mon, 25 Sep 2023 12:14:19 -0300 Subject: [PATCH] [MIG] membership_delegated_partner: Migration to 16.0 --- membership_delegated_partner/__manifest__.py | 3 ++- .../readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 1 + .../tests/test_membership_delegate.py | 13 +++++-------- membership_delegated_partner/views/account_move.xml | 6 ++---- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/membership_delegated_partner/__manifest__.py b/membership_delegated_partner/__manifest__.py index 8d687f09..b766e020 100644 --- a/membership_delegated_partner/__manifest__.py +++ b/membership_delegated_partner/__manifest__.py @@ -1,9 +1,10 @@ # Copyright 2017 Tecnativa - David Vidal # Copyright 2018 Tecnativa - Pedro M. Baeza +# Copyright 2023 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Membership Delegate Partner", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "development_status": "Production/Stable", "category": "Membership", "author": "Tecnativa, Onestein, Odoo Community Association (OCA)", diff --git a/membership_delegated_partner/readme/CONTRIBUTORS.rst b/membership_delegated_partner/readme/CONTRIBUTORS.rst index 29633fe6..186cbea4 100644 --- a/membership_delegated_partner/readme/CONTRIBUTORS.rst +++ b/membership_delegated_partner/readme/CONTRIBUTORS.rst @@ -3,6 +3,7 @@ * Pedro M. Baeza * Rafael Blasco * David Vidal + * Carolina Fernandez * `Onestein `__: diff --git a/membership_delegated_partner/static/description/index.html b/membership_delegated_partner/static/description/index.html index 84d1e954..18f8923d 100644 --- a/membership_delegated_partner/static/description/index.html +++ b/membership_delegated_partner/static/description/index.html @@ -422,6 +422,7 @@

Contributors

  • Pedro M. Baeza
  • Rafael Blasco
  • David Vidal
  • +
  • Carolina Fernandez
  • Onestein:
      diff --git a/membership_delegated_partner/tests/test_membership_delegate.py b/membership_delegated_partner/tests/test_membership_delegate.py index 0e24292d..37b0af8e 100644 --- a/membership_delegated_partner/tests/test_membership_delegate.py +++ b/membership_delegated_partner/tests/test_membership_delegate.py @@ -1,5 +1,6 @@ # Copyright 2017 Tecnativa - David Vidal # Copyright 2019 Onestein - Andrea Stirpe +# Copyright 2023 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import fields @@ -17,17 +18,14 @@ def setUpClass(cls): "name": "Test membership product", "membership": True, "membership_date_from": "2017-01-01", - "membership_date_to": "2017-12-31", + "membership_date_to": "2017-12-31" } ) - cls.account_type = cls.env["account.account.type"].create( - {"name": "Test", "type": "receivable", "internal_group": "asset"} - ) cls.account = cls.env["account.account"].create( { "name": "Test account", "code": "TEST", - "user_type_id": cls.account_type.id, + "account_type": "asset_receivable", "reconcile": True, } ) @@ -63,7 +61,7 @@ def test_01_delegate(self): self.partner2.member_lines.write( { "partner": self.partner1.id, - "account_invoice_line": invoice.invoice_line_ids[0].id, + "account_invoice_line": invoice.line_ids[0].id, } ) self.assertFalse(self.partner1.member_lines, "It's going to stand on partner2") @@ -103,7 +101,6 @@ def test_03_refund_invoice_delegated_partner(self): move_form.partner_id = self.partner1 with move_form.invoice_line_ids.new() as line_form: line_form.product_id = self.product - line_form.account_id = self.account line_form.price_unit = 1.0 invoice = move_form.save() invoice.write({"delegated_member_id": self.partner2.id}) @@ -143,7 +140,7 @@ def test_04_get_partner_for_membership(self): "price_unit": 1.0, } ) - get_member = invoice.invoice_line_ids[0]._get_partner_for_membership + get_member = invoice.line_ids[0]._get_partner_for_membership self.assertEqual(get_member(), self.partner2) invoice.delegated_member_id = False self.assertEqual(get_member(), self.partner1) diff --git a/membership_delegated_partner/views/account_move.xml b/membership_delegated_partner/views/account_move.xml index 900396b8..323a86c7 100644 --- a/membership_delegated_partner/views/account_move.xml +++ b/membership_delegated_partner/views/account_move.xml @@ -3,15 +3,13 @@ account.move - +