diff --git a/account_payment_term_partner_not_paydays/README.rst b/account_payment_term_partner_not_paydays/README.rst new file mode 100644 index 00000000000..cf820286718 --- /dev/null +++ b/account_payment_term_partner_not_paydays/README.rst @@ -0,0 +1,173 @@ +======================================= +Payment Term - Partner Not Payment Days +======================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:150e48e380df2df5d2435713f6d0dd9cedcbac8398e7dbed82539c00bab89d50 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/17.0/account_payment_term_partner_not_paydays + :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-17-0/account-payment-17-0-account_payment_term_partner_not_paydays + :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=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +There may be a scenario where you don't want to make a payment to a +partner, whether due to vacation, an unofficial agreement, or other +reasons. + +This module allows you to automate these scenarios by defining +non-payment date ranges for each partner and calculating the due date +based on those defined ranges and the initial payment terms. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Enable non-payment ranges +------------------------- + +1. Go to Invoicing > Configuration > Settings > Payment Terms + +2. Enable the option "Days not pay" + +3. Save + + |Enable day not pay| + +.. |Enable day not pay| image:: https://raw.githubusercontent.com/OCA/account-payment/17.0/account_payment_term_partner_not_paydays/static/img/readme/enable_day_not_pay.png + +Usage +===== + +Set payment days per customer +----------------------------- + +1. Go to Invoicing > Customers > Customers + +2. Select or create a new partner + +3. Go to tab "Sales & Purchases" in section "SALES" + +4. Enter the payment days separated by commas (,), dashes (-) or spaces + ( ) in field Customer Payment day(s). Example: 12,18,26,29 + + |Partner days pay| + +5. Save + +Add range not pay to partner +---------------------------- + +1. Go to Invoicing > Customers > Customers + +2. Select or create a new partner + +3. Go to tab "Invoicing" in section "DAYS NOT PAY" + +4. Add the range of days not pay + +5. Save + + |Partner days not pay| + +Create invoice with partner configured for non-payment days +----------------------------------------------------------- + +1. Go to Invoicing > Customers > Invoices + +2. Create a new invoice and select a partner that has configured + no-payment ranges. + +3. If, when selecting the partner, today's date falls within a + non-payment range, a notification message will be displayed. + + |Invoice due date not valid| + +4. You can manually change the due date to a valid range if desired. + Otherwise, when confirming the invoice, it will be set to a valid + date based on the following conditions: + + 1. If no payment days are configured, the default day (usually today) + will be used. + + 2. If a valid due date is not configured, the due date will be set + based on the partner's payment days and invalid date ranges. + + Example: Partner Mitchell: + + - Payment Days: 5, 17 + - Payment Terms: 30 days + - Non-Payment Range: 8/1/2025 - 8/31/2025 (Customer Invoice) + + Invoice: Partner: Mitchell Invoice Date: 7/15/2025 Due Date: + 8/15/2025 (30-day payment terms) Since the due date falls within a + non-payment range, it is changed to 9/17/2025, as 17 is one of the + customer's payment days and is later than 15 in a valid date + range. + +.. |Partner days pay| image:: https://raw.githubusercontent.com/OCA/account-payment/17.0/account_payment_term_partner_not_paydays/static/img/readme/partner_days_pay.png +.. |Partner days not pay| image:: https://raw.githubusercontent.com/OCA/account-payment/17.0/account_payment_term_partner_not_paydays/static/img/readme/partner_days_not_pay.png +.. |Invoice due date not valid| image:: https://raw.githubusercontent.com/OCA/account-payment/17.0/account_payment_term_partner_not_paydays/static/img/readme/invoice_due_date_not_valid.png + +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 +------- + +* Binhex + +Contributors +------------ + +[Binhex] (https://www.binhex.cloud): + +- Edilio Escalona Almira e.escalona@binhex.cloud + +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. + +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_term_partner_not_paydays/__init__.py b/account_payment_term_partner_not_paydays/__init__.py new file mode 100644 index 00000000000..aee8895e7a3 --- /dev/null +++ b/account_payment_term_partner_not_paydays/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/account_payment_term_partner_not_paydays/__manifest__.py b/account_payment_term_partner_not_paydays/__manifest__.py new file mode 100644 index 00000000000..61ff667f291 --- /dev/null +++ b/account_payment_term_partner_not_paydays/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Payment Term - Partner Not Payment Days", + "version": "17.0.1.0.0", + "category": "Accounting & Finance", + "summary": """ + Recalculate the due date based on the non-payment + days configured per contact. + """, + "author": "Binhex,Odoo Community Association (OCA)", + "maintainer": "OCA", + "website": "https://github.com/OCA/account-payment", + "license": "AGPL-3", + "depends": ["account_payment_term_partner_paydays"], + "data": [ + "security/ir.model.access.csv", + "views/res_partner_views.xml", + "views/account_payment_term_views.xml", + "views/account_move_views.xml", + "wizards/res_config_settings_view.xml", + ], + "installable": True, +} diff --git a/account_payment_term_partner_not_paydays/i18n/account_payment_term_partner_not_paydays.pot b/account_payment_term_partner_not_paydays/i18n/account_payment_term_partner_not_paydays.pot new file mode 100644 index 00000000000..051bb515d12 --- /dev/null +++ b/account_payment_term_partner_not_paydays/i18n/account_payment_term_partner_not_paydays.pot @@ -0,0 +1,197 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_term_partner_not_paydays +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-12-15 17:46+0000\n" +"PO-Revision-Date: 2025-12-15 17:46+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: account_payment_term_partner_not_paydays +#: model:ir.model.fields,help:account_payment_term_partner_not_paydays.field_res_config_settings__payment_terms_delay_type +msgid "Choose the type of delay when creating new payment terms." +msgstr "Elija el tipo de retraso al crear nuevas condiciones de pago." + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model,name:account_payment_term_partner_not_paydays.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model_terms:ir.ui.view,arch_db:account_payment_term_partner_not_paydays.res_config_settings_view_form +msgid "Configure non-payment ranges." +msgstr "Configurar rangos de no pago" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model,name:account_payment_term_partner_not_paydays.model_res_partner +msgid "Contact" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__create_uid +msgid "Created by" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__create_date +msgid "Created on" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__out_refund +msgid "Customer Credit Note" +msgstr "Nota de crédito" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__out_invoice +msgid "Customer Invoice" +msgstr "Factura" + +#. module: account_payment_term_partner_not_paydays +#. odoo-python +#: code:addons/account_payment_term_partner_not_paydays/models/res_partner_not_pay.py:0 +#, python-format +msgid "Date start must be less than date end." +msgstr "La fecha de inicio debe ser menor a la fecha fin" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_config_settings__days_not_pay +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner__days_not_pay +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_users__days_not_pay +msgid "Days Not Pay" +msgstr "Días de no pago" + +#. module: account_payment_term_partner_not_paydays +#: model_terms:ir.ui.view,arch_db:account_payment_term_partner_not_paydays.res_config_settings_view_form +#: model_terms:ir.ui.view,arch_db:account_payment_term_partner_not_paydays.view_partner_property_form +msgid "Days not pay" +msgstr "Días de no pago" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model,name:account_payment_term_partner_not_paydays.model_res_partner_not_pay +msgid "Days of non-payment to the partner" +msgstr "Días de impago al contacto" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__display_name +msgid "Display Name" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_bank_statement_line__invoice_date_due +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_move__invoice_date_due +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_payment__invoice_date_due +msgid "Due Date" +msgstr "Fecha de vencimiento" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__date_end +msgid "End" +msgstr "Fin" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__id +msgid "ID" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model,name:account_payment_term_partner_not_paydays.model_account_move +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__entry +msgid "Journal Entry" +msgstr "Entrada Diaria" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_bank_statement_line__message_range_not_pay +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_move__message_range_not_pay +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_payment__message_range_not_pay +msgid "Message Range Not Pay" +msgstr "Mensaje de rango de o pago" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__partner_id +msgid "Partner" +msgstr "Contacto" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner__partner_not_pay_ids +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_users__partner_not_pay_ids +msgid "Partner Not Pay" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_config_settings__payment_terms_delay_type +msgid "Payment terms Delay types" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__in_receipt +msgid "Purchase Receipt" +msgstr "Recibo de compra" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__out_receipt +msgid "Sales Receipt" +msgstr "Recibo de venta" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__date_start +msgid "Start" +msgstr "Inicio" + +#. module: account_payment_term_partner_not_paydays +#. odoo-python +#: code:addons/account_payment_term_partner_not_paydays/models/account_move.py:0 +#, python-format +msgid "" +"The due date %(invoice_date_due)s falls within the period " +"(%(range_overlap)s) of not pay to the partner.If, upon confirming the " +"invoice, the date mentioned does not meet the conditions, said date will be " +"changed to the first valid one." +msgstr "" +"La fecha de vencimiento %(invoice_date_due)s se encuentra dentro del período " +"(%(range_overlap)s) de no pago al socio. Si, al confirmar la factura, la " +"fecha mencionada no cumple con las condiciones, se cambiará a la primera fecha válida." + +#. module: account_payment_term_partner_not_paydays +#. odoo-python +#: code:addons/account_payment_term_partner_not_paydays/models/res_partner_not_pay.py:0 +#, python-format +msgid "" +"The start %(start)s and %(end)s values overlap with:\n" +"Overlap: Start: %(start_overlap)s End: %(end_overlap)s" +msgstr "" +"Los valores iniciales %(start)s y %(end)s se superponen con:\n" +"Superposición: Inicio: %(start_overlap)s Fin: %(end_overlap)s" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__type +msgid "Type" +msgstr "Tipo" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__in_invoice +msgid "Vendor Bill" +msgstr "Factura del proveedor" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__in_refund +msgid "Vendor Credit Note" +msgstr "Nota de crédito del proveedor" diff --git a/account_payment_term_partner_not_paydays/i18n/es_ES.po b/account_payment_term_partner_not_paydays/i18n/es_ES.po new file mode 100644 index 00000000000..051bb515d12 --- /dev/null +++ b/account_payment_term_partner_not_paydays/i18n/es_ES.po @@ -0,0 +1,197 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_term_partner_not_paydays +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-12-15 17:46+0000\n" +"PO-Revision-Date: 2025-12-15 17:46+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: account_payment_term_partner_not_paydays +#: model:ir.model.fields,help:account_payment_term_partner_not_paydays.field_res_config_settings__payment_terms_delay_type +msgid "Choose the type of delay when creating new payment terms." +msgstr "Elija el tipo de retraso al crear nuevas condiciones de pago." + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model,name:account_payment_term_partner_not_paydays.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model_terms:ir.ui.view,arch_db:account_payment_term_partner_not_paydays.res_config_settings_view_form +msgid "Configure non-payment ranges." +msgstr "Configurar rangos de no pago" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model,name:account_payment_term_partner_not_paydays.model_res_partner +msgid "Contact" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__create_uid +msgid "Created by" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__create_date +msgid "Created on" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__out_refund +msgid "Customer Credit Note" +msgstr "Nota de crédito" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__out_invoice +msgid "Customer Invoice" +msgstr "Factura" + +#. module: account_payment_term_partner_not_paydays +#. odoo-python +#: code:addons/account_payment_term_partner_not_paydays/models/res_partner_not_pay.py:0 +#, python-format +msgid "Date start must be less than date end." +msgstr "La fecha de inicio debe ser menor a la fecha fin" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_config_settings__days_not_pay +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner__days_not_pay +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_users__days_not_pay +msgid "Days Not Pay" +msgstr "Días de no pago" + +#. module: account_payment_term_partner_not_paydays +#: model_terms:ir.ui.view,arch_db:account_payment_term_partner_not_paydays.res_config_settings_view_form +#: model_terms:ir.ui.view,arch_db:account_payment_term_partner_not_paydays.view_partner_property_form +msgid "Days not pay" +msgstr "Días de no pago" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model,name:account_payment_term_partner_not_paydays.model_res_partner_not_pay +msgid "Days of non-payment to the partner" +msgstr "Días de impago al contacto" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__display_name +msgid "Display Name" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_bank_statement_line__invoice_date_due +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_move__invoice_date_due +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_payment__invoice_date_due +msgid "Due Date" +msgstr "Fecha de vencimiento" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__date_end +msgid "End" +msgstr "Fin" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__id +msgid "ID" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model,name:account_payment_term_partner_not_paydays.model_account_move +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__entry +msgid "Journal Entry" +msgstr "Entrada Diaria" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_bank_statement_line__message_range_not_pay +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_move__message_range_not_pay +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_account_payment__message_range_not_pay +msgid "Message Range Not Pay" +msgstr "Mensaje de rango de o pago" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__partner_id +msgid "Partner" +msgstr "Contacto" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner__partner_not_pay_ids +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_users__partner_not_pay_ids +msgid "Partner Not Pay" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_config_settings__payment_terms_delay_type +msgid "Payment terms Delay types" +msgstr "" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__in_receipt +msgid "Purchase Receipt" +msgstr "Recibo de compra" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__out_receipt +msgid "Sales Receipt" +msgstr "Recibo de venta" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__date_start +msgid "Start" +msgstr "Inicio" + +#. module: account_payment_term_partner_not_paydays +#. odoo-python +#: code:addons/account_payment_term_partner_not_paydays/models/account_move.py:0 +#, python-format +msgid "" +"The due date %(invoice_date_due)s falls within the period " +"(%(range_overlap)s) of not pay to the partner.If, upon confirming the " +"invoice, the date mentioned does not meet the conditions, said date will be " +"changed to the first valid one." +msgstr "" +"La fecha de vencimiento %(invoice_date_due)s se encuentra dentro del período " +"(%(range_overlap)s) de no pago al socio. Si, al confirmar la factura, la " +"fecha mencionada no cumple con las condiciones, se cambiará a la primera fecha válida." + +#. module: account_payment_term_partner_not_paydays +#. odoo-python +#: code:addons/account_payment_term_partner_not_paydays/models/res_partner_not_pay.py:0 +#, python-format +msgid "" +"The start %(start)s and %(end)s values overlap with:\n" +"Overlap: Start: %(start_overlap)s End: %(end_overlap)s" +msgstr "" +"Los valores iniciales %(start)s y %(end)s se superponen con:\n" +"Superposición: Inicio: %(start_overlap)s Fin: %(end_overlap)s" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields,field_description:account_payment_term_partner_not_paydays.field_res_partner_not_pay__type +msgid "Type" +msgstr "Tipo" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__in_invoice +msgid "Vendor Bill" +msgstr "Factura del proveedor" + +#. module: account_payment_term_partner_not_paydays +#: model:ir.model.fields.selection,name:account_payment_term_partner_not_paydays.selection__res_partner_not_pay__type__in_refund +msgid "Vendor Credit Note" +msgstr "Nota de crédito del proveedor" diff --git a/account_payment_term_partner_not_paydays/models/__init__.py b/account_payment_term_partner_not_paydays/models/__init__.py new file mode 100644 index 00000000000..86247fce533 --- /dev/null +++ b/account_payment_term_partner_not_paydays/models/__init__.py @@ -0,0 +1,6 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import res_partner_not_pay +from . import account_move +from . import res_partner diff --git a/account_payment_term_partner_not_paydays/models/account_move.py b/account_payment_term_partner_not_paydays/models/account_move.py new file mode 100644 index 00000000000..71f2919f91c --- /dev/null +++ b/account_payment_term_partner_not_paydays/models/account_move.py @@ -0,0 +1,127 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from calendar import monthrange +from datetime import date + +from dateutil.relativedelta import relativedelta + +from odoo import _, api, fields, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + message_range_not_pay = fields.Char(compute="_compute_message_range_not_pay") + invoice_date_due = fields.Date(tracking=True) + + def _check_day_not_pay(self): + return ( + self.partner_id + and self.partner_id.days_not_pay + and self.partner_id.partner_not_pay_ids + ) + + def next_with_day(self, base_date, day_pay): + target_pay = day_pay + if day_pay <= 0: + target_pay = base_date.day + y, m = base_date.year, base_date.month + while True: + if m > 12: + m, y = 1, y + 1 + if monthrange(y, m)[1] >= target_pay: + return date(y, m, target_pay) + + def get_pay_days(self): + PaymentTermLine = self.env["account.payment.term.line"] + partner_payment_days = self.partner_id.with_context( + move_type=self.move_type + )._get_payment_days() + if partner_payment_days and self.invoice_date: + current_day = self.invoice_date.day + if current_day: + payment_days = PaymentTermLine._decode_payment_days( + partner_payment_days + ) + next_day = list(filter(lambda x: x >= current_day, payment_days)) + return next_day + return False + + @api.depends( + "invoice_payment_term_id", "invoice_date_due", "partner_id", "invoice_date" + ) + def _compute_message_range_not_pay(self): + for move in self: + if move._check_day_not_pay(): + overlap = move.partner_id._check_partner_range_not_pay( + **{ + "compare_date": move.invoice_date_due, + "move_type": move.move_type, + } + ) + if overlap: + move.message_range_not_pay = _( + "The due date %(invoice_date_due)s falls within the period " + "(%(range_overlap)s) of not pay to the partner." + "If, upon confirming the invoice, the date mentioned does not " + "meet the conditions, said date will be changed to the " + "first valid one." + ) % { + "invoice_date_due": move.invoice_date_due.strftime("%d/%m/%Y"), + "range_overlap": overlap[0]["date_start"].strftime("%d/%m/%Y") + + " - " + + overlap[0]["date_end"].strftime("%d/%m/%Y"), + } + else: + move.message_range_not_pay = False + else: + move.message_range_not_pay = False + + def _valid_overlap_date(self, compare_date, pay_day): + overlap = self.partner_id._check_partner_range_not_pay( + **{"compare_date": compare_date, "move_type": self.move_type} + ) + if overlap: + if not self.env.context.get("not_next_date", False): + compare_date = self.next_with_day( + compare_date + relativedelta(months=1), pay_day + ) + return compare_date + return True + + def _reset_compare_date(self, pay_day): + return self.next_with_day( + self.invoice_date_due + relativedelta(months=1), pay_day + ) + + def generate_invoice_date_due(self): + """ + Find the days on or above the current date and check for availability. + + If no available date is found, retrieve the first payday and + check subsequent months for available paydays. + """ + pay_days = self.get_pay_days() or [self.invoice_date_due.day] + for pay_day in pay_days: + compare_date = self._reset_compare_date(pay_day) + overlap_date = self.with_context( + **{"not_next_date": True} + )._valid_overlap_date(compare_date, pay_day) + if overlap_date is True: + return compare_date + + pay_day = pay_days[0] if pay_days else self.invoice_date_due.day + compare_date = self._reset_compare_date(pay_day) + while True: + overlap_date = self._valid_overlap_date(compare_date, pay_day) + if overlap_date is True: + return compare_date + compare_date = overlap_date + + def action_post(self): + moves = super().action_post() + for move in self: + if move.message_range_not_pay and move._check_day_not_pay(): + move.invoice_date_due = move.generate_invoice_date_due() + return moves diff --git a/account_payment_term_partner_not_paydays/models/res_partner.py b/account_payment_term_partner_not_paydays/models/res_partner.py new file mode 100644 index 00000000000..9fd8cf4d4c4 --- /dev/null +++ b/account_payment_term_partner_not_paydays/models/res_partner.py @@ -0,0 +1,54 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + partner_not_pay_ids = fields.One2many("res.partner.not.pay", "partner_id") + days_not_pay = fields.Boolean(compute="_compute_days_not_pay") + + def _get_payment_days(self): + move_type = self.env.context.get("move_type") + if move_type in ("in_invoice", "in_refund", "in_receipt"): + return self.supplier_payment_days + if move_type in ("out_invoice", "out_refund", "out_receipt"): + return self.customer_payment_days + return False + + def _compute_days_not_pay(self): + IrConfigParameter = self.env["ir.config_parameter"] + for partner in self: + partner.days_not_pay = IrConfigParameter.get_param( + "account_payment_term_partner_not_paydays.days_not_pay" + ) + + def _get_domain_range_not_pay(self, **args): + domain = [ + ("partner_id", "=", self.id), + ] + compare_date = args.get("compare_date", False) + if compare_date: + domain += [ + ("date_start", "<=", compare_date), + ("date_end", ">=", compare_date), + ] + + move_type = args.get("move_type", False) + if move_type: + domain += [("type", "=", move_type)] + return domain + + def _get_fields_range_not_pay(self): + return ["date_start", "date_end"] + + def _check_partner_range_not_pay(self, **args): + self.ensure_one() + overlap = self.env["res.partner.not.pay"].search_read( + self._get_domain_range_not_pay(**args), + self._get_fields_range_not_pay(), + limit=1, + ) + return overlap diff --git a/account_payment_term_partner_not_paydays/models/res_partner_not_pay.py b/account_payment_term_partner_not_paydays/models/res_partner_not_pay.py new file mode 100644 index 00000000000..f8c71de8c65 --- /dev/null +++ b/account_payment_term_partner_not_paydays/models/res_partner_not_pay.py @@ -0,0 +1,59 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class ResPartnerNotPay(models.Model): + _name = "res.partner.not.pay" + _description = "Days of non-payment to the partner" + + partner_id = fields.Many2one("res.partner") + date_start = fields.Date(string="Start", required=True) + date_end = fields.Date(string="End", required=True) + type = fields.Selection( + [ + ("entry", "Journal Entry"), + ("out_invoice", "Customer Invoice"), + ("out_refund", "Customer Credit Note"), + ("in_invoice", "Vendor Bill"), + ("in_refund", "Vendor Credit Note"), + ("out_receipt", "Sales Receipt"), + ("in_receipt", "Purchase Receipt"), + ], + default="out_invoice", + required=True, + ) + + @api.constrains("date_start", "date_end") + def _check_date_start_end(self): + for record in self: + if record.date_start > record.date_end: + raise ValidationError(_("Date start must be less than date end.")) + else: + overlap = self.search_read( + [ + ("date_start", "<=", record.date_end), + ("date_end", ">=", record.date_start), + ("id", "!=", record.id), + ("partner_id", "=", record.partner_id.id), + ], + ["date_start", "date_end"], + limit=1, + ) + if overlap: + raise ValidationError( + _( + "The start %(start)s and %(end)s values overlap with:" + "\nOverlap: Start: %(start_overlap)s End: %(end_overlap)s" + ) + % { + "start": record.date_start, + "end": record.date_end, + "start_overlap": overlap[0]["date_start"].strftime( + "%d/%m/%Y" + ), + "end_overlap": overlap[0]["date_end"].strftime("%d/%m/%Y"), + } + ) diff --git a/account_payment_term_partner_not_paydays/pyproject.toml b/account_payment_term_partner_not_paydays/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/account_payment_term_partner_not_paydays/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_payment_term_partner_not_paydays/readme/CONFIGURE.md b/account_payment_term_partner_not_paydays/readme/CONFIGURE.md new file mode 100644 index 00000000000..33d9ba30afc --- /dev/null +++ b/account_payment_term_partner_not_paydays/readme/CONFIGURE.md @@ -0,0 +1,7 @@ +Enable non-payment ranges +------------------ +1. Go to Invoicing > Configuration > Settings > Payment Terms +2. Enable the option "Days not pay" +3. Save + + ![Enable day not pay](../static/img/readme/enable_day_not_pay.png) diff --git a/account_payment_term_partner_not_paydays/readme/CONTRIBUTORS.md b/account_payment_term_partner_not_paydays/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..9fedc357a78 --- /dev/null +++ b/account_payment_term_partner_not_paydays/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +[Binhex] (https://www.binhex.cloud): + - Edilio Escalona Almira diff --git a/account_payment_term_partner_not_paydays/readme/DESCRIPTION.md b/account_payment_term_partner_not_paydays/readme/DESCRIPTION.md new file mode 100644 index 00000000000..f9568d32851 --- /dev/null +++ b/account_payment_term_partner_not_paydays/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +There may be a scenario where you don't want to make a payment to a partner, whether due to vacation, an unofficial agreement, or other reasons. + +This module allows you to automate these scenarios by defining non-payment date ranges for each partner and +calculating the due date based on those defined ranges and the initial payment terms. diff --git a/account_payment_term_partner_not_paydays/readme/USAGE.md b/account_payment_term_partner_not_paydays/readme/USAGE.md new file mode 100644 index 00000000000..d7e8aa1a824 --- /dev/null +++ b/account_payment_term_partner_not_paydays/readme/USAGE.md @@ -0,0 +1,53 @@ +Set payment days per customer +--------------------------------- + +1. Go to Invoicing > Customers > Customers +2. Select or create a new partner +3. Go to tab "Sales & Purchases" in section "SALES" +4. Enter the payment days separated by commas (,), dashes (-) or spaces ( ) in field Customer Payment day(s). + Example: 12,18,26,29 + + ![Partner days pay](../static/img/readme/partner_days_pay.png) + +5. Save + +Add range not pay to partner +------------------------------ + +1. Go to Invoicing > Customers > Customers +2. Select or create a new partner +3. Go to tab "Invoicing" in section "DAYS NOT PAY" +4. Add the range of days not pay +5. Save + + ![Partner days not pay](../static/img/readme/partner_days_not_pay.png) + +Create invoice with partner configured for non-payment days +-------------------------------------------- + +1. Go to Invoicing > Customers > Invoices +2. Create a new invoice and select a partner that has configured no-payment ranges. +3. If, when selecting the partner, today's date falls within a non-payment range, a notification message will be + displayed. + + ![Invoice due date not valid](../static/img/readme/invoice_due_date_not_valid.png) + +4. You can manually change the due date to a valid range if desired. + Otherwise, when confirming the invoice, it will be set to a valid date based on the following conditions: + + 1. If no payment days are configured, the default day (usually today) will be used. + + 2. If a valid due date is not configured, the due date will be set based on the partner's payment days and invalid date ranges. + + Example: + Partner Mitchell: + - Payment Days: 5, 17 + - Payment Terms: 30 days + - Non-Payment Range: 8/1/2025 - 8/31/2025 (Customer Invoice) + + Invoice: + Partner: Mitchell + Invoice Date: 7/15/2025 + Due Date: 8/15/2025 (30-day payment terms) + Since the due date falls within a non-payment range, it is changed to 9/17/2025, as 17 is one of the customer's payment days and is later than 15 in a valid date range. + diff --git a/account_payment_term_partner_not_paydays/security/ir.model.access.csv b/account_payment_term_partner_not_paydays/security/ir.model.access.csv new file mode 100644 index 00000000000..307a94d20ad --- /dev/null +++ b/account_payment_term_partner_not_paydays/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_res_partner_not_pay_manager,res.partner.not.pay,model_res_partner_not_pay,account.group_account_manager,1,1,1,1 diff --git a/account_payment_term_partner_not_paydays/static/description/index.html b/account_payment_term_partner_not_paydays/static/description/index.html new file mode 100644 index 00000000000..e5f1132152c --- /dev/null +++ b/account_payment_term_partner_not_paydays/static/description/index.html @@ -0,0 +1,527 @@ + + + + + +Payment Term - Partner Not Payment Days + + + +
+

