[MERGE] Forward-port 8.0 up to bf163700e4
This commit is contained in:
@@ -66,3 +66,13 @@ class crm_partner_report_assign(osv.osv):
|
||||
left join account_invoice_report i
|
||||
on (i.partner_id=p.id and i.type in ('out_invoice','out_refund') and i.state in ('open','paid'))
|
||||
)""")
|
||||
|
||||
class account_invoice_report(osv.osv):
|
||||
_inherit = 'account.invoice.report'
|
||||
|
||||
def init(self, cr):
|
||||
# ensure we re-create the crm_partner_report_assign view whenever
|
||||
# the underlying account_invoice_report view is changed
|
||||
super(account_invoice_report, self).init(cr)
|
||||
self.pool['crm.partner.report.assign'].init(cr)
|
||||
|
||||
|
||||
@@ -59,14 +59,14 @@ class ir_http(orm.AbstractModel):
|
||||
|
||||
def get_nearest_lang(self, lang):
|
||||
# Try to find a similar lang. Eg: fr_BE and fr_FR
|
||||
if lang in request.website.get_languages():
|
||||
return lang
|
||||
|
||||
short = lang.split('_')[0]
|
||||
short = lang.partition('_')[0]
|
||||
short_match = False
|
||||
for code, name in request.website.get_languages():
|
||||
if code.startswith(short):
|
||||
return code
|
||||
return False
|
||||
if code == lang:
|
||||
return lang
|
||||
if not short_match and code.startswith(short):
|
||||
short_match = code
|
||||
return short_match
|
||||
|
||||
def _geoip_setup_resolver(self):
|
||||
if self._geoip_resolver is None:
|
||||
|
||||
@@ -335,7 +335,7 @@ Some conversions don't match the pattern:
|
||||
:option:`--log-handler` and :option:`--log-db`) just add content to
|
||||
``log_handler``, use that directly in the configuration file
|
||||
* :option:`--smtp` is stored as ``smtp_server``
|
||||
* :option:`--database` is stored as ``dbname``
|
||||
* :option:`--database` is stored as ``db_name``
|
||||
* :option:`--debug` is stored as ``debug_mode`` (a boolean)
|
||||
* :option:`--i18n-import` and :option:`--i18n-export` aren't available at all
|
||||
from configuration files
|
||||
|
||||
@@ -548,7 +548,7 @@ class res_partner(osv.Model, format_address):
|
||||
|
||||
result = super(res_partner, self).write(vals)
|
||||
for partner in self:
|
||||
if any(u.has_group('base.group_user') for u in partner.user_ids):
|
||||
if any(u.has_group('base.group_user') for u in partner.user_ids if u != self.env.user):
|
||||
self.env['res.users'].check_access_rights('write')
|
||||
self._fields_sync(partner, vals)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user