From 663a6f19b216eae5ef0ed65efbd79fc8fbc5e7fa Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Tue, 7 Aug 2018 13:44:40 +0200 Subject: [PATCH 01/47] [FIX] website_sale: badly formatted CSV The gorup was evaluated to True and no group was set on the ACL --- addons/website_sale/security/ir.model.access.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/security/ir.model.access.csv b/addons/website_sale/security/ir.model.access.csv index 2c27cdae6e1..898768c7353 100644 --- a/addons/website_sale/security/ir.model.access.csv +++ b/addons/website_sale/security/ir.model.access.csv @@ -13,7 +13,7 @@ access_product_attribute_value_public,product.attribute value public,product.mod access_product_attribute_price_public,product.attribute price public,product.model_product_attribute_price,,1,0,0,0 access_product_attribute_line_public,product.attribute line public,product.model_product_attribute_line,,1,0,0,0 access_website_pricelist,website_pricelist,model_website_pricelist,,1,0,0,0 -access_website_pricelist_sale_manager,website_pricelist,model_website_pricelist,,base.group_sale_manager,1,1,1,1 +access_website_pricelist_sale_manager,website_pricelist,model_website_pricelist,base.group_sale_manager,1,1,1,1 access_fiscal_position_public,fiscal position public,account.model_account_fiscal_position,base.group_portal,1,0,0,0 access_payment_term,payment term public,account.model_account_payment_term,base.group_portal,1,0,0,0 access_product_supplierinfo_user,product.supplierinfo.user,product.model_product_supplierinfo,base.group_public,1,0,0,0 From ed19ad156898348fc80be93f87f96a46b10c2c3a Mon Sep 17 00:00:00 2001 From: Marco Calcagni Date: Wed, 8 Aug 2018 19:21:39 +0200 Subject: [PATCH 02/47] [CLA] signature for As400it Closes #26253 --- doc/cla/individual/as400it.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/as400it.md diff --git a/doc/cla/individual/as400it.md b/doc/cla/individual/as400it.md new file mode 100644 index 00000000000..d42536df0d6 --- /dev/null +++ b/doc/cla/individual/as400it.md @@ -0,0 +1,11 @@ +Italy, 2018-08-08 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Marco Calcagni mcalcagni@dinamicheaziendali.it https://github.com/As400it From fac1d2dd2ac912db28f53561be4c3071e1141b5c Mon Sep 17 00:00:00 2001 From: Nadal Francisco Garcia Date: Thu, 9 Aug 2018 13:45:45 +0200 Subject: [PATCH 03/47] [CLA] BT-nfrancisco added to Braintec --- doc/cla/corporate/brain-tec.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/cla/corporate/brain-tec.md b/doc/cla/corporate/brain-tec.md index f598f64eb1b..46e4e2d3646 100644 --- a/doc/cla/corporate/brain-tec.md +++ b/doc/cla/corporate/brain-tec.md @@ -38,3 +38,4 @@ Raúl Martín raul.martin@braintec-group.com https://github.com/BT-rmartin Silvan Wyden silvan.wyden@braintec-group.com https://github.com/BT-swyden Timka Piric Muratovic timka.piric@braintec-group.com https://github.com/BT-tpiric Pascal Zenklusen pascal.zenklusen@braintec-group.com https://github.com/BT-pzenklusen +Nadal Francisco Garcia nadal.francisco@braintec-group.com https://github.com/BT-nfrancisco \ No newline at end of file From 4f4fdb2f3520ffc7d3c053fb10e99a87c0bca571 Mon Sep 17 00:00:00 2001 From: Nadal Francisco Garcia Date: Thu, 9 Aug 2018 13:46:57 +0200 Subject: [PATCH 04/47] [FIX] stock: fix unreserve In the original commit 19116cc8782ace5a3, `action_assign` was called on all `move_ids`. However, after API conversion, moves are filtered. Closes #25886 opw-1868834 --- addons/stock/models/stock_picking.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 9a00c2660d4..3e3e99c931e 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -784,8 +784,9 @@ class Picking(models.Model): else: moves = self.env['stock.move'].browse(move_ids) if self.env.context.get('no_state_change'): - moves = moves.filtered(lambda m: m.reserved_quant_ids) - moves.do_unreserve() + moves.filtered(lambda m: m.reserved_quant_ids).do_unreserve() + else: + moves.do_unreserve() moves.action_assign(no_prepare=True) @api.multi From bf282f2b7b02f279bdf703d8fc74c63b28594f71 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 9 Aug 2018 13:36:16 +0200 Subject: [PATCH 05/47] [FIX] stock_landed_costs: List view in multi-company In multi-company, it was not possible to distinguish the records of the current company of the user. opw:1870561 --- addons/stock_landed_costs/__manifest__.py | 1 + .../stock_landed_costs/models/stock_landed_cost.py | 2 ++ .../security/stock_landed_cost_security.xml | 13 +++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 addons/stock_landed_costs/security/stock_landed_cost_security.xml diff --git a/addons/stock_landed_costs/__manifest__.py b/addons/stock_landed_costs/__manifest__.py index 436a601b9bc..8a3bf344ed3 100644 --- a/addons/stock_landed_costs/__manifest__.py +++ b/addons/stock_landed_costs/__manifest__.py @@ -18,6 +18,7 @@ This module allows you to easily add extra costs on pickings and decide the spli ], 'data': [ 'security/ir.model.access.csv', + 'security/stock_landed_cost_security.xml', 'data/stock_landed_cost_data.xml', 'views/product_views.xml', 'views/stock_landed_cost_views.xml', diff --git a/addons/stock_landed_costs/models/stock_landed_cost.py b/addons/stock_landed_costs/models/stock_landed_cost.py index 2cd24d707ae..6dfeb180684 100644 --- a/addons/stock_landed_costs/models/stock_landed_cost.py +++ b/addons/stock_landed_costs/models/stock_landed_cost.py @@ -51,6 +51,8 @@ class LandedCost(models.Model): account_journal_id = fields.Many2one( 'account.journal', 'Account Journal', required=True, states={'done': [('readonly', True)]}) + company_id = fields.Many2one('res.company', string="Company", + related='account_journal_id.company_id') @api.one @api.depends('cost_lines.price_unit') diff --git a/addons/stock_landed_costs/security/stock_landed_cost_security.xml b/addons/stock_landed_costs/security/stock_landed_cost_security.xml new file mode 100644 index 00000000000..1182f9c687a --- /dev/null +++ b/addons/stock_landed_costs/security/stock_landed_cost_security.xml @@ -0,0 +1,13 @@ + + + + + + stock_landed_cost multi-company + + + ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + + \ No newline at end of file From 215754a7db0fb74276e26b9b53c1c5feace1b9a2 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 9 Aug 2018 13:53:35 +0200 Subject: [PATCH 06/47] [FIX] payment: display error on payment acquirer return Before this commit, when authorize (for example) returned a business error the error wasn't displayed to th ecustomer After this commit, it is. OPW 1866408 closes #26279 --- addons/payment/static/src/js/payment_form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js index 9abb0b73424..3847141300e 100644 --- a/addons/payment/static/src/js/payment_form.js +++ b/addons/payment/static/src/js/payment_form.js @@ -133,7 +133,7 @@ odoo.define('payment.payment_form', function (require) { self.displayError( _t('Server Error'), _t("We are not able to add your payment method at the moment.") + - data.data.message + message.data.message ); }); } @@ -178,7 +178,7 @@ odoo.define('payment.payment_form', function (require) { self.displayError( _t('Server Error'), _t("We are not able to redirect you to the payment form. ") + - data.data.message + message.data.message ); }); } From 47c7d123da0050cc30d90ba5e983eaa005c18029 Mon Sep 17 00:00:00 2001 From: len-odoo Date: Fri, 10 Aug 2018 08:30:28 +0200 Subject: [PATCH 07/47] [FIX] web_editor: remove related videos at the end of youtube embeds If a user embeds a youtube video on his website, he has no option to remove the suggestion of related videos at the end of playback. Since there is no good reason to have it, we disable the related videos in all cases. opw 1868380 --- addons/web_editor/static/src/js/widgets/widgets.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index 4bad378490d..fe33e85b3c1 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -820,6 +820,9 @@ var VideoDialog = Widget.extend({ return {errorCode: 1}; } + if (ytMatch) { + $video.attr('src', $video.attr('src') + '&rel=0'); + } if (options.loop && (ytMatch || vimMatch)) { $video.attr('src', $video.attr('src') + '&loop=1'); } From abd2b2e2caef0e073c8df4f973c9059f29bebdd9 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 8 Aug 2018 14:27:15 +0200 Subject: [PATCH 08/47] [FIX] account: reconcile through widget associate payment/invoice Create an invoice, validate it Create a payment from athe account.payment model (not the register payment wizard) click on the smart button payment matching, and match the invoice with the payment Reconcile Before this commit, the invoice was not part of the invoice_ids field of the payment, So, when printing the payment receipt or check, there was nothing on there After this commit, we associate the invoice with the payment, and the receipt prints what is expected OPW 1871575 closes #26245 --- addons/account/models/account_move.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 3b8968f8912..993a04abb7f 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1542,6 +1542,21 @@ class AccountMoveLine(models.Model): action['domain'] = [('id', 'in', ids)] return action + @api.multi + def _payment_invoice_match(self): + ''' + If a partial reconciliation involves payments and invoices + mark the invoices as paid by the payments + Specifically made for len(self) == 2 + ''' + if not self: + return + invoice_ids = self.mapped('invoice_id') + payment_ids = self.mapped('payment_id') + + if payment_ids and invoice_ids: + payment_ids.write({'invoice_ids': [(4, inv.id, False) for inv in invoice_ids]}) + class AccountPartialReconcile(models.Model): _name = "account.partial.reconcile" @@ -1830,6 +1845,7 @@ class AccountPartialReconcile(models.Model): aml.append(vals['credit_move_id']) # Get value of matched percentage from both move before reconciliating lines = self.env['account.move.line'].browse(aml) + lines._payment_invoice_match() if lines[0].account_id.internal_type in ('receivable', 'payable'): percentage_before_rec = lines._get_matched_percentage() # Reconcile From 21064c7de8867c9217d274cb83ff589c8ebcac75 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 2 Aug 2018 16:52:32 +0200 Subject: [PATCH 09/47] [FIX] hw_escpos: byte/string correction OPW 1868196 --- addons/hw_escpos/escpos/escpos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hw_escpos/escpos/escpos.py b/addons/hw_escpos/escpos/escpos.py index 7fc0e196b39..3573efb1d98 100644 --- a/addons/hw_escpos/escpos/escpos.py +++ b/addons/hw_escpos/escpos/escpos.py @@ -358,7 +358,7 @@ class Escpos: else: self._raw(string) - raw += S_RASTER_N + raw += S_RASTER_N.encode('utf-8') buffer = "%02X%02X%02X%02X" % (int((size[0]/size[1])/8), 0, size[1], 0) raw += codecs.decode(buffer, 'hex') buffer = "" From da2140b72678ba8ef7bc5e5f3094e75e753a18f4 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 9 Aug 2018 11:29:27 +0200 Subject: [PATCH 10/47] [FIX] sale_timesheet: choose the project's company to determine cost Companies: B child of A User: Demo in B not in A Admin in A Create a product with Admin: track service = timesheet on project invoicing policy = delivered quantities Create a SO with Demo and validate, a project is created Now, make the demo user timzsheet on it Before this commit, there was an access error on company, that was because the the company that was choosen to determine the cost, was the one on the employee, which could be in another company than the user and moreover than the project After this commit, we take the company of the project OPW 1871440 closes #26271 --- addons/sale_timesheet/models/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_timesheet/models/account.py b/addons/sale_timesheet/models/account.py index a56ded4dc55..258d4d70aef 100644 --- a/addons/sale_timesheet/models/account.py +++ b/addons/sale_timesheet/models/account.py @@ -38,10 +38,10 @@ class AccountAnalyticLine(models.Model): return {} unit_amount = values.get('unit_amount', 0.0) or self.unit_amount user_id = values.get('user_id') or self.user_id.id or self._default_user() - user = self.env['res.users'].browse([user_id]) + project = values.get('project_id') and self.env['project.project'].browse([values['project_id']]) or self.project_id emp = self.env['hr.employee'].search([('user_id', '=', user_id)], limit=1) cost = emp and emp.timesheet_cost or 0.0 - uom = (emp or user).company_id.project_time_mode_id + uom = project.company_id.project_time_mode_id # Nominal employee cost = 1 * company project UoM (project_time_mode_id) return { 'amount': -unit_amount * cost, From c69a6c6509fb3c0c44455b83676a415fde8bb403 Mon Sep 17 00:00:00 2001 From: Prakash Prajapati Date: Wed, 1 Aug 2018 10:17:06 +0530 Subject: [PATCH 11/47] [FIX] mrp: see full name of 'report' option in BoM 'Structure & Cost' report Before this commit, when we opened the report "Structure & Cost" of a Bill of Materials of a product without any variant, the dropdown option selection 'report' had the current selection name cut. For instance, the selection "BoM Structure & Cost" was displayed as "BoM Structure". This was due to each option having a width determined by the bootstrap classname `col-md-4`, independently on the number of options that are available. There are either 2 or 3 options at the top of this report, depending on whether the product of the BoM has variants or not. When there are 3 options, there is not problem. However, with 2 options (i.e., without variants), each option available horizontal space is reduced, so that the 'report' option is shrunk, which cuts the text selection as a result. This commit fixes this problem when there are 2 options (= "no variant"), so that the 'report' option uses more horizontal space. Task-ID 1864490 Closes #25643 --- addons/mrp/static/src/xml/mrp.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/static/src/xml/mrp.xml b/addons/mrp/static/src/xml/mrp.xml index 75c2ce15422..9c250bcfbdd 100644 --- a/addons/mrp/static/src/xml/mrp.xml +++ b/addons/mrp/static/src/xml/mrp.xml @@ -25,7 +25,7 @@ -
+