Payment Term - Partner Not Payment Days

+ + +

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

+

There may be a scenario where you don’t want to make a payment to a +partner, whether due to vacation, an unofficial agreement, or other +reasons.

+

This module allows you to automate these scenarios by defining +non-payment date ranges for each partner and calculating the due date +based on those defined ranges and the initial payment terms.

+

Table of contents

+ +
+

Configuration

+
+

Enable non-payment ranges

+
    +
  1. Go to Invoicing > Configuration > Settings > Payment Terms

    +
  2. +
  3. Enable the option “Days not pay”

    +
  4. +
  5. Save

    +

    Enable day not pay

    +
  6. +
+
+
+
+

Usage

+
+

Set payment days per customer

+
    +
  1. Go to Invoicing > Customers > Customers

    +
  2. +
  3. Select or create a new partner

    +
  4. +
  5. Go to tab “Sales & Purchases” in section “SALES”

    +
  6. +
  7. Enter the payment days separated by commas (,), dashes (-) or spaces +( ) in field Customer Payment day(s). Example: 12,18,26,29

    +

    Partner days pay

    +
  8. +
  9. Save

    +
  10. +
+
+
+

Add range not pay to partner

+
    +
  1. Go to Invoicing > Customers > Customers

    +
  2. +
  3. Select or create a new partner

    +
  4. +
  5. Go to tab “Invoicing” in section “DAYS NOT PAY”

    +
  6. +
  7. Add the range of days not pay

    +
  8. +
  9. Save

    +

    Partner days not pay

    +
  10. +
