diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index da2d0706f1c..db3325e313c 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -327,7 +327,7 @@ class account_cash_statement(osv.osv): for statement in statement_pool.browse(cr, uid, ids, context=context): vals = {} if not self._user_allow(cr, uid, statement.id, context=context): - raise osv.except_osv(_('Error !'), _('User %s does not have rights to access %s journal !' % (statement.user_id.name, statement.journal_id.name))) + raise osv.except_osv(_('Error !'), (_('User %s does not have rights to access %s journal !') % (statement.user_id.name, statement.journal_id.name))) if statement.name and statement.name == '/': number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement') diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 16e1d00e683..963a36876c6 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -6283,10 +6283,7 @@ msgstr "" #. module: account #: code:addons/account/account_cash_statement.py:0 #, python-format -msgid "User %s does not have rights to access %s journal !' % (statement.user_id.name, statement.journal_id.name)))\n" -"\n" -" if statement.name and statement.name == '/':\n" -" number = self.pool.get('ir.sequence" +msgid "User \"%s\" does not have rights to access \"%s\" journal !" msgstr "" #. module: account diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index dfbdc745613..c3aa7bb8720 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -916,7 +916,7 @@ class calendar_event(osv.osv): return [(x.lower(), x) for x in pytz.all_timezones] def onchange_allday(self, cr, uid, ids, allday, context=None): - """Sets duration as 24 Hours if event is selcted for all day + """Sets duration as 24 Hours if event is selected for all day @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @@ -1630,6 +1630,14 @@ true, it will allow you to hide the event alarm information without removing it. if vals.get('vtimezone', '') and vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'): vals['vtimezone'] = vals['vtimezone'][40:] + updated_vals = self.onchange_dates(cr, uid, [], + vals.get('date', False), + vals.get('duration', False), + vals.get('date_deadline', False), + vals.get('allday', False), + context=context) + vals.update(updated_vals.get('value', {})) + res = super(calendar_event, self).create(cr, uid, vals, context) alarm_obj = self.pool.get('res.alarm') alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context) diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml index 9f27e79d5a5..e9dbd2aa297 100644 --- a/addons/base_calendar/base_calendar_view.xml +++ b/addons/base_calendar/base_calendar_view.xml @@ -229,7 +229,7 @@ - + diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index a028e3e0e64..12f0a3f59cc 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -32,7 +32,7 @@ - + diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py index f2570a8c57c..1508704d2d6 100644 --- a/addons/crm_helpdesk/crm_helpdesk.py +++ b/addons/crm_helpdesk/crm_helpdesk.py @@ -64,7 +64,7 @@ class crm_helpdesk(crm.crm_case, osv.osv): 'categ_id': fields.many2one('crm.case.categ', 'Category', \ domain="[('section_id','=',section_id),\ ('object_id.model', '=', 'crm.helpdesk')]"), - 'duration': fields.float('Duration'), + 'duration': fields.float('Duration', states={'done': [('readonly', True)]}), 'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True, help='The state is set to \'Draft\', when a case is created.\ \nIf the case is in progress the state is set to \'Open\'.\ diff --git a/addons/hr/hr.py b/addons/hr/hr.py index fdbed8a3a18..482ad524f71 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -183,7 +183,7 @@ class hr_employee(osv.osv): return {'value': {'work_email' : work_email}} def _get_photo(self, cr, uid, context=None): - photo_path = addons.get_module_resource('hr','image','photo.png') + photo_path = addons.get_module_resource('hr','image','photo.png') return open(photo_path, 'rb').read().encode('base64') _defaults = { diff --git a/addons/l10n_fr/report/base_report.py b/addons/l10n_fr/report/base_report.py index f1b00896159..2c44b062f45 100644 --- a/addons/l10n_fr/report/base_report.py +++ b/addons/l10n_fr/report/base_report.py @@ -42,18 +42,22 @@ class base_report(report_sxw.rml_parse): self.context = context def _load(self, name, form): - fiscalyear = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear']) - period_query_cond=self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id', '=', form['fiscalyear'])]) + fiscalyear = self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear_id']) + period_ids=self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id', '=', form['fiscalyear_id'])]) - self.cr.execute("SELECT MIN(date_start) AS date_start, MAX(date_stop) AS date_stop FROM account_period WHERE id IN %s", (tuple(period_query_cond),)) - dates = self.cr.dictfetchall() - self._set_variable('date_start', dates[0]['date_start']) - self._set_variable('date_stop', dates[0]['date_stop']) + if period_ids: + self.cr.execute("SELECT MIN(date_start) AS date_start, MAX(date_stop) AS date_stop FROM account_period WHERE id = ANY(%s)", (period_ids,)) + dates = self.cr.dictfetchall() + else: + dates = False + if dates: + self._set_variable('date_start', dates[0]['date_start']) + self._set_variable('date_stop', dates[0]['date_stop']) self.cr.execute("SELECT l10n_fr_line.code,definition FROM l10n_fr_line LEFT JOIN l10n_fr_report ON l10n_fr_report.id=report_id WHERE l10n_fr_report.code=%s",(name,)) datas = self.cr.dictfetchall() for line in datas: - self._load_accounts(form,line['code'],eval(line['definition']),fiscalyear,period_query_cond) + self._load_accounts(form,line['code'],eval(line['definition']),fiscalyear,period_ids) def _set_variable(self, variable, valeur): self.localcontext.update({variable: valeur}) @@ -61,30 +65,35 @@ class base_report(report_sxw.rml_parse): def _get_variable(self, variable): return self.localcontext[variable] - def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond): + def _load_accounts(self, form, code, definition, fiscalyear, period_ids): accounts = {} for x in definition['load']: p = x.split(":") accounts[p[1]] = [p[0],p[2]] sum = 0.0 if fiscalyear.state != 'done' or not code.startswith('bpcheck'): + query_params = [] query_cond = "(" for account in accounts: - query_cond += "aa.code LIKE '" + account + "%' OR " + query_cond += "aa.code LIKE '" + account + "%%' OR " query_cond = query_cond[:-4]+")" if len(definition['except']) > 0: query_cond = query_cond+" and (" for account in definition['except']: - query_cond += "aa.code NOT LIKE '"+account+"%' AND " + query_cond += "aa.code NOT LIKE '"+account+"%%' AND " query_cond = query_cond[:-5]+")" closed_cond = "" if fiscalyear.state == 'done': - closed_cond=" AND (aml.move_id NOT IN (SELECT account_move.id as move_id FROM account_move WHERE period_id IN "+str(tuple(period_query_cond))+" AND journal_id=(SELECT res_id FROM ir_model_data WHERE name='closing_journal' AND module='l10n_fr')) OR (aa.type != 'income' AND aa.type !='expense'))" + closed_cond=" AND (aml.move_id NOT IN (SELECT account_move.id as move_id FROM account_move WHERE period_id = ANY(%s) AND journal_id=(SELECT res_id FROM ir_model_data WHERE name='closing_journal' AND module='l10n_fr')) OR (aa.type != 'income' AND aa.type !='expense'))" + query_params.append(list(period_ids)) - query = "SELECT aa.code AS code, SUM(debit) as debit, SUM(credit) as credit FROM account_move_line aml LEFT JOIN account_account aa ON aa.id=aml.account_id WHERE "+query_cond+closed_cond+" AND aml.state='valid' AND aml.period_id IN "+str(tuple(period_query_cond))+" GROUP BY code" - self.cr.execute(query) + query = "SELECT aa.code AS code, SUM(debit) as debit, SUM(credit) as credit " \ + " FROM account_move_line aml LEFT JOIN account_account aa ON aa.id=aml.account_id "\ + " WHERE "+query_cond+closed_cond+" AND aml.state='valid' AND aml.period_id = ANY(%s) GROUP BY code" + query_params.append(list(period_ids)) + self.cr.execute(query, query_params) lines =self.cr.dictfetchall() for line in lines: diff --git a/addons/l10n_fr/test/l10n_fr_report.yml b/addons/l10n_fr/test/l10n_fr_report.yml index ddc95595175..7cf9b161223 100644 --- a/addons/l10n_fr/test/l10n_fr_report.yml +++ b/addons/l10n_fr/test/l10n_fr_report.yml @@ -7,6 +7,11 @@ date_start: '2012-01-01' date_stop: '2012-12-31' name: Fiscal Year 2012 +- + I create the fiscal periods +- + !python {model: account.fiscalyear}: + self.create_period(cr, uid, [ref('account_fiscalyear_01'),]) - In order to test the PDF reports defined on a l10n_fr, we will print an Account Move Line Report for l10n_fr - diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml index 7e315b265a7..3f2d9bad868 100644 --- a/addons/project/project_demo.xml +++ b/addons/project/project_demo.xml @@ -35,7 +35,7 @@ jth - Alien + Aline apr apr diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index da455015d3c..3145979d7b0 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -187,7 +187,7 @@ class purchase_order(osv.osv): help="From Order: a draft invoice will be pre-generated based on the purchase order. The accountant " \ "will just have to validate this invoice for control.\n" \ "From Picking: a draft invoice will be pre-generated based on validated receptions.\n" \ - "Manual: no invoice will be pre-generated. The accountant will have to encode manually." + "Manual: allows you to generate suppliers invoices by chosing in the uninvoiced lines of all manual purchase orders." ), 'minimum_planned_date':fields.function(_minimum_planned_date, fnct_inv=_set_minimum_planned_date, method=True,store=True, string='Expected Date', type='date', help="This is computed as the minimum scheduled date of all purchase order lines' products."), 'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Purchase Price'), string='Untaxed Amount', @@ -597,7 +597,7 @@ class purchase_order_line(osv.osv): _columns = { 'name': fields.char('Description', size=256, required=True), 'product_qty': fields.float('Quantity', required=True, digits=(16,2)), - 'date_planned': fields.date('Scheduled date', required=True), + 'date_planned': fields.date('Scheduled Date', required=True), 'taxes_id': fields.many2many('account.tax', 'purchase_order_taxe', 'ord_id', 'tax_id', 'Taxes'), 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True), 'product_id': fields.many2one('product.product', 'Product', domain=[('purchase_ok','=',True)], change_default=True), @@ -616,7 +616,7 @@ class purchase_order_line(osv.osv): \n* The \'Cancelled\' state is set automatically when user cancel purchase order.'), 'invoice_lines': fields.many2many('account.invoice.line', 'purchase_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True), 'invoiced': fields.boolean('Invoiced', readonly=True), - 'partner_id': fields.related('order_id','partner_id',string='Partner',readonly=True,type="many2one", relation="res.partner"), + 'partner_id': fields.related('order_id','partner_id',string='Partner',readonly=True,type="many2one", relation="res.partner", store=True), 'date_order': fields.related('order_id','date_order',string='Order Date',readonly=True,type="date") } diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index e9e20c952b2..caa6790b537 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -144,10 +144,10 @@