diff --git a/account_payment_credit_card/README.rst b/account_payment_credit_card/README.rst new file mode 100644 index 000000000000..8d3f3a3225a7 --- /dev/null +++ b/account_payment_credit_card/README.rst @@ -0,0 +1,125 @@ +==================== +Credit Card Payments +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:263b2ace78923cfef5795af035b7bd38381cce7073fd49a0e35ba65a022c7025 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-OCA%2Faccount--payment-lightgray.png?logo=github + :target: https://github.com/OCA/account-payment/tree/16.0/account_payment_credit_card + :alt: OCA/account-payment +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-payment-16-0/account-payment-16-0-account_payment_credit_card + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-payment&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module provides a way to record Credit Card purchases and to pay them the same way regular purchases are recorded (via Vendor Bills) and paid (via Vendor Payments). + +By default, if vendor bills are used to record credit card purchases, the liability (AP) from the supplier/vendor must be moved to the credit card company via a manual journal entry. + +Because a journal entry contains less information than a vendor bill, there may be a loss of information that affects book keeping accuracy and the ability to properly reconcile the AP amount when the credit card statement arrives and needs to be settled. +This method also requires an additional step not needed when a vendor bill is paid via bank or cash. + +This module automates the creation of the manual journal entry required to move the AP to the credit card company, retains all information about the purchase in an invoice document, and leverages the standard purchase and payment workflow already in place for bank and cash payments. + +It supports as many Credit Cards as are needed, configured in the same way an additional payment method would be (i.e. via the creation of a new journal). + +To settle a Credit Card statement, the regular workflow to record a vendor payment is used – allowing the removal of charges not included in the statement. +Non-purchase transactions like fees for annual membership, balance transfers, cash advances and foreign transactions; as well as charges for late payments and returned checks; can be entered either as Vendor Invoices or manual Journal Entries as users elect. + +Both of these methods will allow these items to be settled when making a payment to the credit card company. + +This module also supports payment cancellation and re-entry (in the case a mistaken amount is entered) as well as refunds (where the purchase is returned and a credit from the credit card company will be issued). + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +* Go to Accounting > Configuration > Journals +* Create a new journal bank for your credit card +* Check the box ‘Transfer AP to Credit Card Company’ and set the ‘Credit Card Company’ field + +Usage +===== + +To use this module, you need to: + +#. Go to Accounting > Purchases > Vendors Bills +#. Select an open bill and click on Register Payment +#. Select the credit card journal and validate the payment + +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 +~~~~~~~ + +* Open Source Integrators + +Contributors +~~~~~~~~~~~~ + +* `Open Source Integrators `_: + + * Ray Carnes + * Balaji Kannan + * Bhavesh Odedra + * Sudarshan Kadalazhi + * Freni Patel + +* Odoo Dev Team: DS, JA +* Nikul Chaudhary + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px + :target: https://github.com/max3903 + :alt: max3903 + +Current `maintainer `__: + +|maintainer-max3903| + +This module is part of the `OCA/account-payment `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_payment_credit_card/__init__.py b/account_payment_credit_card/__init__.py new file mode 100644 index 000000000000..66746263931a --- /dev/null +++ b/account_payment_credit_card/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2017 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/account_payment_credit_card/__manifest__.py b/account_payment_credit_card/__manifest__.py new file mode 100644 index 000000000000..229d4ec46656 --- /dev/null +++ b/account_payment_credit_card/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2017 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Credit Card Payments", + "summary": "Add support for credit card payments", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Open Source Integrators, Odoo Community Association (OCA)", + "category": "Accounting & Finance", + "website": "https://github.com/OCA/account-payment", + "depends": ["account"], + "data": ["views/account_view.xml"], + "installable": True, + "development_status": "Beta", + "maintainers": ["max3903"], +} diff --git a/account_payment_credit_card/i18n/account_payment_credit_card.pot b/account_payment_credit_card/i18n/account_payment_credit_card.pot new file mode 100644 index 000000000000..e77b5207cbb7 --- /dev/null +++ b/account_payment_credit_card/i18n/account_payment_credit_card.pot @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_credit_card +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__partner_id +msgid "Credit Card Company" +msgstr "" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__display_name +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move__display_name +msgid "Display Name" +msgstr "" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__id +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move__id +msgid "ID" +msgstr "" + +#. module: account_payment_credit_card +#: model:ir.model,name:account_payment_credit_card.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_payment_credit_card +#: model:ir.model,name:account_payment_credit_card.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal____last_update +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__credit_card +msgid "Transfer AP to Credit Card Company" +msgstr "" diff --git a/account_payment_credit_card/i18n/es.po b/account_payment_credit_card/i18n/es.po new file mode 100644 index 000000000000..67df1b229233 --- /dev/null +++ b/account_payment_credit_card/i18n/es.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_credit_card +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-18 19:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__partner_id +msgid "Credit Card Company" +msgstr "Compañía de Tarjeta de Crédito" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__display_name +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__id +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move__id +msgid "ID" +msgstr "ID (identificación)" + +#. module: account_payment_credit_card +#: model:ir.model,name:account_payment_credit_card.model_account_journal +msgid "Journal" +msgstr "Diario" + +#. module: account_payment_credit_card +#: model:ir.model,name:account_payment_credit_card.model_account_move +msgid "Journal Entry" +msgstr "Entrada en Diario" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal____last_update +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move____last_update +msgid "Last Modified on" +msgstr "Última Modificación en" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__credit_card +msgid "Transfer AP to Credit Card Company" +msgstr "Transferir AP a la Compañía de la Tarjeta de Crédito" diff --git a/account_payment_credit_card/i18n/nl.po b/account_payment_credit_card/i18n/nl.po new file mode 100644 index 000000000000..2abd47c3f61b --- /dev/null +++ b/account_payment_credit_card/i18n/nl.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_credit_card +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-02-05 11:40+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__partner_id +msgid "Credit Card Company" +msgstr "Credit Card Maatschappij" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__display_name +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move__display_name +msgid "Display Name" +msgstr "Weergave naam" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__id +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move__id +msgid "ID" +msgstr "ID" + +#. module: account_payment_credit_card +#: model:ir.model,name:account_payment_credit_card.model_account_journal +msgid "Journal" +msgstr "Dagboek" + +#. module: account_payment_credit_card +#: model:ir.model,name:account_payment_credit_card.model_account_move +msgid "Journal Entry" +msgstr "Boeking" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal____last_update +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move____last_update +msgid "Last Modified on" +msgstr "Laatst gewijzigd op" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__credit_card +msgid "Transfer AP to Credit Card Company" +msgstr "Verplaats de crediteurenrekening naar de Credit Card Maatschappij" diff --git a/account_payment_credit_card/i18n/pt_BR.po b/account_payment_credit_card/i18n/pt_BR.po new file mode 100644 index 000000000000..54d2da904a72 --- /dev/null +++ b/account_payment_credit_card/i18n/pt_BR.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_credit_card +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-03-17 22:22+0000\n" +"Last-Translator: Douglas Custódio \n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__partner_id +msgid "Credit Card Company" +msgstr "Empresa de Cartão de Crédito" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__display_name +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move__display_name +msgid "Display Name" +msgstr "Nome exibido" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__id +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move__id +msgid "ID" +msgstr "ID" + +#. module: account_payment_credit_card +#: model:ir.model,name:account_payment_credit_card.model_account_journal +msgid "Journal" +msgstr "Diário" + +#. module: account_payment_credit_card +#: model:ir.model,name:account_payment_credit_card.model_account_move +msgid "Journal Entry" +msgstr "Lançamento de Diário" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal____last_update +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_move____last_update +msgid "Last Modified on" +msgstr "Última Modificação Em" + +#. module: account_payment_credit_card +#: model:ir.model.fields,field_description:account_payment_credit_card.field_account_journal__credit_card +msgid "Transfer AP to Credit Card Company" +msgstr "Transferir AP para empresa de cartão de crédito" diff --git a/account_payment_credit_card/models/__init__.py b/account_payment_credit_card/models/__init__.py new file mode 100644 index 000000000000..57fba6919ab5 --- /dev/null +++ b/account_payment_credit_card/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2017 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import account_journal +from . import account_move diff --git a/account_payment_credit_card/models/account_journal.py b/account_payment_credit_card/models/account_journal.py new file mode 100644 index 000000000000..b3d31d575d01 --- /dev/null +++ b/account_payment_credit_card/models/account_journal.py @@ -0,0 +1,11 @@ +# Copyright 2017 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + credit_card = fields.Boolean("Transfer AP to Credit Card Company") + partner_id = fields.Many2one("res.partner", "Credit Card Company") diff --git a/account_payment_credit_card/models/account_move.py b/account_payment_credit_card/models/account_move.py new file mode 100644 index 000000000000..0b7165bd8015 --- /dev/null +++ b/account_payment_credit_card/models/account_move.py @@ -0,0 +1,41 @@ +# Copyright 2017 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountMove(models.Model): + _inherit = "account.move" + + def _post(self, soft=True): + for move in self: + result = [] + # Check whether journal has Transfer AP to Credit Card + # Company = checked or not + if move.journal_id and move.journal_id.credit_card: + # Browse move lines + for move_line in move.line_ids: + # prepare move line values + result.append( + { + "name": move_line.name, + "ref": move_line.ref, + "partner_id": move.journal_id.partner_id.id + or move_line.partner_id.id + or False, + "journal_id": move_line.journal_id.id, + "account_id": move_line.account_id.id, + "debit": move_line.credit, + "credit": move_line.debit, + "date_maturity": move_line.date_maturity, + "move_id": move_line.move_id.id, + "date": move_line.date, + } + ) + # Check result list + if result: + # Create new move lines + self.env["account.move.line"].with_context( + skip_account_move_synchronization=True + ).create(result) + return super(AccountMove, self)._post(soft) diff --git a/account_payment_credit_card/readme/CONFIGURE.rst b/account_payment_credit_card/readme/CONFIGURE.rst new file mode 100644 index 000000000000..f34fee9bc8a9 --- /dev/null +++ b/account_payment_credit_card/readme/CONFIGURE.rst @@ -0,0 +1,3 @@ +* Go to Accounting > Configuration > Journals +* Create a new journal bank for your credit card +* Check the box ‘Transfer AP to Credit Card Company’ and set the ‘Credit Card Company’ field diff --git a/account_payment_credit_card/readme/CONTRIBUTORS.rst b/account_payment_credit_card/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..6a927de727f6 --- /dev/null +++ b/account_payment_credit_card/readme/CONTRIBUTORS.rst @@ -0,0 +1,10 @@ +* `Open Source Integrators `_: + + * Ray Carnes + * Balaji Kannan + * Bhavesh Odedra + * Sudarshan Kadalazhi + * Freni Patel + +* Odoo Dev Team: DS, JA +* Nikul Chaudhary diff --git a/account_payment_credit_card/readme/DESCRIPTION.rst b/account_payment_credit_card/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..c0260a5e956b --- /dev/null +++ b/account_payment_credit_card/readme/DESCRIPTION.rst @@ -0,0 +1,17 @@ +This module provides a way to record Credit Card purchases and to pay them the same way regular purchases are recorded (via Vendor Bills) and paid (via Vendor Payments). + +By default, if vendor bills are used to record credit card purchases, the liability (AP) from the supplier/vendor must be moved to the credit card company via a manual journal entry. + +Because a journal entry contains less information than a vendor bill, there may be a loss of information that affects book keeping accuracy and the ability to properly reconcile the AP amount when the credit card statement arrives and needs to be settled. +This method also requires an additional step not needed when a vendor bill is paid via bank or cash. + +This module automates the creation of the manual journal entry required to move the AP to the credit card company, retains all information about the purchase in an invoice document, and leverages the standard purchase and payment workflow already in place for bank and cash payments. + +It supports as many Credit Cards as are needed, configured in the same way an additional payment method would be (i.e. via the creation of a new journal). + +To settle a Credit Card statement, the regular workflow to record a vendor payment is used – allowing the removal of charges not included in the statement. +Non-purchase transactions like fees for annual membership, balance transfers, cash advances and foreign transactions; as well as charges for late payments and returned checks; can be entered either as Vendor Invoices or manual Journal Entries as users elect. + +Both of these methods will allow these items to be settled when making a payment to the credit card company. + +This module also supports payment cancellation and re-entry (in the case a mistaken amount is entered) as well as refunds (where the purchase is returned and a credit from the credit card company will be issued). diff --git a/account_payment_credit_card/readme/USAGE.rst b/account_payment_credit_card/readme/USAGE.rst new file mode 100644 index 000000000000..26e55da0545a --- /dev/null +++ b/account_payment_credit_card/readme/USAGE.rst @@ -0,0 +1,5 @@ +To use this module, you need to: + +#. Go to Accounting > Purchases > Vendors Bills +#. Select an open bill and click on Register Payment +#. Select the credit card journal and validate the payment diff --git a/account_payment_credit_card/static/description/icon.png b/account_payment_credit_card/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/account_payment_credit_card/static/description/icon.png differ diff --git a/account_payment_credit_card/static/description/index.html b/account_payment_credit_card/static/description/index.html new file mode 100644 index 000000000000..1e00356c77eb --- /dev/null +++ b/account_payment_credit_card/static/description/index.html @@ -0,0 +1,462 @@ + + + + + +Credit Card Payments + + + +
+

