diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-08-13 20:03:07 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-08-13 20:03:07 +0200 |
| commit | 964f1c2b594f5acdca3171cd34aef5276091db31 (patch) | |
| tree | 4e00867b6f897bf9c346885d253f979ff6141891 | |
| parent | 8be6470a826fc6e467a3bef1696d236249ca29f9 (diff) | |
| parent | 3972e9ea3e3ff5ad5f446498c17d49a3a0ed653c (diff) | |
[MERGE] forward port branch saas-12.3 up to 3972e9ea3e3
| -rw-r--r-- | addons/account/models/account.py | 6 | ||||
| -rw-r--r-- | addons/hr/security/hr_security.xml | 7 | ||||
| -rw-r--r-- | addons/hr_holidays/models/hr_employee.py | 3 | ||||
| -rw-r--r-- | addons/website_crm_partner_assign/static/src/js/crm_partner_assign.js | 2 |
4 files changed, 7 insertions, 11 deletions
diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 30ab7082504..5cd647e5648 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -1419,13 +1419,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({ diff --git a/addons/hr/security/hr_security.xml b/addons/hr/security/hr_security.xml index e3a33270e73..bbafaf7fb38 100644 --- a/addons/hr/security/hr_security.xml +++ b/addons/hr/security/hr_security.xml @@ -54,12 +54,5 @@ <field name="domain_force">['|',('company_id','=',False),('company_id', 'in', company_ids)]</field> </record> - <record id="hr_employee_comp_rule" model="ir.rule"> - <field name="name">Employee multi company rule</field> - <field name="model_id" ref="model_hr_employee"/> - <field name="global" eval="True"/> - <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field> - </record> - </data> </odoo> diff --git a/addons/hr_holidays/models/hr_employee.py b/addons/hr_holidays/models/hr_employee.py index c0a47809e04..c5be1cd73a9 100644 --- a/addons/hr_holidays/models/hr_employee.py +++ b/addons/hr_holidays/models/hr_employee.py @@ -63,7 +63,7 @@ class HrEmployeeBase(models.AbstractModel): ) 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),)) @@ -82,6 +82,7 @@ class HrEmployeeBase(models.AbstractModel): 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), 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()); } |
