@ -0,0 +1,42 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Automatic Invoice And Post |
||||
|
========================== |
||||
|
This module generates and post invoice while validating the delivery. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No additional configurations needed |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
General Public License, Version 3 (AGPL v3). |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developers: |
||||
|
(V16) Akhil, |
||||
|
(V17) Jumana Haseen. |
||||
|
Contact : odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Sreerag PM @cybrosys(odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
@ -0,0 +1,42 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Sreerag PM @cybrosys(odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Automatic Invoice And Post', |
||||
|
'version': "18.0.1.0.0", |
||||
|
'category': 'Sales,Warehouse,Accounting', |
||||
|
'summary': """ Auto Invoice Generation and Auto Sending of Invoice on |
||||
|
Delivery validation.""", |
||||
|
'description': """This module generates and post invoice while validating |
||||
|
the delivery and enable to send invoice to customer |
||||
|
on delivery validate .""", |
||||
|
'author': "Cybrosys Techno Solutions", |
||||
|
'company': "Cybrosys Techno Solutions", |
||||
|
'maintainer': "Cybrosys Techno Solutions", |
||||
|
'website': "https://www.cybrosys.com", |
||||
|
'depends': ['base', 'sale_management', 'stock', 'account'], |
||||
|
'data': ['views/res_config_settings_views.xml'], |
||||
|
'license': "AGPL-3", |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
## Module <automatic_invoice_and_post> |
||||
|
|
||||
|
#### 07.02.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
##### ADD |
||||
|
- Initial commit for Automatic Invoice And Post |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Sreerag PM @cybrosys(odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import res_config_settings |
||||
|
from . import stock_picking |
@ -0,0 +1,44 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Sreerag PM @cybrosys(odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ResConfigSettings(models.TransientModel): |
||||
|
""" |
||||
|
This class inherits from the `res.config.settings` model in Odoo and adds |
||||
|
two boolean fields to the |
||||
|
configuration settings page: `create_invoice_delivery_validate` and |
||||
|
`auto_send_invoice`. |
||||
|
""" |
||||
|
_inherit = "res.config.settings" |
||||
|
|
||||
|
is_create_invoice_delivery_validate = fields.Boolean( |
||||
|
string="Auto Post invoice", config_parameter= |
||||
|
'automatic_invoice_and_post.is_create_invoice_delivery_validate', |
||||
|
help="Create and post invoice on delivery validate") |
||||
|
|
||||
|
is_auto_send_invoice = fields.Boolean(string="Auto Send Invoice", |
||||
|
config_parameter= |
||||
|
'automatic_invoice_and_post.is_auto_' |
||||
|
'send_invoice', |
||||
|
help="Enable to send invoice to " |
||||
|
"customer on delivery validate ") |
@ -0,0 +1,70 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Sreerag PM @cybrosys(odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import models |
||||
|
|
||||
|
|
||||
|
class StockPicking(models.Model): |
||||
|
""" |
||||
|
This class inherits from the `stock.picking` model in Odoo and adds |
||||
|
functionality to automatically create and post invoices when a delivery is |
||||
|
validated. |
||||
|
""" |
||||
|
_inherit = 'stock.picking' |
||||
|
|
||||
|
def button_validate(self): |
||||
|
""" |
||||
|
This function is called when a delivery is validated. It checks whether |
||||
|
an invoice should be created and posted automatically based on |
||||
|
configuration settings. If an invoice should be created, it calls |
||||
|
the `_create_invoices` function on the sale associated with the |
||||
|
delivery, creates the invoice, and posts it. |
||||
|
If the `auto_send_invoice` configuration setting is enabled, it sends |
||||
|
an email to the customer with the invoice attached. |
||||
|
|
||||
|
:return: result of the parent class's button_validate function |
||||
|
""" |
||||
|
res = super().button_validate() |
||||
|
auto_validate_invoice = self.env[ |
||||
|
'ir.config_parameter'].sudo().get_param( |
||||
|
'automatic_invoice_and_post.is_create_invoice_delivery_validate') |
||||
|
auto_send_invoice = self.env['ir.config_parameter'].sudo().get_param( |
||||
|
'automatic_invoice_and_post.is_auto_send_invoice') |
||||
|
if auto_validate_invoice: |
||||
|
if any(rec.product_id.invoice_policy == 'delivery' for rec in |
||||
|
self.move_ids) or not self.sale_id.invoice_ids: |
||||
|
# Call the _create_invoices function on the associated sale |
||||
|
# to create the invoice |
||||
|
invoice_created = self.sale_id._create_invoices( |
||||
|
self.sale_id) if self.sale_id else False |
||||
|
# Post the created invoice |
||||
|
if invoice_created: |
||||
|
invoice_created.action_post() |
||||
|
# If automatic invoice sending is enabled and the customer |
||||
|
# has an email address,send the invoice to the customer |
||||
|
if auto_send_invoice and invoice_created.partner_id.email: |
||||
|
template = self.env.ref( |
||||
|
'account.email_template_edi_invoice').sudo() |
||||
|
template.send_mail(invoice_created.id, force_send=True, |
||||
|
email_values={ |
||||
|
'email_to': invoice_created.partner_id.email |
||||
|
}) |
||||
|
return res |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 710 KiB |
After Width: | Height: | Size: 776 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 108 KiB |
After Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 484 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 726 KiB |
After Width: | Height: | Size: 38 KiB |
@ -0,0 +1,28 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!-- The view inherits from the standard "account.res_config_settings_view_form" |
||||
|
view and adds the two new fields in a separate section.--> |
||||
|
<odoo> |
||||
|
<record id="res_config_settings_view_form" model="ir.ui.view"> |
||||
|
<field name="name"> |
||||
|
res.config.settings.view.form.inherit.automatic.invoice.and.post |
||||
|
</field> |
||||
|
<field name="model">res.config.settings</field> |
||||
|
<field name="inherit_id" ref="account.res_config_settings_view_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<xpath expr="//app[@name='account']/block" position="after"> |
||||
|
<block title="Auto Invoice Post" id="auto_invoice_post"> |
||||
|
<setting id="delivery_validate" string="Auto Post invoice" |
||||
|
help="Create and post invoice on delivery validate"> |
||||
|
<field name="is_create_invoice_delivery_validate" |
||||
|
widget="upgrade_boolean"/> |
||||
|
</setting> |
||||
|
<setting id="send_invoice" string="Auto Send Invoice" |
||||
|
help="Enable to send invoice to customer on delivery validate "> |
||||
|
<field name="is_auto_send_invoice" |
||||
|
widget="upgrade_boolean"/> |
||||
|
</setting> |
||||
|
</block> |
||||
|
</xpath> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |