diff --git a/account_compensate_advance/README.rst b/account_compensate_advance/README.rst new file mode 100644 index 0000000..41841f5 --- /dev/null +++ b/account_compensate_advance/README.rst @@ -0,0 +1,96 @@ +=============== +Account Advance +=============== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b31048a0d09e9bb80e5a67333760d5339ecf9df289bb9d7d742276a8ac6d79b5 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-Escodoo%2Faccount--addons-lightgray.png?logo=github + :target: https://github.com/Escodoo/account-addons/tree/14.0/account_compensate_advance + :alt: Escodoo/account-addons + +|badge1| |badge2| |badge3| + +The Account Compensate Advance enhances the accounting functionality in Odoo by enabling advanced handling of advances for suppliers and customers. This module streamlines the process of creating, managing, and compensating advances, ensuring accurate financial. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +After installing the module, follow these steps to configure it for the desired company: + +#. Go to Invoice > Configuration > Journals. +#. Select an existing journal or create a new one of type Miscellaneous. +#. In the journal view, click on the Advance Journal tab. +#. Set the journal type to Advance. +#. Specify the Advance Account Type (Supplier or Customer). +#. Specify the Account where the advance will be recorded. + +Usage +===== + +To use this module: + +#. Ensure you have a Miscellaneous type journal configured as an Advance Journal with the appropriate settings. +#. Select the type of invoice to be created/used (In Invoice or Out Invoice). +#. In the Supplier/Customer menu, access the Advance submenu. +#. Create an advance through the Advance menu. +#. Create or select an invoice for the partner specified in the advance. +#. Once the invoice status is posted, a button to Compensate the Advance will appear at the top of the screen. +#. Select an Advance Journal. +#. Select the created advance for that journal. +#. Select the invoice line to be compensated. +#. The amount will be displayed according to the invoice line, allowing modifications as long as it is not less than 0 or more than the line amount. +#. The Entry Date corresponds to the invoice line date but can be changed to another date. +#. After filling in the necessary fields, click Compensate. +#. You will be redirected back to the invoice with the payment status updated to either Partial or Paid, depending on the amount entered. +#. To view advances, go to Supplier/Customer > Advance > Advances. The movements will be displayed in a tree view, and compensations will be separated by the advance reference when created. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Escodoo + +Contributors +~~~~~~~~~~~~ + +* `Escodoo `_: + + * Marcel Savegnago + * Kaynnan Lemes + * Douglas Custodio + +Maintainers +~~~~~~~~~~~ + +This module is part of the `Escodoo/account-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/account_compensate_advance/__init__.py b/account_compensate_advance/__init__.py new file mode 100644 index 0000000..9b42961 --- /dev/null +++ b/account_compensate_advance/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/account_compensate_advance/__manifest__.py b/account_compensate_advance/__manifest__.py new file mode 100644 index 0000000..915828d --- /dev/null +++ b/account_compensate_advance/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2024 - TODAY, Escodoo +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Account Advance", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "author": "Escodoo", + "website": "https://github.com/Escodoo/account-addons", + "depends": ["account"], + "data": [ + "security/ir.model.access.csv", + "views/account_move_views.xml", + "views/account_menuitem.xml", + "views/account_journal.xml", + "wizard/account_create_advance_journal.xml", + "wizard/account_compensate_advance_journal.xml", + ], +} diff --git a/account_compensate_advance/models/__init__.py b/account_compensate_advance/models/__init__.py new file mode 100644 index 0000000..ea6d653 --- /dev/null +++ b/account_compensate_advance/models/__init__.py @@ -0,0 +1,2 @@ +from . import account_move +from . import account_journal diff --git a/account_compensate_advance/models/account_journal.py b/account_compensate_advance/models/account_journal.py new file mode 100644 index 0000000..2a67afc --- /dev/null +++ b/account_compensate_advance/models/account_journal.py @@ -0,0 +1,50 @@ +# Copyright 2024 - TODAY, Kaynnan Lemes +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, api, fields, models + +ACCOUNT_TYPES = [ + ("supplier", _("Supplier")), + ("customer", _("Customer")), +] +DOMAIN_ADVANCE_ACCOUNT = [ + ("user_type_id.type", "!=", "payable"), + ("user_type_id.type", "!=", "receivable"), + ("reconcile", "=", True), +] + + +class AccountJournal(models.Model): + + _inherit = "account.journal" + + is_advance_journal = fields.Boolean( + string="Is Advance Journal", + help="Check this box if this journal is for advances", + ) + + advance_account_type = fields.Selection( + selection=ACCOUNT_TYPES, + string="Advance Account Type", + help="Select the type of advance account to be filled", + default="supplier", + ) + + advance_account_supplier_id = fields.Many2one( + "account.account", + string="Advance Account for Suppliers", + domain=DOMAIN_ADVANCE_ACCOUNT, + help="Advance account for supplier payments", + ) + + advance_account_customer_id = fields.Many2one( + "account.account", + string="Advance Account for Customers", + domain=DOMAIN_ADVANCE_ACCOUNT, + help="Advance account for customer payments", + ) + + @api.onchange("advance_account_type", "is_advance_journal") + def _onchange_clear_advance_account_info(self): + self.advance_account_supplier_id = False + self.advance_account_customer_id = False diff --git a/account_compensate_advance/models/account_move.py b/account_compensate_advance/models/account_move.py new file mode 100644 index 0000000..935a181 --- /dev/null +++ b/account_compensate_advance/models/account_move.py @@ -0,0 +1,28 @@ +# Copyright 2024 - TODAY, Kaynnan Lemes +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, fields, models + + +class AccountMove(models.Model): + + _inherit = "account.move" + + is_advance_move = fields.Boolean( + string="Advance Move", + ) + + def action_compensate_advance(self): + + return { + "name": _("Compensate Advance"), + "res_model": "account.compensate.advance.journal", + "view_mode": "form", + "context": { + "active_model": "account.move", + "active_ids": self.ids, + "default_move_type": self.env.context.get("default_move_type"), + }, + "target": "new", + "type": "ir.actions.act_window", + } diff --git a/account_compensate_advance/readme/CONFIGURE.rst b/account_compensate_advance/readme/CONFIGURE.rst new file mode 100644 index 0000000..02a12a9 --- /dev/null +++ b/account_compensate_advance/readme/CONFIGURE.rst @@ -0,0 +1,8 @@ +After installing the module, follow these steps to configure it for the desired company: + +#. Go to Invoice > Configuration > Journals. +#. Select an existing journal or create a new one of type Miscellaneous. +#. In the journal view, click on the Advance Journal tab. +#. Set the journal type to Advance. +#. Specify the Advance Account Type (Supplier or Customer). +#. Specify the Account where the advance will be recorded. diff --git a/account_compensate_advance/readme/CONTRIBUTORS.rst b/account_compensate_advance/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..77968e7 --- /dev/null +++ b/account_compensate_advance/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* `Escodoo `_: + + * Marcel Savegnago + * Kaynnan Lemes + * Douglas Custodio diff --git a/account_compensate_advance/readme/DESCRIPTION.rst b/account_compensate_advance/readme/DESCRIPTION.rst new file mode 100644 index 0000000..ae3fb69 --- /dev/null +++ b/account_compensate_advance/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +The Account Compensate Advance enhances the accounting functionality in Odoo by enabling advanced handling of advances for suppliers and customers. This module streamlines the process of creating, managing, and compensating advances, ensuring accurate financial. diff --git a/account_compensate_advance/readme/USAGE.rst b/account_compensate_advance/readme/USAGE.rst new file mode 100644 index 0000000..2229daf --- /dev/null +++ b/account_compensate_advance/readme/USAGE.rst @@ -0,0 +1,16 @@ +To use this module: + +#. Ensure you have a Miscellaneous type journal configured as an Advance Journal with the appropriate settings. +#. Select the type of invoice to be created/used (In Invoice or Out Invoice). +#. In the Supplier/Customer menu, access the Advance submenu. +#. Create an advance through the Advance menu. +#. Create or select an invoice for the partner specified in the advance. +#. Once the invoice status is posted, a button to Compensate the Advance will appear at the top of the screen. +#. Select an Advance Journal. +#. Select the created advance for that journal. +#. Select the invoice line to be compensated. +#. The amount will be displayed according to the invoice line, allowing modifications as long as it is not less than 0 or more than the line amount. +#. The Entry Date corresponds to the invoice line date but can be changed to another date. +#. After filling in the necessary fields, click Compensate. +#. You will be redirected back to the invoice with the payment status updated to either Partial or Paid, depending on the amount entered. +#. To view advances, go to Supplier/Customer > Advance > Advances. The movements will be displayed in a tree view, and compensations will be separated by the advance reference when created. diff --git a/account_compensate_advance/security/ir.model.access.csv b/account_compensate_advance/security/ir.model.access.csv new file mode 100644 index 0000000..814d383 --- /dev/null +++ b/account_compensate_advance/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_create_advance,account.create.advance.journal,model_account_create_advance_journal,account.group_account_invoice,1,1,1,1 +access_account_compensate_advance,account.compensate.advance.journal,model_account_compensate_advance_journal,account.group_account_invoice,1,1,1,1 diff --git a/account_compensate_advance/static/description/icon.png b/account_compensate_advance/static/description/icon.png new file mode 100644 index 0000000..12ab005 Binary files /dev/null and b/account_compensate_advance/static/description/icon.png differ diff --git a/account_compensate_advance/static/description/index.html b/account_compensate_advance/static/description/index.html new file mode 100644 index 0000000..6815766 --- /dev/null +++ b/account_compensate_advance/static/description/index.html @@ -0,0 +1,454 @@ + + + + + +Account Advance + + + +
+

