diff --git a/sale_crm_auto_won/README.rst b/sale_crm_auto_won/README.rst new file mode 100644 index 0000000..a8aba25 --- /dev/null +++ b/sale_crm_auto_won/README.rst @@ -0,0 +1,35 @@ +**This file is going to be generated by oca-gen-addon-readme.** + +*Manual changes will be overwritten.* + +Please provide content in the ``readme`` directory: + +* **DESCRIPTION.rst** (required) +* INSTALL.rst (optional) +* CONFIGURE.rst (optional) +* **USAGE.rst** (optional, highly recommended) +* DEVELOP.rst (optional) +* ROADMAP.rst (optional) +* HISTORY.rst (optional, recommended) +* **CONTRIBUTORS.rst** (optional, highly recommended) +* CREDITS.rst (optional) + +Content of this README will also be drawn from the addon manifest, +from keys such as name, authors, maintainers, development_status, +and license. + +A good, one sentence summary in the manifest is also highly recommended. + + +Automatic changelog generation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`HISTORY.rst` can be auto generated using `towncrier `_. + +Just put towncrier compatible changelog fragments into `readme/newsfragments` +and the changelog file will be automatically generated and updated when a new fragment is added. + +Please refer to `towncrier` documentation to know more. + +NOTE: the changelog will be automatically generated when using `/ocabot merge $option`. +If you need to run it manually, refer to `OCA/maintainer-tools README `_. \ No newline at end of file diff --git a/sale_crm_auto_won/__init__.py b/sale_crm_auto_won/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/sale_crm_auto_won/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_crm_auto_won/__manifest__.py b/sale_crm_auto_won/__manifest__.py new file mode 100644 index 0000000..3379674 --- /dev/null +++ b/sale_crm_auto_won/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2024 KMEE +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Sale Crm Auto Won", + "summary": """KMEE""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "KMEE, Odoo Community Association (OCA)", + "website": "https://github.com/KMEE/kmee-odoo-addons", + "depends": ["sale_crm"], + "data": [], + "demo": [], +} diff --git a/sale_crm_auto_won/models/__init__.py b/sale_crm_auto_won/models/__init__.py new file mode 100644 index 0000000..6aacb75 --- /dev/null +++ b/sale_crm_auto_won/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order diff --git a/sale_crm_auto_won/models/sale_order.py b/sale_crm_auto_won/models/sale_order.py new file mode 100644 index 0000000..756fd36 --- /dev/null +++ b/sale_crm_auto_won/models/sale_order.py @@ -0,0 +1,14 @@ +# Copyright 2024 KMEE +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class SaleOrder(models.Model): + + _inherit = "sale.order" + + def action_confirm(self): + for sale in self: + sale.opportunity_id.action_set_won_rainbowman() + return super().action_confirm() diff --git a/setup/sale_crm_auto_won/odoo/addons/sale_crm_auto_won b/setup/sale_crm_auto_won/odoo/addons/sale_crm_auto_won new file mode 120000 index 0000000..728fd2f --- /dev/null +++ b/setup/sale_crm_auto_won/odoo/addons/sale_crm_auto_won @@ -0,0 +1 @@ +../../../../sale_crm_auto_won \ No newline at end of file diff --git a/setup/sale_crm_auto_won/setup.py b/setup/sale_crm_auto_won/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/sale_crm_auto_won/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)