Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions academic_payment_portal/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
"name": "Academic Payment portal",
"version": "19.0.1.0.0",
"version": "20.0.1.0.0",
"sequence": 14,
"summary": "",
"author": "ADHOC SA",
Expand All @@ -29,7 +29,7 @@
"data": [
"wizards/res_config_setting_views.xml",
],
"installable": False,
"installable": True,
"auto_install": False,
"application": False,
}
27 changes: 23 additions & 4 deletions academic_payment_portal/i18n/academic_payment_portal.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0+e\n"
"Project-Id-Version: Odoo Server 20.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-22 20:31+0000\n"
"PO-Revision-Date: 2025-12-22 20:31+0000\n"
"POT-Creation-Date: 2026-10-22 17:36+0000\n"
"PO-Revision-Date: 2026-10-22 17:36+0000\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: academic_payment_portal
#: model:ir.module.module,shortdesc:base.module_academic_payment_portal
msgid "Academic Payment portal"
msgstr ""

#. module: academic_payment_portal
#: model:ir.model,name:academic_payment_portal.model_res_company
msgid "Companies"
msgid "Company"
msgstr ""

#. module: academic_payment_portal
Expand All @@ -32,6 +37,8 @@ msgstr ""

#. module: academic_payment_portal
#: model:ir.model.fields,field_description:academic_payment_portal.field_account_move__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_account_payment__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_payment_transaction__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_company__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_config_settings__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_partner__display_name
Expand All @@ -40,6 +47,8 @@ msgstr ""

#. module: academic_payment_portal
#: model:ir.model.fields,field_description:academic_payment_portal.field_account_move__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_account_payment__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_payment_transaction__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_company__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_config_settings__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_partner__id
Expand All @@ -58,6 +67,16 @@ msgstr ""
msgid "Journal Entry"
msgstr ""

#. module: academic_payment_portal
#: model:ir.model,name:academic_payment_portal.model_account_payment
msgid "Payment"
msgstr ""

#. module: academic_payment_portal
#: model:ir.model,name:academic_payment_portal.model_payment_transaction
msgid "Payment Transaction"
msgstr ""

#. module: academic_payment_portal
#: model_terms:ir.ui.view,arch_db:academic_payment_portal.res_config_settings_view_form
msgid "Payments in portal"
Expand Down
31 changes: 25 additions & 6 deletions academic_payment_portal/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-22 20:31+0000\n"
"PO-Revision-Date: 2026-07-30 14:54+0000\n"
"POT-Creation-Date: 2026-10-22 17:36+0000\n"
"PO-Revision-Date: 2026-10-22 17:36+0000\n"
"Last-Translator: BAF <baf@adhoc.inc>\n"
"Language-Team: Spanish <https://translation.dev-adhoc.com/projects/"
"odoo-academic-19-0/odoo-academic-19-0-academic_payment_portal/es/>\n"
Expand All @@ -22,10 +22,15 @@ msgstr ""
" ? 1 : 2);\n"
"X-Generator: Weblate 5.10.4\n"

#. module: academic_payment_portal
#: model:ir.module.module,shortdesc:base.module_academic_payment_portal
msgid "Academic Payment portal"
msgstr "Portal de pagos de Academic"

#. module: academic_payment_portal
#: model:ir.model,name:academic_payment_portal.model_res_company
msgid "Companies"
msgstr "Compañías"
msgid "Company"
msgstr "Empresa"

#. module: academic_payment_portal
#: model:ir.model,name:academic_payment_portal.model_res_config_settings
Expand All @@ -39,19 +44,23 @@ msgstr "Contacto"

#. module: academic_payment_portal
#: model:ir.model.fields,field_description:academic_payment_portal.field_account_move__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_account_payment__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_payment_transaction__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_company__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_config_settings__display_name
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_partner__display_name
msgid "Display Name"
msgstr "Nombre a mostrar"
msgstr "Nombre en pantalla"

#. module: academic_payment_portal
#: model:ir.model.fields,field_description:academic_payment_portal.field_account_move__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_account_payment__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_payment_transaction__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_company__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_config_settings__id
#: model:ir.model.fields,field_description:academic_payment_portal.field_res_partner__id
msgid "ID"
msgstr ""
msgstr "ID (identificación)"

#. module: academic_payment_portal
#: model_terms:ir.ui.view,arch_db:academic_payment_portal.res_config_settings_view_form
Expand All @@ -67,6 +76,16 @@ msgstr ""
msgid "Journal Entry"
msgstr "Asiento contable"

#. module: academic_payment_portal
#: model:ir.model,name:academic_payment_portal.model_account_payment
msgid "Payment"
msgstr "Pago"

#. module: academic_payment_portal
#: model:ir.model,name:academic_payment_portal.model_payment_transaction
msgid "Payment Transaction"
msgstr "Transacción de pago"

#. module: academic_payment_portal
#: model_terms:ir.ui.view,arch_db:academic_payment_portal.res_config_settings_view_form
msgid "Payments in portal"
Expand Down
1 change: 1 addition & 0 deletions academic_payment_portal/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_portal_payment
74 changes: 74 additions & 0 deletions academic_payment_portal/tests/test_portal_payment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from dateutil.relativedelta import relativedelta
from odoo import Command, fields
from odoo.addons.account_payment.tests.common import AccountPaymentCommon
from odoo.tests import tagged


@tagged("post_install", "-at_install")
class TestPortalPayment(AccountPaymentCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.today = fields.Date.today()
cls.env["ir.config_parameter"].sudo().set_bool("account_payment.enable_portal_payment", True)
cls.student = cls.env["res.partner"].create({"name": "Student"})
cls.payer = cls.env["res.partner"].create({"name": "Payer"})

def _create_posted_invoice(self, partner, invoice_date):
# Without payment terms the due date is the invoice date.
return self._create_invoice_one_line(
price_unit=100.0,
partner_id=partner,
invoice_date=invoice_date,
invoice_payment_term_id=False,
post=True,
)

def test_only_oldest_invoice_can_be_paid(self):
"""Portal users can only pay the invoice with the oldest due date, when the company asks for it."""
oldest = self._create_posted_invoice(self.student, self.today - relativedelta(days=20))
newest = self._create_posted_invoice(self.student, self.today - relativedelta(days=10))
company = oldest.company_id

with self.subTest("option on: only the oldest invoice can be paid"):
company.users_can_pay_only_oldest_invoice = True
self.assertTrue(oldest._has_to_be_paid())
self.assertFalse(newest._has_to_be_paid())

with self.subTest("option off: every invoice can be paid"):
company.users_can_pay_only_oldest_invoice = False
self.assertTrue(oldest._has_to_be_paid())
self.assertTrue(newest._has_to_be_paid())

with self.subTest("option on, oldest paid: the next one can be paid"):
company.users_can_pay_only_oldest_invoice = True
self.env["account.payment.register"].with_context(
active_model="account.move", active_ids=oldest.ids
).create({})._create_payments()
self.assertFalse(oldest.amount_residual)
self.assertTrue(newest._has_to_be_paid())

def test_payment_by_other_partner_goes_to_invoice_partner(self):
"""A payment made from the portal by another contact is registered for the invoice partner."""
invoice = self._create_posted_invoice(self.student, self.today)
tx = self._create_transaction(
"redirect",
state="done",
partner_id=self.payer.id,
amount=invoice.amount_total,
currency_id=invoice.currency_id.id,
invoice_ids=[Command.set(invoice.ids)],
)

self._run_post_processing()
payment = tx.payment_id

self.assertTrue(payment)
self.assertEqual(payment.partner_id, self.student)
self.assertIn(payment.state, ("paid", "reconciled"))
self.assertFalse(invoice.amount_residual)
self.assertIn(invoice.payment_state, ("in_payment", "paid"))
Loading