From 48a591c40995ade34bf815c7bf8e09b3ffa56bb8 Mon Sep 17 00:00:00 2001 From: dht-odoo Date: Tue, 15 Jun 2021 08:49:42 +0000 Subject: [PATCH 1/4] [FIX] repair: fix html formatting in narration Followup of odoo/odoo@cb4f597410bcb08208ee277144d755bef8b6d688 and odoo/enterprise@971f3ed9ae89e965e4c6d2d0b6d26719d694ddc1 We have converted string into markup string in repair as we cannot concatenate strings directly to Markup string. And if we try to do it we will see the html elements '
' in field value, so we have to convert '
' string into markup language to avoid this. Also avoid adding pseudo-void html content in narration. LINKS Task Id-2558824 PR odoo/odoo#74795 PR odoo/enterprise#20117 --- addons/repair/models/repair.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/repair/models/repair.py b/addons/repair/models/repair.py index 25443b46ce8..62b798c0081 100644 --- a/addons/repair/models/repair.py +++ b/addons/repair/models/repair.py @@ -3,9 +3,11 @@ from collections import defaultdict from random import randint +from markupsafe import Markup + from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError -from odoo.tools import float_compare +from odoo.tools import float_compare, is_html_empty class StockMove(models.Model): @@ -344,7 +346,7 @@ class Repair(models.Model): 'partner_id': partner_invoice.id, 'partner_shipping_id': repair.address_id.id, 'currency_id': currency.id, - 'narration': narration, + 'narration': narration if not is_html_empty(narration) else '', 'invoice_origin': repair.name, 'repair_ids': [(4, repair.id)], 'invoice_line_ids': [], @@ -358,10 +360,11 @@ class Repair(models.Model): invoice_vals = current_invoices_list[0] invoice_vals['invoice_origin'] += ', ' + repair.name invoice_vals['repair_ids'].append((4, repair.id)) - if not invoice_vals['narration']: - invoice_vals['narration'] = narration - else: - invoice_vals['narration'] += '
' + narration + if not is_html_empty(narration): + if is_html_empty(invoice_vals['narration']): + invoice_vals['narration'] = narration + else: + invoice_vals['narration'] += Markup('
') + narration # Create invoice lines from operations. for operation in repair.operations.filtered(lambda op: op.type == 'add'): From 4cc4ee8919d82b373e5539f3e2a9a16839301f27 Mon Sep 17 00:00:00 2001 From: dht-odoo Date: Thu, 17 Jun 2021 05:31:51 +0000 Subject: [PATCH 2/4] [FIX] account: fix editor/Html addition in account.move form view Followup of odoo/odoo@cb4f597410bcb08208ee277144d755bef8b6d688 and odoo/enterprise@971f3ed9ae89e965e4c6d2d0b6d26719d694ddc1 This commit fix the view of account.move model by improving formation of groups in form view. Purpose is to improve display and usage of editor in Html field. LINKS Task Id-2558824 PR odoo/odoo#74795 PR odoo/enterprise#2011 --- addons/account/views/account_move_views.xml | 39 +++++++++++---------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 83fafc29e1e..b3296670a76 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -1019,25 +1019,26 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + From c1e0acf4c61efb33f620ad3bd339a31d7f17b249 Mon Sep 17 00:00:00 2001 From: dht-odoo Date: Thu, 24 Jun 2021 08:38:05 +0000 Subject: [PATCH 3/4] [FIX] base: fix create contact view Before commit[1] there was only one field image_1920 in group with 'colspan=1'. In commit[1] a new invisible field avatar_128 is added in this group. But due to this an empty 'tr' element is added in view and it breaks the view. With this commit we move avatar_128 field outside of the group and placed it with other invisible fields, so it doesn't break view. And also adding comment field in new group because it is html field now so it displays nicely. Followup of odoo/odoo@cb4f597410bcb08208ee277144d755bef8b6d688 and odoo/enterprise@971f3ed9ae89e965e4c6d2d0b6d26719d694ddc1 commit[1]: c53724ebc35150d9111e165ef5089beb26bedc29 LINKS Task Id-2558824 PR odoo/odoo#74795 PR odoo/enterprise#2011 --- odoo/addons/base/views/res_partner_views.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/odoo/addons/base/views/res_partner_views.xml b/odoo/addons/base/views/res_partner_views.xml index d793383daa7..9c69312c26b 100644 --- a/odoo/addons/base/views/res_partner_views.xml +++ b/odoo/addons/base/views/res_partner_views.xml @@ -318,7 +318,6 @@ - @@ -327,13 +326,16 @@ - + + + + From c23a95a9ec9b30554660e931edd71c9c98cb2959 Mon Sep 17 00:00:00 2001 From: dht-odoo Date: Mon, 2 Aug 2021 12:08:16 +0000 Subject: [PATCH 4/4] [FIX] calendar: fix description integration in mail templates Followup of odoo/odoo@cb4f597410bcb08208ee277144d755bef8b6d688 and odoo/enterprise@971f3ed9ae89e965e4c6d2d0b6d26719d694ddc1 This commit will improve mail template design by adjusting description section of template. LINKS Task Id-2558824 PR odoo/odoo#74795 PR odoo/enterprise#2011 --- addons/calendar/data/mail_template_data.xml | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/calendar/data/mail_template_data.xml b/addons/calendar/data/mail_template_data.xml index 452962d3c24..8d6157c6b6e 100644 --- a/addons/calendar/data/mail_template_data.xml +++ b/addons/calendar/data/mail_template_data.xml @@ -108,11 +108,11 @@ % if object.event_id.videocall_location:
  • Join Video Call: ${object.event_id.videocall_location}
  • % endif + % if not is_html_empty(object.event_id.description): +
  • Description of the event: + ${object.event_id.description | safe}
  • + % endif - % if not is_html_empty(object.event_id.description): -

    Description of the event

    - ${object.event_id.description | safe} - % endif
    @@ -230,11 +230,11 @@ % if object.event_id.videocall_location:
  • Join Video Call: ${object.event_id.videocall_location}
  • % endif + % if not is_html_empty(object.event_id.description): +
  • Description of the event: + ${object.event_id.description | safe}
  • + % endif - % if not is_html_empty(object.event_id.description): -

    Description of the event

    - ${object.event_id.description | safe} - % endif
    @@ -332,11 +332,11 @@ % if object.event_id.videocall_location:
  • Join Video Call: ${object.event_id.videocall_location}
  • % endif + % if not is_html_empty(object.event_id.description): +
  • Description of the event: + ${object.event_id.description | safe}
  • + % endif - % if not is_html_empty(object.event_id.description): -

    Description of the event

    - ${object.event_id.description | safe} - % endif