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 0b6a8929258..c8589eb43c8 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -699,6 +699,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 ec3bb082fc5..c79913d99e9 100644 --- a/addons/delivery/models/sale_order.py +++ b/addons/delivery/models/sale_order.py @@ -81,6 +81,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/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py index 23b3386fa9d..e7e801429d1 100644 --- a/addons/purchase/models/account_invoice.py +++ b/addons/purchase/models/account_invoice.py @@ -27,11 +27,12 @@ class AccountInvoice(models.Model): purchase_line_ids = self.invoice_line_ids.mapped('purchase_line_id') purchase_ids = self.invoice_line_ids.mapped('purchase_id').filtered(lambda r: r.order_line <= purchase_line_ids) - result['domain'] = {'purchase_id': [ - ('invoice_status', '=', 'to invoice'), - ('partner_id', 'child_of', self.partner_id.id), - ('id', 'not in', purchase_ids.ids), - ]} + domain = [('invoice_status', '=', 'to invoice')] + if self.partner_id: + domain += [('partner_id', 'child_of', self.partner_id.id)] + if purchase_ids: + domain += [('id', 'not in', purchase_ids.ids)] + result['domain'] = {'purchase_id': domain} return result def _prepare_invoice_line_from_po_line(self, line): diff --git a/doc/cla/corporate/brain-tec.md b/doc/cla/corporate/brain-tec.md index f598f64eb1b..46e4e2d3646 100644 --- a/doc/cla/corporate/brain-tec.md +++ b/doc/cla/corporate/brain-tec.md @@ -38,3 +38,4 @@ Raúl Martín raul.martin@braintec-group.com https://github.com/BT-rmartin Silvan Wyden silvan.wyden@braintec-group.com https://github.com/BT-swyden Timka Piric Muratovic timka.piric@braintec-group.com https://github.com/BT-tpiric Pascal Zenklusen pascal.zenklusen@braintec-group.com https://github.com/BT-pzenklusen +Nadal Francisco Garcia nadal.francisco@braintec-group.com https://github.com/BT-nfrancisco \ No newline at end of file diff --git a/doc/cla/individual/as400it.md b/doc/cla/individual/as400it.md new file mode 100644 index 00000000000..d42536df0d6 --- /dev/null +++ b/doc/cla/individual/as400it.md @@ -0,0 +1,11 @@ +Italy, 2018-08-08 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Marco Calcagni mcalcagni@dinamicheaziendali.it https://github.com/As400it diff --git a/odoo/addons/base/res/res.lang.csv b/odoo/addons/base/res/res.lang.csv index 8de2be3a327..2452927d718 100644 --- a/odoo/addons/base/res/res.lang.csv +++ b/odoo/addons/base/res/res.lang.csv @@ -6,9 +6,9 @@ "base.lang_bs_BA","Bosnian / bosanski jezik","bs_BA","bs","Left-to-Right","[]",",",,"%d.%m.%Y","%H:%M:%S","True" "base.lang_bg","Bulgarian / български език","bg_BG","bg","Left-to-Right","[3,0]",",",,"%d.%m.%Y","%H,%M,%S","True" "base.lang_ca_ES","Catalan / Català","ca_ES","ca_ES","Left-to-Right","[3,0]",",",".","%d/%m/%Y","%H:%M:%S","True" -"base.lang_zh_CN","Chinese (CN) / 简体中文","zh_CN","zh_CN","Left-to-Right","[3,0]",".",",","%Y年%m月%d日","%H时%M分%S秒","True" +"base.lang_zh_CN","Chinese (Simplified) / 简体中文","zh_CN","zh_CN","Left-to-Right","[3,0]",".",",","%Y年%m月%d日","%H时%M分%S秒","True" "base.lang_zh_HK","Chinese (HK)","zh_HK","zh_HK","Left-to-Right","[3,0]",".",",","%Y年%m月%d日 %A","%I時%M分%S秒","True" -"base.lang_zh_TW","Chinese (TW) / 正體字","zh_TW","zh_TW","Left-to-Right","[3,0]",".",",","%Y年%m月%d日","%H時%M分%S秒","True" +"base.lang_zh_TW","Chinese (Traditional) / 正體字","zh_TW","zh_TW","Left-to-Right","[3,0]",".",",","%Y年%m月%d日","%H時%M分%S秒","True" "base.lang_hr","Croatian / hrvatski jezik","hr_HR","hr","Left-to-Right","[]",",",,"%d.%m.%Y","%H:%M:%S","True" "base.lang_cs_CZ","Czech / Čeština","cs_CZ","cs_CZ","Left-to-Right","[3,0]",","," ","%d.%m.%Y","%H:%M:%S","True" "base.lang_da_DK","Danish / Dansk","da_DK","da_DK","Left-to-Right","[3,0]",",",".","%d-%m-%Y","%H:%M:%S","True" diff --git a/odoo/exceptions.py b/odoo/exceptions.py index c318f9ecdac..6807485e80a 100644 --- a/odoo/exceptions.py +++ b/odoo/exceptions.py @@ -46,6 +46,10 @@ class RedirectWarning(Exception): :param string button_text: text to put on the button that will trigger the redirection. """ + # using this RedirectWarning won't crash if used as an except_orm + @property + def name(self): + return self.args[0] class AccessDenied(Exception): diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index a036932f6fc..32300440bac 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -1078,10 +1078,7 @@ def formatLang(env, value, digits=None, grouping=True, monetary=False, dp=False, return '' lang = env.context.get('lang') or env.user.company_id.partner_id.lang or 'en_US' - lang_objs = env['res.lang'].search([('code', '=', lang)]) - if not lang_objs: - lang_objs = env['res.lang'].search([], limit=1) - lang_obj = lang_objs[0] + lang_obj = env['res.lang']._lang_get(lang) res = lang_obj.format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary) diff --git a/requirements.txt b/requirements.txt index 96736e9917d..44b4fcb11c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ gevent==1.3.4 ; sys_platform != 'win32' and python_version >= '3.7' greenlet==0.4.10 ; python_version < '3.7' greenlet==0.4.13 ; python_version >= '3.7' html2text==2016.9.19 -Jinja2==2.8 +Jinja2==2.8.1 lxml==3.7.1 ; sys_platform != 'win32' and python_version < '3.7' lxml==4.2.3 ; sys_platform != 'win32' and python_version >= '3.7' lxml ; sys_platform == 'win32'