Merge PR #168 into 12.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2020-10-01 15:12:01 +00:00
6 changed files with 28 additions and 7 deletions

View File

@@ -0,0 +1,10 @@
# Copyright 2020 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
# Convert Text description field to Html
openupgrade.convert_field_to_html(
env.cr, "rma", "description", "description")

View File

@@ -176,7 +176,7 @@ class Rma(models.Model):
copy=False, copy=False,
track_visibility="onchange", track_visibility="onchange",
) )
description = fields.Text( description = fields.Html(
states={ states={
'locked': [('readonly', True)], 'locked': [('readonly', True)],
'cancelled': [('readonly', True)], 'cancelled': [('readonly', True)],

View File

@@ -81,7 +81,7 @@
</div> </div>
<div t-if="doc.description"> <div t-if="doc.description">
<strong>RMA Note:</strong> <strong>RMA Note:</strong>
<p t-field="doc.description" /> <p t-raw="doc.description" />
</div> </div>
</div> </div>
</t> </t>

View File

@@ -256,7 +256,7 @@
<section id="description" class="mt-5" t-if="rma.description"> <section id="description" class="mt-5" t-if="rma.description">
<h3 class="">Description</h3> <h3 class="">Description</h3>
<hr class="mt-0 mb-1"/> <hr class="mt-0 mb-1"/>
<em t-field="rma.description"/> <t t-raw="rma.description"/>
</section> </section>
</t> </t>
</t> </t>

View File

@@ -19,6 +19,17 @@
string="Received" string="Received"
domain="[('state','=', 'received')]" /> domain="[('state','=', 'received')]" />
<separator /> <separator />
<filter string="Unresolved RMAs"
name="undone_rma"
domain="[('state', 'not in', ['refunded', 'returned', 'replaced', 'locked', 'cancelled'])]"
help="RMAs yet to be fully processed"/>
<filter string="Late RMAs"
name="late_rma"
domain="[('deadline', '&lt;', context_today().strftime('%Y-%m-%d')), ('state', 'not in', ['refunded', 'returned', 'replaced', 'locked', 'cancelled'])]"
help="RMAs which deadline has passed"/>
<separator />
<filter string="RMA Date" name="filter_rma_date" date="date"/>
<filter string="RMA Deadline" name="filter_rma_deadline" date="deadline"/>
<filter name="no_user_id_filter" <filter name="no_user_id_filter"
string="Unassigned RMAs" string="Unassigned RMAs"
domain="[('user_id','=', False)]" /> domain="[('user_id','=', False)]" />
@@ -48,7 +59,8 @@
<field name="model">rma</field> <field name="model">rma</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree decoration-muted="state in ['cancelled', 'locked']" <tree decoration-muted="state in ['cancelled', 'locked']"
decoration-bf="state == 'draft' and product_id == False"> decoration-bf="state == 'draft' and product_id == False"
decoration-danger="deadline and (deadline &lt; current_date)">
<field name="name"/> <field name="name"/>
<field name="origin"/> <field name="origin"/>
<field name="user_id"/> <field name="user_id"/>
@@ -208,8 +220,7 @@
</group> </group>
</group> </group>
<group> <group>
<label for="description" class="oe_edit_only"/> <field name="description" widget="html" colspan="4" />
<field name="description" colspan="4" nolabel="1"/>
</group> </group>
</page> </page>
</notebook> </notebook>

View File

@@ -10,7 +10,7 @@
<button name="action_create_rma" <button name="action_create_rma"
type="object" type="object"
string="Create RMA" string="Create RMA"
states="sale"/> states="sale,done"/>
</button> </button>
<div name="button_box"> <div name="button_box">
<button name="action_view_rma" <button name="action_view_rma"