Skip to content

Commit

Permalink
[MIG] stock_request_tier_validation: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ps-tubtim committed Dec 27, 2022
1 parent de01344 commit dd17ae0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 207 deletions.
2 changes: 1 addition & 1 deletion stock_request_tier_validation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Stock Request Tier Validation",
"summary": "Extends the functionality of Stock Requests to "
"support a tier validation process.",
"version": "14.0.1.0.0",
"version": "15.0.1.0.0",
"category": "Warehouse",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "ForgeFlow, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2019 ForgeFlow S.L.
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<data noupdate="1">
<record id="stock_request_default_tier_definition" model="tier.definition">
<field name="name">Manager review</field>
<field name="model_id" ref="model_stock_request" />
<field name="definition_type">domain</field>
<field name="definition_domain" />
<field name="review_type">group</field>
<field
name="reviewer_group_id"
ref='stock_request.group_stock_request_manager'
/>
<field name="active">False</field>
</record>
<record
id="stock_request_order_default_tier_definition"
model="tier.definition"
>
<field name="name">Manager review</field>
<field name="model_id" ref="model_stock_request_order" />
<field name="definition_type">domain</field>
<field name="definition_domain" />
<field name="review_type">group</field>
<field
name="reviewer_group_id"
ref='stock_request.group_stock_request_manager'
/>
<field name="active">False</field>
</record>
</data>
<odoo noupdate="1">
<record id="stock_request_default_tier_definition" model="tier.definition">
<field name="name">Manager review</field>
<field name="model_id" ref="model_stock_request" />
<field name="definition_type">domain</field>
<field name="definition_domain" />
<field name="review_type">group</field>
<field
name="reviewer_group_id"
ref='stock_request.group_stock_request_manager'
/>
<field name="active">False</field>
</record>
<record id="stock_request_order_default_tier_definition" model="tier.definition">
<field name="name">Manager review</field>
<field name="model_id" ref="model_stock_request_order" />
<field name="definition_type">domain</field>
<field name="definition_domain" />
<field name="review_type">group</field>
<field
name="reviewer_group_id"
ref='stock_request.group_stock_request_manager'
/>
<field name="active">False</field>
</record>
</odoo>
2 changes: 2 additions & 0 deletions stock_request_tier_validation/models/stock_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class StockRequest(models.Model):
_state_from = ["draft"]
_state_to = ["open"]

_tier_validation_manual_config = False

@api.model
def _get_under_validation_exceptions(self):
res = super()._get_under_validation_exceptions()
Expand Down
2 changes: 2 additions & 0 deletions stock_request_tier_validation/models/stock_request_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class StockRequestOrder(models.Model):
_state_from = ["draft"]
_state_to = ["open"]

_tier_validation_manual_config = False

@api.model
def _get_under_validation_exceptions(self):
res = super()._get_under_validation_exceptions()
Expand Down
Binary file modified stock_request_tier_validation/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 0 additions & 88 deletions stock_request_tier_validation/views/stock_request_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,94 +2,6 @@
<!-- Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="stock_request_order_form_inherit_tier" model="ir.ui.view">
<field name="name">stock.request.order.tier.validation.form</field>
<field name="model">stock.request.order</field>
<field name="inherit_id" ref="stock_request.stock_request_order_form" />
<field name="arch" type="xml">
<button name="action_confirm" position="attributes">
<attribute
name="attrs"
>{'invisible': ['|','&amp;',('validated', '!=', True),('need_validation', '=', True),'|',('need_validation', '=', True),('state', 'not in', ['draft'])]}</attribute>
<attribute
name="groups"
>stock_request.group_stock_request_manager</attribute>
</button>
<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'])]}"
type="object"
/>
<button
name="restart_validation"
string="Restart Validation"
attrs="{'invisible': ['|',('review_ids', '=', []),('state','not in',['draft','sent'])]}"
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']),
('rejected', '=', True), ('review_ids', '=', [])]}"
style="margin-bottom:0px;"
>
<p><i class="fa fa-info-circle" />This Stock Request 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']), ('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']), ('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_stock_request_order_filter" model="ir.ui.view">
<field name="name">stock.request.select - stock_request_tier_validation</field>
<field name="model">stock.request</field>
Expand Down
88 changes: 0 additions & 88 deletions stock_request_tier_validation/views/stock_request_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,94 +2,6 @@
<!-- Copyright 2019-2020 ForgeFlow S.L. (https://www.forgeflow.com)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_stock_request_form_inherit_tier" model="ir.ui.view">
<field name="name">stock.request.tier.validation.form</field>
<field name="model">stock.request</field>
<field name="inherit_id" ref="stock_request.view_stock_request_form" />
<field name="arch" type="xml">
<button name="action_confirm" position="attributes">
<attribute
name="attrs"
>{'invisible': ['|','&amp;',('validated', '!=', True),('need_validation', '=', True),'|',('need_validation', '=', True),('state', 'not in', ['draft'])]}</attribute>
<attribute
name="groups"
>stock_request.group_stock_request_manager</attribute>
</button>
<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'])]}"
type="object"
/>
<button
name="restart_validation"
string="Restart Validation"
attrs="{'invisible': ['|',('review_ids', '=', []),('state','not in',['draft','sent'])]}"
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']),
('rejected', '=', True), ('review_ids', '=', [])]}"
style="margin-bottom:0px;"
>
<p><i class="fa fa-info-circle" />This Stock Request 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']), ('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']), ('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_stock_request_filter" model="ir.ui.view">
<field name="name">stock.request.select - stock_request_tier_validation</field>
<field name="model">stock.request</field>
Expand Down

0 comments on commit dd17ae0

Please sign in to comment.