diff --git a/sale_advance_payment/README.rst b/sale_advance_payment/README.rst new file mode 100644 index 00000000000..49c78e6c00c --- /dev/null +++ b/sale_advance_payment/README.rst @@ -0,0 +1,101 @@ +==================== +Sale Advance Payment +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:413cfc7cdb058b13df5804127f9e387f5ee8ebad625a1fef6a1a1e6babb629f4 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsale--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/sale-workflow/tree/18.0/sale_advance_payment + :alt: OCA/sale-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_advance_payment + :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/sale-workflow&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +The module allows to add advance payments on sales and then use them on +invoices. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +- Go to a sale order. +- Click on "Pay Sale Advance". +- Select the Journal and specify the amount of the advanced payment. +- "Make Advance Payment". + +When generating the invoice, the system displays the advanced payments, +select those you want to add to the invoice. + +Known issues / Roadmap +====================== + +Split several computed values in separate fields (mls, advance_amount, +amount_residual). This allows a better comprehension of logic, and a +better inheritance possibility. + +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 +------- + +* Comunitea + +Contributors +------------ + +- Omar Castiñeira Saaevdra +- Daniel Reis +- Nikul Chaudhary +- Manuel Regidor +- Urvisha Desai + +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/sale-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_advance_payment/__init__.py b/sale_advance_payment/__init__.py new file mode 100644 index 00000000000..9b4296142f4 --- /dev/null +++ b/sale_advance_payment/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/sale_advance_payment/__manifest__.py b/sale_advance_payment/__manifest__.py new file mode 100644 index 00000000000..928e5866168 --- /dev/null +++ b/sale_advance_payment/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2015 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Sale Advance Payment", + "version": "18.0.1.0.0", + "author": "Comunitea, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/sale-workflow", + "category": "Sales", + "license": "AGPL-3", + "summary": "Allow to add advance payments on sales and then use them on invoices", + "depends": ["sale"], + "data": [ + "wizard/sale_advance_payment_wzd_view.xml", + "views/sale_view.xml", + "security/ir.model.access.csv", + ], + "installable": True, +} diff --git a/sale_advance_payment/i18n/es.po b/sale_advance_payment/i18n/es.po new file mode 100644 index 00000000000..7e55998b7cb --- /dev/null +++ b/sale_advance_payment/i18n/es.po @@ -0,0 +1,254 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_advance_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-23 11:13+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: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard +msgid "Account Voucher Wizard" +msgstr "Asistente de comprobación de cuentas" + +#. module: sale_advance_payment +#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Advance Payment" +msgstr "Pago por Adelantado" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status +msgid "Advance Payment Status" +msgstr "Estado del pago anticipado" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total +msgid "Amount Total" +msgstr "Importe Total" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance +msgid "Amount advanced" +msgstr "Importe anticipado" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Amount in Order Currency" +msgstr "Importe en la divisa del pedido" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Amount of advance must be positive." +msgstr "El importe del anticipo debe de ser positivo." + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Cancel" +msgstr "Cancelar" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date +msgid "Created on" +msgstr "creado el" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount +msgid "Curr. amount" +msgstr "divisa del importe" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Currency" +msgstr "Divisa" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date +msgid "Date" +msgstr "fecha" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name +msgid "Display Name" +msgstr "nombre para mostrar" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id +msgid "ID" +msgstr "ID (identificación)" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound +msgid "Inbound" +msgstr "Entrante" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Inbound amount of advance is greater than residual amount on sale" +msgstr "" +"El importe de entrada del anticipo es superior al importe residual de la " +"venta" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id +msgid "Journal" +msgstr "Dario" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id +msgid "Journal Currency" +msgstr "Divisa del diario" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_move +msgid "Journal Entry" +msgstr "Entrada diaria" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date +msgid "Last Updated on" +msgstr "Última Actualización el" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Make advance payment" +msgstr "Pagar por adelantado" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid +msgid "Not Paid" +msgstr "No pagado" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Operation" +msgstr "Operación" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id +msgid "Order" +msgstr "Orden" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Currency" +msgstr "Divisa del pedido" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Due Amount" +msgstr "Importe pendiente del pedido" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound +msgid "Outbound" +msgstr "Saliente" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Outbound amount of advance is greater than the advanced paid amount" +msgstr "" +"El importe de salida del anticipo es superior al importe pagado por " +"anticipado" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid +msgid "Paid" +msgstr "Pagado" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial +msgid "Partially Paid" +msgstr "Pagado parcialmente" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Pay sale advanced" +msgstr "Pago anticipado" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Payment Method" +msgstr "Método de Pago" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type +msgid "Payment Type" +msgstr "Tipo de pago" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Payment advances" +msgstr "Anticipos de pago" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids +msgid "Payment move lines" +msgstr "Líneas de movimiento de pagos" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_payment +msgid "Payments" +msgstr "pagos" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref +msgid "Ref." +msgstr "Referencia" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual +msgid "Residual amount" +msgstr "Importe pendiente" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id +msgid "Sale" +msgstr "Ventas" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_sale_order +msgid "Sales Order" +msgstr "Órdenes de Venta" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "" +"The amount to advance must always be positive. Please use the payment type " +"to indicate if this is an inbound or an outbound payment." +msgstr "" +"El importe a anticipar debe ser siempre positivo. Utilice el tipo de pago " +"para indicar si se trata de un pago entrante o saliente." + +#~ msgid "Last Modified on" +#~ msgstr "modificado por última vez el" diff --git a/sale_advance_payment/i18n/fr.po b/sale_advance_payment/i18n/fr.po new file mode 100644 index 00000000000..07707642667 --- /dev/null +++ b/sale_advance_payment/i18n/fr.po @@ -0,0 +1,261 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_advance_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-10-29 15:06+0000\n" +"Last-Translator: epanisset \n" +"Language-Team: none\n" +"Language: fr\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 5.6.2\n" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard +msgid "Account Voucher Wizard" +msgstr "Assistant de Configuration Paiement d'Avance" + +#. module: sale_advance_payment +#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Advance Payment" +msgstr "Paiement d'Avance" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status +msgid "Advance Payment Status" +msgstr "Statut du Paiement d'Avance" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total +msgid "Amount Total" +msgstr "Montant total" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance +msgid "Amount advanced" +msgstr "Montant avancé" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Amount in Order Currency" +msgstr "Montant dans la Devise de la Commande" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Amount of advance must be positive." +msgstr "Le montant de l'avance doit être positif." + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Cancel" +msgstr "Annuler" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount +msgid "Curr. amount" +msgstr "Montant en devise" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Currency" +msgstr "Devise" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date +msgid "Date" +msgstr "Date" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id +msgid "ID" +msgstr "ID" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound +msgid "Inbound" +msgstr "Entrant" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Inbound amount of advance is greater than residual amount on sale" +msgstr "" +"Le montant de l'avance reçue est supérieur au montant résiduel de la vente" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id +msgid "Journal" +msgstr "Journal" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id +msgid "Journal Currency" +msgstr "Devise du Journal" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_move +msgid "Journal Entry" +msgstr "Écriture comptable" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid +msgid "Last Updated by" +msgstr "Dernière modification par" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date +msgid "Last Updated on" +msgstr "Dernière modification le" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Make advance payment" +msgstr "Enregistrer un paiement d'avance" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid +msgid "Not Paid" +msgstr "Non Payé" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Operation" +msgstr "Opération" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id +msgid "Order" +msgstr "Commande" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Currency" +msgstr "Devise de la Commande" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Due Amount" +msgstr "Montant dû de la Commande" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound +msgid "Outbound" +msgstr "Sortant" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Outbound amount of advance is greater than the advanced paid amount" +msgstr "" +"Le montant de l'avance sortante est supérieur au montant de l'avance payée" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid +msgid "Paid" +msgstr "Payé" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial +msgid "Partially Paid" +msgstr "Partiellement Payé" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Pay sale advanced" +msgstr "Enregistrer un paiement d'avance" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Payment Method" +msgstr "Méthode de paiement" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type +msgid "Payment Type" +msgstr "Type de paiement" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Payment advances" +msgstr "Avances de paiement" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids +msgid "Payment move lines" +msgstr "Écritures comptables de paiement" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_payment +msgid "Payments" +msgstr "Paiements" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref +msgid "Ref." +msgstr "Réf." + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual +msgid "Residual amount" +msgstr "Montant restant dû" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id +msgid "Sale" +msgstr "Vente" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_sale_order +msgid "Sales Order" +msgstr "Commandes" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "" +"The amount to advance must always be positive. Please use the payment type " +"to indicate if this is an inbound or an outbound payment." +msgstr "" +"Le montant de l'avance doit toujours être positif. Veuillez utiliser le type " +"de paiement pour indiquer s'il s'agit d'un paiement entrant ou sortant." + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification le" + +#, python-format +#~ msgid "Amount of advance is greater than residual amount on sale" +#~ msgstr "" +#~ "Le montant de l'avance est supérieur au montant restant à payer sur la " +#~ "vente" + +#~ msgid "Amount total" +#~ msgstr "Montant total" diff --git a/sale_advance_payment/i18n/hr.po b/sale_advance_payment/i18n/hr.po new file mode 100644 index 00000000000..a31c5f1ba9c --- /dev/null +++ b/sale_advance_payment/i18n/hr.po @@ -0,0 +1,249 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_advance_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-06-21 12:16+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.17\n" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard +msgid "Account Voucher Wizard" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Advance Payment" +msgstr "Avansno plaćanje" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status +msgid "Advance Payment Status" +msgstr "Status avansnog plaćanja" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total +msgid "Amount Total" +msgstr "Ukupni iznos" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance +msgid "Amount advanced" +msgstr "Iznos avansa" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Amount in Order Currency" +msgstr "Iznos u valuti naloga" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Amount of advance must be positive." +msgstr "Iznos avansa mora biti pozitivan." + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Cancel" +msgstr "Otkaži" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid +msgid "Created by" +msgstr "Kreirao" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date +msgid "Created on" +msgstr "Kreirano" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount +msgid "Curr. amount" +msgstr "Iznos u valuti" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Currency" +msgstr "Valuta" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date +msgid "Date" +msgstr "Datum" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name +msgid "Display Name" +msgstr "Prikazani naziv" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id +msgid "ID" +msgstr "ID" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound +msgid "Inbound" +msgstr "Ulazno" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Inbound amount of advance is greater than residual amount on sale" +msgstr "Ulazni iznos avansa je veći od dospjelog iznosa prodaje" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id +msgid "Journal" +msgstr "Dnevnik" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id +msgid "Journal Currency" +msgstr "Valuta dnevnika" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_move +msgid "Journal Entry" +msgstr "Zapis dnevnika" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid +msgid "Last Updated by" +msgstr "Zadnje ažurirao" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date +msgid "Last Updated on" +msgstr "Zadnje ažurirano" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Make advance payment" +msgstr "Napravi avansno plaćanje" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid +msgid "Not Paid" +msgstr "Nije plaćeno" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Operation" +msgstr "Operacija" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id +msgid "Order" +msgstr "Ponuda" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Currency" +msgstr "Valuta ponude" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Due Amount" +msgstr "Dospjeli iznos ponude" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound +msgid "Outbound" +msgstr "Izlazno" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Outbound amount of advance is greater than the advanced paid amount" +msgstr "Izlazni iznos avansa je veći od avansno plaćenog iznosa" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid +msgid "Paid" +msgstr "Plaćeno" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial +msgid "Partially Paid" +msgstr "Djelomično plaćeno" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Pay sale advanced" +msgstr "Avansno plaćanje ponude" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Payment Method" +msgstr "Metoda plaćanja" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type +msgid "Payment Type" +msgstr "Vrsta plaćanja" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Payment advances" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids +msgid "Payment move lines" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_payment +msgid "Payments" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref +msgid "Ref." +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual +msgid "Residual amount" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id +msgid "Sale" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "" +"The amount to advance must always be positive. Please use the payment type " +"to indicate if this is an inbound or an outbound payment." +msgstr "" + +#~ msgid "Last Modified on" +#~ msgstr "Zadnje modificirano" diff --git a/sale_advance_payment/i18n/it.po b/sale_advance_payment/i18n/it.po new file mode 100644 index 00000000000..d1835fea2f5 --- /dev/null +++ b/sale_advance_payment/i18n/it.po @@ -0,0 +1,253 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_advance_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-02-05 09:41+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\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: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard +msgid "Account Voucher Wizard" +msgstr "Procedura per ricevuta contabile" + +#. module: sale_advance_payment +#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Advance Payment" +msgstr "Pagamento anticipato" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status +msgid "Advance Payment Status" +msgstr "Stato pagamento anticipato" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total +msgid "Amount Total" +msgstr "Importo totale" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance +msgid "Amount advanced" +msgstr "Importo anticipato" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Amount in Order Currency" +msgstr "Importo nella valuta dell'ordine" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Amount of advance must be positive." +msgstr "L'importo dell'anticipo deve essere positivo." + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Cancel" +msgstr "Annulla" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount +msgid "Curr. amount" +msgstr "Importo valuta" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Currency" +msgstr "Valuta" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date +msgid "Date" +msgstr "Data" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id +msgid "ID" +msgstr "ID" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound +msgid "Inbound" +msgstr "In entrata" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Inbound amount of advance is greater than residual amount on sale" +msgstr "" +"L'importo dell'anticipo in entrata è superiore all'importo residuo in vendita" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id +msgid "Journal" +msgstr "Registro" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id +msgid "Journal Currency" +msgstr "Valuta registro" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_move +msgid "Journal Entry" +msgstr "Registrazione contabile" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Make advance payment" +msgstr "Effettua il pagamento anticipato" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid +msgid "Not Paid" +msgstr "Non pagato" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Operation" +msgstr "Operazione" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id +msgid "Order" +msgstr "Ordine" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Currency" +msgstr "Valuta ordine" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Due Amount" +msgstr "Importo dovuto dell'ordine" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound +msgid "Outbound" +msgstr "In uscita" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Outbound amount of advance is greater than the advanced paid amount" +msgstr "" +"L'importo dell'anticipo in uscita è superiore all'importo dell'anticipo " +"pagato" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid +msgid "Paid" +msgstr "Pagato" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial +msgid "Partially Paid" +msgstr "Pagato parzialmente" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Pay sale advanced" +msgstr "Paga anticipo vendita" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Payment Method" +msgstr "Metodo di pagamento" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type +msgid "Payment Type" +msgstr "Tipo pagamento" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Payment advances" +msgstr "Pagamenti anticipati" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids +msgid "Payment move lines" +msgstr "Righe movimento pagamento" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_payment +msgid "Payments" +msgstr "Pagamenti" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref +msgid "Ref." +msgstr "Rif." + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual +msgid "Residual amount" +msgstr "Importo residuo" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id +msgid "Sale" +msgstr "Vendita" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_sale_order +msgid "Sales Order" +msgstr "Ordine di vendita" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "" +"The amount to advance must always be positive. Please use the payment type " +"to indicate if this is an inbound or an outbound payment." +msgstr "" +"L'importo da anticipare deve essere sempre positivo. Utilizzare il tipo di " +"pagamento per indicare se si tratta di un pagamento in entrata o in uscita." + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" diff --git a/sale_advance_payment/i18n/sale_advance_payment.pot b/sale_advance_payment/i18n/sale_advance_payment.pot new file mode 100644 index 00000000000..01087545df7 --- /dev/null +++ b/sale_advance_payment/i18n/sale_advance_payment.pot @@ -0,0 +1,242 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_advance_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.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: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard +msgid "Account Voucher Wizard" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Advance Payment" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status +msgid "Advance Payment Status" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total +msgid "Amount Total" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance +msgid "Amount advanced" +msgstr "" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Amount in Order Currency" +msgstr "" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Amount of advance must be positive." +msgstr "" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Cancel" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid +msgid "Created by" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date +msgid "Created on" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount +msgid "Curr. amount" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Currency" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date +msgid "Date" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name +msgid "Display Name" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id +msgid "ID" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound +msgid "Inbound" +msgstr "" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Inbound amount of advance is greater than residual amount on sale" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id +msgid "Journal" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id +msgid "Journal Currency" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date +msgid "Last Updated on" +msgstr "" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Make advance payment" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid +msgid "Not Paid" +msgstr "" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Operation" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id +msgid "Order" +msgstr "" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Currency" +msgstr "" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Order Due Amount" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound +msgid "Outbound" +msgstr "" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "Outbound amount of advance is greater than the advanced paid amount" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid +msgid "Paid" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial +msgid "Partially Paid" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Pay sale advanced" +msgstr "" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard +msgid "Payment Method" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type +msgid "Payment Type" +msgstr "" + +#. module: sale_advance_payment +#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form +msgid "Payment advances" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids +msgid "Payment move lines" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_account_payment +msgid "Payments" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref +msgid "Ref." +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual +msgid "Residual amount" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id +msgid "Sale" +msgstr "" + +#. module: sale_advance_payment +#: model:ir.model,name:sale_advance_payment.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: sale_advance_payment +#. odoo-python +#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0 +#, python-format +msgid "" +"The amount to advance must always be positive. Please use the payment type " +"to indicate if this is an inbound or an outbound payment." +msgstr "" diff --git a/sale_advance_payment/models/__init__.py b/sale_advance_payment/models/__init__.py new file mode 100644 index 00000000000..fad33e7989b --- /dev/null +++ b/sale_advance_payment/models/__init__.py @@ -0,0 +1,3 @@ +from . import payment +from . import sale +from . import account_move diff --git a/sale_advance_payment/models/account_move.py b/sale_advance_payment/models/account_move.py new file mode 100644 index 00000000000..a638f4d8e0c --- /dev/null +++ b/sale_advance_payment/models/account_move.py @@ -0,0 +1,21 @@ +# Copyright 2022 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 action_post(self): + # Automatic reconciliation of payment when invoice confirmed. + res = super().action_post() + sale_order = self.mapped("line_ids.sale_line_ids.order_id") + if sale_order and self.invoice_outstanding_credits_debits_widget is not False: + json_invoice_outstanding_data = ( + self.invoice_outstanding_credits_debits_widget.get("content", []) + ) + for data in json_invoice_outstanding_data: + if data.get("move_id") in sale_order.account_payment_ids.move_id.ids: + self.js_assign_outstanding_line(line_id=data.get("id")) + return res diff --git a/sale_advance_payment/models/payment.py b/sale_advance_payment/models/payment.py new file mode 100644 index 00000000000..f7d70016a51 --- /dev/null +++ b/sale_advance_payment/models/payment.py @@ -0,0 +1,10 @@ +# Copyright 2017 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountPayment(models.Model): + _inherit = "account.payment" + + sale_id = fields.Many2one(comodel_name="sale.order", string="Sale", readonly=True) diff --git a/sale_advance_payment/models/sale.py b/sale_advance_payment/models/sale.py new file mode 100644 index 00000000000..8c221514939 --- /dev/null +++ b/sale_advance_payment/models/sale.py @@ -0,0 +1,97 @@ +# Copyright 2017 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models +from odoo.tools import float_compare + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + account_payment_ids = fields.One2many( + comodel_name="account.payment", + inverse_name="sale_id", + string="Pay sale advanced", + ) + amount_residual = fields.Float( + string="Residual amount", + compute="_compute_advance_payment", + store=True, + ) + payment_line_ids = fields.Many2many( + comodel_name="account.move.line", + string="Payment move lines", + compute="_compute_advance_payment", + store=True, + ) + advance_payment_status = fields.Selection( + selection=[ + ("not_paid", "Not Paid"), + ("paid", "Paid"), + ("partial", "Partially Paid"), + ], + store=True, + copy=False, + tracking=True, + compute="_compute_advance_payment", + ) + + @api.depends( + "currency_id", + "company_id", + "amount_total", + "account_payment_ids", + "account_payment_ids.state", + "account_payment_ids.move_id", + "account_payment_ids.move_id.line_ids", + "account_payment_ids.move_id.line_ids.date", + "account_payment_ids.move_id.line_ids.debit", + "account_payment_ids.move_id.line_ids.credit", + "account_payment_ids.move_id.line_ids.currency_id", + "account_payment_ids.move_id.line_ids.amount_currency", + "invoice_ids.amount_residual", + ) + def _compute_advance_payment(self): + for order in self: + mls = order.account_payment_ids.mapped("move_id.line_ids").filtered( + lambda x: x.account_id.account_type == "asset_receivable" + and x.parent_state == "posted" + ) + advance_amount = 0.0 + for line in mls: + line_currency = line.currency_id or line.company_id.currency_id + # Exclude reconciled pre-payments amount because once reconciled + # the pre-payment will reduce invoice residual amount like any + # other payment. + line_amount = ( + line.amount_residual_currency + if line.currency_id + else line.amount_residual + ) + line_amount *= -1 + if line_currency != order.currency_id: + advance_amount += line.currency_id._convert( + line_amount, + order.currency_id, + order.company_id, + line.date or fields.Date.today(), + ) + else: + advance_amount += line_amount + # Consider payments in related invoices. + invoice_paid_amount = 0.0 + for inv in order.invoice_ids: + invoice_paid_amount += inv.amount_total - inv.amount_residual + amount_residual = order.amount_total - advance_amount - invoice_paid_amount + payment_state = "not_paid" + if mls: + has_due_amount = float_compare( + amount_residual, 0.0, precision_rounding=order.currency_id.rounding + ) + if has_due_amount <= 0: + payment_state = "paid" + elif has_due_amount > 0: + payment_state = "partial" + order.payment_line_ids = mls + order.amount_residual = amount_residual + order.advance_payment_status = payment_state diff --git a/sale_advance_payment/pyproject.toml b/sale_advance_payment/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/sale_advance_payment/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_advance_payment/readme/CONTRIBUTORS.md b/sale_advance_payment/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..c422679f907 --- /dev/null +++ b/sale_advance_payment/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- Omar Castiñeira Saaevdra \<\> +- Daniel Reis \<\> +- Nikul Chaudhary \<\> +- Manuel Regidor \<\> +- Urvisha Desai \<\> diff --git a/sale_advance_payment/readme/DESCRIPTION.md b/sale_advance_payment/readme/DESCRIPTION.md new file mode 100644 index 00000000000..02808e96b21 --- /dev/null +++ b/sale_advance_payment/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +The module allows to add advance payments on sales and then use them on +invoices. diff --git a/sale_advance_payment/readme/ROADMAP.md b/sale_advance_payment/readme/ROADMAP.md new file mode 100644 index 00000000000..2239b5e6522 --- /dev/null +++ b/sale_advance_payment/readme/ROADMAP.md @@ -0,0 +1,3 @@ +Split several computed values in separate fields (mls, advance_amount, +amount_residual). This allows a better comprehension of logic, and a +better inheritance possibility. diff --git a/sale_advance_payment/readme/USAGE.md b/sale_advance_payment/readme/USAGE.md new file mode 100644 index 00000000000..2a4b64781f7 --- /dev/null +++ b/sale_advance_payment/readme/USAGE.md @@ -0,0 +1,9 @@ +To use this module, you need to: + +- Go to a sale order. +- Click on "Pay Sale Advance". +- Select the Journal and specify the amount of the advanced payment. +- "Make Advance Payment". + +When generating the invoice, the system displays the advanced payments, +select those you want to add to the invoice. diff --git a/sale_advance_payment/security/ir.model.access.csv b/sale_advance_payment/security/ir.model.access.csv new file mode 100644 index 00000000000..0b97dbeee47 --- /dev/null +++ b/sale_advance_payment/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_payment_salesman,account.payment salesman,account.model_account_payment,sales_team.group_sale_salesman,1,1,1,0 +access_account_payment_method_salesman,account.payment.method salesman,account.model_account_payment_method,sales_team.group_sale_salesman,1,0,0,0 +access_account_voucher_wizard_salesman,access_account_voucher_wizard_salesman,model_account_voucher_wizard,sales_team.group_sale_salesman,1,1,1,0 diff --git a/sale_advance_payment/static/description/icon.png b/sale_advance_payment/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/sale_advance_payment/static/description/icon.png differ diff --git a/sale_advance_payment/static/description/index.html b/sale_advance_payment/static/description/index.html new file mode 100644 index 00000000000..433dc4c38b8 --- /dev/null +++ b/sale_advance_payment/static/description/index.html @@ -0,0 +1,448 @@ + + + + + +Sale Advance Payment + + + +
+