+
+
+

Create invoice with partner configured for non-payment days

+
    +
  1. Go to Invoicing > Customers > Invoices

    +
  2. +
  3. Create a new invoice and select a partner that has configured +no-payment ranges.

    +
  4. +
  5. If, when selecting the partner, today’s date falls within a +non-payment range, a notification message will be displayed.

    +

    Invoice due date not valid

    +
  6. +
  7. You can manually change the due date to a valid range if desired. +Otherwise, when confirming the invoice, it will be set to a valid +date based on the following conditions:

    +
      +
    1. If no payment days are configured, the default day (usually today) +will be used.

      +
    2. +
    3. If a valid due date is not configured, the due date will be set +based on the partner’s payment days and invalid date ranges.

      +

      Example: Partner Mitchell:

      +
        +
      • Payment Days: 5, 17
      • +
      • Payment Terms: 30 days
      • +
      • Non-Payment Range: 8/1/2025 - 8/31/2025 (Customer Invoice)
      • +
      +

      Invoice: Partner: Mitchell Invoice Date: 7/15/2025 Due Date: +8/15/2025 (30-day payment terms) Since the due date falls within a +non-payment range, it is changed to 9/17/2025, as 17 is one of the +customer’s payment days and is later than 15 in a valid date +range.

      +
    4. +
    +
  8. +
