diff --git a/addons/account/account.py b/addons/account/account.py index 0f8c9575931..6cead2cddd3 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -344,7 +344,7 @@ class account_account(osv.osv): _columns = { 'name': fields.char('Name', size=128, required=True, select=True), 'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."), - 'code': fields.char('Code', size=64, required=True), + 'code': fields.char('Code', size=64, required=True, select=1), 'type': fields.selection([ ('view', 'View'), ('other', 'Regular'), @@ -1726,7 +1726,12 @@ class account_tax(osv.osv): if not context: context = {} ids = [] - ids = self.search(cr, user, args, limit=limit, context=context) + if name: + ids = self.search(cr, user, [('description', '=', name)] + args, limit=limit, context=context) + if not ids: + ids = self.search(cr, user, [('name', operator, name)] + args, limit=limit, context=context) + else: + ids = self.search(cr, user, args, limit=limit, context=context or {}) return self.name_get(cr, user, ids, context=context) def write(self, cr, uid, ids, vals, context=None): @@ -2254,7 +2259,7 @@ class account_account_template(osv.osv): _columns = { 'name': fields.char('Name', size=128, required=True, select=True), 'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all moves for this account to have this secondary currency."), - 'code': fields.char('Code', size=64), + 'code': fields.char('Code', size=64, select=1), 'type': fields.selection([ ('receivable','Receivable'), ('payable','Payable'), @@ -2454,7 +2459,8 @@ class account_tax_template(osv.osv): 'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."), 'include_base_amount': fields.boolean('Include in Base Amount', help="Set if the amount of tax must be included in the base amount before computing the next taxes."), 'description': fields.char('Internal Name', size=32), - 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Use In', required=True,) + 'type_tax_use': fields.selection([('sale','Sale'),('purchase','Purchase'),('all','All')], 'Tax Use In', required=True,), + 'price_include': fields.boolean('Tax Included in Price', help="Check this if the price you use on the product and invoices includes this tax."), } def name_get(self, cr, uid, ids, context={}): @@ -2485,6 +2491,7 @@ class account_tax_template(osv.osv): 'base_sign': 1, 'include_base_amount': False, 'type_tax_use': 'all', + 'price_include': 0, } _order = 'sequence' @@ -2658,7 +2665,8 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'include_base_amount': tax.include_base_amount, 'description':tax.description, 'company_id': company_id, - 'type_tax_use': tax.type_tax_use + 'type_tax_use': tax.type_tax_use, + 'price_include': tax.price_include } new_tax = obj_acc_tax.create(cr, uid, vals_tax) tax_template_to_tax[tax.id] = new_tax diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 0b03f52a1e9..173f0651a90 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -454,4 +454,4 @@ class account_bank_statement_line(osv.osv): account_bank_statement_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index ffcc979169d..0f14fb77bb6 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -95,7 +95,7 @@ class account_cash_statement(osv.osv): @param arg: User defined arguments @return: Dictionary of values. """ - res ={} + res = {} for statement in self.browse(cr, uid, ids): amount_total = 0.0 for line in statement.ending_details_ids: @@ -110,7 +110,7 @@ class account_cash_statement(osv.osv): @param arg: User defined arguments @return: Dictionary of values. """ - res2={} + res2 = {} for statement in self.browse(cr, uid, ids): encoding_total=0.0 for line in statement.line_ids: @@ -297,7 +297,6 @@ class account_cash_statement(osv.osv): """ res = {} balance_start = 0.0 - if not journal_id: res.update({ 'balance_start': balance_start @@ -311,8 +310,7 @@ class account_cash_statement(osv.osv): statement.balance_end_real = statement.balance_end if statement.balance_end != statement.balance_end_cash: return False - else: - return True + return True def _user_allow(self, cr, uid, statement_id, context=None): return True diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 3926e4fd9fb..213b80c3a44 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -23,7 +23,7 @@ - + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index cdb692f454a..93d5c37bd08 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -433,7 +433,7 @@ class account_move_line(osv.osv): 'period_id': fields.many2one('account.period', 'Period', required=True, select=2), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1), 'blocked': fields.boolean('Litigation', help="You can check this box to mark this journal item as a litigation with the associated partner"), - 'partner_id': fields.many2one('res.partner', 'Partner'), + 'partner_id': fields.many2one('res.partner', 'Partner', select=1), 'date_maturity': fields.date('Due date', help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."), 'date': fields.related('move_id','date', string='Effective date', type='date', required=True, store = { @@ -489,6 +489,7 @@ class account_move_line(osv.osv): 'state': 'draft', 'currency_id': _get_currency, 'journal_id': lambda self, cr, uid, c: c.get('journal_id', False), + 'account_id': lambda self, cr, uid, c: c.get('account_id', False), 'period_id': lambda self, cr, uid, c: c.get('period_id', False), 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.move.line', context=c) } @@ -1091,7 +1092,7 @@ class account_move_line(osv.osv): def _update_check(self, cr, uid, ids, context={}): done = {} for line in self.browse(cr, uid, ids, context): - if line.move_id.state <> 'draft': + if line.move_id.state <> 'draft' and (not line.journal_id.entry_posted): raise osv.except_osv(_('Error !'), _('You can not do this modification on a confirmed entry ! Please note that you can just change some non important fields !')) if line.reconcile_id: raise osv.except_osv(_('Error !'), _('You can not do this modification on a reconciled entry ! Please note that you can just change some non important fields !')) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index ca9d72640dc..a031aafd9e8 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -79,7 +79,7 @@ tree,form,search Define your company's fiscal year depending on the period you have chosen to follow. A fiscal year is a 1 year period over which a company budgets its spending. It may run over any period of 12 months. The fiscal year is referred to by the date in which it ends. For example, if a company's fiscal year ends November 30, 2011, then everything between December 1, 2010 and November 30, 2011 would be referred to as FY 2011. Not using the actual calendar year gives many companies an advantage, allowing them to close their books at a time which is most convenient for them. - + @@ -863,7 +863,7 @@ A tax code is a reference of a tax that will be taken out of a gross income depending on the country and sometimes industry sector. OpenERP allows you to define and manage them from this menu. - + 30 Days End of Month + 30 Days End of Month 30 Days End of Month diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index e4048f69a9c..10f2df28605 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -201,7 +201,7 @@ X1113 Reserve and Profit/Loss - (test) - payable + other diff --git a/addons/account/installer.py b/addons/account/installer.py index aa9a022d0c1..b1be04f7c70 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -188,7 +188,8 @@ class account_installer(osv.osv_memory): 'include_base_amount': tax.include_base_amount, 'description': tax.description, 'company_id': company_id.id, - 'type_tax_use': tax.type_tax_use + 'type_tax_use': tax.type_tax_use, + 'price_include': tax.price_include } new_tax = obj_acc_tax.create(cr, uid, vals_tax, context=context) #as the accounts have not been created yet, we have to wait before filling these fields diff --git a/addons/account/invoice.py b/addons/account/invoice.py index e03e0035022..4eae61d90d7 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -263,7 +263,7 @@ class account_invoice(osv.osv): 'invoice_line': fields.one2many('account.invoice.line', 'invoice_id', 'Invoice Lines', readonly=True, states={'draft':[('readonly',False)]}), 'tax_line': fields.one2many('account.invoice.tax', 'invoice_id', 'Tax Lines', readonly=True, states={'draft':[('readonly',False)]}), - 'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, help="Link to the automatically generated Journal Items."), + 'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, help="Link to the automatically generated Journal Items."), 'amount_untaxed': fields.function(_amount_all, method=True, digits_compute=dp.get_precision('Account'), string='Untaxed', store={ 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20), @@ -326,16 +326,18 @@ class account_invoice(osv.osv): def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): journal_obj = self.pool.get('account.journal') - if context.get('active_model','') in ['res.partner']: - partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[0] + if context is None: + context = {} + if context.get('active_model', '') in ['res.partner'] and context.get('active_ids', False) and context['active_ids']: + partner = self.pool.get(context['active_model']).read(cr, uid, context['active_ids'], ['supplier','customer'])[0] if not view_type: - view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.tree')])[0] + view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'account.invoice.tree')])[0] view_type = 'tree' if view_type == 'form': if partner['supplier'] and not partner['customer']: - view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.supplier.form')])[0] + view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.supplier.form')])[0] else: - view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name','=','account.invoice.form')])[0] + view_id = self.pool.get('ir.ui.view').search(cr,uid,[('name', '=', 'account.invoice.form')])[0] res = super(account_invoice,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) type = context.get('journal_type', 'sale') for field in res['fields']: @@ -596,6 +598,7 @@ class account_invoice(osv.osv): self.write(cr, uid, ids, {'state':'draft'}) wf_service = netsvc.LocalService("workflow") for inv_id in ids: + wf_service.trg_delete(uid, 'account.invoice', inv_id, cr) wf_service.trg_create(uid, 'account.invoice', inv_id, cr) return True @@ -657,7 +660,7 @@ class account_invoice(osv.osv): ctx = context.copy() ait_obj = self.pool.get('account.invoice.tax') for id in ids: - cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,)) + cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s AND manual is False", (id,)) partner = self.browse(cr, uid, id, context=ctx).partner_id if partner.lang: ctx.update({'lang': partner.lang}) @@ -1063,7 +1066,7 @@ class account_invoice(osv.osv): 'out_refund': 'OR: ', 'in_refund': 'SR: ', } - return [(r['id'], types[r['type']]+(r['number'] or '')+' '+(r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')] + return [(r['id'], (r['number']) or types[r['type']] + (r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')] def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: @@ -1072,9 +1075,9 @@ class account_invoice(osv.osv): context = {} ids = [] if name: - ids = self.search(cr, user, [('number','=',name)]+ args, limit=limit, context=context) + ids = self.search(cr, user, [('number','=',name)] + args, limit=limit, context=context) if not ids: - ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context) + ids = self.search(cr, user, [('name',operator,name)] + args, limit=limit, context=context) return self.name_get(cr, user, ids, context) def _refund_cleanup_lines(self, cr, uid, lines): diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index b99070330f7..20c1fe7cc55 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -59,15 +59,23 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): def _get_lines(self, form): res = [] + move_state = ['draft','posted'] + if self.target_move == 'posted': + move_state = ['posted'] self.cr.execute('SELECT DISTINCT res_partner.id AS id,\ res_partner.name AS name \ - FROM res_partner,account_move_line AS l, account_account\ + FROM res_partner,account_move_line AS l, account_account, account_move am\ WHERE (l.account_id=account_account.id) \ + AND (l.move_id=am.id) \ + AND (am.state IN %s)\ + AND (account_account.type IN %s)\ + AND account_account.active\ AND ((reconcile_id IS NULL)\ - OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ + OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ AND (l.partner_id=res_partner.id)\ + AND (l.date <= %s)\ AND ' + self.query + ' \ - ORDER BY res_partner.name', (self.date_from,)) + ORDER BY res_partner.name', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,)) partners = self.cr.dictfetchall() ## mise a 0 du total for i in range(7): @@ -78,9 +86,6 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): if not partner_ids: return [] # This dictionary will store the debit-credit for all partners, using partner_id as key. - move_state = ['draft','posted'] - if self.target_move == 'posted': - move_state = ['posted'] totals = {} self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit) \ @@ -93,7 +98,8 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ AND ' + self.query + '\ AND account_account.active\ - GROUP BY l.partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from)) + AND (l.date <= %s)\ + GROUP BY l.partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from, self.date_from,)) t = self.cr.fetchall() for i in t: totals[i[0]] = i[1] @@ -112,7 +118,8 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ AND '+ self.query + '\ AND account_account.active\ - GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids),self.date_from)) + AND (l.date <= %s)\ + GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids),self.date_from, self.date_from,)) t = self.cr.fetchall() for i in t: future_past[i[0]] = i[1] @@ -128,7 +135,8 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ AND '+ self.query + '\ AND account_account.active\ - GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from)) + AND (l.date <= %s)\ + GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from, self.date_from,)) t = self.cr.fetchall() for i in t: future_past[i[0]] = i[1] @@ -148,19 +156,20 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): else: dates_query += ' < %s)' args_list += (form[str(i)]['stop'],) - - self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit)\ - FROM account_move_line AS l, account_account, account_move am \ - WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\ - AND (am.state IN %s)\ - AND (account_account.type IN %s)\ - AND (l.partner_id IN %s)\ - AND ((l.reconcile_id IS NULL)\ - OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ - AND '+ self.query + '\ - AND account_account.active\ - AND ' + dates_query + '\ - GROUP BY l.partner_id', args_list) + args_list += (self.date_from,) + self.cr.execute('''SELECT l.partner_id, SUM(l.debit-l.credit) + FROM account_move_line AS l, account_account, account_move am + WHERE (l.account_id = account_account.id) AND (l.move_id=am.id) + AND (am.state IN %s) + AND (account_account.type IN %s) + AND (l.partner_id IN %s) + AND ((l.reconcile_id IS NULL) + OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) + AND ''' + self.query + ''' + AND account_account.active + AND ''' + dates_query + ''' + AND (l.date <= %s) + GROUP BY l.partner_id''', args_list) t = self.cr.fetchall() d = {} for i in t: @@ -201,8 +210,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0) values['name'] = partner['name'] - if values['total']: - res.append(values) + res.append(values) total = 0.0 totals = {} @@ -232,7 +240,8 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): AND ((l.reconcile_id IS NULL) \ OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ AND ' + self.query + '\ - AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from)) + AND (l.date <= %s)\ + AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,)) t = self.cr.fetchall() for i in t: totals['Unknown Partner'] = i[0] @@ -281,7 +290,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): else: dates_query += ' < %s)' args_list += (form[str(i)]['stop'],) - + args_list += (self.date_from,) self.cr.execute('SELECT SUM(l.debit-l.credit)\ FROM account_move_line AS l, account_account, account_move am \ WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\ @@ -293,6 +302,7 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header): AND '+ self.query + '\ AND account_account.active\ AND ' + dates_query + '\ + AND (l.date <= %s)\ GROUP BY l.partner_id', args_list) t = self.cr.fetchall() d = {} diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index d901f211ba0..b925c115a54 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -95,7 +95,7 @@ - + diff --git a/addons/account/wizard/account_invoice_state_view.xml b/addons/account/wizard/account_invoice_state_view.xml index 8e9c04b788d..a1fd5dc3673 100644 --- a/addons/account/wizard/account_invoice_state_view.xml +++ b/addons/account/wizard/account_invoice_state_view.xml @@ -16,14 +16,11 @@ - - Confirm Draft Invoices - account.invoice.confirm - form - form - - new - + account.invoice.cancel.form diff --git a/addons/account/wizard/account_open_closed_fiscalyear_view.xml b/addons/account/wizard/account_open_closed_fiscalyear_view.xml index 625be2db246..a7e35390c46 100644 --- a/addons/account/wizard/account_open_closed_fiscalyear_view.xml +++ b/addons/account/wizard/account_open_closed_fiscalyear_view.xml @@ -29,5 +29,10 @@ new + + diff --git a/addons/account_followup/report/account_followup_print.rml b/addons/account_followup/report/account_followup_print.rml index fb0f93b4a38..08dae5a82bc 100644 --- a/addons/account_followup/report/account_followup_print.rml +++ b/addons/account_followup/report/account_followup_print.rml @@ -117,7 +117,7 @@ Document : Customer account statement - Date : [[ formatLang(time.strftime('%Y-%m-%d'),date = True) ]] + Date : [[ formatLang(data['form']['date'],date=True) ]] Customer Ref : [[ o.ref or '' ]] diff --git a/addons/account_followup/wizard/account_followup_print.py b/addons/account_followup/wizard/account_followup_print.py index 18c455ac07a..174061438f8 100644 --- a/addons/account_followup/wizard/account_followup_print.py +++ b/addons/account_followup/wizard/account_followup_print.py @@ -319,13 +319,12 @@ class account_followup_print_all(osv.osv_memory): "WHERE id=%s", (to_update[id]['level'], date, int(id),)) - + data.update({'date': context['date']}) datas = { 'ids': [], 'model': 'account_followup.followup', 'form': data } - return { 'type': 'ir.actions.report.xml', 'report_name': 'account_followup.followup.print', diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py index ef603a48f62..662ed495d31 100644 --- a/addons/account_payment/wizard/account_payment_order.py +++ b/addons/account_payment/wizard/account_payment_order.py @@ -99,7 +99,7 @@ class payment_order_create(osv.osv_memory): context = {} data = self.read(cr, uid, ids, [], context=context)[0] search_due_date = data['duedate'] -# payment = order_obj.browse(cr, uid, context['active_id'], context=context) +# payment = self.pool.get('payment.order').browse(cr, uid, context['active_id'], context=context) # Search for move line to pay: domain = [('reconcile_id', '=', False), ('account_id.type', '=', 'payable'), ('amount_to_pay', '>', 0)] diff --git a/addons/account_sequence/__openerp__.py b/addons/account_sequence/__openerp__.py index e6580c4088c..28c7ac44e7f 100644 --- a/addons/account_sequence/__openerp__.py +++ b/addons/account_sequence/__openerp__.py @@ -31,7 +31,7 @@ 'depends': ['account'], 'init_xml': [], 'update_xml': ['account_sequence_data.xml','account_sequence.xml'], - 'demo_xml': ['account_sequence_minimal.xml'], + 'demo_xml': [], 'installable': True, 'active': False, 'certificate': '', diff --git a/addons/account_sequence/account_sequence.py b/addons/account_sequence/account_sequence.py index 496fb08bc05..c61720f857b 100644 --- a/addons/account_sequence/account_sequence.py +++ b/addons/account_sequence/account_sequence.py @@ -34,6 +34,7 @@ class account_move(osv.osv): res = super(account_move, self).post(cr, uid, ids, context=context) seq_no = False for line in self.browse(cr, uid, ids): + # Todo: if there is not internal seq defined on journal raise error ? if line.journal_id.internal_sequence: seq_no = obj_sequence.get_id(cr, uid, line.journal_id.internal_sequence.id, context=context) if seq_no: @@ -48,6 +49,7 @@ class account_journal(osv.osv): _columns = { 'internal_sequence': fields.many2one('ir.sequence', 'Internal Sequence'), } + account_journal() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_sequence/account_sequence.xml b/addons/account_sequence/account_sequence.xml index 92c145a9b2e..26a458fc8d1 100644 --- a/addons/account_sequence/account_sequence.xml +++ b/addons/account_sequence/account_sequence.xml @@ -20,7 +20,7 @@ form - + diff --git a/addons/account_sequence/account_sequence_data.xml b/addons/account_sequence/account_sequence_data.xml index 5429d93b522..f5d1117f51d 100644 --- a/addons/account_sequence/account_sequence_data.xml +++ b/addons/account_sequence/account_sequence_data.xml @@ -8,5 +8,8 @@ account.journal 1 + + + \ No newline at end of file diff --git a/addons/account_sequence/account_sequence_minimal.xml b/addons/account_sequence/account_sequence_minimal.xml deleted file mode 100644 index d634c2aa3af..00000000000 --- a/addons/account_sequence/account_sequence_minimal.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/addons/account_sequence/i18n/fr.po b/addons/account_sequence/i18n/fr.po new file mode 100644 index 00000000000..3c6132dfaa6 --- /dev/null +++ b/addons/account_sequence/i18n/fr.po @@ -0,0 +1,67 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_sequence +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.0-rc1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2010-11-18 16:11:21+0000\n" +"PO-Revision-Date: 2010-11-18 16:11:21+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_sequence +#: sql_constraint:ir.module.module:0 +msgid "The certificate ID of the module must be unique !" +msgstr "" + +#. module: account_sequence +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: account_sequence +#: model:ir.model,name:account_sequence.model_account_move +msgid "Account Entry" +msgstr "" + +#. module: account_sequence +#: field:account.move,internal_sequence_number:0 +msgid "Internal Sequence Number" +msgstr "" + +#. module: account_sequence +#: model:ir.model,name:account_sequence.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_sequence +#: sql_constraint:ir.module.module:0 +msgid "The name of the module must be unique !" +msgstr "" + +#. module: account_sequence +#: model:ir.module.module,shortdesc:account_sequence.module_meta_information +msgid "Entries Sequence Numbering" +msgstr "" + +#. module: account_sequence +#: field:account.journal,internal_sequence:0 +msgid "Internal Sequence" +msgstr "" + +#. module: account_sequence +#: constraint:ir.model:0 +msgid "The Object name must start with x_ and not contain any special character !" +msgstr "" + +#. module: account_sequence +#: sql_constraint:ir.model.fields:0 +msgid "Size of the field can never be less than 1 !" +msgstr "" + diff --git a/addons/event/event.py b/addons/event/event.py index 64f93e6db55..ab90fe64803 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -370,6 +370,18 @@ class event_registration(osv.osv): self.history(cr, uid, [reg], _('Invoiced')) return inv_id + def copy(self, cr, uid, id, default=None, context=None): + """ Copy record of Given id + @param id: Id of Registration record. + @param context: A standard dictionary for contextual values + """ + if not default: + default = {} + default.update({ + 'invoice_id': False, + }) + return super(event_registration, self).copy(cr, uid, id, default=default, context=context) + def action_invoice_create(self, cr, uid, ids, grouped=False, date_inv = False, context=None): """ Action of Create Invoice """ res = False @@ -550,11 +562,11 @@ class event_registration(osv.osv): subject = _('Auto Confirmation: [%s] %s') %(regestration.id, regestration.name) body = regestration.event_id.mail_confirm if subject or body: - tools.email_send(src, email_to, subject, body, email_cc = email_cc, openobject_id = regestration.id) + tools.email_send(src, email_to, subject, body, email_cc=email_cc, openobject_id=regestration.id) self.history(cr, uid, [regestration], subject, history = True, \ - email = email_to, details = body, \ - subject = subject, email_from = src, \ - email_cc = ', '.join(email_cc)) + email=email_to, details=body, \ + subjec=subject, email_from=src, \ + email_cc=', '.join(email_cc)) return True diff --git a/addons/event_project/__init__.py b/addons/event_project/__init__.py index c629a522a8b..fe2b9771046 100644 --- a/addons/event_project/__init__.py +++ b/addons/event_project/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,10 +15,10 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## -import event +import event_project import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_holidays/hr_holidays_demo.xml b/addons/hr_holidays/hr_holidays_demo.xml index dca01d06b1a..b4a971dc328 100644 --- a/addons/hr_holidays/hr_holidays_demo.xml +++ b/addons/hr_holidays/hr_holidays_demo.xml @@ -6,7 +6,7 @@ Casual Leave for Fabien Pinckaers add - 12 + 20 diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index e3011f7c0eb..be2be2dd54f 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -166,12 +166,8 @@ -