Account Advance

+ + +

Beta License: AGPL-3 Escodoo/account-addons

+

The Account Compensate Advance enhances the accounting functionality in Odoo by enabling advanced handling of advances for suppliers and customers. This module streamlines the process of creating, managing, and compensating advances, ensuring accurate financial.

+

Table of contents

+ +
+

Configuration

+

After installing the module, follow these steps to configure it for the desired company:

+
    +
  1. Go to Invoice > Configuration > Journals.
  2. +
  3. Select an existing journal or create a new one of type Miscellaneous.
  4. +
  5. In the journal view, click on the Advance Journal tab.
  6. +
  7. Set the journal type to Advance.
  8. +
  9. Specify the Advance Account Type (Supplier or Customer).
  10. +
  11. Specify the Account where the advance will be recorded.
  12. +
+
+
+

Usage

+

To use this module:

+
    +
  1. Ensure you have a Miscellaneous type journal configured as an Advance Journal with the appropriate settings.
  2. +
  3. Select the type of invoice to be created/used (In Invoice or Out Invoice).
  4. +
  5. In the Supplier/Customer menu, access the Advance submenu.
  6. +
  7. Create an advance through the Advance menu.
  8. +
  9. Create or select an invoice for the partner specified in the advance.
  10. +
  11. Once the invoice status is posted, a button to Compensate the Advance will appear at the top of the screen.
  12. +
  13. Select an Advance Journal.
  14. +
  15. Select the created advance for that journal.
  16. +
  17. Select the invoice line to be compensated.
  18. +
  19. The amount will be displayed according to the invoice line, allowing modifications as long as it is not less than 0 or more than the line amount.
  20. +
  21. The Entry Date corresponds to the invoice line date but can be changed to another date.
  22. +
  23. After filling in the necessary fields, click Compensate.
  24. +
  25. You will be redirected back to the invoice with the payment status updated to either Partial or Paid, depending on the amount entered.
  26. +
  27. To view advances, go to Supplier/Customer > Advance > Advances. The movements will be displayed in a tree view, and compensations will be separated by the advance reference when created.
  28. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Escodoo
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the Escodoo/account-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/account_compensate_advance/views/account_journal.xml b/account_compensate_advance/views/account_journal.xml new file mode 100644 index 0000000..9fbbb7c --- /dev/null +++ b/account_compensate_advance/views/account_journal.xml @@ -0,0 +1,128 @@ + + + + + + account.journal.form (in account_compensate_advance) + account.journal + + + + + + + + + + + + + + + + + + + + account.journal.kanban in (account_compensate_advance) + account.journal + + + + + + + +
+
+
+ + Advance + +
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+ + Advance + +
+
+
+
+ +
+
+ +
+
+
+
+
+
+ + +
diff --git a/account_compensate_advance/views/account_menuitem.xml b/account_compensate_advance/views/account_menuitem.xml new file mode 100644 index 0000000..d0501fe --- /dev/null +++ b/account_compensate_advance/views/account_menuitem.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + diff --git a/account_compensate_advance/views/account_move_views.xml b/account_compensate_advance/views/account_move_views.xml new file mode 100644 index 0000000..6613e4b --- /dev/null +++ b/account_compensate_advance/views/account_move_views.xml @@ -0,0 +1,75 @@ + + + + + + + account.move.form in (account_compensate_advance) + account.move + + + +