[MERGE] Forward-port of 7.0 bugfixes up to rev.9369 rev-id: launchpad_translations_on_behalf_of_openerp-20130820051502-deoiql3lru7goosd

bzr revid: odo@openerp.com-20130820152607-0p0fx87v1rqhk3vy
This commit is contained in:
Olivier Dony 2013-08-20 17:26:07 +02:00
commit 788eb29237
20 changed files with 5164 additions and 21 deletions

View File

@ -800,7 +800,7 @@ class account_move_line(osv.osv):
r_id = move_rec_obj.create(cr, uid, { r_id = move_rec_obj.create(cr, uid, {
'type': type, 'type': type,
'line_partial_ids': map(lambda x: (4,x,False), merges+unmerge) 'line_partial_ids': map(lambda x: (4,x,False), merges+unmerge)
}) }, context=context)
move_rec_obj.reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=context) move_rec_obj.reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=context)
return True return True

View File

@ -25,7 +25,7 @@ from dateutil.relativedelta import relativedelta
from operator import itemgetter from operator import itemgetter
from os.path import join as opj from os.path import join as opj
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT as DF from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.tools.translate import _ from openerp.tools.translate import _
from openerp.osv import fields, osv from openerp.osv import fields, osv
from openerp import tools from openerp import tools

View File

@ -67,9 +67,10 @@
Then I cancel Bank Statements and verifies that it raises a warning Then I cancel Bank Statements and verifies that it raises a warning
- -
!python {model: account.bank.statement}: | !python {model: account.bank.statement}: |
from openerp.osv import osv
try: try:
self.button_cancel(cr, uid, [ref("account_bank_statement_0")]) self.button_cancel(cr, uid, [ref("account_bank_statement_0")])
assert False, "An exception should have been raised, the journal should not let us cancel moves!" assert False, "An exception should have been raised, the journal should not let us cancel moves!"
except Exception: except osv.except_osv:
# exception was raised as expected, as the journal does not allow cancelling moves # exception was raised as expected, as the journal does not allow cancelling moves
pass pass

View File

@ -73,14 +73,16 @@
I cancel the account move which is in posted state and verifies that it gives warning message I cancel the account move which is in posted state and verifies that it gives warning message
- -
!python {model: account.move}: | !python {model: account.move}: |
from openerp.osv import osv
inv_obj = self.pool.get('account.invoice') inv_obj = self.pool.get('account.invoice')
inv = inv_obj.browse(cr, uid, ref('account_invoice_supplier0')) inv = inv_obj.browse(cr, uid, ref('account_invoice_supplier0'))
try: try:
mov_cancel = self.button_cancel(cr, uid, [inv.move_id.id], {'lang': u'en_US', 'tz': False, mov_cancel = self.button_cancel(cr, uid, [inv.move_id.id], {'lang': u'en_US', 'tz': False,
'active_model': 'ir.ui.menu', 'journal_type': 'purchase', 'active_ids': [ref('menu_action_invoice_tree2')], 'active_model': 'ir.ui.menu', 'journal_type': 'purchase', 'active_ids': [ref('menu_action_invoice_tree2')],
'type': 'in_invoice', 'active_id': ref('menu_action_invoice_tree2')}) 'type': 'in_invoice', 'active_id': ref('menu_action_invoice_tree2')})
except Exception, e: assert False, "This should never happen!"
assert e, 'Warning message has not been raised' except osv.except_osv:
pass
- -
I verify that 'Period Sum' and 'Year sum' of the tax code are the expected values I verify that 'Period Sum' and 'Year sum' of the tax code are the expected values
- -

View File

