From 68a13c99fd5803d92a7f81dff39a937198996421 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Tue, 13 Aug 2019 09:37:00 +0000 Subject: [PATCH 1/4] [FIX] account: Fix taxes computation for intracomm Suppose an amount of 1000 with tax 21% having +100%, -100% as repartition: In that case, the condition preventing a rounding issue must be ignored because the sum of factors is 0%, not 100% closes odoo/odoo#35681 Signed-off-by: Josse Colpaert --- addons/account/models/account.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 27176ba238f..9547eb43c4f 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -1427,13 +1427,15 @@ class AccountTax(models.Model): # Compute the tax lines tax_repartition_lines = (is_refund and tax.refund_repartition_line_ids or tax.invoice_repartition_line_ids).filtered(lambda x: x.repartition_type == 'tax') + sum_factor = sum(tax_repartition_lines.mapped('factor')) repartition_lines_to_treat = len(tax_repartition_lines) total_amount = 0 for repartition_line in tax_repartition_lines: - if repartition_lines_to_treat != 1: + if repartition_lines_to_treat != 1 or sum_factor != 1.0: line_amount = round(tax_amount * repartition_line.factor, prec) else: - # In case some rounding error occurs, we compensate for it on the last line + # When the sum of the repartition lines factor is 100%, we need to ensure the whole tax amount has + # been spread into the repartition lines. line_amount = round(tax_amount - total_amount, prec) taxes_vals.append({ From 0b25547fc691d66d3b78fb544f5fda52bb5cbe28 Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Thu, 8 Aug 2019 06:43:24 +0000 Subject: [PATCH 2/4] [IMP] hr_holidays: add domain on active time off Add a domain to only count active holiday allocations on the employee's profile. TaskID: 2048672 closes odoo/odoo#35547 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_holidays/models/hr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/hr_holidays/models/hr.py b/addons/hr_holidays/models/hr.py index be5294d847a..68e20bb3420 100644 --- a/addons/hr_holidays/models/hr.py +++ b/addons/hr_holidays/models/hr.py @@ -116,7 +116,7 @@ class Employee(models.Model): ) h join hr_leave_type s ON (s.id=h.holiday_status_id) WHERE - h.state='validate' AND + s.active = true AND h.state='validate' AND (s.allocation_type='fixed' OR s.allocation_type='fixed_allocation') AND h.employee_id in %s GROUP BY h.employee_id""", (tuple(self.ids),)) @@ -135,6 +135,7 @@ class Employee(models.Model): for employee in self: allocations = self.env['hr.leave.allocation'].search([ ('employee_id', '=', employee.id), + ('holiday_status_id.active', '=', True), ('state', '=', 'validate'), '|', ('date_to', '=', False), From 0855f9418147c48fa9623f4c0457e35fa41f618f Mon Sep 17 00:00:00 2001 From: Nicolas Seinlet Date: Tue, 13 Aug 2019 14:02:48 +0000 Subject: [PATCH 3/4] [FIX] website_crm_partner_assign: force date format as format is forced in XML https://github.com/odoo/odoo/blame/saas-12.3/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml#L674 closes odoo/odoo#35697 Signed-off-by: Christophe Simonis --- .../static/src/js/crm_partner_assign.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js b/addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js index bc5b17b5151..59a835945a0 100644 --- a/addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js +++ b/addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js @@ -264,7 +264,7 @@ publicWidget.registry.crmPartnerAssign = publicWidget.Widget.extend({ _parse_date: function (value) { console.log(value); - var date = moment(value, time.getLangDateFormat(), true); + var date = moment(value, "YYYY-MM-DD", true); if (date.isValid()) { return time.date_to_str(date.toDate()); } From 3972e9ea3e3ff5ad5f446498c17d49a3a0ed653c Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 13 Aug 2019 14:03:14 +0000 Subject: [PATCH 4/4] [FIX] hr: remove redefined record rule Actually revert commit 7b1a894573b1499e9ea563f500c866378a65e1ca closes odoo/odoo#35698 Signed-off-by: Christophe Simonis --- addons/hr/security/hr_security.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/addons/hr/security/hr_security.xml b/addons/hr/security/hr_security.xml index 30958ef43d1..8d435e67463 100644 --- a/addons/hr/security/hr_security.xml +++ b/addons/hr/security/hr_security.xml @@ -47,12 +47,5 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - - Employee multi company rule - - - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - -