From 0a9bec8f18698ae48c618cb473323c4c6affdfc5 Mon Sep 17 00:00:00 2001 From: Ankita Raval Date: Tue, 30 Jul 2019 10:24:25 +0000 Subject: [PATCH 01/59] [FIX] account : fix statbutton of partner invoices Before Commit: The statbutton on partner form does not work properly. After Commit: we change the domain because use the wrong domain in filter so statbutton not work properly on partnerform. task-id : 2041822 closes odoo/odoo#35290 Signed-off-by: Victor Feyens (vfe) --- addons/account/models/partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index 4661f48c6bb..213cc97abcc 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -439,7 +439,7 @@ class ResPartner(models.Model): action = self.env.ref('account.action_move_out_invoice_type').read()[0] action['domain'] = [ ('type', 'in', ('out_invoice', 'out_refund')), - ('type', '=', 'posted'), + ('state', '=', 'posted'), ('partner_id', 'child_of', self.id), ] return action From 5032fc16b4012eb9802fe261bc0170ac2f17749d Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Tue, 10 Sep 2019 14:30:41 +0000 Subject: [PATCH 02/59] [FIX] orm: in modified() force target search ordering by 'id' Some model can have really complex _order, which can induce unnecessary slow queries; here as we don't need the right business order we force ordering by 'id' instead OPW-2007478 closes odoo/odoo#36660 X-original-commit: a1fe8976156a7b6e14aa2d68650176a0e64ba73f Signed-off-by: Raphael Collet (rco) --- odoo/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/models.py b/odoo/models.py index 7e9da96559b..b1cbe64cd80 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -5279,7 +5279,7 @@ Fields: target0 = Model.browse(i for [i] in self.env.cr.fetchall()) else: env = self.env(user=SUPERUSER_ID, context={'active_test': False}) - target0 = env[model_name].search([(path, 'in', self.ids)]) + target0 = env[model_name].search([(path, 'in', self.ids)], order='id') target0 = target0.with_env(self.env) # prepare recomputation for each field on linked records for field in stored: From 6ebbea16817fa194f2d084c3a8821d21e88dc483 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Fri, 6 Sep 2019 07:56:48 +0000 Subject: [PATCH 03/59] [FIX] base: barcode qweb field correct API Before this commit, the barcode Qweb Field had a option called "type", which meant what is the mapping between numbers and barcode, that mapping is called a symbology https://www.barcoding.com/resources/barcoding-basics/barcode-symbologies/ This option "type" collided with what the qweb engine does at ``` qweb > _compile_directive_field that calls ir_qweb > _get_field ``` It resulted in a crash where type = "barcode" was not a valid symbology to pass to the barcode lib It is safe to say that this barcode widget was never user, otherwise it would have crashed This commit changes that non-functioning API, and the barcode renders well OPW 2066870 forward-port of #36499 (330d862513dba5bbc4716fe9c8694fd0db696934) closes odoo/odoo#36499 closes odoo/odoo#36658 Signed-off-by: Lucas Perais (lpe) Signed-off-by: Lucas Perais (lpe) --- odoo/addons/base/i18n/base.pot | 6 ++++++ odoo/addons/base/models/ir_qweb_fields.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/odoo/addons/base/i18n/base.pot b/odoo/addons/base/i18n/base.pot index f23d932a1ac..c4cb51ebe6d 100644 --- a/odoo/addons/base/i18n/base.pot +++ b/odoo/addons/base/i18n/base.pot @@ -6938,6 +6938,12 @@ msgstr "" #. module: base #: code:addons/base/models/ir_qweb_fields.py:610 #, python-format +msgid "Barcode symbology" +msgstr "" + +#. module: base +#: code:addons/base/models/ir_qweb_fields.py:603 +#, python-format msgid "Barcode type" msgstr "" diff --git a/odoo/addons/base/models/ir_qweb_fields.py b/odoo/addons/base/models/ir_qweb_fields.py index 097ba57e69d..046e98e357b 100644 --- a/odoo/addons/base/models/ir_qweb_fields.py +++ b/odoo/addons/base/models/ir_qweb_fields.py @@ -607,7 +607,7 @@ class BarcodeConverter(models.AbstractModel): def get_available_options(self): options = super(BarcodeConverter, self).get_available_options() options.update( - type=dict(type='string', string=_('Barcode type'), description=_('Barcode type, eg: UPCA, EAN13, Code128'), default_value='Code128'), + symbology=dict(type='string', string=_('Barcode symbology'), description=_('Barcode type, eg: UPCA, EAN13, Code128'), default_value='Code128'), width=dict(type='integer', string=_('Width'), default_value=600), height=dict(type='integer', string=_('Height'), default_value=100), humanreadable=dict(type='integer', string=_('Human Readable'), default_value=0), @@ -616,9 +616,9 @@ class BarcodeConverter(models.AbstractModel): @api.model def value_to_html(self, value, options=None): - barcode_type = options.get('type', 'Code128') + barcode_symbology = options.get('symbology', 'Code128') barcode = self.env['ir.actions.report'].barcode( - barcode_type, + barcode_symbology, value, **{key: value for key, value in options.items() if key in ['width', 'height', 'humanreadable']}) return u'' % base64.b64encode(barcode).decode('ascii') From 01854457c59bc6ab1078b32674c6ee1c0f96d07d Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Wed, 11 Sep 2019 07:24:17 +0000 Subject: [PATCH 04/59] [FIX] account: Fix editing mail alias on account.journal Since https://github.com/odoo/odoo/commit/01d0523fd76e6d616f36c872f9bff9ca9cd9cbb9, the _get_alias_values methods is called during the write on the mail.alias. In this method, the r.sub seems wrong & useless since the alias_name is also checked when writing on the mail.alias (alias_name is a related="alias_id.alias_name") with a different behavior that the r.sub. closes odoo/odoo#36668 --task: 2069650 Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 4abf984c719..fff0313c555 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -715,7 +715,7 @@ class AccountJournal(models.Model): return { 'alias_defaults': {'type': type == 'purchase' and 'in_invoice' or 'out_invoice', 'company_id': self.company_id.id}, 'alias_parent_thread_id': self.id, - 'alias_name': re.sub(r'[^\w]+', '-', alias_name) + 'alias_name': alias_name, } @api.multi From 9e30276556bbcfcb2605105b496393d21f5e61b2 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 11 Sep 2019 10:31:50 +0000 Subject: [PATCH 05/59] [FIX] base: address and name split on 2 lines The name and address printed on any PDF report (e.g. SO or RFQ) is very likely to be split on 2 lines once it is long enough. For example, 'My Company (Chicago)' will be displayed on 2 lines. This is due to 0c6e0d660ea00a and 064eb0a4f43fcfe. opw-2061553 closes odoo/odoo#36498 Signed-off-by: Nicolas Martinelli (nim) --- odoo/addons/base/views/ir_qweb_widget_templates.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/addons/base/views/ir_qweb_widget_templates.xml b/odoo/addons/base/views/ir_qweb_widget_templates.xml index 47bf04a62ff..4f141cadb71 100644 --- a/odoo/addons/base/views/ir_qweb_widget_templates.xml +++ b/odoo/addons/base/views/ir_qweb_widget_templates.xml @@ -13,7 +13,7 @@