Skip to content

Commit

Permalink
[14.0][MIG] sale_tier_validation
Browse files Browse the repository at this point in the history
  • Loading branch information
aphon61bank authored and newtratip committed Feb 17, 2021
1 parent 48c27cc commit 41b4783
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 90 deletions.
12 changes: 7 additions & 5 deletions sale_tier_validation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Sale Tier Validation
: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/13.0/sale_tier_validation
:target: https://github.com/OCA/sale-workflow/tree/14.0/sale_tier_validation
: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-13-0/sale-workflow-13-0-sale_tier_validation
:target: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_tier_validation
: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/13.0
:target: https://runbot.odoo-community.org/runbot/167/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -71,7 +71,7 @@ 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_tier_validation%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_tier_validation%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.

Expand All @@ -92,6 +92,8 @@ Contributors

* Sergio Teruel

* Tharathip Chaweewongphan <[email protected]>

Maintainers
~~~~~~~~~~~

Expand All @@ -105,6 +107,6 @@ 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.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion sale_tier_validation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Sale Tier Validation",
"summary": "Extends the functionality of Sale Orders to "
"support a tier validation process.",
"version": "13.0.1.0.0",
"version": "14.0.1.0.0",
"category": "Sale",
"website": "https://github.com/OCA/sale-workflow",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
Expand Down
2 changes: 2 additions & 0 deletions sale_tier_validation/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ class SaleOrder(models.Model):
_inherit = ["sale.order", "tier.validation"]
_state_from = ["draft", "sent", "to approve"]
_state_to = ["sale", "approved"]

_tier_validation_manual_config = False
2 changes: 2 additions & 0 deletions sale_tier_validation/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
* `Tecnativa <https://www.tecnativa.com>`__:

* Sergio Teruel

* Tharathip Chaweewongphan <[email protected]>
9 changes: 5 additions & 4 deletions sale_tier_validation/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Sale Tier Validation</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Sale Tier Validation</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/13.0/sale_tier_validation"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/sale-workflow-13-0/sale-workflow-13-0-sale_tier_validation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/167/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/14.0/sale_tier_validation"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_tier_validation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/167/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of Sale Orders to support a tier
validation process.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -421,7 +421,7 @@ <h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_tier_validation%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_tier_validation%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -440,6 +440,7 @@ <h2><a class="toc-backref" href="#id7">Contributors</a></h2>
<li>Sergio Teruel</li>
</ul>
</li>
<li>Tharathip Chaweewongphan &lt;<a class="reference external" href="mailto:tharathipc&#64;ecosoft.co.th">tharathipc&#64;ecosoft.co.th</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -449,7 +450,7 @@ <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/13.0/sale_tier_validation">OCA/sale-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/14.0/sale_tier_validation">OCA/sale-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
80 changes: 0 additions & 80 deletions sale_tier_validation/views/sale_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,86 +2,6 @@
<!-- Copyright 2019 Open Source Integrators
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="sale_order_form_tier" model="ir.ui.view">
<field name="name">sale.order.form - test</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<button name="action_confirm" position="before">
<button
name="request_validation"
string="Request Validation"
attrs="{'invisible': ['|','|',('need_validation', '!=', True),('rejected','=',True),('state','not in',['draft','sent','to approve'])]}"
type="object"
/>
<button
name="restart_validation"
string="Restart Validation"
attrs="{'invisible': ['|',('review_ids', '=', []),('state','not in',['draft','sent','to approve'])]}"
type="object"
/>
</button>
<header position="after">
<field name="need_validation" invisible="1" />
<field name="validated" invisible="1" />
<field name="rejected" invisible="1" />
<div
class="alert alert-warning"
role="alert"
attrs="{'invisible': ['|', '|', '|',
('validated', '=', True), ('state', 'not in', ['draft','sent','to approve']),
('rejected', '=', True), ('review_ids', '=', [])]}"
style="margin-bottom:0px;"
>
<p><i class="fa fa-info-circle" />This SO needs to be
validated.
<field name="can_review" invisible="1" />
<button
name="validate_tier"
string="Validate"
attrs="{'invisible': [('can_review', '=', False)]}"
type="object"
class="oe_inline oe_button btn-success"
icon="fa-thumbs-up"
/>
<button
name="reject_tier"
string="Reject"
attrs="{'invisible': [('can_review', '=', False)]}"
type="object"
class="btn-icon btn-danger"
icon="fa-thumbs-down"
/>
</p>
</div>
<div
class="alert alert-success"
role="alert"
attrs="{'invisible': ['|', '|', ('validated', '!=', True), ('state', 'not in', ['draft','sent','to approve']), ('review_ids', '=', [])]}"
style="margin-bottom:0px;"
>
<p><i class="fa fa-thumbs-up" /> Operation has been <b
>validated</b>!</p>
</div>
<div
class="alert alert-danger"
role="alert"
attrs="{'invisible': ['|', '|', ('rejected', '!=', True), ('state', 'not in', ['draft','sent','to approve']), ('review_ids', '=', [])]}"
style="margin-bottom:0px;"
>
<p><i class="fa fa-thumbs-down" /> Operation has been <b
>rejected</b>.</p>
</div>
</header>
<xpath expr="//form/div[hasclass('oe_chatter')]" position="before">
<field
name="review_ids"
widget="tier_validation"
attrs="{'invisible':[('review_ids', '=', [])]}"
/>
</xpath>
</field>
</record>
<record id="view_sale_order_filter" model="ir.ui.view">
<field name="name">sale.order.select - sale_tier_validation</field>
<field name="model">sale.order</field>
Expand Down
6 changes: 6 additions & 0 deletions setup/sale_tier_validation/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 41b4783

Please sign in to comment.