@ -1184,7 +1184,7 @@ class account_voucher(osv.osv):
for line in voucher.line_ids: for line in voucher.line_ids:
#create one move line per voucher line where amount is not 0.0 #create one move line per voucher line where amount is not 0.0
# AND (second part of the clause) only if the original move line was not having debit = credit = 0 (which is a legal value) # AND (second part of the clause) only if the original move line was not having debit = credit = 0 (which is a legal value)
if not line.amount and not (line.move_line_id and not float_compare(line.move_line_id.debit, line.move_line_id.credit, precision_rounding=prec) and not float_compare(line.move_line_id.debit, 0.0, precision_rounding=prec)): if not line.amount and not (line.move_line_id and not float_compare(line.move_line_id.debit, line.move_line_id.credit, precision_digits=prec) and not float_compare(line.move_line_id.debit, 0.0, precision_digits=prec)):
continue continue
# convert the amount set on the voucher line into the currency of the voucher's company # convert the amount set on the voucher line into the currency of the voucher's company
# this calls res_curreny.compute() with the right context, so that it will take either the rate on the voucher if it is relevant or will use the default behaviour # this calls res_curreny.compute() with the right context, so that it will take either the rate on the voucher if it is relevant or will use the default behaviour

View File

@ -120,7 +120,7 @@ class res_users(osv.osv):
def set_pw(self, cr, uid, id, name, value, args, context): def set_pw(self, cr, uid, id, name, value, args, context):
if value: if value:
encrypted = md5crypt(value, gen_salt()) encrypted = md5crypt(value, gen_salt())
cr.execute('update res_users set password_crypt=%s where id=%s', (encrypted, int(id))) cr.execute("update res_users set password='', password_crypt=%s where id=%s", (encrypted, id))
del value del value
def get_pw( self, cr, uid, ids, name, args, context ): def get_pw( self, cr, uid, ids, name, args, context ):

View File

