diff --git a/sale_order_invoice_wizard_date/README.rst b/sale_order_invoice_wizard_date/README.rst new file mode 100644 index 0000000..4548030 --- /dev/null +++ b/sale_order_invoice_wizard_date/README.rst @@ -0,0 +1,60 @@ +============================== +Sale Order Invoice Wizard Date +============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3a0ebfec951ad08c7970832f404b7736e323f24783402d767272f2e6ae77daff + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-solvosci%2Fslv--sale-lightgray.png?logo=github + :target: https://github.com/solvosci/slv-sale/tree/17.0/sale_order_invoice_wizard_date + :alt: solvosci/slv-sale + +|badge1| |badge2| |badge3| + +Add “invoice date” field when creating multiple order invoices to be included in draft invoices + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* Solvos + +Contributors +~~~~~~~~~~~~ + +* Iria Alonso + +Maintainers +~~~~~~~~~~~ + +This module is part of the `solvosci/slv-sale `_ project on GitHub. + +You are welcome to contribute. diff --git a/sale_order_invoice_wizard_date/__init__.py b/sale_order_invoice_wizard_date/__init__.py new file mode 100644 index 0000000..134df27 --- /dev/null +++ b/sale_order_invoice_wizard_date/__init__.py @@ -0,0 +1,2 @@ +from . import wizard +from . import models diff --git a/sale_order_invoice_wizard_date/__manifest__.py b/sale_order_invoice_wizard_date/__manifest__.py new file mode 100644 index 0000000..921f015 --- /dev/null +++ b/sale_order_invoice_wizard_date/__manifest__.py @@ -0,0 +1,18 @@ +# © 2024 Solvos Consultoría Informática () +# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html +{ + "name": "Sale Order Invoice Wizard Date", + "summary": """ + Add “invoice date” field when creating multiple order invoices to be included in draft invoices + """, + "author": "Solvos", + "license": "LGPL-3", + "version": "17.0.1.0.0", + "category": "Sale", + "website": "https://github.com/solvosci/slv-sale", + "depends": ["sale"], + "data": [ + "wizard/sale_make_invoice_advance_views.xml", + ], + 'installable': True, +} diff --git a/sale_order_invoice_wizard_date/i18n/es.po b/sale_order_invoice_wizard_date/i18n/es.po new file mode 100644 index 0000000..7912b13 --- /dev/null +++ b/sale_order_invoice_wizard_date/i18n/es.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_order_invoice_wizard_date +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-19 07:28+0000\n" +"PO-Revision-Date: 2024-11-19 07:28+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: sale_order_invoice_wizard_date +#: model:ir.model.fields,field_description:sale_order_invoice_wizard_date.field_sale_advance_payment_inv__invoice_date +msgid "Invoice Date" +msgstr "Fecha de factura" + +#. module: sale_order_invoice_wizard_date +#: model:ir.model,name:sale_order_invoice_wizard_date.model_sale_advance_payment_inv +msgid "Sales Advance Payment Invoice" +msgstr "Pago anticipado para factura de ventas" diff --git a/sale_order_invoice_wizard_date/i18n/sale_order_invoice_wizard_date.pot b/sale_order_invoice_wizard_date/i18n/sale_order_invoice_wizard_date.pot new file mode 100644 index 0000000..f930e41 --- /dev/null +++ b/sale_order_invoice_wizard_date/i18n/sale_order_invoice_wizard_date.pot @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_order_invoice_wizard_date +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-19 07:27+0000\n" +"PO-Revision-Date: 2024-11-19 07:27+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: sale_order_invoice_wizard_date +#: model:ir.model.fields,field_description:sale_order_invoice_wizard_date.field_sale_advance_payment_inv__invoice_date +msgid "Invoice Date" +msgstr "" + +#. module: sale_order_invoice_wizard_date +#: model:ir.model,name:sale_order_invoice_wizard_date.model_sale_advance_payment_inv +msgid "Sales Advance Payment Invoice" +msgstr "" diff --git a/sale_order_invoice_wizard_date/models/__init__.py b/sale_order_invoice_wizard_date/models/__init__.py new file mode 100644 index 0000000..6aacb75 --- /dev/null +++ b/sale_order_invoice_wizard_date/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order diff --git a/sale_order_invoice_wizard_date/models/sale_order.py b/sale_order_invoice_wizard_date/models/sale_order.py new file mode 100644 index 0000000..0417283 --- /dev/null +++ b/sale_order_invoice_wizard_date/models/sale_order.py @@ -0,0 +1,16 @@ +# © 2024 Solvos Consultoría Informática () +# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html +from odoo import models + + +class SaleOrder(models.Model): + _inherit = 'sale.order' + + def _create_invoices(self, grouped=False, final=False, date=None): + moves = super()._create_invoices(grouped=grouped, final=final, date=date) + invoice_date = self.env.context.get('wizard_order_invoice_date', False) + if invoice_date: + moves.write({ + 'invoice_date': invoice_date, + }) + return moves diff --git a/sale_order_invoice_wizard_date/readme/CONTRIBUTORS.rst b/sale_order_invoice_wizard_date/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..8b5203a --- /dev/null +++ b/sale_order_invoice_wizard_date/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Iria Alonso diff --git a/sale_order_invoice_wizard_date/readme/DESCRIPTION.rst b/sale_order_invoice_wizard_date/readme/DESCRIPTION.rst new file mode 100644 index 0000000..da608fc --- /dev/null +++ b/sale_order_invoice_wizard_date/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Add “invoice date” field when creating multiple order invoices to be included in draft invoices diff --git a/sale_order_invoice_wizard_date/static/description/icon.png b/sale_order_invoice_wizard_date/static/description/icon.png new file mode 100644 index 0000000..daa2a02 Binary files /dev/null and b/sale_order_invoice_wizard_date/static/description/icon.png differ diff --git a/sale_order_invoice_wizard_date/static/description/index.html b/sale_order_invoice_wizard_date/static/description/index.html new file mode 100644 index 0000000..a2998a1 --- /dev/null +++ b/sale_order_invoice_wizard_date/static/description/index.html @@ -0,0 +1,415 @@ + + + + + +Sale Order Invoice Wizard Date + + + +
+