Credit Card Payments

+ + +

Beta License: AGPL-3 OCA/account-payment Translate me on Weblate Try me on Runboat

+

This module provides a way to record Credit Card purchases and to pay them the same way regular purchases are recorded (via Vendor Bills) and paid (via Vendor Payments).

+

By default, if vendor bills are used to record credit card purchases, the liability (AP) from the supplier/vendor must be moved to the credit card company via a manual journal entry.

+

Because a journal entry contains less information than a vendor bill, there may be a loss of information that affects book keeping accuracy and the ability to properly reconcile the AP amount when the credit card statement arrives and needs to be settled. +This method also requires an additional step not needed when a vendor bill is paid via bank or cash.

+

This module automates the creation of the manual journal entry required to move the AP to the credit card company, retains all information about the purchase in an invoice document, and leverages the standard purchase and payment workflow already in place for bank and cash payments.

+

It supports as many Credit Cards as are needed, configured in the same way an additional payment method would be (i.e. via the creation of a new journal).

+

To settle a Credit Card statement, the regular workflow to record a vendor payment is used – allowing the removal of charges not included in the statement. +Non-purchase transactions like fees for annual membership, balance transfers, cash advances and foreign transactions; as well as charges for late payments and returned checks; can be entered either as Vendor Invoices or manual Journal Entries as users elect.

