diff --git a/egd_stock_picking_invoicing_custom/README.rst b/egd_stock_picking_invoicing_custom/README.rst new file mode 100644 index 0000000..20765f4 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/README.rst @@ -0,0 +1,72 @@ +================================== +EGD Stock Picking Invoicing Custom +================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:5a949ea2c891592065844c529a4abf6bbe1439a03a1fcc7ee3e41f306de95c4b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-Escodoo%2Fegd--addons-lightgray.png?logo=github + :target: https://github.com/Escodoo/egd-addons/tree/14.0/egd_stock_picking_invoicing_custom + :alt: Escodoo/egd-addons + +|badge1| |badge2| |badge3| + +This module customizes the stock picking invoicing process by introducing a **Production Date** field in Sales Orders and Invoice. + +When a Sales Order is invoiced, the **Production Date** is transferred to the invoice. Upon confirming the invoice, the analytical line dates are automatically updated to reflect the configured **Production Date**. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +1. Create an invoice from the Sales Order. +2. Select a **Production Date** in the Sales Order. +3. Confirm the invoice to automatically update analytical line dates based on the Production Date. + +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 +~~~~~~~ + +* Escodoo + +Contributors +~~~~~~~~~~~~ + +* `Escodoo `_: + + * Marcel Savegnago + * Kaynnan Lemes + +Maintainers +~~~~~~~~~~~ + +This module is part of the `Escodoo/egd-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/egd_stock_picking_invoicing_custom/__init__.py b/egd_stock_picking_invoicing_custom/__init__.py new file mode 100644 index 0000000..aee8895 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/egd_stock_picking_invoicing_custom/__manifest__.py b/egd_stock_picking_invoicing_custom/__manifest__.py new file mode 100644 index 0000000..757bc5a --- /dev/null +++ b/egd_stock_picking_invoicing_custom/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2024 - TODAY, Escodoo +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "EGD Stock Picking Invoicing Custom", + "summary": """ + EGD Stock Picking Invoicing Custom""", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "author": "Escodoo", + "website": "https://github.com/Escodoo/egd-addons", + "depends": ["stock_picking_invoicing"], + "data": [ + "views/account_move.xml", + "wizards/stock_invoice_onshipping.xml", + ], +} diff --git a/egd_stock_picking_invoicing_custom/i18n/pt_BR.po b/egd_stock_picking_invoicing_custom/i18n/pt_BR.po new file mode 100644 index 0000000..d622d57 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/i18n/pt_BR.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * egd_stock_picking_invoicing_custom +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-19 18:08+0000\n" +"PO-Revision-Date: 2024-11-19 15:08-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 3.4.4\n" + +#. module: egd_stock_picking_invoicing_custom +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_account_move__display_name +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_stock_invoice_onshipping__display_name +msgid "Display Name" +msgstr "Nome Exibido" + +#. module: egd_stock_picking_invoicing_custom +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_account_move__id +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_stock_invoice_onshipping__id +msgid "ID" +msgstr "" + +#. module: egd_stock_picking_invoicing_custom +#: model:ir.model,name:egd_stock_picking_invoicing_custom.model_account_move +msgid "Journal Entry" +msgstr "Lançamento de Diário" + +#. module: egd_stock_picking_invoicing_custom +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_account_move____last_update +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_stock_invoice_onshipping____last_update +msgid "Last Modified on" +msgstr "Última Modificação em" + +#. module: egd_stock_picking_invoicing_custom +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_account_bank_statement_line__production_date +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_account_move__production_date +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_account_payment__production_date +#: model:ir.model.fields,field_description:egd_stock_picking_invoicing_custom.field_stock_invoice_onshipping__production_date +#: model_terms:ir.ui.view,arch_db:egd_stock_picking_invoicing_custom.account_move_form_view +#: model_terms:ir.ui.view,arch_db:egd_stock_picking_invoicing_custom.stock_invoice_onshipping_form_view +msgid "Production Date" +msgstr "Data de Produção" + +#. module: egd_stock_picking_invoicing_custom +#: model:ir.model,name:egd_stock_picking_invoicing_custom.model_stock_invoice_onshipping +msgid "Stock Invoice Onshipping" +msgstr "Faturamento ao Enviar" diff --git a/egd_stock_picking_invoicing_custom/models/__init__.py b/egd_stock_picking_invoicing_custom/models/__init__.py new file mode 100644 index 0000000..9c0a421 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/models/__init__.py @@ -0,0 +1 @@ +from . import account_move diff --git a/egd_stock_picking_invoicing_custom/models/account_move.py b/egd_stock_picking_invoicing_custom/models/account_move.py new file mode 100644 index 0000000..da30647 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/models/account_move.py @@ -0,0 +1,18 @@ +# Copyright 2024 - TODAY, Kaynnan Lemes +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountMove(models.Model): + + _inherit = "account.move" + + production_date = fields.Date(string="Production Date", readonly=True) + + def action_post(self): + res = super().action_post() + for move in self: + if move.production_date: + move.line_ids.analytic_line_ids.write({"date": move.production_date}) + return res diff --git a/egd_stock_picking_invoicing_custom/readme/CONTRIBUTORS.rst b/egd_stock_picking_invoicing_custom/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..c7fe690 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Escodoo `_: + + * Marcel Savegnago + * Kaynnan Lemes diff --git a/egd_stock_picking_invoicing_custom/readme/DESCRIPTION.rst b/egd_stock_picking_invoicing_custom/readme/DESCRIPTION.rst new file mode 100644 index 0000000..6b49fdc --- /dev/null +++ b/egd_stock_picking_invoicing_custom/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module customizes the stock picking invoicing process by introducing a **Production Date** field in Sales Orders and Invoice. + +When a Sales Order is invoiced, the **Production Date** is transferred to the invoice. Upon confirming the invoice, the analytical line dates are automatically updated to reflect the configured **Production Date**. diff --git a/egd_stock_picking_invoicing_custom/readme/USAGE.rst b/egd_stock_picking_invoicing_custom/readme/USAGE.rst new file mode 100644 index 0000000..8c9eab1 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/readme/USAGE.rst @@ -0,0 +1,3 @@ +1. Create an invoice from the Sales Order. +2. Select a **Production Date** in the Sales Order. +3. Confirm the invoice to automatically update analytical line dates based on the Production Date. diff --git a/egd_stock_picking_invoicing_custom/static/description/icon.png b/egd_stock_picking_invoicing_custom/static/description/icon.png new file mode 100644 index 0000000..12ab005 Binary files /dev/null and b/egd_stock_picking_invoicing_custom/static/description/icon.png differ diff --git a/egd_stock_picking_invoicing_custom/static/description/index.html b/egd_stock_picking_invoicing_custom/static/description/index.html new file mode 100644 index 0000000..ddb9c62 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/static/description/index.html @@ -0,0 +1,430 @@ + + + + + +EGD Stock Picking Invoicing Custom + + + +
+