+
+
+
+

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

+
    +
  • Binhex
  • +
+
+
+

Contributors

+

[Binhex] (https://www.binhex.cloud):

+ +
+
+

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.

+

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_term_partner_not_paydays/static/img/readme/enable_day_not_pay.png b/account_payment_term_partner_not_paydays/static/img/readme/enable_day_not_pay.png new file mode 100644 index 00000000000..8a7879be43f Binary files /dev/null and b/account_payment_term_partner_not_paydays/static/img/readme/enable_day_not_pay.png differ diff --git a/account_payment_term_partner_not_paydays/static/img/readme/invoice_due_date_not_valid.png b/account_payment_term_partner_not_paydays/static/img/readme/invoice_due_date_not_valid.png new file mode 100644 index 00000000000..745c57069c1 Binary files /dev/null and b/account_payment_term_partner_not_paydays/static/img/readme/invoice_due_date_not_valid.png differ diff --git a/account_payment_term_partner_not_paydays/static/img/readme/partner_days_not_pay.png b/account_payment_term_partner_not_paydays/static/img/readme/partner_days_not_pay.png new file mode 100644 index 00000000000..c008643b33b Binary files /dev/null and b/account_payment_term_partner_not_paydays/static/img/readme/partner_days_not_pay.png differ diff --git a/account_payment_term_partner_not_paydays/static/img/readme/partner_days_pay.png b/account_payment_term_partner_not_paydays/static/img/readme/partner_days_pay.png new file mode 100644 index 00000000000..ae31ae98776 Binary files /dev/null and b/account_payment_term_partner_not_paydays/static/img/readme/partner_days_pay.png differ diff --git a/account_payment_term_partner_not_paydays/tests/__init__.py b/account_payment_term_partner_not_paydays/tests/__init__.py new file mode 100644 index 00000000000..86ed6bdaa88 --- /dev/null +++ b/account_payment_term_partner_not_paydays/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_account_payment_term_partner_not_paydays diff --git a/account_payment_term_partner_not_paydays/tests/test_account_payment_term_partner_not_paydays.py b/account_payment_term_partner_not_paydays/tests/test_account_payment_term_partner_not_paydays.py new file mode 100644 index 00000000000..520075c2807 --- /dev/null +++ b/account_payment_term_partner_not_paydays/tests/test_account_payment_term_partner_not_paydays.py @@ -0,0 +1,96 @@ +# Copyright 2025 Binhex +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from datetime import date + +from odoo import Command +from odoo.exceptions import ValidationError +from odoo.tests import tagged + +from odoo.addons.base.tests.common import BaseCommon + + +@tagged("post_install", "-at_install") +class TestAccountPaymentTermPartnerNotPaydays(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.company = cls.env.ref("base.main_company") + cls.product = cls.env["product.product"].create({"name": "Product Test"}) + + def enable_config_days_not_pay(self): + conf = self.env["res.config.settings"].create({"days_not_pay": True}) + conf.execute() + + def create_partner(self, **values): + range_not_pay_days = [ + Command.create({"date_start": "2025-08-01", "date_end": "2025-08-31"}) + ] + create_values = {"name": "Partner Test", "customer_payment_days": "5,17"} + if values.get("failed_range", False): + range_not_pay_days.append( + Command.create({"date_start": "2025-08-06", "date_end": "2025-08-23"}) + ) + create_values.update({"partner_not_pay_ids": range_not_pay_days}) + return self.env["res.partner"].create(create_values) + + def create_invoice(self, **values): + partner_id = self.create_partner() + create_values = { + "partner_id": partner_id.id, + "company_id": self.company.id, + "invoice_date": "2025-07-15", + "invoice_date_due": "2025-08-15", + "move_type": values.get("move_type", "out_invoice"), + "invoice_payment_term_id": self.env.ref( + "account.account_payment_term_30days" + ).id, + } + if values.get("add_lines", False): + create_values.update( + { + "invoice_line_ids": [ + Command.create( + { + "name": "Test", + "product_id": self.product.id, + "debit": 100, + "credit": 0, + } + ) + ] + } + ) + + return self.env["account.move"].create(create_values) + + def test_overlap_days_not_pay(self): + self.enable_config_days_not_pay() + invoice = self.create_invoice() + self.assertTrue(invoice.message_range_not_pay) + self.assertIn("01/08/2025", invoice.message_range_not_pay) + self.assertIn("31/08/2025", invoice.message_range_not_pay) + invoice_entry = self.create_invoice( + **{ + "move_type": "entry", + } + ) + self.assertFalse(invoice_entry.message_range_not_pay) + + def test_action_post(self): + self.enable_config_days_not_pay() + invoice = self.create_invoice( + **{ + "add_lines": True, + } + ) + invoice.action_post() + self.assertEqual(invoice.invoice_date_due, date(2025, 9, 17)) + + def test_check_date_start_end(self): + with self.assertRaises(ValidationError): + self.create_partner( + **{ + "failed_range": True, + } + ) diff --git a/account_payment_term_partner_not_paydays/views/account_move_views.xml b/account_payment_term_partner_not_paydays/views/account_move_views.xml new file mode 100644 index 00000000000..bc8b89047a8 --- /dev/null +++ b/account_payment_term_partner_not_paydays/views/account_move_views.xml @@ -0,0 +1,51 @@ + + + + + account.move.form.account_payment_term_extension + account.move + + + + + + + + + + + + + + + + + diff --git a/account_payment_term_partner_not_paydays/views/account_payment_term_views.xml b/account_payment_term_partner_not_paydays/views/account_payment_term_views.xml new file mode 100644 index 00000000000..b71b3e96f9f --- /dev/null +++ b/account_payment_term_partner_not_paydays/views/account_payment_term_views.xml @@ -0,0 +1,23 @@ + + + + + account.payment.term.form.inherit.account_payment_term_partner_not_paydays + account.payment.term + + + + 1 + + + + diff --git a/account_payment_term_partner_not_paydays/views/res_partner_views.xml b/account_payment_term_partner_not_paydays/views/res_partner_views.xml new file mode 100644 index 00000000000..acb643f24ad --- /dev/null +++ b/account_payment_term_partner_not_paydays/views/res_partner_views.xml @@ -0,0 +1,29 @@ + + + + res.partner.form.extension + res.partner + + + + + + + + + + + + + + + + + diff --git a/account_payment_term_partner_not_paydays/wizards/__init__.py b/account_payment_term_partner_not_paydays/wizards/__init__.py new file mode 100644 index 00000000000..0deb68c4680 --- /dev/null +++ b/account_payment_term_partner_not_paydays/wizards/__init__.py @@ -0,0 +1 @@ +from . import res_config_settings diff --git a/account_payment_term_partner_not_paydays/wizards/res_config_settings.py b/account_payment_term_partner_not_paydays/wizards/res_config_settings.py new file mode 100644 index 00000000000..f3146390d80 --- /dev/null +++ b/account_payment_term_partner_not_paydays/wizards/res_config_settings.py @@ -0,0 +1,12 @@ +# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + days_not_pay = fields.Boolean( + config_parameter="account_payment_term_partner_not_paydays.days_not_pay" + ) diff --git a/account_payment_term_partner_not_paydays/wizards/res_config_settings_view.xml b/account_payment_term_partner_not_paydays/wizards/res_config_settings_view.xml new file mode 100644 index 00000000000..9ca3c6a3d06 --- /dev/null +++ b/account_payment_term_partner_not_paydays/wizards/res_config_settings_view.xml @@ -0,0 +1,28 @@ + + + + + + res.config.settings.view.form.inherit.not.paydays + res.config.settings + + + + + + + + + + diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000000..2fcc84dba16 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-account_payment_term_partner_paydays @ git+https://github.com/OCA/account-payment.git@refs/pull/908/head#subdirectory=account_payment_term_partner_paydays