+

Both of these methods will allow these items to be settled when making a payment to the credit card company.

+

This module also supports payment cancellation and re-entry (in the case a mistaken amount is entered) as well as refunds (where the purchase is returned and a credit from the credit card company will be issued).

+

Table of contents

+ +
+

Configuration

+
    +
  • Go to Accounting > Configuration > Journals
  • +
  • Create a new journal bank for your credit card
  • +
  • Check the box ‘Transfer AP to Credit Card Company’ and set the ‘Credit Card Company’ field
  • +
+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Accounting > Purchases > Vendors Bills
  2. +
  3. Select an open bill and click on Register Payment
  4. +
  5. Select the credit card journal and validate the payment
  6. +
+
+
+

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

+
    +
  • Open Source Integrators
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

max3903

+

This module is part of the OCA/account-payment project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_payment_credit_card/tests/__init__.py b/account_payment_credit_card/tests/__init__.py new file mode 100644 index 000000000000..99432984a3d3 --- /dev/null +++ b/account_payment_credit_card/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import test_payment_credit_card diff --git a/account_payment_credit_card/tests/test_payment_credit_card.py b/account_payment_credit_card/tests/test_payment_credit_card.py new file mode 100644 index 000000000000..2946b3a5d567 --- /dev/null +++ b/account_payment_credit_card/tests/test_payment_credit_card.py @@ -0,0 +1,62 @@ +# Copyright 2019 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from datetime import datetime, timedelta + +# from odoo import fields +from odoo.tests import common +from odoo.tools import DEFAULT_SERVER_DATE_FORMAT + + +class TestPaymentCreditCard(common.TransactionCase): + def setUp(self): + super(TestPaymentCreditCard, self).setUp() + self.account_invoice_obj = self.env["account.move"] + self.account_move_line_obj = self.env["account.move.line"] + self.account_account_obj = self.env["account.account"] + self.account_journal_obj = self.env["account.journal"] + self.partner_12 = self.env.ref("base.res_partner_12") + + self.journal_sale = self.account_journal_obj.create( + {"name": "sale_0", "code": "SALE0", "type": "sale", "credit_card": True} + ) + + self.invoice_data_list = [ + # Customer Invoice Data + [ + "out_invoice", + self.get_date(set_days=30), + self.partner_12.id, + self.journal_sale.id, + ], + ] + + def test_create_invoice_with_cc(self): + for invoice_data in self.invoice_data_list: + invoice = self.account_invoice_obj.with_context( + default_journal_id=invoice_data[3] + ).create( + { + "ref": "reference", + "move_type": invoice_data[0], + "invoice_date": invoice_data[1], + "invoice_date_due": invoice_data[1], + "partner_id": invoice_data[2], + } + ) + self.account_move_line_obj.create( + { + "product_id": self.env.ref("product.product_product_4").id, + "quantity": 1.0, + "price_unit": 0, + "move_id": invoice.id, + "name": "product that cost 100", + } + ) + invoice._post(soft=False) + return invoice + + def get_date(self, set_days): + return (datetime.now() - timedelta(days=-set_days)).strftime( + DEFAULT_SERVER_DATE_FORMAT + ) diff --git a/account_payment_credit_card/views/account_view.xml b/account_payment_credit_card/views/account_view.xml new file mode 100644 index 000000000000..3ad25ceae84c --- /dev/null +++ b/account_payment_credit_card/views/account_view.xml @@ -0,0 +1,24 @@ + + + + + account.journal.form + account.journal + form + + + + + + + + + + diff --git a/setup/account_payment_credit_card/odoo/addons/account_payment_credit_card b/setup/account_payment_credit_card/odoo/addons/account_payment_credit_card new file mode 120000 index 000000000000..09bc88a2bd63 --- /dev/null +++ b/setup/account_payment_credit_card/odoo/addons/account_payment_credit_card @@ -0,0 +1 @@ +../../../../account_payment_credit_card \ No newline at end of file diff --git a/setup/account_payment_credit_card/setup.py b/setup/account_payment_credit_card/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/account_payment_credit_card/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)