Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
10fe74f
[13.0][ADD] purchase_isolated_rfq
kongrattapong Jan 28, 2020
3fb2ea1
[UPD] Update purchase_isolated_rfq.pot
oca-travis Feb 21, 2020
56f85d3
[UPD] README.rst
OCA-git-bot Feb 21, 2020
0398425
[ADD] icon.png
OCA-git-bot Feb 21, 2020
f1d6ed9
pre-commit update
OCA-git-bot Mar 14, 2020
ccc4d5d
[FIX] purchase_isolated_rfq, add uninstall_hook to restore original a…
kittiu Jul 16, 2020
1140079
[UPD] README.rst
OCA-git-bot Nov 10, 2020
8873b14
purchase_isolated_rfq 13.0.1.1.0
OCA-git-bot Nov 10, 2020
c0638b4
[13.0][FIX] purchase_isolated_rfq, fix cancel error
kittiu Dec 3, 2020
250b6cb
purchase_isolated_rfq 13.0.1.1.1
OCA-git-bot Dec 4, 2020
cbe3838
Added translation using Weblate (Chinese (Simplified))
dong-z Jan 24, 2021
3479aac
Translated using Weblate (Chinese (Simplified))
dong-z Jan 24, 2021
3c16e90
Translated using Weblate (Chinese (Simplified))
dong-z Jan 25, 2021
281a4d8
Translated using Weblate (Chinese (Simplified))
dong-z Jan 25, 2021
a4fe2dd
[IMP] purchase_isolated_rfq: black, isort, prettier
SurachetS Feb 1, 2021
15afbfb
[MIG] purchase_isolated_rfq: Migration to 14.0
SurachetS Feb 2, 2021
32ff191
[UPD] Update purchase_isolated_rfq.pot
oca-travis May 8, 2021
652943c
[UPD] README.rst
OCA-git-bot May 9, 2021
6313691
[FIX] purchase_isolated_rfq: Remove selection attribute on rfq_state …
HviorForgeFlow May 20, 2021
2e97843
purchase_isolated_rfq 14.0.1.0.1
OCA-git-bot May 20, 2021
b135124
[IMP] update dotfiles [ci skip]
OCA-git-bot Mar 31, 2022
6bd0659
Added translation using Weblate (Portuguese)
pedrocs-exo Jul 26, 2022
dfaef6e
Translated using Weblate (Portuguese)
pedrocs-exo Jul 26, 2022
928822b
[IMP]purchase_isolated_rfq: black, isort, prettier
bizzappdev Mar 21, 2023
57c10a6
[MIG][15.0]purchase_isolated_rfq:Migration to 15.0
bizzappdev Mar 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions purchase_isolated_rfq/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
=====================
Purchase Isolated RFQ
=====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/14.0/purchase_isolated_rfq
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-14-0/purchase-workflow-14-0-purchase_isolated_rfq
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/142/14.0
:alt: Try me on Runbot

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

Note: This module is similar to sale_isolated_quotation, but for purchase/rfq

In some countries/companies, It's already common to separate these two documents.
For filing purposes, the document sequence of Requests For Quotation (RFQ) and Purchases order
has to be separated. In practice, there could be multiple RFQ open
to a vendor, yet only one RFQ get converted to the Purchases order.

This module separate RFQ and Purchases order by adding order_sequence flag in
purchase.order model.

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

**Table of contents**

.. contents::
:local:

Usage
=====

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

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-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/purchase-workflow/issues/new?body=module:%20purchase_isolated_rfq%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
~~~~~~~~~~~~

* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>

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-kittiu| image:: https://github.com/kittiu.png?size=40px
:target: https://github.com/kittiu
:alt: kittiu

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

