From 7b87212ea851518a641f65a71dc094cf88507cdc Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 29 Aug 2018 13:02:59 +0200 Subject: [PATCH 1/5] [FIX] account: Wrong quantity in Invoices analysis Steps to reproduce: Create a customer invoice with 2 product A and refund 1 product A. Display account.invoice.report for this custumer. Bug: The quantity should be 1 not 3. Fine tuning of this commit: e890682656b4739f489d34b954a1b1e8d9f78065 opw:1868116 --- addons/account/report/account_invoice_report.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 7c6bf726a38..77d026ed6ff 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -113,7 +113,7 @@ class AccountInvoiceReport(models.Model): 1 AS nbr, ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id, ai.partner_bank_id, - SUM ((invoice_type.sign * ail.quantity) / u.factor * u2.factor) AS product_qty, + SUM ((invoice_type.sign_qty * ail.quantity) / u.factor * u2.factor) AS product_qty, SUM(ail.price_subtotal_signed * invoice_type.sign) AS price_total, SUM(ABS(ail.price_subtotal_signed)) / CASE WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric @@ -144,7 +144,11 @@ class AccountInvoiceReport(models.Model): WHEN ai.type::text = ANY (ARRAY['in_refund'::character varying::text, 'in_invoice'::character varying::text]) THEN -1 ELSE 1 - END) AS sign + END) AS sign,(CASE + WHEN ai.type::text = ANY (ARRAY['out_refund'::character varying::text, 'in_invoice'::character varying::text]) + THEN -1 + ELSE 1 + END) AS sign_qty FROM account_invoice ai ) AS invoice_type ON invoice_type.id = ai.id """ From e65c8826ef9969ee0c0416c8f5165525ee3f0809 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 29 Aug 2018 15:53:54 +0200 Subject: [PATCH 2/5] [FIX] sale_timesheet: timesheet cost with company on analytic account FIXUP da2140b The above commmit was half-right in the business logic, but overlooked that if a user is not in the company of the project, it will crash. This use case worked before that commit While agreeing that a little more clear access right is needed like for example be able to get the project_time_mode_id on the companies that are in user.company_ids, the aim of this present commit is to avoid regression OPW 1878204 closes #26539 --- 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 258d4d70aef..121c1940000 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() - 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) + account = values.get('account_id') and self.env['account.analytic.account'].browse([values['account_id']]) or self.account_id or emp.account_id cost = emp and emp.timesheet_cost or 0.0 - uom = project.company_id.project_time_mode_id + uom = account.company_id.sudo().project_time_mode_id # Nominal employee cost = 1 * company project UoM (project_time_mode_id) return { 'amount': -unit_amount * cost, From 5028da38736f7f3c4bf651779c0bfe39a31f91c1 Mon Sep 17 00:00:00 2001 From: Mitali Patel Date: Thu, 30 Aug 2018 12:56:49 +0530 Subject: [PATCH 3/5] [FIX] website_sale: removing compute_currency function from qweb template (#26606) compute method called 2 times in t-esc case when monetary field has "from_currency :: 1) value_to_html: compute method call when qweb monetary widget is return value as a html. see https://github.com/odoo/odoo/blob/10.0/odoo/addons/base/ir/ir_qweb/fields.py#L325 2) compute_currency : compute_currency method is pass from controller into render engine and it is call the compute method. So, we removed compute_currency method from qweb template in the t-esc with monetary widget. --- addons/website_sale/views/templates.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 2f576530b88..0241cc8536a 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -103,7 +103,7 @@
- + @@ -587,7 +587,7 @@

@@ -878,7 +878,7 @@ - + From 90ce4733ae38c44e6062c1000fc6096dc33bff2e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 30 Aug 2018 09:56:53 +0200 Subject: [PATCH 4/5] [FIX] website_sale: add back compute_currency function from qweb template Unless there is a a bug, do not remove a currency conversion. This reverts commit 5028da38736f7f3c4bf651779c0bfe39a31f91c1. --- addons/website_sale/views/templates.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 0241cc8536a..2f576530b88 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -103,7 +103,7 @@
- + @@ -587,7 +587,7 @@

@@ -878,7 +878,7 @@ - + From 09ad56066043f596a766de5f04959664f3f54ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davor=20Bojki=C4=87=20-=20Bole?= Date: Tue, 31 Oct 2017 14:50:31 +0100 Subject: [PATCH 5/5] [ADD] base: add Kosovo to list of countries According to discussion on jvOrsouw/Odoo11#1 Closes #20605 --- odoo/addons/base/res/res_country_data.xml | 7 +++++++ odoo/addons/base/static/img/country_flags/xk.png | Bin 0 -> 2581 bytes 2 files changed, 7 insertions(+) create mode 100644 odoo/addons/base/static/img/country_flags/xk.png diff --git a/odoo/addons/base/res/res_country_data.xml b/odoo/addons/base/res/res_country_data.xml index 3e0e094d400..fd9b777d67a 100644 --- a/odoo/addons/base/res/res_country_data.xml +++ b/odoo/addons/base/res/res_country_data.xml @@ -1774,6 +1774,13 @@ + + Kosovo + xk + + + + Europe diff --git a/odoo/addons/base/static/img/country_flags/xk.png b/odoo/addons/base/static/img/country_flags/xk.png new file mode 100644 index 0000000000000000000000000000000000000000..cbabf92cdcf12ad3dcbc3fd47e07be9b38c28bbe GIT binary patch literal 2581 zcmV+w3hMQVP)>NAWv~D`pR2al+N?(mL#Y5k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