[MERGE] forward port branch 10.0 up to a487d7d397

This commit is contained in:
Christophe Simonis
2018-08-14 17:09:32 +02:00
13 changed files with 43 additions and 17 deletions
@@ -126,6 +126,9 @@ class IrModelFieldsAnonymizeWizard(models.TransientModel):
@api.multi @api.multi
def anonymize_database(self): def anonymize_database(self):
"""Sets the 'anonymized' state to defined fields""" """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() self.ensure_one()
# create a new history record: # create a new history record:
+2
View File
@@ -639,6 +639,8 @@ class Lead(models.Model):
@api.model @api.model
def _get_duplicated_leads_by_emails(self, partner_id, email, include_lost=False): 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 """ """ Search for opportunities that have the same partner and that arent done or cancelled """
if not email:
return []
partner_match_domain = [] partner_match_domain = []
for email in set(email_split(email) + [email]): for email in set(email_split(email) + [email]):
partner_match_domain.append(('email_from', '=ilike', email)) partner_match_domain.append(('email_from', '=ilike', email))
+3
View File
@@ -75,6 +75,9 @@ class SaleOrder(models.Model):
def _create_delivery_line(self, carrier, price_unit): def _create_delivery_line(self, carrier, price_unit):
SaleOrderLine = self.env['sale.order.line'] 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 # Apply fiscal position
taxes = carrier.product_id.taxes_id.filtered(lambda t: t.company_id.id == self.company_id.id) taxes = carrier.product_id.taxes_id.filtered(lambda t: t.company_id.id == self.company_id.id)
+6 -5
View File
@@ -23,11 +23,12 @@ class AccountInvoice(models.Model):
purchase_line_ids = self.invoice_line_ids.mapped('purchase_line_id') 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) purchase_ids = self.invoice_line_ids.mapped('purchase_id').filtered(lambda r: r.order_line <= purchase_line_ids)
result['domain'] = {'purchase_id': [ domain = [('invoice_status', '=', 'to invoice')]
('invoice_status', '=', 'to invoice'), if self.partner_id:
('partner_id', 'child_of', self.partner_id.id), domain += [('partner_id', 'child_of', self.partner_id.id)]
('id', 'not in', purchase_ids.ids), if purchase_ids:
]} domain += [('id', 'not in', purchase_ids.ids)]
result['domain'] = {'purchase_id': domain}
return result return result
def _prepare_invoice_line_from_po_line(self, line): def _prepare_invoice_line_from_po_line(self, line):
+4 -1
View File
@@ -17,7 +17,10 @@
<button string="New Quotation" name="%(sale_action_quotations_new)d" type="action" class="oe_highlight" <button string="New Quotation" name="%(sale_action_quotations_new)d" type="action" class="oe_highlight"
context="{'search_default_partner_id': partner_id, context="{'search_default_partner_id': partner_id,
'default_partner_id': partner_id, 'default_partner_id': partner_id,
'default_team_id': team_id}"/> 'default_team_id': team_id,
'default_campaign_id': campaign_id,
'default_medium_id': medium_id,
'default_source_id': source_id}"/>
</xpath> </xpath>
<button name="toggle_active" position="before"> <button name="toggle_active" position="before">
<button class="oe_stat_button" type="action" <button class="oe_stat_button" type="action"
+2 -2
View File
@@ -38,10 +38,10 @@ class AccountAnalyticLine(models.Model):
return {} return {}
unit_amount = values.get('unit_amount', 0.0) or self.unit_amount unit_amount = values.get('unit_amount', 0.0) or self.unit_amount
user_id = values.get('user_id') or self.user_id.id or self._default_user() user_id = values.get('user_id') or self.user_id.id or self._default_user()
user = self.env['res.users'].browse([user_id]) project = values.get('project_id') and self.env['project.project'].browse([values['project_id']]) or self.project_id
emp = self.env['hr.employee'].search([('user_id', '=', user_id)], limit=1) emp = self.env['hr.employee'].search([('user_id', '=', user_id)], limit=1)
cost = emp and emp.timesheet_cost or 0.0 cost = emp and emp.timesheet_cost or 0.0
uom = (emp or user).company_id.project_time_mode_id uom = project.company_id.project_time_mode_id
# Nominal employee cost = 1 * company project UoM (project_time_mode_id) # Nominal employee cost = 1 * company project UoM (project_time_mode_id)
return { return {
'amount': -unit_amount * cost, 'amount': -unit_amount * cost,
+3 -2
View File
@@ -779,8 +779,9 @@ class Picking(models.Model):
else: else:
moves = self.env['stock.move'].browse(move_ids) moves = self.env['stock.move'].browse(move_ids)
if self.env.context.get('no_state_change'): if self.env.context.get('no_state_change'):
moves = moves.filtered(lambda m: m.reserved_quant_ids) moves.filtered(lambda m: m.reserved_quant_ids).do_unreserve()
moves.do_unreserve() else:
moves.do_unreserve()
moves.action_assign(no_prepare=True) moves.action_assign(no_prepare=True)
@api.multi @api.multi
+1
View File
@@ -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 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 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 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
+11
View File
@@ -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
+2 -2
View File
@@ -6,9 +6,9 @@
"base.lang_bs_BA","Bosnian / bosanski jezik","bs_BA","bs_BA","Left-to-Right","[]",",",,"%d.%m.%Y","%H:%M:%S","True" "base.lang_bs_BA","Bosnian / bosanski jezik","bs_BA","bs_BA","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_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_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_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_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_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" "base.lang_da_DK","Danish / Dansk","da_DK","da_DK","Left-to-Right","[3,0]",",",".","%d-%m-%Y","%H:%M:%S","True"
1 id name code iso_code direction grouping decimal_point thousands_sep date_format time_format translatable
6 base.lang_bs_BA Bosnian / bosanski jezik bs_BA bs_BA Left-to-Right [] , %d.%m.%Y %H:%M:%S True
7 base.lang_bg Bulgarian / български език bg_BG bg Left-to-Right [3,0] , %d.%m.%Y %H,%M,%S True
8 base.lang_ca_ES Catalan / Català ca_ES ca_ES Left-to-Right [3,0] , . %d/%m/%Y %H:%M:%S True
9 base.lang_zh_CN Chinese (CN) / 简体中文 Chinese (Simplified) / 简体中文 zh_CN zh_CN Left-to-Right [3,0] . , %Y年%m月%d日 %H时%M分%S秒 True
10 base.lang_zh_HK Chinese (HK) zh_HK zh_HK Left-to-Right [3,0] . , %Y年%m月%d日 %A %I時%M分%S秒 True
11 base.lang_zh_TW Chinese (TW) / 正體字 Chinese (Traditional) / 正體字 zh_TW zh_TW Left-to-Right [3,0] . , %Y年%m月%d日 %H時%M分%S秒 True
12 base.lang_hr Croatian / hrvatski jezik hr_HR hr Left-to-Right [] , %d.%m.%Y %H:%M:%S True
13 base.lang_cs_CZ Czech / Čeština cs_CZ cs_CZ Left-to-Right [3,0] ,   %d.%m.%Y %H:%M:%S True
14 base.lang_da_DK Danish / Dansk da_DK da_DK Left-to-Right [3,0] , . %d-%m-%Y %H:%M:%S True
+4
View File
@@ -46,6 +46,10 @@ class RedirectWarning(Exception):
:param string button_text: text to put on the button that will trigger :param string button_text: text to put on the button that will trigger
the redirection. 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): class AccessDenied(Exception):
+1 -4
View File
@@ -1177,10 +1177,7 @@ def formatLang(env, value, digits=None, grouping=True, monetary=False, dp=False,
return '' return ''
lang = env.context.get('lang') or env.user.company_id.partner_id.lang or 'en_US' lang = env.context.get('lang') or env.user.company_id.partner_id.lang or 'en_US'
lang_objs = env['res.lang'].search([('code', '=', lang)]) lang_obj = env['res.lang']._lang_get(lang)
if not lang_objs:
lang_objs = env['res.lang'].search([], limit=1)
lang_obj = lang_objs[0]
res = lang_obj.format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary) res = lang_obj.format('%.' + str(digits) + 'f', value, grouping=grouping, monetary=monetary)
+1 -1
View File
@@ -6,7 +6,7 @@ feedparser==5.2.1
gevent==1.1.2 gevent==1.1.2
greenlet==0.4.10 greenlet==0.4.10
jcconv==0.2.3 jcconv==0.2.3
Jinja2==2.8 Jinja2==2.8.1
lxml==3.5.0 lxml==3.5.0
Mako==1.0.4 Mako==1.0.4
MarkupSafe==0.23 MarkupSafe==0.23