|maintainer-kittiu|

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/14.0/purchase_isolated_rfq>`_ 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 purchase_isolated_rfq/__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
16 changes: 16 additions & 0 deletions purchase_isolated_rfq/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2020 Ecosoft Co., Ltd (https://ecosoft.co.th)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
{
"name": "Purchase Isolated RFQ",
"version": "15.0.1.0.1",
"author": "Ecosoft, Odoo Community Association (OCA)",
"category": "Purchases",
"website": "https://github.com/OCA/purchase-workflow",
"depends": ["purchase"],
"license": "AGPL-3",
"data": ["data/ir_sequence_data.xml", "views/purchase_views.xml"],
"maintainers": ["kittiu"],
"installable": True,
"uninstall_hook": "uninstall_hook",
"post_init_hook": "post_init_hook",
}
10 changes: 10 additions & 0 deletions purchase_isolated_rfq/data/ir_sequence_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<odoo noupdate="1">
<!-- Sequences for RFQ -->
<record id="seq_purchase_rfq" model="ir.sequence">
<field name="name">Requests for Quotation</field>
<field name="code">purchase.rfq</field>
<field name="prefix">RFQ</field>
<field name="padding">3</field>
<field name="company_id" eval="False" />
</record>
</odoo>
45 changes: 45 additions & 0 deletions purchase_isolated_rfq/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2020 Ecosoft Co., Ltd (https://ecosoft.co.th)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
import ast

from odoo import SUPERUSER_ID, api

ACTIONS = {
"purchase.purchase_rfq": {"dom": [], "ctx": {"quotation_only": True}},
"purchase.purchase_form_action": {
"dom": [("state", "in", ("purchase", "done"))],
"ctx": {},
},
}


def post_init_hook(cr, registry):
"""Set value for order_sequence on old records"""
cr.execute(
"""
update purchase_order
set order_sequence = true
where state not in ('draft', 'cancel')
"""
)


def uninstall_hook(cr, registry):
"""Restore purchase.order action's domain/context"""
env = api.Environment(cr, SUPERUSER_ID, {})
for action_id in ACTIONS:
action = env.ref(action_id)
# Clean context
ctx = ast.literal_eval(action.context)
if "order_sequence" in ctx:
del ctx["order_sequence"]
if "default_order_sequence" in ctx:
del ctx["default_order_sequence"]
# Clean domain
dom = ast.literal_eval(action.domain or "[]")
dom = [x for x in dom if x[0] != "order_sequence"]
# Assign original domain / context
dom += ACTIONS[action_id]["dom"]
dom = list(set(dom))
ctx.update(ACTIONS[action_id]["ctx"])
action.write({"context": ctx, "domain": dom})
94 changes: 94 additions & 0 deletions purchase_isolated_rfq/i18n/pt.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_isolated_rfq
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-07-26 13:06+0000\n"
"Last-Translator: Pedro Castro Silva <pedrocs@exo.pt>\n"
"Language-Team: none\n"
"Language: pt\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: purchase_isolated_rfq
#: model_terms:ir.ui.view,arch_db:purchase_isolated_rfq.purchase_order_form
msgid "Cancel"
msgstr "Cancelar"

#. module: purchase_isolated_rfq
#: model_terms:ir.ui.view,arch_db:purchase_isolated_rfq.purchase_order_form
msgid "Convert to Order"
msgstr "Converter em Encomenda"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__display_name
msgid "Display Name"
msgstr "Nome a Apresentar"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,help:purchase_isolated_rfq.field_purchase_order__quote_id
msgid "For Purchases Order, this field references to its RFQ"
msgstr "Em Encomendas de Compra, este campo referencia os seus PdO"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,help:purchase_isolated_rfq.field_purchase_order__purchase_order_id
msgid "For RFQ, this field references to its Purchases Order"
msgstr "Em PdO, este campo referencia as suas Encomendas de Compra"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__id
msgid "ID"
msgstr "ID"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order____last_update
msgid "Last Modified on"
msgstr "Última Modificação Em"

#. module: purchase_isolated_rfq
#: code:addons/purchase_isolated_rfq/models/purchase_order.py:0
#, python-format
msgid "Only quotation can convert to order"
msgstr "Apenas cotações podem ser convertidas em encomendas"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,help:purchase_isolated_rfq.field_purchase_order__rfq_state
msgid "Only relative RFQ states"
msgstr "Apenas estados PdC relativos"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__purchase_order_id
msgid "Order"
msgstr "Encomenda"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__order_sequence
msgid "Order Sequence"
msgstr "Sequência de Ordenação"

#. module: purchase_isolated_rfq
#: model:ir.model,name:purchase_isolated_rfq.model_purchase_order
msgid "Purchase Order"
msgstr "Encomenda de Compra"

#. module: purchase_isolated_rfq
#: code:addons/purchase_isolated_rfq/models/purchase_order.py:0
#, python-format
msgid "Purchases Order"
msgstr "Encomenda de Compra"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__quote_id
msgid "Quotation"
msgstr "Cotação"

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__rfq_state
msgid "RFQ Status"
msgstr "Estado do PdC"
91 changes: 91 additions & 0 deletions purchase_isolated_rfq/i18n/purchase_isolated_rfq.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_isolated_rfq
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \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: purchase_isolated_rfq
#: model_terms:ir.ui.view,arch_db:purchase_isolated_rfq.purchase_order_form
msgid "Cancel"
msgstr ""

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

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__display_name
msgid "Display Name"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model.fields,help:purchase_isolated_rfq.field_purchase_order__quote_id
msgid "For Purchases Order, this field references to its RFQ"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model.fields,help:purchase_isolated_rfq.field_purchase_order__purchase_order_id
msgid "For RFQ, this field references to its Purchases Order"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__id
msgid "ID"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order____last_update
msgid "Last Modified on"
msgstr ""

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

#. module: purchase_isolated_rfq
#: model:ir.model.fields,help:purchase_isolated_rfq.field_purchase_order__rfq_state
msgid "Only relative RFQ states"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__purchase_order_id
msgid "Order"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__order_sequence
msgid "Order Sequence"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model,name:purchase_isolated_rfq.model_purchase_order
msgid "Purchase Order"
msgstr ""

#. module: purchase_isolated_rfq
#: code:addons/purchase_isolated_rfq/models/purchase_order.py:0
#, python-format
msgid "Purchases Order"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__quote_id
msgid "Quotation"
msgstr ""

#. module: purchase_isolated_rfq
#: model:ir.model.fields,field_description:purchase_isolated_rfq.field_purchase_order__rfq_state
msgid "RFQ Status"
msgstr ""
Loading