Skip to content

Commit

Permalink
[MIG] membership_delegated_partner: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinafernandez-tecnativa committed Sep 25, 2023
1 parent a52bd1e commit 4d06d4c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
3 changes: 2 additions & 1 deletion membership_delegated_partner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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)",
Expand Down
1 change: 1 addition & 0 deletions membership_delegated_partner/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Pedro M. Baeza
* Rafael Blasco
* David Vidal
* Carolina Fernandez

* `Onestein <https://onestein.eu>`__:

Expand Down
1 change: 1 addition & 0 deletions membership_delegated_partner/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Pedro M. Baeza</li>
<li>Rafael Blasco</li>
<li>David Vidal</li>
<li>Carolina Fernandez</li>
</ul>
</li>
<li><a class="reference external" href="https://onestein.eu">Onestein</a>:<ul>
Expand Down
13 changes: 5 additions & 8 deletions membership_delegated_partner/tests/test_membership_delegate.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
}
)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -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)
6 changes: 2 additions & 4 deletions membership_delegated_partner/views/account_move.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
<record id="invoice_form_view" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field
name="groups_id"
eval="[(4, ref('membership_delegated_partner.group_delegated_member'))]"
/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="delegated_member_id" invisible="1" />
<field
name="delegated_member_id"
attrs="{'invisible':[('move_type', 'not in', ('out_invoice', 'out_refund'))]}"
groups="membership_delegated_partner.group_delegated_member"
/>
</field>
</field>
Expand Down

0 comments on commit 4d06d4c

Please sign in to comment.