From 42230ed22efdbc58fbaf3fdfb753560b1c4cdb2a Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 20 Dec 2018 12:01:53 +0100 Subject: [PATCH 01/10] [FIX] website_sale: make eCommerce animations work in all browsers The eCommerce sometimes animates product images when they are put in the cart / wishlist / comparison panel. Those animations did not work on Firefox and IE and made strange scrollbars appear instead. --- addons/website_sale/static/src/css/website_sale.css | 2 +- addons/website_sale/static/src/css/website_sale.sass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_sale/static/src/css/website_sale.css b/addons/website_sale/static/src/css/website_sale.css index 8f71e5bbfbd..78c6e86126e 100644 --- a/addons/website_sale/static/src/css/website_sale.css +++ b/addons/website_sale/static/src/css/website_sale.css @@ -643,7 +643,7 @@ a.no-decoration { .o_website_sale_animate { opacity: 0.7; - position: absolute; + position: absolute !important; height: 150px; width: 150px; z-index: 1020; diff --git a/addons/website_sale/static/src/css/website_sale.sass b/addons/website_sale/static/src/css/website_sale.sass index 3c1abfeb323..3bf9b0e8c97 100644 --- a/addons/website_sale/static/src/css/website_sale.sass +++ b/addons/website_sale/static/src/css/website_sale.sass @@ -567,7 +567,7 @@ a.no-decoration .o_website_sale_animate opacity: 0.7 - position: absolute + position: absolute !important height: 150px width: 150px z-index: 1020 From b131658966a347ec0058b713610e123347799cd7 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Tue, 8 Jan 2019 10:48:20 +0000 Subject: [PATCH 02/10] [FIX] account: error in Base amount tax opw-1917605 Before this commit, when accounting is set to global rounding, the base amount per tax is not correctly calculated. Now, the Base amount per tax is calculated adding the rounded lines. To test this issue, you need to set to global rounding and create a customer invoice with the following lines : line 1 = Qty:40; unit price:2.27; tax:15%; discount: 10% line 2 = Qty:21; unit price:2.77; tax:15%; discount: 10% line 3 = Qty:21; unit price:2.77; tax:15%; discount: 10% When the invoce is printed, you would notice that the amount is 186.43 and it should be 186.42. closes odoo/odoo#30021 --- addons/account/models/account_invoice.py | 4 +- .../tests/test_account_customer_invoice.py | 63 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 240d63ea7fc..aff495072ce 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -642,6 +642,7 @@ class AccountInvoice(models.Model): @api.multi def get_taxes_values(self): tax_grouped = {} + round_curr = self.currency_id.round for line in self.invoice_line_ids: price_unit = line.price_unit * (1 - (line.discount or 0.0) / 100.0) taxes = line.invoice_line_tax_ids.compute_all(price_unit, self.currency_id, line.quantity, line.product_id, self.partner_id)['taxes'] @@ -651,9 +652,10 @@ class AccountInvoice(models.Model): if key not in tax_grouped: tax_grouped[key] = val + tax_grouped[key]['base'] = round_curr(val['base']) else: tax_grouped[key]['amount'] += val['amount'] - tax_grouped[key]['base'] += val['base'] + tax_grouped[key]['base'] += round_curr(val['base']) return tax_grouped @api.multi diff --git a/addons/account/tests/test_account_customer_invoice.py b/addons/account/tests/test_account_customer_invoice.py index 0c559892644..12a164cd3cb 100644 --- a/addons/account/tests/test_account_customer_invoice.py +++ b/addons/account/tests/test_account_customer_invoice.py @@ -107,3 +107,66 @@ class TestAccountCustomerInvoice(AccountTestUsers): # I clicked on refund button. self.account_invoice_refund_0.invoice_refund() + + def test_customer_invoice_tax(self): + + self.env.user.company_id.tax_calculation_rounding_method = 'round_globally' + + payment_term = self.env.ref('account.account_payment_term_advance') + journalrec = self.env['account.journal'].search([('type', '=', 'sale')])[0] + partner3 = self.env.ref('base.res_partner_3') + account_id = self.env['account.account'].search([('user_type_id', '=', self.env.ref('account.data_account_type_revenue').id)], limit=1).id + + tax = self.env['account.tax'].create({ + 'name': 'Tax 15.0', + 'amount': 15.0, + 'amount_type': 'percent', + 'type_tax_use': 'sale', + }) + + invoice_line_data = [ + (0, 0, + { + 'product_id': self.env.ref('product.product_product_1').id, + 'quantity': 40.0, + 'account_id': account_id, + 'name': 'product test 1', + 'discount' : 10.00, + 'price_unit': 2.27, + 'invoice_line_tax_ids': [(6, 0, [tax.id])], + } + ), + (0, 0, + { + 'product_id': self.env.ref('product.product_product_2').id, + 'quantity': 21.0, + 'account_id': self.env['account.account'].search([('user_type_id', '=', self.env.ref('account.data_account_type_revenue').id)], limit=1).id, + 'name': 'product test 2', + 'discount' : 10.00, + 'price_unit': 2.77, + 'invoice_line_tax_ids': [(6, 0, [tax.id])], + } + ), + (0, 0, + { + 'product_id': self.env.ref('product.product_product_3').id, + 'quantity': 21.0, + 'account_id': self.env['account.account'].search([('user_type_id', '=', self.env.ref('account.data_account_type_revenue').id)], limit=1).id, + 'name': 'product test 3', + 'discount' : 10.00, + 'price_unit': 2.77, + 'invoice_line_tax_ids': [(6, 0, [tax.id])], + } + ) + ] + + invoice = self.env['account.invoice'].create(dict( + name="Test Customer Invoice", + reference_type="none", + payment_term_id=payment_term.id, + journal_id=journalrec.id, + partner_id=partner3.id, + invoice_line_ids=invoice_line_data + )) + + self.assertEquals(invoice.amount_untaxed, sum([x.base for x in invoice.tax_line_ids])) From 3929e419ffdbf49ed9b0c1370a2538e86e2aac34 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 4 Jan 2019 13:41:17 +0000 Subject: [PATCH 03/10] [FIX] stock: assign partner - Create a SO with a stockable product, validate - On the corresponding picking, change the partner - Print the 'Picking Operations' or 'Delivery Slip' The partner printed is the partner of the SO, not of the picking. This was reported many times in the past, and is quite confusing. It happens because the partner on the `stock.move` remains the partner set on the SO. We shouldn't change the reports, nor automatically propagate the change since it might cause issues, e.g. in case on dropshipping or manual creation of the picking. Therefore, we add an action which allows to set the partner on the stock move manually. opw-1917851 closes odoo/odoo#29939 --- addons/stock/i18n/stock.pot | 10 ++++++++++ addons/stock/models/stock_picking.py | 4 ++++ addons/stock/views/stock_picking_views.xml | 3 +++ 3 files changed, 17 insertions(+) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 39533e3c765..845d5707750 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -716,6 +716,16 @@ msgstr "" msgid "Assign Owner" msgstr "" +#. module: stock +#: model:ir.ui.view,arch_db:stock.view_picking_form +msgid "Assign Partner" +msgstr "" + +#. module: stock +#: model:ir.ui.view,arch_db:stock.view_picking_form +msgid "Assign the partner to the Operations. Use only if the partner is manually changed!" +msgstr "" + #. module: stock #: model:ir.ui.view,arch_db:stock.view_picking_internal_search msgid "Assigned Moves" diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 6be5cd8b26a..47e0fcceaec 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -547,6 +547,10 @@ class Picking(models.Model): def action_assign_owner(self): self.move_line_ids.write({'owner_id': self.owner_id.id}) + def action_assign_partner(self): + for picking in self: + picking.move_lines.write({'partner_id': picking.partner_id.id}) + @api.multi def do_print_picking(self): self.write({'printed': True}) diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml index 4c459ad2d9c..a39c5794652 100644 --- a/addons/stock/views/stock_picking_views.xml +++ b/addons/stock/views/stock_picking_views.xml @@ -242,6 +242,9 @@ +