EGD Stock Picking Invoicing Custom

+ + +

Beta License: AGPL-3 Escodoo/egd-addons

+

This module customizes the stock picking invoicing process by introducing a Production Date field in Sales Orders and Invoice.

+

When a Sales Order is invoiced, the Production Date is transferred to the invoice. Upon confirming the invoice, the analytical line dates are automatically updated to reflect the configured Production Date.

+

Table of contents

+ +
+

Usage

+
    +
  1. Create an invoice from the Sales Order.
  2. +
  3. Select a Production Date in the Sales Order.
  4. +
  5. Confirm the invoice to automatically update analytical line dates based on the Production Date.
  6. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Escodoo
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the Escodoo/egd-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/egd_stock_picking_invoicing_custom/views/account_move.xml b/egd_stock_picking_invoicing_custom/views/account_move.xml new file mode 100644 index 0000000..ebc6def --- /dev/null +++ b/egd_stock_picking_invoicing_custom/views/account_move.xml @@ -0,0 +1,17 @@ + + + + + + account.move.form (in egd_sale_custom) + account.move + + + + + + + + + diff --git a/egd_stock_picking_invoicing_custom/wizards/__init__.py b/egd_stock_picking_invoicing_custom/wizards/__init__.py new file mode 100644 index 0000000..87b9317 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/wizards/__init__.py @@ -0,0 +1 @@ +from . import stock_invoice_onshipping diff --git a/egd_stock_picking_invoicing_custom/wizards/stock_invoice_onshipping.py b/egd_stock_picking_invoicing_custom/wizards/stock_invoice_onshipping.py new file mode 100644 index 0000000..a5061e9 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/wizards/stock_invoice_onshipping.py @@ -0,0 +1,19 @@ +# Copyright 2024 - TODAY, Kaynnan Lemes +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockInvoiceOnshipping(models.TransientModel): + _inherit = "stock.invoice.onshipping" + + production_date = fields.Date(string="Production Date") + + def _action_generate_invoices(self): + invoices = super()._action_generate_invoices() + + for invoice in invoices: + if invoice.invoice_line_ids: + invoice.write({"production_date": self.production_date}) + + return invoices diff --git a/egd_stock_picking_invoicing_custom/wizards/stock_invoice_onshipping.xml b/egd_stock_picking_invoicing_custom/wizards/stock_invoice_onshipping.xml new file mode 100644 index 0000000..7ac3003 --- /dev/null +++ b/egd_stock_picking_invoicing_custom/wizards/stock_invoice_onshipping.xml @@ -0,0 +1,22 @@ + + + + + + Stock Invoice Onshipping (in egd_stock_picking_invoicing_custom) + stock.invoice.onshipping + + + + + + + + + diff --git a/setup/egd_stock_picking_invoicing_custom/odoo/addons/egd_stock_picking_invoicing_custom b/setup/egd_stock_picking_invoicing_custom/odoo/addons/egd_stock_picking_invoicing_custom new file mode 120000 index 0000000..411a3e7 --- /dev/null +++ b/setup/egd_stock_picking_invoicing_custom/odoo/addons/egd_stock_picking_invoicing_custom @@ -0,0 +1 @@ +../../../../egd_stock_picking_invoicing_custom \ No newline at end of file diff --git a/setup/egd_stock_picking_invoicing_custom/setup.py b/setup/egd_stock_picking_invoicing_custom/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/egd_stock_picking_invoicing_custom/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)