Sale Advance Payment

+ + +

Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

+

The module allows to add advance payments on sales and then use them on +invoices.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  • Go to a sale order.
  • +
  • Click on “Pay Sale Advance”.
  • +
  • Select the Journal and specify the amount of the advanced payment.
  • +
  • “Make Advance Payment”.
  • +
+

When generating the invoice, the system displays the advanced payments, +select those you want to add to the invoice.

+
+
+

Known issues / Roadmap

+

Split several computed values in separate fields (mls, advance_amount, +amount_residual). This allows a better comprehension of logic, and a +better inheritance possibility.

+
+
+

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

+
    +
  • Comunitea
  • +
+
+
+

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.

+

This module is part of the OCA/sale-workflow project on GitHub.

+

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

+
+
+
+ + diff --git a/sale_advance_payment/tests/__init__.py b/sale_advance_payment/tests/__init__.py new file mode 100644 index 00000000000..1d4adafb684 --- /dev/null +++ b/sale_advance_payment/tests/__init__.py @@ -0,0 +1 @@ +from . import test_sale_advance_payment diff --git a/sale_advance_payment/tests/test_sale_advance_payment.py b/sale_advance_payment/tests/test_sale_advance_payment.py new file mode 100644 index 00000000000..79ed772988a --- /dev/null +++ b/sale_advance_payment/tests/test_sale_advance_payment.py @@ -0,0 +1,373 @@ +# Copyright (C) 2021 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) + +from odoo import fields +from odoo.exceptions import ValidationError +from odoo.tests import common + + +class TestSaleAdvancePayment(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + # Partners + cls.res_partner_1 = cls.env["res.partner"].create({"name": "Wood Corner"}) + cls.res_partner_address_1 = cls.env["res.partner"].create( + {"name": "Willie Burke", "parent_id": cls.res_partner_1.id} + ) + cls.res_partner_2 = cls.env["res.partner"].create({"name": "Partner 12"}) + + # Products + cls.product_1 = cls.env["product.product"].create( + {"name": "Desk Combination", "invoice_policy": "order"} + ) + cls.product_2 = cls.env["product.product"].create( + {"name": "Conference Chair", "invoice_policy": "order"} + ) + cls.product_3 = cls.env["product.product"].create( + {"name": "Repair Services", "invoice_policy": "order"} + ) + + cls.tax = cls.env["account.tax"].create( + { + "name": "Tax 15", + "type_tax_use": "sale", + "amount": 20, + } + ) + + # Sale Order + cls.sale_order_1 = cls.env["sale.order"].create( + {"partner_id": cls.res_partner_1.id} + ) + cls.order_line_1 = cls.env["sale.order.line"].create( + { + "order_id": cls.sale_order_1.id, + "product_id": cls.product_1.id, + "product_uom": cls.product_1.uom_id.id, + "product_uom_qty": 10.0, + "price_unit": 100.0, + "tax_id": cls.tax, + } + ) + cls.order_line_2 = cls.env["sale.order.line"].create( + { + "order_id": cls.sale_order_1.id, + "product_id": cls.product_2.id, + "product_uom": cls.product_2.uom_id.id, + "product_uom_qty": 25.0, + "price_unit": 40.0, + "tax_id": cls.tax, + } + ) + cls.order_line_3 = cls.env["sale.order.line"].create( + { + "order_id": cls.sale_order_1.id, + "product_id": cls.product_3.id, + "product_uom": cls.product_3.uom_id.id, + "product_uom_qty": 20.0, + "price_unit": 50.0, + "tax_id": cls.tax, + } + ) + + cls.active_euro = False + cls.currency_euro = ( + cls.env["res.currency"] + .with_context(active_test=False) + .search([("name", "=", "EUR")]) + ) + # active euro currency if inactive for test + if not cls.currency_euro.active: + cls.currency_euro.active = True + cls.active_euro = True + cls.currency_usd = cls.env["res.currency"].search([("name", "=", "USD")]) + cls.currency_rate = cls.env["res.currency.rate"].search( + [ + ("currency_id", "=", cls.currency_usd.id), + ("name", "=", fields.Date.today()), + ] + ) + if cls.currency_rate: + cls.currency_rate.write({"inverse_company_rate": 1.20}) + else: + cls.currency_rate = cls.env["res.currency.rate"].create( + { + "inverse_company_rate": 1.20, + "currency_id": cls.currency_euro.id, + "name": fields.Date.today(), + } + ) + + cls.journal_eur_bank = cls.env["account.journal"].create( + { + "name": "Journal Euro Bank", + "type": "bank", + "code": "111", + "currency_id": cls.currency_euro.id, + } + ) + + cls.journal_usd_bank = cls.env["account.journal"].create( + { + "name": "Journal USD Bank", + "type": "bank", + "code": "222", + "currency_id": cls.currency_usd.id, + } + ) + cls.journal_eur_cash = cls.env["account.journal"].create( + { + "name": "Journal Euro Cash", + "type": "cash", + "code": "333", + "currency_id": cls.currency_euro.id, + } + ) + + cls.journal_usd_cash = cls.env["account.journal"].create( + { + "name": "Journal USD Cash", + "type": "cash", + "code": "444", + "currency_id": cls.currency_usd.id, + } + ) + + def test_01_sale_advance_payment(self): + self.assertEqual( + self.sale_order_1.amount_residual, + 3600, + ) + self.assertEqual( + self.sale_order_1.amount_residual, + self.sale_order_1.amount_total, + "Amounts should match", + ) + + context_payment = { + "active_ids": [self.sale_order_1.id], + "active_id": self.sale_order_1.id, + } + + # Check residual > advance payment and the comparison takes + # into account the currency. 3001*1.2 > 3600 + with self.assertRaises(ValidationError): + advance_payment_0 = ( + self.env["account.voucher.wizard"] + .with_context(**context_payment) + .create( + { + "journal_id": self.journal_eur_bank.id, + "payment_type": "inbound", + "amount_advance": 3001, + "order_id": self.sale_order_1.id, + } + ) + ) + advance_payment_0.make_advance_payment() + + # Create Advance Payment 1 - EUR - bank + advance_payment_1 = ( + self.env["account.voucher.wizard"] + .with_context(**context_payment) + .create( + { + "journal_id": self.journal_eur_bank.id, + "payment_type": "inbound", + "amount_advance": 100, + "order_id": self.sale_order_1.id, + } + ) + ) + advance_payment_1.make_advance_payment() + + self.assertEqual(self.sale_order_1.amount_residual, 3480) + + # Create Advance Payment 2 - USD - cash + advance_payment_2 = ( + self.env["account.voucher.wizard"] + .with_context(**context_payment) + .create( + { + "journal_id": self.journal_usd_cash.id, + "payment_type": "inbound", + "amount_advance": 200, + "order_id": self.sale_order_1.id, + } + ) + ) + advance_payment_2.make_advance_payment() + + self.assertEqual(self.sale_order_1.amount_residual, 3280) + + # Confirm Sale Order + self.sale_order_1.action_confirm() + + # Create Advance Payment 3 - EUR - cash + advance_payment_3 = ( + self.env["account.voucher.wizard"] + .with_context(**context_payment) + .create( + { + "journal_id": self.journal_eur_cash.id, + "payment_type": "inbound", + "amount_advance": 250, + "order_id": self.sale_order_1.id, + } + ) + ) + advance_payment_3.make_advance_payment() + self.assertEqual(self.sale_order_1.amount_residual, 2980) + + # Create Advance Payment 4 - USD - bank + advance_payment_4 = ( + self.env["account.voucher.wizard"] + .with_context(**context_payment) + .create( + { + "journal_id": self.journal_usd_bank.id, + "payment_type": "inbound", + "amount_advance": 400, + "order_id": self.sale_order_1.id, + } + ) + ) + advance_payment_4.make_advance_payment() + self.assertEqual(self.sale_order_1.amount_residual, 2580) + + # Check that the outbound amount is not greated than the + # amount paid in advanced (in EUR) + with self.assertRaises(ValidationError): + advance_payment_5 = ( + self.env["account.voucher.wizard"] + .with_context(**context_payment) + .create( + { + "journal_id": self.journal_eur_bank.id, + "payment_type": "outbound", + "amount_advance": 850.01, + "order_id": self.sale_order_1.id, + } + ) + ) + advance_payment_5.make_advance_payment() + # Create Invoice + invoice = self.sale_order_1._create_invoices() + invoice.action_post() + + # Compare payments + rate = self.currency_rate.inverse_company_rate + payment_list = [100 * rate, 200, 250 * rate, 400] + payments = invoice.invoice_outstanding_credits_debits_widget + result = [d["amount"] for d in payments["content"]] + self.assertEqual(set(payment_list), set(result)) + + def test_02_residual_amount_with_invoice(self): + self.assertEqual( + self.sale_order_1.amount_residual, + 3600, + ) + self.assertEqual( + self.sale_order_1.amount_residual, + self.sale_order_1.amount_total, + ) + # Create Advance Payment 1 - EUR - bank + context_payment = { + "active_ids": [self.sale_order_1.id], + "active_id": self.sale_order_1.id, + } + # Create Advance Payment 2 - USD - cash + advance_payment_2 = ( + self.env["account.voucher.wizard"] + .with_context(**context_payment) + .create( + { + "journal_id": self.journal_usd_cash.id, + "payment_type": "inbound", + "amount_advance": 200, + "order_id": self.sale_order_1.id, + } + ) + ) + advance_payment_2.make_advance_payment() + pre_payment = self.sale_order_1.account_payment_ids + self.assertEqual(len(pre_payment), 1) + self.assertEqual(self.sale_order_1.amount_residual, 3400) + # generate invoice, pay invoice, check amount residual. + self.sale_order_1.action_confirm() + self.assertEqual(self.sale_order_1.invoice_status, "to invoice") + self.sale_order_1._create_invoices() + self.assertEqual(self.sale_order_1.invoice_status, "invoiced") + self.assertEqual(self.sale_order_1.amount_residual, 3400) + invoice = self.sale_order_1.invoice_ids + invoice.invoice_date = fields.Date.today() + invoice.action_post() + active_ids = invoice.ids + self.env["account.payment.register"].with_context( + active_model="account.move", active_ids=active_ids + ).create( + { + "amount": 1200.0, + "group_payment": True, + "payment_difference_handling": "open", + } + )._create_payments() + self.assertEqual(self.sale_order_1.amount_residual, 2200) + + def test_03_residual_amount_big_pre_payment(self): + self.assertEqual( + self.sale_order_1.amount_residual, + 3600, + ) + self.assertEqual( + self.sale_order_1.amount_residual, + self.sale_order_1.amount_total, + ) + # Create Advance Payment 1 - EUR - bank + context_payment = { + "active_ids": [self.sale_order_1.id], + "active_id": self.sale_order_1.id, + } + # Create Advance Payment 2 - USD - cash + advance_payment_2 = ( + self.env["account.voucher.wizard"] + .with_context(**context_payment) + .create( + { + "journal_id": self.journal_usd_cash.id, + "payment_type": "inbound", + "amount_advance": 2000, + "order_id": self.sale_order_1.id, + } + ) + ) + advance_payment_2.make_advance_payment() + pre_payment = self.sale_order_1.account_payment_ids + self.assertEqual(len(pre_payment), 1) + self.assertEqual(self.sale_order_1.amount_residual, 1600) + # generate a partial invoice, reconcile with pre payment, check amount residual. + self.sale_order_1.action_confirm() + self.assertEqual(self.sale_order_1.invoice_status, "to invoice") + # Adjust invoice_policy method to then do a partial invoice with a total amount + # smaller than the pre-payment. + self.product_1.invoice_policy = "delivery" + self.order_line_1.qty_delivered = 10.0 + self.assertEqual(self.order_line_1.qty_to_invoice, 10.0) + self.product_2.invoice_policy = "delivery" + self.order_line_2.qty_delivered = 0.0 + self.assertEqual(self.order_line_2.qty_to_invoice, 0.0) + self.product_3.invoice_policy = "delivery" + self.order_line_3.qty_delivered = 0.0 + self.assertEqual(self.order_line_3.qty_to_invoice, 0.0) + self.sale_order_1._create_invoices() + self.assertEqual(self.sale_order_1.invoice_status, "no") + self.assertEqual(self.sale_order_1.amount_residual, 1600) + invoice = self.sale_order_1.invoice_ids + invoice.invoice_date = fields.Date.today() + invoice.action_post() + self.assertEqual(invoice.amount_total, 1200) + self.assertEqual(invoice.amount_residual, 0.0) + self.assertEqual(self.sale_order_1.amount_residual, 1600) + self.assertEqual(invoice.amount_residual, 0) diff --git a/sale_advance_payment/views/sale_view.xml b/sale_advance_payment/views/sale_view.xml new file mode 100644 index 00000000000..284c2190e7d --- /dev/null +++ b/sale_advance_payment/views/sale_view.xml @@ -0,0 +1,97 @@ + + + + sale.order.form + sale.order + + + + + + + + + + + + + + + + + + + + sale.order.tree + sale.order + + + + + + + + + + + + sale.order.tree + sale.order + + + + + + + + + + + diff --git a/sale_advance_payment/wizard/__init__.py b/sale_advance_payment/wizard/__init__.py new file mode 100644 index 00000000000..06aef981fea --- /dev/null +++ b/sale_advance_payment/wizard/__init__.py @@ -0,0 +1 @@ +from . import sale_advance_payment_wzd diff --git a/sale_advance_payment/wizard/sale_advance_payment_wzd.py b/sale_advance_payment/wizard/sale_advance_payment_wzd.py new file mode 100644 index 00000000000..54a8977c761 --- /dev/null +++ b/sale_advance_payment/wizard/sale_advance_payment_wzd.py @@ -0,0 +1,167 @@ +# Copyright 2017 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import _, api, exceptions, fields, models +from odoo.exceptions import UserError +from odoo.tools import float_compare + + +class AccountVoucherWizard(models.TransientModel): + _name = "account.voucher.wizard" + _description = "Account Voucher Wizard" + + order_id = fields.Many2one("sale.order", required=True) + journal_id = fields.Many2one( + "account.journal", + "Journal", + required=True, + domain=[("type", "in", ("bank", "cash"))], + ) + journal_currency_id = fields.Many2one( + "res.currency", + "Journal Currency", + store=True, + readonly=False, + compute="_compute_get_journal_currency", + ) + currency_id = fields.Many2one("res.currency", "Currency") + amount_total = fields.Monetary() + amount_advance = fields.Monetary( + "Amount advanced", required=True, currency_field="journal_currency_id" + ) + date = fields.Date(required=True, default=fields.Date.context_today) + currency_amount = fields.Monetary( + "Curr. amount", + currency_field="currency_id", + compute="_compute_currency_amount", + store=True, + ) + payment_ref = fields.Char("Ref.") + payment_type = fields.Selection( + [("inbound", "Inbound"), ("outbound", "Outbound")], + default="inbound", + required=True, + ) + + @api.depends("journal_id") + def _compute_get_journal_currency(self): + for wzd in self: + wzd.journal_currency_id = ( + wzd.journal_id.currency_id.id + or wzd.journal_id.company_id.currency_id.id + ) + + @api.constrains("amount_advance") + def check_amount(self): + if self.amount_advance <= 0: + raise exceptions.ValidationError(_("Amount of advance must be positive.")) + if self.env.context.get("active_id", False): + if self.payment_type == "inbound": + if ( + float_compare( + self.currency_amount, + self.order_id.amount_residual, + precision_digits=2, + ) + > 0 + ): + raise exceptions.ValidationError( + _( + "Inbound amount of advance is greater than residual " + "amount on sale" + ) + ) + else: + paid_in_advanced = self.order_id.amount_total - self.amount_total + if ( + float_compare( + self.currency_amount, + paid_in_advanced, + precision_digits=2, + ) + > 0 + ): + raise exceptions.ValidationError( + _( + "Outbound amount of advance is greater than the " + "advanced paid amount" + ) + ) + + @api.model + def default_get(self, fields_list): + res = super().default_get(fields_list) + sale_ids = self.env.context.get("active_ids", []) + if not sale_ids: + return res + sale_id = fields.first(sale_ids) + sale = self.env["sale.order"].browse(sale_id) + if "amount_total" in fields_list: + res.update( + { + "order_id": sale.id, + "amount_total": sale.amount_residual, + "currency_id": sale.pricelist_id.currency_id.id + or sale.currency_id.id, + } + ) + + return res + + @api.depends("journal_id", "date", "amount_advance") + def _compute_currency_amount(self): + for wzd in self: + if wzd.journal_currency_id != wzd.currency_id: + amount_advance = wzd.journal_currency_id._convert( + wzd.amount_advance, + wzd.currency_id, + wzd.order_id.company_id, + wzd.date or fields.Date.today(), + ) + else: + amount_advance = wzd.amount_advance + wzd.currency_amount = amount_advance + + def _prepare_payment_vals(self, sale): + partner_id = sale.partner_invoice_id.commercial_partner_id.id + if self.amount_advance < 0.0: + raise UserError( + _( + "The amount to advance must always be positive. " + "Please use the payment type to indicate if this " + "is an inbound or an outbound payment." + ) + ) + + return { + "date": self.date, + "amount": self.amount_advance, + "payment_type": self.payment_type, + "partner_type": "customer", + "memo": self.payment_ref or sale.name, + "journal_id": self.journal_id.id, + "currency_id": self.journal_currency_id.id, + "partner_id": partner_id, + "payment_method_id": self.env.ref( + "account.account_payment_method_manual_in" + ).id, + } + + def make_advance_payment(self): + """Create customer paylines and validates the payment""" + self.ensure_one() + payment_obj = self.env["account.payment"] + sale_obj = self.env["sale.order"] + sale_ids = self.env.context.get("active_ids", []) + if sale_ids: + sale_id = fields.first(sale_ids) + sale = sale_obj.browse(sale_id) + payment_vals = self._prepare_payment_vals(sale) + payment = payment_obj.create(payment_vals) + sale.account_payment_ids |= payment + payment.action_post() + + return { + "type": "ir.actions.act_window_close", + } diff --git a/sale_advance_payment/wizard/sale_advance_payment_wzd_view.xml b/sale_advance_payment/wizard/sale_advance_payment_wzd_view.xml new file mode 100644 index 00000000000..cc2adf7b985 --- /dev/null +++ b/sale_advance_payment/wizard/sale_advance_payment_wzd_view.xml @@ -0,0 +1,59 @@ + + + + Advance Payment + account.voucher.wizard + form + +
+ + + + + + + + + + + + + + + + + +
+
+
+
+
+ + Advance Payment + ir.actions.act_window + account.voucher.wizard + form + new + +