Skip to content

Commit

Permalink
Merge PR #2565 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by rousseldenis
  • Loading branch information
OCA-git-bot committed Feb 12, 2025
2 parents d623c75 + 0f34671 commit c4f68dd
Show file tree
Hide file tree
Showing 41 changed files with 2,936 additions and 0 deletions.
107 changes: 107 additions & 0 deletions sale_isolated_quotation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
=======================
Sale Isolated Quotation
=======================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/14.0/sale_isolated_quotation
: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-14-0/sale-workflow-14-0-sale_isolated_quotation
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/167/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

In some countries/companies, it is already common to separate these two documents.
For filing purposes, the document sequence of quotation and sales order
has to be separated. In practice, there could be multiple quotations open
to a customer, yet only one quotation get converted to the sales order.

This module separate quotation and sales order by adding order_sequence flag in
sale.order model.

Each type of document will have separated sequence numbering.
Quotation will have only 2 state, Draft and Done. Sales Order work as normal.

**Table of contents**

.. contents::
:local:

Usage
=====

* Create Quotation as normal
* As user click "Convert to Order", the isolated sales order will be created

Known issues / Roadmap
======================

Provide a way to purge old quotes to avoid that database grow up excessively

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_isolated_quotation%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Ecosoft

Contributors
~~~~~~~~~~~~

* Kitti U. <[email protected]>
* Robert J Sullivan <[email protected]>
* David Béal <[email protected]>
* Tharathip Chaweewongphan <[email protected]>

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.

.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px
:target: https://github.com/bealdav
:alt: bealdav
.. |maintainer-kittiu| image:: https://github.com/kittiu.png?size=40px
:target: https://github.com/kittiu
:alt: kittiu

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-bealdav| |maintainer-kittiu|

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/14.0/sale_isolated_quotation>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_isolated_quotation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .hooks import post_init_hook, uninstall_hook
from . import models
18 changes: 18 additions & 0 deletions sale_isolated_quotation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Sale Isolated Quotation",
"version": "15.0.1.0.0",
"author": "Ecosoft, Odoo Community Association (OCA)",
"category": "Sales",
"website": "https://github.com/OCA/sale-workflow",
"depends": ["sale_management", "sale_quotation_number"],
"license": "AGPL-3",
"images": [],
"data": ["views/sale_views.xml"],
"installable": True,
"auto_install": False,
"uninstall_hook": "uninstall_hook",
"post_init_hook": "post_init_hook",
"maintainers": ["bealdav", "kittiu"],
}
54 changes: 54 additions & 0 deletions sale_isolated_quotation/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# © 2017 Ecosoft (ecosoft.co.th).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import ast

from odoo import SUPERUSER_ID, api

ACTIONS = (
"sale.action_quotations_with_onboarding",
"sale.action_orders",
)


def post_init_hook(cr, registry):
"""Set value for order_sequence on old records, stop updating sale
order name."""
cr.execute(
"""
update sale_order
set order_sequence = true
where state not in ('draft', 'cancel')
"""
)
cr.execute(
"""
update res_company
set keep_name_so = true
where keep_name_so = false
"""
)


def uninstall_hook(cr, registry):
"""Restore sale.order action, remove context value"""
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
for action_id in ACTIONS:
action = env.ref(action_id)
ctx = ast.literal_eval(action.context)
_cleanup_ctx(ctx)
dom = ast.literal_eval(action.domain or "{}")
dom = [x for x in dom if x[0] != "order_sequence"]
if action_id == "sale.action_orders":
dom.append(("state", "not in", ("draft", "sent", "cancel")))
else:
ctx["search_default_my_quotation"] = True
dom = list(set(dom))
action.write({"context": ctx, "domain": dom})


def _cleanup_ctx(ctx):
if "order_sequence" in ctx:
del ctx["order_sequence"]
if "default_order_sequence" in ctx:
del ctx["default_order_sequence"]
83 changes: 83 additions & 0 deletions sale_isolated_quotation/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_isolated_quotation
#
# Translators:
# OCA Transbot <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-13 01:19+0000\n"
"PO-Revision-Date: 2017-05-13 01:19+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\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"

#. module: sale_isolated_quotation
#: model_terms:ir.ui.view,arch_db:sale_isolated_quotation.view_order_form
msgid "Cancel"
msgstr ""

#. module: sale_isolated_quotation
#: model_terms:ir.ui.view,arch_db:sale_isolated_quotation.view_order_form
msgid "Convert to Order"
msgstr ""

#. module: sale_isolated_quotation
#: model:ir.model.fields,help:sale_isolated_quotation.field_sale_order__order_id
msgid "For Quotation, this field references to its Sales Order"
msgstr ""