Sale Order Invoice Wizard Date

+ + +

Beta License: LGPL-3 solvosci/slv-sale

+

Add “invoice date” field when creating multiple order invoices to be included in draft invoices

+

Table of contents

+ +
+

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

+
    +
  • Solvos
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the solvosci/slv-sale project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/sale_order_invoice_wizard_date/wizard/__init__.py b/sale_order_invoice_wizard_date/wizard/__init__.py new file mode 100644 index 0000000..fca48c3 --- /dev/null +++ b/sale_order_invoice_wizard_date/wizard/__init__.py @@ -0,0 +1 @@ +from . import sale_make_invoice_advance diff --git a/sale_order_invoice_wizard_date/wizard/sale_make_invoice_advance.py b/sale_order_invoice_wizard_date/wizard/sale_make_invoice_advance.py new file mode 100644 index 0000000..69032cb --- /dev/null +++ b/sale_order_invoice_wizard_date/wizard/sale_make_invoice_advance.py @@ -0,0 +1,18 @@ +# © 2024 Solvos Consultoría Informática () +# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html +from odoo import fields, models + + +class SaleAdvancePaymentInv(models.TransientModel): + _inherit = 'sale.advance.payment.inv' + + invoice_date = fields.Date() + + def _prepare_invoice_values(self, order, so_lines): + values = super()._prepare_invoice_values(order, so_lines) + values['invoice_date'] = self.invoice_date + return values + + def create_invoices(self): + self = self.with_context(wizard_order_invoice_date=self.invoice_date) + return super().create_invoices() diff --git a/sale_order_invoice_wizard_date/wizard/sale_make_invoice_advance_views.xml b/sale_order_invoice_wizard_date/wizard/sale_make_invoice_advance_views.xml new file mode 100644 index 0000000..bf254d5 --- /dev/null +++ b/sale_order_invoice_wizard_date/wizard/sale_make_invoice_advance_views.xml @@ -0,0 +1,14 @@ + + + + Invoice Orders + sale.advance.payment.inv + + + + + + + + +