diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 405e4978bcd83..06c05c8180abd 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -581,8 +581,7 @@ def _get_alias_values(self, alias_name=None): if self.company_id != self.env.ref('base.main_company'): alias_name += '-' + str(self.company_id.name) return { - 'alias_defaults': {'type': 'in_invoice'}, - 'alias_user_id': self.env.user.id, + 'alias_defaults': {'type': 'in_invoice', 'company_id': self.company_id.id}, 'alias_parent_thread_id': self.id, 'alias_name': re.sub(r'[^\w]+', '-', alias_name) } diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index fbbde7737b1c2..43a1eaf7512c1 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1928,12 +1928,12 @@ def _prepare_invoice_line(self): } return data - @api.model - def create(self, vals): - if vals.get('display_type', self.default_get(['display_type'])['display_type']): - vals.update(price_unit=0, account_id=False, quantity=0) - - return super(AccountInvoiceLine, self).create(vals) + @api.model_create_multi + def create(self, vals_list): + for vals in vals_list: + if vals.get('display_type', self.default_get(['display_type'])['display_type']): + vals.update(price_unit=0, account_id=False, quantity=0) + return super(AccountInvoiceLine, self).create(vals_list) @api.multi def write(self, values): diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index aa37b7bec3cf3..7861644525ac4 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -114,7 +114,8 @@ def _sub_select(self): ai.partner_bank_id, 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(ai.amount_total * invoice_type.sign) AS amount_total, + (ai.amount_total * invoice_type.sign) / (SELECT count(*) FROM account_invoice_line l where invoice_id = ai.id) * + count(*) * invoice_type.sign AS amount_total, SUM(ABS(ail.price_subtotal_signed)) / CASE WHEN SUM(ail.quantity / u.factor * u2.factor) <> 0::numeric THEN SUM(ail.quantity / u.factor * u2.factor) diff --git a/addons/auth_signup/data/auth_signup_data.xml b/addons/auth_signup/data/auth_signup_data.xml index 658ea04d25116..6db81fd0dc391 100644 --- a/addons/auth_signup/data/auth_signup_data.xml +++ b/addons/auth_signup/data/auth_signup_data.xml @@ -142,7 +142,7 @@ % set website_url = object.env['ir.config_parameter'].sudo().get_param('web.base.url') Your Odoo domain is: ${website_url}
Your sign in email is: ${object.email}

- Never heard of Odoo? It’s a all-in-one business software loved by 3+ million users. It will considerably improve your experience at work and increase your productivity. + Never heard of Odoo? It’s an all-in-one business software loved by 3+ million users. It will considerably improve your experience at work and increase your productivity.

Have a look at the Odoo Tour to discover the tool.

diff --git a/addons/base_iban/models/res_partner_bank.py b/addons/base_iban/models/res_partner_bank.py index 62b414eae00c2..f457a91201192 100644 --- a/addons/base_iban/models/res_partner_bank.py +++ b/addons/base_iban/models/res_partner_bank.py @@ -70,13 +70,21 @@ def get_bban(self): @api.model def create(self, vals): if vals.get('acc_number'): - vals['acc_number'] = pretty_iban(normalize_iban(vals['acc_number'])) + try: + validate_iban(vals['acc_number']) + vals['acc_number'] = pretty_iban(normalize_iban(vals['acc_number'])) + except ValidationError: + pass return super(ResPartnerBank, self).create(vals) @api.multi def write(self, vals): if vals.get('acc_number'): - vals['acc_number'] = pretty_iban(normalize_iban(vals['acc_number'])) + try: + validate_iban(vals['acc_number']) + vals['acc_number'] = pretty_iban(normalize_iban(vals['acc_number'])) + except ValidationError: + pass return super(ResPartnerBank, self).write(vals) @api.one diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index d2370c986e277..ca59e30798b76 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -277,6 +277,13 @@ def _onchange_state(self): if self.state_id: self.country_id = self.state_id.country_id.id + @api.onchange('country_id') + def _onchange_country_id(self): + res = {'domain': {'state_id': []}} + if self.country_id: + res['domain']['state_id'] = [('country_id', '=', self.country_id.id)] + return res + # ---------------------------------------- # ORM override (CRUD, fields_view_get, ...) # ---------------------------------------- diff --git a/addons/crm/models/crm_team.py b/addons/crm/models/crm_team.py index a101fb26848dc..d7e66bfa3ee19 100644 --- a/addons/crm/models/crm_team.py +++ b/addons/crm/models/crm_team.py @@ -48,13 +48,18 @@ def _compute_unassigned_leads_count(self): team.unassigned_leads_count = counts.get(team.id, 0) def _compute_opportunities(self): - opportunity_data = self.env['crm.lead'].read_group([ + opportunity_data = self.env['crm.lead'].search([ ('team_id', 'in', self.ids), ('probability', '<', 100), ('type', '=', 'opportunity'), - ], ['planned_revenue', 'team_id'], ['team_id']) - counts = {datum['team_id'][0]: datum['team_id_count'] for datum in opportunity_data} - amounts = {datum['team_id'][0]: (datum['planned_revenue']) for datum in opportunity_data} + ]).read(['planned_revenue', 'team_id']) + counts = {} + amounts = {} + for datum in opportunity_data: + counts.setdefault(datum['team_id'][0], 0) + amounts.setdefault(datum['team_id'][0], 0) + counts[datum['team_id'][0]] += 1 + amounts[datum['team_id'][0]] += (datum.get('planned_revenue', 0)) for team in self: team.opportunities_count = counts.get(team.id, 0) team.opportunities_amount = amounts.get(team.id, 0) diff --git a/addons/fleet/models/fleet_vehicle_cost.py b/addons/fleet/models/fleet_vehicle_cost.py index 0c5a04f6d9cec..238101c42fb00 100644 --- a/addons/fleet/models/fleet_vehicle_cost.py +++ b/addons/fleet/models/fleet_vehicle_cost.py @@ -279,7 +279,7 @@ def scheduler_manage_contract_expiration(self): 'fleet.mail_act_fleet_contract_to_renew', contract.expiration_date, user_id=contract.user_id.id) - expired_contracts = self.search([('state', '!=', 'expired'), ('expiration_date', '<',fields.Date.today() )]) + expired_contracts = self.search([('state', 'not in', ['expired', 'closed']), ('expiration_date', '<',fields.Date.today() )]) expired_contracts.write({'state': 'expired'}) futur_contracts = self.search([('state', 'not in', ['futur', 'closed']), ('start_date', '>', fields.Date.today())]) diff --git a/addons/hr_holidays/static/scss/hr_leave_mobile.scss b/addons/hr_holidays/static/scss/hr_leave_mobile.scss new file mode 100644 index 0000000000000..7dabf58db05e2 --- /dev/null +++ b/addons/hr_holidays/static/scss/hr_leave_mobile.scss @@ -0,0 +1,6 @@ +@include media-breakpoint-down(sm) { + .o_hr_holidays_dates { + display: flex; + flex-flow: column; + } +} diff --git a/addons/hr_holidays/views/hr_leave_template.xml b/addons/hr_holidays/views/hr_leave_template.xml index ecffad0e31dc3..170009345022a 100644 --- a/addons/hr_holidays/views/hr_leave_template.xml +++ b/addons/hr_holidays/views/hr_leave_template.xml @@ -1,8 +1,11 @@ - + diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml index 215a2c36f6d8e..1cd2367c65394 100644 --- a/addons/hr_holidays/views/hr_leave_views.xml +++ b/addons/hr_holidays/views/hr_leave_views.xml @@ -168,7 +168,7 @@
-
+
- +