#. module: sale_isolated_quotation
#: model:ir.model.fields,help:sale_isolated_quotation.field_sale_order__quote_id
msgid "For Sales Order, this field references to its Quotation"
msgstr ""

#. module: sale_isolated_quotation
#: code:addons/sale_isolated_quotation/models/sale.py:0
#, python-format
msgid "Only quotation can convert to order"
msgstr ""

#. module: sale_isolated_quotation
#: model:ir.model.fields,help:sale_isolated_quotation.field_sale_order__quotation_state
msgid "Only relative quotation states"
msgstr ""

#. module: sale_isolated_quotation
#: model:ir.model.fields,field_description:sale_isolated_quotation.field_sale_order__order_id
#, fuzzy
msgid "Order"
msgstr "Comandes de venda"

#. module: sale_isolated_quotation
#: model:ir.model.fields,field_description:sale_isolated_quotation.field_sale_order__order_sequence
msgid "Order Sequence"
msgstr ""

#. module: sale_isolated_quotation
#: model:ir.model.fields,field_description:sale_isolated_quotation.field_sale_order__quote_id
msgid "Quotation"
msgstr ""

#. module: sale_isolated_quotation
#: model:ir.model.fields,field_description:sale_isolated_quotation.field_sale_order__quotation_state
msgid "Quotation Status"
msgstr ""

#. module: sale_isolated_quotation
#: code:addons/sale_isolated_quotation/models/sale.py:0
#: model:ir.model,name:sale_isolated_quotation.model_sale_order
#, python-format
msgid "Sales Order"
msgstr "Comandes de venda"

#, fuzzy
#~| msgid "Sales Order"
#~ msgid "Sale Order"
#~ msgstr "Comandes de venda"
83 changes: 83 additions & 0 deletions sale_isolated_quotation/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_isolated_quotation
#
# Translators:
# OCA Transbot <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-01 02:53+0000\n"
"PO-Revision-Date: 2021-07-09 15:48+0000\n"
"Last-Translator: Maria Sparenberg <[email protected]>\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\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.3.2\n"

#. module: sale_isolated_quotation
#: model_terms:ir.ui.view,arch_db:sale_isolated_quotation.view_order_form
msgid "Cancel"
msgstr "Abbrechen"

#. module: sale_isolated_quotation
#: model_terms:ir.ui.view,arch_db:sale_isolated_quotation.view_order_form
msgid "Convert to Order"
msgstr "In Auftrag umwandeln"

#. module: sale_isolated_quotation
#: model:ir.model.fields,help:sale_isolated_quotation.field_sale_order__order_id
msgid "For Quotation, this field references to its Sales Order"
msgstr "Bei Angeboten verweist dieses Feld auf den zugehörigen Auftrag."

#. module: sale_isolated_quotation
#: model:ir.model.fields,help:sale_isolated_quotation.field_sale_order__quote_id
msgid "For Sales Order, this field references to its Quotation"
msgstr "Bei Aufträgen verweist dieses Feld auf das zugehörige Angebot."

#. module: sale_isolated_quotation
#: code:addons/sale_isolated_quotation/models/sale.py:0
#, python-format
msgid "Only quotation can convert to order"
msgstr "Nur Angebote können zu einem Auftrag umgewandelt werden."

#. module: sale_isolated_quotation
#: model:ir.model.fields,help:sale_isolated_quotation.field_sale_order__quotation_state
msgid "Only relative quotation states"
msgstr ""

#. module: sale_isolated_quotation
#: model:ir.model.fields,field_description:sale_isolated_quotation.field_sale_order__order_id
msgid "Order"
msgstr "Auftrag"

#. module: sale_isolated_quotation
#: model:ir.model.fields,field_description:sale_isolated_quotation.field_sale_order__order_sequence
msgid "Order Sequence"
msgstr "Auftragssequenz"

#. module: sale_isolated_quotation
#: model:ir.model.fields,field_description:sale_isolated_quotation.field_sale_order__quote_id
msgid "Quotation"
msgstr "Angebot"

#. module: sale_isolated_quotation
#: model:ir.model.fields,field_description:sale_isolated_quotation.field_sale_order__quotation_state
msgid "Quotation Status"
msgstr "Angebotsstatus"

#. module: sale_isolated_quotation
#: code:addons/sale_isolated_quotation/models/sale.py:0
#: model:ir.model,name:sale_isolated_quotation.model_sale_order
#, python-format
msgid "Sales Order"
msgstr "Verkaufsauftrag"

#, fuzzy
#~| msgid "Sales Order"
#~ msgid "Sale Order"
#~ msgstr "Verkaufsauftrag"
Loading

0 comments on commit c4f68dd

Please sign in to comment.