From cbdea0caba25b515e9cc1f57d174b62e612c0414 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 30 Sep 2020 16:32:04 +0200 Subject: [PATCH] [FIX+IMP] rma: usability * IMP - Now the description will be an html son we can show rich styles in the customers report. * FIX - On locked sale orders it was need to unlock them to be able to open an RMA. * IMP - Make the description label visible in the backend form so the user can easily spot it. * IMP - Added date and deadline filters. * IMP - Added pending RMAs filter. * IMP - Added late RMAs filter. * IMP - Added danger decoration in tree view --- rma/migrations/12.0.2.0.0/post-migration.py | 10 ++++++++++ rma/models/rma.py | 2 +- rma/views/report_rma.xml | 2 +- rma/views/rma_portal_templates.xml | 2 +- rma/views/rma_views.xml | 17 ++++++++++++++--- rma_sale/views/sale_views.xml | 2 +- 6 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 rma/migrations/12.0.2.0.0/post-migration.py diff --git a/rma/migrations/12.0.2.0.0/post-migration.py b/rma/migrations/12.0.2.0.0/post-migration.py new file mode 100644 index 00000000..77fe95b4 --- /dev/null +++ b/rma/migrations/12.0.2.0.0/post-migration.py @@ -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") diff --git a/rma/models/rma.py b/rma/models/rma.py index 191bc965..50f86e06 100644 --- a/rma/models/rma.py +++ b/rma/models/rma.py @@ -176,7 +176,7 @@ class Rma(models.Model): copy=False, track_visibility="onchange", ) - description = fields.Text( + description = fields.Html( states={ 'locked': [('readonly', True)], 'cancelled': [('readonly', True)], diff --git a/rma/views/report_rma.xml b/rma/views/report_rma.xml index c6320d0d..2225bab3 100644 --- a/rma/views/report_rma.xml +++ b/rma/views/report_rma.xml @@ -81,7 +81,7 @@
RMA Note: -

+

diff --git a/rma/views/rma_portal_templates.xml b/rma/views/rma_portal_templates.xml index 9219c044..0767f82d 100644 --- a/rma/views/rma_portal_templates.xml +++ b/rma/views/rma_portal_templates.xml @@ -256,7 +256,7 @@

Description


- +
diff --git a/rma/views/rma_views.xml b/rma/views/rma_views.xml index f77660a6..6885d52b 100644 --- a/rma/views/rma_views.xml +++ b/rma/views/rma_views.xml @@ -19,6 +19,17 @@ string="Received" domain="[('state','=', 'received')]" /> + + + + + @@ -48,7 +59,8 @@ rma + decoration-bf="state == 'draft' and product_id == False" + decoration-danger="deadline and (deadline < current_date)"> @@ -208,8 +220,7 @@ - diff --git a/rma_sale/views/sale_views.xml b/rma_sale/views/sale_views.xml index 879040b2..e25d1e53 100644 --- a/rma_sale/views/sale_views.xml +++ b/rma_sale/views/sale_views.xml @@ -10,7 +10,7 @@