diff --git a/addons/account/models/company.py b/addons/account/models/company.py index 63aa0230a1a..10c95922ca4 100644 --- a/addons/account/models/company.py +++ b/addons/account/models/company.py @@ -124,12 +124,8 @@ Best Regards,''')) @api.model def _verify_fiscalyear_last_day(self, company_id, last_day, last_month): - company = self.browse(company_id) - last_day = last_day or (company and company.fiscalyear_last_day) or 31 - last_month = last_month or (company and company.fiscalyear_last_month) or 12 - current_year = datetime.now().year - last_day_of_month = calendar.monthrange(current_year, last_month)[1] - return last_day > last_day_of_month and last_day_of_month or last_day + # FIXME: Remove this method in master + return last_day @api.multi def compute_fiscalyear_dates(self, current_date): diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index f220b6d9059..5acb2ffcb9f 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -52,11 +52,6 @@ - - - - @@ -67,7 +62,6 @@ - @@ -88,13 +82,6 @@ - - diff --git a/addons/account/wizard/setup_wizards.py b/addons/account/wizard/setup_wizards.py index 5128d50e2e4..69a10649a9e 100644 --- a/addons/account/wizard/setup_wizards.py +++ b/addons/account/wizard/setup_wizards.py @@ -36,17 +36,6 @@ class FinancialYearOpeningWizard(models.TransientModel): """ Forces fiscal year setup state to 'undone'.""" self.company_id.account_setup_fy_data_done = False - @api.multi - def write(self, vals): - if 'fiscalyear_last_day' in vals or 'fiscalyear_last_month' in vals: - for wizard in self: - company = wizard.company_id - vals['fiscalyear_last_day'] = company._verify_fiscalyear_last_day( - company.id, - vals.get('fiscalyear_last_day'), - vals.get('fiscalyear_last_month')) - return super(FinancialYearOpeningWizard, self).write(vals) - class SetupBarBankConfigWizard(models.TransientModel): _inherits = {'res.partner.bank': 'res_partner_bank_id'} diff --git a/addons/anonymization/wizard/anonymize_wizard.py b/addons/anonymization/wizard/anonymize_wizard.py index 4ba71b03455..7bf914ba742 100644 --- a/addons/anonymization/wizard/anonymize_wizard.py +++ b/addons/anonymization/wizard/anonymize_wizard.py @@ -127,6 +127,9 @@ class IrModelFieldsAnonymizeWizard(models.TransientModel): @api.multi def anonymize_database(self): """Sets the 'anonymized' state to defined fields""" + # pylint: disable=W0101 + raise UserError("""The Odoo Migration Platform no longer accepts anonymized databases.\n + If you wish for your data to remain private during migration, please contact us at upgrade@odoo.com""") self.ensure_one() # create a new history record: diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 9e6c4a83416..b3ffeaf2538 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -707,6 +707,8 @@ class Lead(models.Model): @api.model def _get_duplicated_leads_by_emails(self, partner_id, email, include_lost=False): """ Search for opportunities that have the same partner and that arent done or cancelled """ + if not email: + return [] partner_match_domain = [] for email in set(email_split(email) + [email]): partner_match_domain.append(('email_from', '=ilike', email)) diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py index e08f37b135e..d0ca0a7c424 100644 --- a/addons/delivery/models/sale_order.py +++ b/addons/delivery/models/sale_order.py @@ -88,6 +88,9 @@ class SaleOrder(models.Model): def _create_delivery_line(self, carrier, price_unit): SaleOrderLine = self.env['sale.order.line'] + if self.partner_id: + # set delivery detail in the customer language + carrier = carrier.with_context(lang=self.partner_id.lang) # Apply fiscal position taxes = carrier.product_id.taxes_id.filtered(lambda t: t.company_id.id == self.company_id.id) diff --git a/addons/hr_payroll_account/models/hr_payroll_account.py b/addons/hr_payroll_account/models/hr_payroll_account.py index da168912095..989d5f260f4 100644 --- a/addons/hr_payroll_account/models/hr_payroll_account.py +++ b/addons/hr_payroll_account/models/hr_payroll_account.py @@ -53,6 +53,7 @@ class HrPayslip(models.Model): @api.multi def action_payslip_done(self): + res = super(HrPayslip, self).action_payslip_done() precision = self.env['decimal.precision'].precision_get('Payroll') for slip in self: @@ -138,7 +139,7 @@ class HrPayslip(models.Model): move = self.env['account.move'].create(move_dict) slip.write({'move_id': move.id, 'date': date}) move.post() - return super(HrPayslip, self).action_payslip_done() + return res class HrSalaryRule(models.Model): diff --git a/addons/hw_escpos/escpos/escpos.py b/addons/hw_escpos/escpos/escpos.py index 7fc0e196b39..3573efb1d98 100644 --- a/addons/hw_escpos/escpos/escpos.py +++ b/addons/hw_escpos/escpos/escpos.py @@ -358,7 +358,7 @@ class Escpos: else: self._raw(string) - raw += S_RASTER_N + raw += S_RASTER_N.encode('utf-8') buffer = "%02X%02X%02X%02X" % (int((size[0]/size[1])/8), 0, size[1], 0) raw += codecs.decode(buffer, 'hex') buffer = "" diff --git a/addons/l10n_in/views/report_invoice.xml b/addons/l10n_in/views/report_invoice.xml index 7fb7337becf..f20fee72efd 100644 --- a/addons/l10n_in/views/report_invoice.xml +++ b/addons/l10n_in/views/report_invoice.xml @@ -108,7 +108,14 @@ - + + + + + + + +
Unit Price Disc.(%) TaxesTax Amount Amount
- - - - @@ -106,7 +93,6 @@
diff --git a/addons/l10n_in_stock/views/report_stockpicking_operations.xml b/addons/l10n_in_stock/views/report_stockpicking_operations.xml index 70d9fdbc1f4..cb6fb012d2c 100644 --- a/addons/l10n_in_stock/views/report_stockpicking_operations.xml +++ b/addons/l10n_in_stock/views/report_stockpicking_operations.xml @@ -2,8 +2,8 @@ diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index 949a715cddb..6386273070c 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -176,6 +176,20 @@ class MailController(http.Controller): models that have an access_token may apply variations on this. """ + # ============================================================================================== + # This block of code disappeared on saas-11.3 to be reintroduced by TBE. + # This is needed because after a migration from an older version to saas-11.3, the link + # received by mail with a message_id no longer work. + # So this block of code is needed to guarantee the backward compatibility of those links. + if kwargs.get('message_id'): + try: + message = request.env['mail.message'].sudo().browse(int(kwargs['message_id'])).exists() + except: + message = request.env['mail.message'] + if message: + model, res_id = message.model, message.res_id + # ============================================================================================== + if res_id and isinstance(res_id, pycompat.string_types): res_id = int(res_id) return self._redirect_to_record(model, res_id, access_token) diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py index 47b724aac98..b556a6ac66a 100644 --- a/addons/mail/models/mail_activity.py +++ b/addons/mail/models/mail_activity.py @@ -387,6 +387,8 @@ class MailActivityMixin(models.AbstractModel): record.activity_date_deadline = record.activity_ids[:1].date_deadline def _search_activity_date_deadline(self, operator, operand): + if operator == '=' and not operand: + return [('activity_ids', '=', False)] return [('activity_ids.date_deadline', operator, operand)] @api.model diff --git a/addons/mass_mailing/models/mail_thread.py b/addons/mass_mailing/models/mail_thread.py index 8e4ee298c67..f26aee7ff4a 100644 --- a/addons/mass_mailing/models/mail_thread.py +++ b/addons/mass_mailing/models/mail_thread.py @@ -35,7 +35,7 @@ class MailThread(models.AbstractModel): """ Override to update the parent mail statistics. The parent is found by using the References header of the incoming message and looking for matching message_id in mail.mail.statistics. """ - if message.get('References'): + if message.get('References') and routes: message_ids = [x.strip() for x in decode_smtp_header(message['References']).split()] self.env['mail.mail.statistics'].set_opened(mail_message_ids=message_ids) self.env['mail.mail.statistics'].set_replied(mail_message_ids=message_ids) diff --git a/addons/mass_mailing/models/mass_mailing_stats.py b/addons/mass_mailing/models/mass_mailing_stats.py index 0a095943f99..8e48a4cb465 100644 --- a/addons/mass_mailing/models/mass_mailing_stats.py +++ b/addons/mass_mailing/models/mass_mailing_stats.py @@ -106,7 +106,7 @@ class MailMailStats(models.Model): def set_opened(self, mail_mail_ids=None, mail_message_ids=None): statistics = self._get_records(mail_mail_ids, mail_message_ids, [('opened', '=', False)]) - statistics.write({'opened': fields.Datetime.now()}) + statistics.write({'opened': fields.Datetime.now(), 'bounced': False}) return statistics def set_clicked(self, mail_mail_ids=None, mail_message_ids=None): @@ -120,6 +120,7 @@ class MailMailStats(models.Model): return statistics def set_bounced(self, mail_mail_ids=None, mail_message_ids=None): - statistics = self._get_records(mail_mail_ids, mail_message_ids, [('bounced', '=', False)]) + statistics = self._get_records( + mail_mail_ids, mail_message_ids, [('bounced', '=', False), ('opened', '=', False)]) statistics.write({'bounced': fields.Datetime.now()}) return statistics diff --git a/addons/mrp/static/src/xml/mrp.xml b/addons/mrp/static/src/xml/mrp.xml index 75c2ce15422..9c250bcfbdd 100644 --- a/addons/mrp/static/src/xml/mrp.xml +++ b/addons/mrp/static/src/xml/mrp.xml @@ -25,7 +25,7 @@ -
+