Skip to content

Commit

Permalink
[IMP] account_receipt_sale: Move Partner and Fiscal Position to base
Browse files Browse the repository at this point in the history
account_receipt_sale (LGPL-3) depends on account_receipt_base (AGPL-3)
  • Loading branch information
SirTakobi authored and OCA-git-bot committed Mar 5, 2024
1 parent b5f8b76 commit c0ce362
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 127 deletions.
8 changes: 4 additions & 4 deletions account_receipt_sale/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Copyright 2018-2019 Simone Rubino
# Copyright 2019 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo)
# Copyright 2020 Giovanni Serra - GSLab.it
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
# Copyright 2023 Simone Rubino - TAKOBI
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Receipts from sales",
"summary": "Generate receipts from sale orders",
Expand All @@ -12,17 +13,16 @@
"website": "https://github.com/OCA/account-invoicing",
"author": "TAKOBI, Agile Business Group, Odoo Community Association (OCA)",
"maintainers": ["eLBati"],
"license": "LGPL-3",
"license": "AGPL-3",
"application": False,
"installable": True,
"preloadable": True,
"depends": [
"account_receipt_base",
"account_receipt_journal",
"sale",
],
"data": [
"views/partner_views.xml",
"views/account_fiscal_position_views.xml",
"views/sale_views.xml",
],
"pre_init_hook": "rename_old_italian_module",
Expand Down
2 changes: 0 additions & 2 deletions account_receipt_sale/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from . import account_fiscal_position
from . import partner
from . import sale
29 changes: 0 additions & 29 deletions account_receipt_sale/models/account_fiscal_position.py

This file was deleted.

21 changes: 0 additions & 21 deletions account_receipt_sale/models/partner.py

This file was deleted.

3 changes: 2 additions & 1 deletion account_receipt_sale/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
If needed, create "receipts" fiscal positions and partners.
- Add your users to "Sale Receipt" group
- Go to Invoicing > Customers > Receipts
3 changes: 3 additions & 0 deletions account_receipt_sale/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
* Simone Rubino
* Sergio Zanchetta <https://github.com/primes2h>
* Giovanni Serra <giovanni@gslab.it>
* `TAKOBI <https://takobi.online>`_:

* Simone Rubino <sir@takobi.online>
2 changes: 1 addition & 1 deletion account_receipt_sale/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Based on `account_receipt_journal`, this module allows to create receipts from sale orders, configuring "receipts" fiscal positions and partners.
Based on `account_receipt_journal`, this module allows to create receipts from sale orders.
43 changes: 2 additions & 41 deletions account_receipt_sale/tests/test_receipts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright 2018 Simone Rubino
# Copyright 2022 Lorenzo Battistini
# Copyright 2023 Simone Rubino - TAKOBI
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.tests import tagged

Expand Down Expand Up @@ -27,13 +29,6 @@ def setUp(self):
"company_id": self.env.user.company_id.id,
}
)
self.receipts_partner = partner_model.create(
{
"name": "Receipts partner",
"use_receipts": True,
"property_account_position_id": self.receipts_fiscal_position.id,
}
)
self.no_receipts_partner = partner_model.create(
{
"name": "No receipts partner",
Expand All @@ -42,40 +37,6 @@ def setUp(self):
}
)

def test_get_receipts_fiscal_pos(self):
"""Test that get_receipts_fiscal_pos gets a receipts
fiscal position"""
receipts_fiscal_pos = self.fiscal_pos_model.get_receipts_fiscal_pos()
self.assertTrue(receipts_fiscal_pos.receipts)

def test_receipts_partner_onchange(self):
"""Test onchange in partner."""
# If the partner uses receipts,
# the fiscal position must have the flag receipts
self.receipts_partner.onchange_use_receipts()
self.assertTrue(self.receipts_partner.property_account_position_id.receipts)

# If the partner does not use receipts
# and it already has a fiscal position that is
# receipts, it must be removed
self.no_receipts_partner.write(
{"property_account_position_id": self.receipts_fiscal_position.id}
)
self.no_receipts_partner.onchange_use_receipts()
self.assertFalse(self.no_receipts_partner.property_account_position_id)

# If the partner does not use receipts
# and it already has a fiscal position that is
# not receipts, it must not be removed
self.no_receipts_partner.write(
{"property_account_position_id": self.no_receipts_fiscal_position.id}
)
self.no_receipts_partner.onchange_use_receipts()
self.assertEqual(
self.no_receipts_partner.property_account_position_id,
self.no_receipts_fiscal_position,
)

def test_order_creation(self):
order_no_receipts = self.sale_model.create(
{
Expand Down
14 changes: 0 additions & 14 deletions account_receipt_sale/views/account_fiscal_position_views.xml

This file was deleted.

14 changes: 0 additions & 14 deletions account_receipt_sale/views/partner_views.xml

This file was deleted.

0 comments on commit c0ce362

Please sign in to comment.