diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 223398e4107a8b97db508d1cf0ca7777cbfb2ca3..7b46e9c83a543aa16ee0249e0edd167ad0ad1b8a 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -568,7 +568,7 @@ class account_invoice(osv.osv): if isinstance(ids, (int, long)): ids = [ids] if not date_invoice: - date_invoice = time.strftime('%Y-%m-%d') + date_invoice = fields.date.context_today(self, cr, uid) if not payment_term_id: inv = self.browse(cr, uid, ids[0]) #To make sure the invoice due date should contain due date which is entered by user when there is no payment term defined @@ -866,7 +866,7 @@ class account_invoice(osv.osv): cur_obj = self.pool.get('res.currency') for i in invoice_move_lines: if inv.currency_id.id != company_currency: - context.update({'date': inv.date_invoice or time.strftime('%Y-%m-%d')}) + context.update({'date': inv.date_invoice or fields.date.context_today(self, cr, uid, context=context)}) i['currency_id'] = inv.currency_id.id i['amount_currency'] = i['price'] i['price'] = cur_obj.compute(cr, uid, inv.currency_id.id, @@ -938,7 +938,8 @@ class account_invoice(osv.osv): ctx = context.copy() ctx.update({'lang': inv.partner_id.lang}) if not inv.date_invoice: - self.write(cr, uid, [inv.id], {'date_invoice': fields.date.context_today(self,cr,uid,context=context)}, context=ctx) + self.write(cr, uid, [inv.id], {'date_invoice': fields.date.context_today(self, cr, uid, context=context)}, context=ctx) + inv.refresh() company_currency = self.pool['res.company'].browse(cr, uid, inv.company_id.id).currency_id.id # create the analytical lines # one move line per invoice line @@ -1034,11 +1035,9 @@ class account_invoice(osv.osv): 'ref': ref }) - date = inv.date_invoice or time.strftime('%Y-%m-%d') - part = self.pool.get("res.partner")._find_accounting_partner(inv.partner_id) - line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x, part.id, date, context=ctx)),iml) + line = map(lambda x:(0,0,self.line_get_convert(cr, uid, x, part.id, inv.date_invoice, context=ctx)),iml) line = self.group_lines(cr, uid, iml, line, inv) @@ -1054,7 +1053,7 @@ class account_invoice(osv.osv): 'ref': inv.reference and inv.reference or inv.name, 'line_id': line, 'journal_id': journal_id, - 'date': date, + 'date': inv.date_invoice, 'narration': inv.comment, 'company_id': inv.company_id.id, } @@ -1269,7 +1268,7 @@ class account_invoice(osv.osv): refund_journal_ids = obj_journal.search(cr, uid, [('type','=','sale_refund')], context=context) if not date: - date = time.strftime('%Y-%m-%d') + date = fields.date.context_today(self, cr, uid, context=context) invoice_data.update({ 'type': type_dict[invoice['type']], 'date_invoice': date, @@ -1708,7 +1707,7 @@ class account_invoice_tax(osv.osv): if company_id: company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] if currency_id and company_currency: - base = cur_obj.compute(cr, uid, currency_id, company_currency, base*factor, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) + base = cur_obj.compute(cr, uid, currency_id, company_currency, base*factor, context={'date': date_invoice or fields.date.context_today(self, cr, uid)}, round=False) return {'value': {'base_amount':base}} def amount_change(self, cr, uid, ids, amount, currency_id=False, company_id=False, date_invoice=False): @@ -1721,7 +1720,7 @@ class account_invoice_tax(osv.osv): if company_id: company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] if currency_id and company_currency: - amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*factor, context={'date': date_invoice or time.strftime('%Y-%m-%d')}, round=False) + amount = cur_obj.compute(cr, uid, currency_id, company_currency, amount*factor, context={'date': date_invoice or fields.date.context_today(self, cr, uid)}, round=False) return {'value': {'tax_amount': amount}} _order = 'sequence' @@ -1750,15 +1749,15 @@ class account_invoice_tax(osv.osv): if inv.type in ('out_invoice','in_invoice'): val['base_code_id'] = tax['base_code_id'] val['tax_code_id'] = tax['tax_code_id'] - val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False) - val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False) + val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['base_sign'], context={'date': inv.date_invoice or fields.date.context_today(self, cr, uid, context=context)}, round=False) + val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['tax_sign'], context={'date': inv.date_invoice or fields.date.context_today(self, cr, uid, context=context)}, round=False) val['account_id'] = tax['account_collected_id'] or line.account_id.id val['account_analytic_id'] = tax['account_analytic_collected_id'] else: val['base_code_id'] = tax['ref_base_code_id'] val['tax_code_id'] = tax['ref_tax_code_id'] - val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False) - val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date': inv.date_invoice or time.strftime('%Y-%m-%d')}, round=False) + val['base_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['base'] * tax['ref_base_sign'], context={'date': inv.date_invoice or fields.date.context_today(self, cr, uid, context=context)}, round=False) + val['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, val['amount'] * tax['ref_tax_sign'], context={'date': inv.date_invoice or fields.date.context_today(self, cr, uid, context=context)}, round=False) val['account_id'] = tax['account_paid_id'] or line.account_id.id val['account_analytic_id'] = tax['account_analytic_paid_id'] diff --git a/addons/auth_ldap/users_ldap.py b/addons/auth_ldap/users_ldap.py index 7b3d88af1546afa22907c176bbc9d1c95e26b32a..694b0b6b469dd75807c3bc63617216a9f59c2e65 100644 --- a/addons/auth_ldap/users_ldap.py +++ b/addons/auth_ldap/users_ldap.py @@ -237,7 +237,7 @@ class res_company(osv.osv): _inherit = "res.company" _columns = { 'ldaps': fields.one2many( - 'res.company.ldap', 'company', 'LDAP Parameters'), + 'res.company.ldap', 'company', 'LDAP Parameters', groups="base.group_system"), } diff --git a/addons/base_gengo/res_company.py b/addons/base_gengo/res_company.py index 3d038ac08132139156dae4e582c9513002ab8594..448df8d558c3c47c676710aef4a842836643bdef 100644 --- a/addons/base_gengo/res_company.py +++ b/addons/base_gengo/res_company.py @@ -26,10 +26,10 @@ class res_company(osv.Model): _name = "res.company" _inherit = "res.company" _columns = { - "gengo_private_key": fields.text("Gengo Private Key"), - "gengo_public_key": fields.text("Gengo Public Key"), - "gengo_comment": fields.text("Comments", help="This comment will be automatically be enclosed in each an every request sent to Gengo"), - "gengo_auto_approve": fields.boolean("Auto Approve Translation ?", help="Jobs are Automatically Approved by Gengo."), + "gengo_private_key": fields.text("Gengo Private Key", groups="base.group_system"), + "gengo_public_key": fields.text("Gengo Public Key", groups="base.group_user"), + "gengo_comment": fields.text("Comments", help="This comment will be automatically be enclosed in each an every request sent to Gengo", groups="base.group_user"), + "gengo_auto_approve": fields.boolean("Auto Approve Translation ?", help="Jobs are Automatically Approved by Gengo.", groups="base.group_user"), } _defaults = { diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index 65737ad234e4bd9e6b152ec4f26b2be76a4cd02d..d2587c87add8fac11826d912be0cbd6bdeafd1f8 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -424,7 +424,7 @@ instance.web.SearchView.include({ add_common_inputs: function() { this._super(); var vm = this.getParent().getParent(); - if (vm.inner_action && vm.inner_action.views) { + if (vm.inner_action && vm.inner_action.id && vm.inner_action.views) { (new instance.board.AddToDashboard(this)); } } diff --git a/addons/email_template/security/ir.model.access.csv b/addons/email_template/security/ir.model.access.csv index adce0420793ec119a792c07b29d99cad757bec65..80be050ecbc2968121eb9af81324e93f5ac73a8c 100644 --- a/addons/email_template/security/ir.model.access.csv +++ b/addons/email_template/security/ir.model.access.csv @@ -1,3 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_email_template,email.template,model_email_template,,1,1,1,0 +access_email_template,email.template,model_email_template,base.group_user,1,1,1,0 access_email_template_system,email.template system,model_email_template,base.group_system,1,1,1,1 diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 18b8f09de76b8bbab4053a4ba3fbca3332a9836f..a41f69071f9b79546bb2a24d3ddf9ae3ddc44ce7 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -56,7 +56,7 @@ class mail_compose_message(osv.TransientModel): return res _columns = { - 'template_id': fields.many2one('email.template', 'Use template', select=True), + 'template_id': fields.many2one('email.template', 'Use template', select=True, groups="base.group_user"), 'partner_to': fields.char('To (Partner IDs)', help="Comma-separated list of recipient partners ids (placeholders may be used here)"), 'email_to': fields.char('To (Emails)', diff --git a/addons/email_template/wizard/mail_compose_message_view.xml b/addons/email_template/wizard/mail_compose_message_view.xml index 44145114fff85f823388d079d70199cb2372d1a1..987ec44acbb5f171d0bbc96f61beeeccaa59b66d 100644 --- a/addons/email_template/wizard/mail_compose_message_view.xml +++ b/addons/email_template/wizard/mail_compose_message_view.xml @@ -6,6 +6,7 @@ <field name="name">mail.compose.message.form</field> <field name="model">mail.compose.message</field> <field name="inherit_id" ref="mail.email_compose_message_wizard_form"/> + <field name="groups_id" eval="[(4,ref('base.group_user'))]"/> <field name="arch" type="xml"> <xpath expr="//field[@name='subject']" position="after"> <label string="Template Recipients" for="partner_to" diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py index 5f6379025aee759a842a67c62786fdc7e1253121..565996bf96138db319457acb946db8fc18f06a5e 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -235,12 +235,12 @@ openerp_mailgate: "|/path/to/openerp-mailgate.py --host=localhost -u %(uid)d -p save_original=server.original, strip_attachments=(not server.attach), context=context) + pop_server.dele(num) except Exception: _logger.exception('Failed to process mail from %s server %s.', server.type, server.name) failed += 1 if res_id and server.action_id: action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids': [res_id], 'active_model': context.get("thread_model", server.object_id.model)}) - pop_server.dele(num) cr.commit() _logger.info("Fetched %d email(s) on %s server %s; %d succeeded, %d failed.", numMsgs, server.type, server.name, (numMsgs - failed), failed) except Exception: diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 812f0438a415fbb08e3e724319f8321986dd6762..685bd7d9af52bac1f002ed94717d5aecb40d258a 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -328,8 +328,14 @@ class hr_holidays(osv.osv): if context is None: context = {} context = dict(context, mail_create_nolog=True) - hol_id = super(hr_holidays, self).create(cr, uid, values, context=context) - return hol_id + if values.get('state') and values['state'] not in ['draft', 'confirm', 'cancel'] and not self.pool['res.users'].has_group(cr, uid, 'base.group_hr_user'): + raise osv.except_osv(_('Warning!'), _('You cannot set a leave request as \'%s\'. Contact a human resource manager.') % values.get('state')) + return super(hr_holidays, self).create(cr, uid, values, context=context) + + def write(self, cr, uid, ids, vals, context=None): + if vals.get('state') and vals['state'] not in ['draft', 'confirm', 'cancel'] and not self.pool['res.users'].has_group(cr, uid, 'base.group_hr_user'): + raise osv.except_osv(_('Warning!'), _('You cannot set a leave request as \'%s\'. Contact a human resource manager.') % vals.get('state')) + return super(hr_holidays, self).write(cr, uid, ids, vals, context=context) def holidays_reset(self, cr, uid, ids, context=None): self.write(cr, uid, ids, { diff --git a/addons/hr_holidays/security/ir_rule.xml b/addons/hr_holidays/security/ir_rule.xml index 1ff12f41244014337fa2eb81db3d7dec3fab4c1e..77c98db5d7180300a0f80990f09b1561b3e7340a 100644 --- a/addons/hr_holidays/security/ir_rule.xml +++ b/addons/hr_holidays/security/ir_rule.xml @@ -5,6 +5,17 @@ <field name="name">Employee Holidays</field> <field name="model_id" ref="model_hr_holidays"/> <field name="domain_force">[('employee_id.user_id','=',user.id)]</field> + <field name="perm_create" eval="False"/> + <field name="perm_write" eval="False"/> + <field name="perm_unlink" eval="False"/> + <field name="groups" eval="[(4,ref('base.group_user'))]"/> + </record> + + <record id="property_rule_holidays_employee_write" model="ir.rule"> + <field name="name">Employee Holidays Create, Write, Unlink</field> + <field model="ir.model" name="model_id" ref="model_hr_holidays"/> + <field name="domain_force">[('employee_id.user_id','=',user.id), ('state', 'in', ['draft', 'confirm', 'cancel'])]</field> + <field name="perm_read" eval="False"/> <field name="groups" eval="[(4,ref('base.group_user'))]"/> </record> diff --git a/addons/mail/mail_alias.py b/addons/mail/mail_alias.py index ad680bddb43927d35154d1f0f694d13c49d9fcb7..8729f7edf5fabed8efac328418b5011957723c26 100644 --- a/addons/mail/mail_alias.py +++ b/addons/mail/mail_alias.py @@ -61,7 +61,7 @@ class mail_alias(osv.Model): def _get_alias_domain(self, cr, uid, ids, name, args, context=None): ir_config_parameter = self.pool.get("ir.config_parameter") - domain = ir_config_parameter.get_param(cr, uid, "mail.catchall.domain", context=context) + domain = ir_config_parameter.get_param(cr, SUPERUSER_ID, "mail.catchall.domain", context=context) return dict.fromkeys(ids, domain or "") _columns = { diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js index 0dd438d13afaf76e5d33b504edde71b1f08d7dea..d76e32a5fe859a8800f95194976b2a9de3005c20 100644 --- a/addons/mail/static/src/js/announcement.js +++ b/addons/mail/static/src/js/announcement.js @@ -36,6 +36,8 @@ openerp_announcement = function(instance) { }); $('head').append($css); + }).fail(function(result, ev){ + ev.preventDefault(); }); } }); diff --git a/addons/pad/pad.py b/addons/pad/pad.py index cec784eb277994f58308f8c139537617c72aacf4..68b19c3a1d6ea0dbf2be1bb741d79e21c3490d89 100644 --- a/addons/pad/pad.py +++ b/addons/pad/pad.py @@ -5,6 +5,7 @@ import re import string import urllib2 import logging +from openerp import SUPERUSER_ID from openerp.tools.translate import _ from openerp.tools import html2plaintext from py_etherpad import EtherpadLiteClient @@ -19,7 +20,7 @@ class pad_common(osv.osv_memory): return bool(user.company_id.pad_server) def pad_generate_url(self, cr, uid, context=None): - company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id; + company = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context).company_id pad = { "server" : company.pad_server, diff --git a/addons/pad/res_company.py b/addons/pad/res_company.py index 95f1d9c1118732d42956ebedf6fb9a1a33ea07e5..02c034c3df656bfeb8141c78822698b1d869f6de 100644 --- a/addons/pad/res_company.py +++ b/addons/pad/res_company.py @@ -5,7 +5,7 @@ class company_pad(osv.osv): _inherit = 'res.company' _columns = { 'pad_server': fields.char('Pad Server', help="Etherpad lite server. Example: beta.primarypad.com"), - 'pad_key': fields.char('Pad Api Key', help="Etherpad lite api key."), + 'pad_key': fields.char('Pad Api Key', help="Etherpad lite api key.", groups="base.group_system"), } diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 3161a8950c8173183f54d1f7b5004f416d01c497..1e19821a87d9e8b6afd3e494c0807e83a50fbdf9 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -788,12 +788,12 @@ class pos_order(osv.osv): 'amount': data['amount'], 'date': data.get('payment_date', time.strftime('%Y-%m-%d')), 'name': order.name + ': ' + (data.get('payment_name', '') or ''), + 'partner_id': order.partner_id and self.pool.get("res.partner")._find_accounting_partner(order.partner_id).id or False, } account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context) args['account_id'] = (order.partner_id and order.partner_id.property_account_receivable \ and order.partner_id.property_account_receivable.id) or (account_def and account_def.id) or False - args['partner_id'] = order.partner_id and order.partner_id.id or None if not args['account_id']: if not args['partner_id']: diff --git a/addons/product_visible_discount/product_visible_discount.py b/addons/product_visible_discount/product_visible_discount.py index 9b0968ad1aceac192b4573a2590193bab7b43557..f4982bf269245b573cb692665f26e15cf24cc71d 100644 --- a/addons/product_visible_discount/product_visible_discount.py +++ b/addons/product_visible_discount/product_visible_discount.py @@ -83,9 +83,11 @@ class sale_order_line(osv.osv): if so_pricelist.visible_discount and list_price[pricelist] != 0 and new_list_price != 0: if product.company_id and so_pricelist.currency_id.id != product.company_id.currency_id.id: # new_list_price is in company's currency while price in pricelist currency + ctx = context.copy() + ctx['date'] = date_order new_list_price = self.pool['res.currency'].compute(cr, uid, product.company_id.currency_id.id, so_pricelist.currency_id.id, - new_list_price, context=context) + new_list_price, context=ctx) discount = (new_list_price - price) / new_list_price * 100 if discount > 0: result['price_unit'] = new_list_price diff --git a/addons/resource/security/ir.model.access.csv b/addons/resource/security/ir.model.access.csv index bf8504e2f4650320d270f937d918740f742ec58a..6112565d9bf1d39abb98c4f95a985648ab3acb95 100644 --- a/addons/resource/security/ir.model.access.csv +++ b/addons/resource/security/ir.model.access.csv @@ -2,6 +2,6 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_resource_calendar,resource.calendar,model_resource_calendar,base.group_system,1,1,1,1 access_resource_calendar_attendance,resource.calendar.attendance,model_resource_calendar_attendance,base.group_system,1,1,1,1 access_resource_resource,resource.resource,model_resource_resource,base.group_system,1,0,0,0 -access_resource_resource_all,resource.resource all,model_resource_resource,,1,0,0,0 +access_resource_resource_all,resource.resource all,model_resource_resource,base.group_user,1,0,0,0 access_resource_calendar_leaves_user,resource.calendar.leaves,model_resource_calendar_leaves,base.group_user,1,0,0,0 access_resource_calendar_leaves,resource.calendar.leaves,model_resource_calendar_leaves,base.group_system,1,1,1,1 diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index 4c2e9ffc4f4530494342702f5b7b9c6eec3f9800..36b0a74015c80e12b998e841b6512a14185d7d78 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -31,11 +31,15 @@ class sale_order_line(osv.osv): lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context) if not pricelist: return res + if context is None: + context = {} frm_cur = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id to_cur = self.pool.get('product.pricelist').browse(cr, uid, [pricelist])[0].currency_id.id if product: purchase_price = self.pool.get('product.product').browse(cr, uid, product).standard_price - price = self.pool.get('res.currency').compute(cr, uid, frm_cur, to_cur, purchase_price, round=False) + ctx = context.copy() + ctx['date'] = date_order + price = self.pool.get('res.currency').compute(cr, uid, frm_cur, to_cur, purchase_price, round=False, context=ctx) res['value'].update({'purchase_price': price}) return res diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index cc65900a1bc143c2a9a7294913c06871543cb3f6..69a1476a95bc4b8a3a6b680c207df3fe14116674 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1045,6 +1045,9 @@ instance.web.UserMenu = instance.web.Widget.extend({ scope: 'userinfo', }; instance.web.redirect('https://accounts.openerp.com/oauth2/auth?'+$.param(params)); + }).fail(function(result, ev){ + ev.preventDefault(); + instance.web.redirect('https://accounts.openerp.com/web'); }); } }, diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 6977692236208bb9302f6e84fd457ca3b2c8d872..e3ec6e6202f5d30161c9de01018dd0153424b811 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -122,7 +122,7 @@ class ir_attachment(osv.osv): if context is None: context = {} result = {} - location = self.pool.get('ir.config_parameter').get_param(cr, uid, 'ir_attachment.location') + location = self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'ir_attachment.location') bin_size = context.get('bin_size') for attach in self.browse(cr, uid, ids, context=context): if location and attach.store_fname: @@ -137,7 +137,7 @@ class ir_attachment(osv.osv): return True if context is None: context = {} - location = self.pool.get('ir.config_parameter').get_param(cr, uid, 'ir_attachment.location') + location = self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'ir_attachment.location') file_size = len(value.decode('base64')) if location: attach = self.browse(cr, uid, id, context=context) @@ -285,7 +285,7 @@ class ir_attachment(osv.osv): if isinstance(ids, (int, long)): ids = [ids] self.check(cr, uid, ids, 'unlink', context=context) - location = self.pool.get('ir.config_parameter').get_param(cr, uid, 'ir_attachment.location') + location = self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'ir_attachment.location') if location: for attach in self.browse(cr, uid, ids, context=context): if attach.store_fname: diff --git a/openerp/addons/base/security/ir.model.access.csv b/openerp/addons/base/security/ir.model.access.csv index 0fd8b548cb09528c5615455b8a40e1acad78de63..fed9a4a8966a9d9182b7e2769319dfcae9d1c1ad 100644 --- a/openerp/addons/base/security/ir.model.access.csv +++ b/openerp/addons/base/security/ir.model.access.csv @@ -29,7 +29,7 @@ "access_ir_property_group_user_manager","ir_property group_manager","model_ir_property","base.group_partner_manager",1,1,1,0 "access_ir_rule_group_user","ir_rule group_user","model_ir_rule",,1,0,0,0 "access_ir_rule_group_erp_manager","ir_rule group_erp_manager","model_ir_rule","group_erp_manager",1,1,1,1 -"access_ir_sequence_group_user","ir_sequence group_user","model_ir_sequence",,1,0,0,0 +"access_ir_sequence_group_user","ir_sequence group_user","model_ir_sequence","group_user",1,0,0,0 "access_ir_sequence_group_system","ir_sequence group_system","model_ir_sequence","group_system",1,1,1,1 "access_ir_sequence_type_group_user","ir_sequence_type group_user","model_ir_sequence_type",,1,0,0,0 "access_ir_sequence_type_group_system","ir_sequence_type group_system","model_ir_sequence_type","group_system",1,1,1,1 @@ -53,7 +53,6 @@ "access_res_currency_group_system","res_currency group_system","model_res_currency","group_system",1,1,1,1 "access_res_currency_rate_group_system","res_currency_rate group_system","model_res_currency_rate","group_system",1,1,1,1 "access_res_groups_group_erp_manager","res_groups group_erp_manager","model_res_groups","group_erp_manager",1,1,1,1 -"access_res_groups_group_user","res_groups group_user","model_res_groups",,1,0,0,0 "access_res_lang_group_all","res_lang group_all","model_res_lang",,1,0,0,0 "access_res_lang_group_user","res_lang group_user","model_res_lang","group_system",1,1,1,1 "access_res_partner_public","res_partner group_public","model_res_partner","group_public",1,0,0,0 @@ -107,7 +106,7 @@ "access_multi_company_default user","multi_company_default all","model_multi_company_default",,1,0,0,0 "access_multi_company_default manager","multi_company_default Manager","model_multi_company_default","group_erp_manager",1,1,1,1 "access_ir_filter all","ir_filters all","model_ir_filters",,1,1,1,1 -"access_ir_config_parameter","ir_config_parameter","model_ir_config_parameter",,1,0,0,0 +"access_ir_config_parameter","ir_config_parameter","model_ir_config_parameter","group_user",1,0,0,0 "access_ir_config_parameter_system","ir_config_parameter_system","model_ir_config_parameter","group_system",1,1,1,1 "access_ir_mail_server","ir_mail_server","model_ir_mail_server","group_system",1,1,1,1 "access_ir_actions_client","ir_actions_client all","model_ir_actions_client",,1,0,0,0 diff --git a/openerp/report/report_sxw.py b/openerp/report/report_sxw.py index 76533b2077745151b1388f937657851316b699e1..e13f710c57fff1e8957a835864d092babeb70dc1 100644 --- a/openerp/report/report_sxw.py +++ b/openerp/report/report_sxw.py @@ -326,8 +326,11 @@ class rml_parse(object): res='%s %s'%(currency_obj.symbol, res) return res - def display_address(self, address_browse_record): - return self.pool['res.partner']._display_address(self.cr, self.uid, address_browse_record) + def display_address(self, address_browse_record, without_company=False): + return self.pool['res.partner']._display_address( + self.cr, self.uid, address_browse_record, + without_company=without_company + ) def repeatIn(self, lst, name,nodes_parent=False): ret_lst = []