@ -1,4 +1,6 @@
openerp.auth_oauth = function(instance) { openerp.auth_oauth = function(instance) {
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb; var QWeb = instance.web.qweb;
instance.web.Login.include({ instance.web.Login.include({
@ -9,9 +11,11 @@ openerp.auth_oauth = function(instance) {
this.$el.on('click', 'a.zocial', this.on_oauth_sign_in); this.$el.on('click', 'a.zocial', this.on_oauth_sign_in);
this.oauth_providers = []; this.oauth_providers = [];
if(this.params.oauth_error === 1) { if(this.params.oauth_error === 1) {
this.do_warn("Sign up error.","Sign up is not allowed on this database."); this.do_warn(_t("Sign up error"),_t("Sign up is not allowed on this database."), true);
} else if(this.params.oauth_error === 2) { } else if(this.params.oauth_error === 2) {
this.do_warn("Authentication error",""); this.do_warn(_t("Authentication error"),_t("Access Denied"), true);
} else if(this.params.oauth_error === 3) {
this.do_warn(_t("Authentication error"),_t("You do not have access to this database or your invitation has expired. Please ask for an invitation and be sure to follow the link in your invitation email."), true);
} }
return d.done(this.do_oauth_load).fail(function() { return d.done(this.do_oauth_load).fail(function() {
self.do_oauth_load([]); self.do_oauth_load([]);

View File

@ -23,6 +23,7 @@ import logging
import simplejson import simplejson
import openerp import openerp
from openerp.addons.auth_signup.res_users import SignupError
from openerp.osv import osv, fields from openerp.osv import osv, fields
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
@ -35,7 +36,7 @@ class res_users(osv.Model):
try: try:
login = super(res_users, self)._auth_oauth_signin(cr, uid, provider, validation, params, context=context) login = super(res_users, self)._auth_oauth_signin(cr, uid, provider, validation, params, context=context)
except openerp.exceptions.AccessDenied: except openerp.exceptions.AccessDenied, access_denied_exception:
if context and context.get('no_user_creation'): if context and context.get('no_user_creation'):
return None return None
state = simplejson.loads(params['state']) state = simplejson.loads(params['state'])
@ -52,6 +53,8 @@ class res_users(osv.Model):
'oauth_access_token': params['access_token'], 'oauth_access_token': params['access_token'],
'active': True, 'active': True,
} }
_, login, _ = self.signup(cr, uid, values, token, context=context) try:
_, login, _ = self.signup(cr, uid, values, token, context=context)
except SignupError:
raise access_denied_exception
return login return login

View File

@ -25,7 +25,7 @@ from urlparse import urljoin
from openerp.osv import osv, fields from openerp.osv import osv, fields
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.tools.safe_eval import safe_eval from ast import literal_eval
from openerp.tools.translate import _ from openerp.tools.translate import _
class SignupError(Exception): class SignupError(Exception):
@ -217,12 +217,12 @@ class res_users(osv.Model):
def _signup_create_user(self, cr, uid, values, context=None): def _signup_create_user(self, cr, uid, values, context=None):
""" create a new user from the template user """ """ create a new user from the template user """
ir_config_parameter = self.pool.get('ir.config_parameter') ir_config_parameter = self.pool.get('ir.config_parameter')
template_user_id = safe_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.template_user_id', 'False')) template_user_id = literal_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.template_user_id', 'False'))
assert template_user_id and self.exists(cr, uid, template_user_id, context=context), 'Signup: invalid template user' assert template_user_id and self.exists(cr, uid, template_user_id, context=context), 'Signup: invalid template user'
# check that uninvited users may sign up # check that uninvited users may sign up
if 'partner_id' not in values: if 'partner_id' not in values:
if not safe_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')): if not literal_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')):
raise SignupError('Signup is not allowed for uninvited users') raise SignupError('Signup is not allowed for uninvited users')
assert values.get('login'), "Signup: no login given for new user" assert values.get('login'), "Signup: no login given for new user"

View File

@ -381,6 +381,10 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
_.each(data.contexts, context.add, context); _.each(data.contexts, context.add, context);
_.each(data.domains, domain.add, domain); _.each(data.domains, domain.add, domain);
context.add({
group_by: instance.web.pyeval.eval('groupbys', data.groupbys || [])
});
var c = instance.web.pyeval.eval('context', context); var c = instance.web.pyeval.eval('context', context);
for(var k in c) { for(var k in c) {
if (c.hasOwnProperty(k) && /^search_default_/.test(k)) { if (c.hasOwnProperty(k) && /^search_default_/.test(k)) {

View File

@ -61,12 +61,13 @@
!python {model: hr_timesheet_sheet.sheet}: | !python {model: hr_timesheet_sheet.sheet}: |
uid = ref('base.user_root') uid = ref('base.user_root')
from openerp import netsvc from openerp import netsvc
from openerp.osv import osv
try: try:
self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {"active_ids": self.button_confirm(cr, uid, [ref('hr_timesheet_sheet_sheet_deddk0')], {"active_ids":
[ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form")],"active_id": ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"), [ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form")],"active_id": ref("hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"),
}) })
assert True, "The validation of the timesheet was unexpectedly accepted despite the 2:30 hours of difference" assert False, "The validation of the timesheet was unexpectedly accepted despite the 2:30 hours of difference"
except: except osv.except_osv:
pass pass
- -
I Modified the timesheet record and make the difference less than 1 hour. I Modified the timesheet record and make the difference less than 1 hour.

View File

@ -58,6 +58,7 @@ Wizards provided by this module:
'base_iban', 'base_iban',
'account_chart', 'account_chart',
'l10n_be_coda', 'l10n_be_coda',
#'l10n_multilang', uncomment for version > 7.0
], ],
'data': [ 'data': [
'account_financial_report.xml', 'account_financial_report.xml',
@ -68,11 +69,11 @@ Wizards provided by this module:
'wizard/l10n_be_account_vat_declaration_view.xml', 'wizard/l10n_be_account_vat_declaration_view.xml',
'wizard/l10n_be_vat_intra_view.xml', 'wizard/l10n_be_vat_intra_view.xml',
'wizard/l10n_be_partner_vat_listing.xml', 'wizard/l10n_be_partner_vat_listing.xml',
'wizard/account_wizard.xml',
'l10n_be_sequence.xml', 'l10n_be_sequence.xml',
'fiscal_templates.xml', 'fiscal_templates.xml',
'account_fiscal_position_tax_template.xml', 'account_fiscal_position_tax_template.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'l10n_be_wizard.yml'
], ],
'demo': [], 'demo': [],
'installable': True, 'installable': True,

View File

@ -12,6 +12,7 @@
<field name="property_account_payable" ref="a_pay"/> <field name="property_account_payable" ref="a_pay"/>
<field name="property_account_expense_categ" ref="a_expense"/> <field name="property_account_expense_categ" ref="a_expense"/>
<field name="property_account_income_categ" ref="a_sale"/> <field name="property_account_income_categ" ref="a_sale"/>
<field name="spoken_languages" eval="'nl_BE'"/>
</record> </record>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
<openerp>
<data noupdate="1">
<record id="account.action_wizard_multi_chart_todo" model="ir.actions.todo">
<field name="state">open</field>
</record>
</data>
</openerp>

View File

@ -202,11 +202,11 @@ class partner_vat_intra(osv.osv_memory):
'vatnum': row['vat'][2:].replace(' ','').upper(), 'vatnum': row['vat'][2:].replace(' ','').upper(),
'vat': row['vat'], 'vat': row['vat'],
'country': row['vat'][:2], 'country': row['vat'][:2],
'amount': '%.2f' % amt, 'amount': round(amt,2),
'intra_code': row['intra_code'], 'intra_code': row['intra_code'],
'code': intra_code}) 'code': intra_code})
xmldict.update({'dnum': dnum, 'clientnbr': str(seq), 'amountsum': '%.2f' % amount_sum, 'partner_wo_vat': p_count}) xmldict.update({'dnum': dnum, 'clientnbr': str(seq), 'amountsum': round(amount_sum,2), 'partner_wo_vat': p_count})
return xmldict return xmldict
def create_xml(self, cursor, user, ids, context=None): def create_xml(self, cursor, user, ids, context=None):

View File

@ -32,6 +32,7 @@ Accounting Data for Belgian Payroll Rules.
'auto_install': True, 'auto_install': True,
'demo': [], 'demo': [],
'data':[ 'data':[
'l10n_be_wizard.yml',
'l10n_be_hr_payroll_account_data.xml', 'l10n_be_hr_payroll_account_data.xml',
'data/hr.salary.rule.csv', 'data/hr.salary.rule.csv',
], ],

View File

@ -207,6 +207,19 @@ class account_invoice(osv.osv):
'\nPlease create manually a unique BBA Structured Communication.')) '\nPlease create manually a unique BBA Structured Communication.'))
return super(account_invoice, self).write(cr, uid, ids, vals, context) return super(account_invoice, self).write(cr, uid, ids, vals, context)
def copy(self, cr, uid, id, default=None, context=None):
default = default or {}
invoice = self.browse(cr, uid, id, context=context)
if invoice.type in ['out_invoice']:
reference_type = invoice.reference_type or 'none'
default['reference_type'] = reference_type
if reference_type == 'bba':
partner = invoice.partner_id
default['reference'] = self.generate_bbacomm(cr, uid, id,
invoice.type, reference_type,
partner.id, '', context=context)['value']['reference']
return super(account_invoice, self).copy(cr, uid, id, default, context=context)
_columns = { _columns = {
'reference': fields.char('Communication', size=64, help="The partner reference of this invoice."), 'reference': fields.char('Communication', size=64, help="The partner reference of this invoice."),
'reference_type': fields.selection(_get_reference_type, 'Communication Type', 'reference_type': fields.selection(_get_reference_type, 'Communication Type',

View File

@ -109,7 +109,8 @@ class pos_config(osv.osv):
return result return result
def _default_sale_journal(self, cr, uid, context=None): def _default_sale_journal(self, cr, uid, context=None):
res = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale')], limit=1) company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
res = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale'), ('company_id', '=', company_id)], limit=1, context=context)
return res and res[0] or False return res and res[0] or False
def _default_shop(self, cr, uid, context=None): def _default_shop(self, cr, uid, context=None):