[MERGE] forward port branch saas-12.3 up to 3972e9ea3e
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user