diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index d4731fa0215..cea696f590f 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -107,8 +107,11 @@ module named account_voucherss 'company_view.xml', 'account_installer.xml', 'report/account_invoice_report_view.xml', + 'report/account_entries_report_view.xml', 'report/account_report_view.xml', 'report/account_analytic_report_view.xml', + 'report/account_account_report_view.xml', + 'report/account_analytic_entries_report_view.xml' ], 'demo_xml': [ #'demo/price_accuracy00.yml', diff --git a/addons/account/account.py b/addons/account/account.py index 6095c2aa113..5181028c17b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -231,9 +231,9 @@ class account_account(osv.osv): aml_query = self.pool.get('account.move.line')._query_get(cr, uid, context=context) wheres = [""] - if query: + if query.strip(): wheres.append(query.strip()) - if aml_query: + if aml_query.strip(): wheres.append(aml_query.strip()) query = " AND ".join(wheres) @@ -251,6 +251,7 @@ class account_account(osv.osv): # consolidate accounts with direct children + ids2.reverse() brs = list(self.browse(cr, uid, ids2, context=context)) sums = {} while brs: @@ -270,8 +271,9 @@ class account_account(osv.osv): if current.child_id: sums[current.id][fn] += sum(sums[child.id][fn] for child in current.child_id) res = {} + null_result = dict((fn, 0.0) for fn in field_names) for id in ids: - res[id] = sums[id] + res[id] = sums.get(id, null_result) return res def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}): @@ -313,7 +315,7 @@ class account_account(osv.osv): 'user_type': fields.many2one('account.account.type', 'Account Type', required=True, help="These types are defined according to your country. The type contains more information "\ "about the account and its specificities."), - 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade'), + 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]), 'child_parent_ids': fields.one2many('account.account','parent_id','Children'), 'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'), 'child_id': fields.function(_get_child_ids, method=True, type='many2many', relation="account.account", string="Child Accounts"), @@ -450,18 +452,42 @@ class account_account(osv.osv): def _check_moves(self, cr, uid, ids, method, context): line_obj = self.pool.get('account.move.line') account_ids = self.search(cr, uid, [('id', 'child_of', ids)]) + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): if method == 'write': raise osv.except_osv(_('Error !'), _('You cannot deactivate an account that contains account moves.')) elif method == 'unlink': raise osv.except_osv(_('Error !'), _('You cannot remove an account which has account entries!. ')) + #Checking whether the account is set as a property to any Partner or not + value = 'account.account,' + str(ids[0]) + partner_prop_acc = self.pool.get('ir.property').search(cr, uid, [('value_reference','=',value)], context=context) + if partner_prop_acc: + raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set as a property to any Partner.')) + return True + + def _check_allow_type_change(self, cr, uid, ids, new_type, context): + group1 = ['payable', 'receivable', 'other'] + group2 = ['consolidation','view'] + line_obj = self.pool.get('account.move.line') + for account in self.browse(cr, uid, ids, context=context): + old_type = account.type + account_ids = self.search(cr, uid, [('id', 'child_of', [account.id])]) + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): + #Check for 'Closed' type + if old_type == 'closed' and new_type !='closed': + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains account entries!")) + #Check for change From group1 to group2 and vice versa + if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1): + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from '%s' to '%s' type as it contains account entries!") % (old_type,new_type,)) return True def write(self, cr, uid, ids, vals, context=None): - if not context: + if context is None: context = {} if 'active' in vals and not vals['active']: self._check_moves(cr, uid, ids, "write", context) + if 'type' in vals.keys(): + self._check_allow_type_change(cr, uid, ids, vals['type'], context=context) return super(account_account, self).write(cr, uid, ids, vals, context=context) def unlink(self, cr, uid, ids, context={}): @@ -557,15 +583,16 @@ class account_journal(osv.osv): def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: - args=[] - if not context: - context={} + args = [] + if context is None: + context = {} ids = [] if name: - ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit, context=context) if not ids: - ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit, context=context) return self.name_get(cr, user, ids, context=context) + account_journal() class account_fiscalyear(osv.osv): @@ -631,6 +658,19 @@ class account_fiscalyear(osv.osv): else: return False return ids[0] + + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if args is None: + args = [] + if context is None: + context = {} + ids = [] + if name: + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + if not ids: + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + return self.name_get(cr, user, ids, context=context) + account_fiscalyear() class account_period(osv.osv): @@ -706,12 +746,24 @@ class account_period(osv.osv): cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id)) cr.execute('update account_period set state=%s where id=%s', (mode, id)) return True + + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if args is None: + args = [] + if context is None: + context = {} + ids = [] + if name: + ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit) + if not ids: + ids = self.search(cr, user, [('name',operator,name)]+ args, limit=limit) + return self.name_get(cr, user, ids, context=context) account_period() class account_journal_period(osv.osv): _name = "account.journal.period" - _description = "Journal - Period" + _description = "Journal Period" def _icon_get(self, cr, uid, ids, field_name, arg=None, context={}): result = {}.fromkeys(ids, 'STOCK_NEW') @@ -950,7 +1002,6 @@ class account_move(osv.osv): l[2]['period_id'] = default_period context['period_id'] = default_period - accnt_journal = self.pool.get('account.journal').browse(cr, uid, vals['journal_id']) if 'line_id' in vals: c = context.copy() c['novalidate'] = True @@ -1248,7 +1299,7 @@ class account_tax_code(osv.osv): _description = 'Tax Code' _rec_name = 'code' _columns = { - 'name': fields.char('Tax Case Name', size=64, required=True), + 'name': fields.char('Tax Case Name', size=64, required=True, translate=True), 'code': fields.char('Case Code', size=64), 'info': fields.text('Description'), 'sum': fields.function(_sum_year, method=True, string="Year Sum"), @@ -1262,6 +1313,15 @@ class account_tax_code(osv.osv): } + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + if not args: + args = [] + if context is None: + context = {} + ids = self.search(cr, user, ['|',('name',operator,name),('code',operator,name)] + args, limit=limit, context=context) + return self.name_get(cr, user, ids, context) + + def name_get(self, cr, uid, ids, context=None): if not len(ids): return [] @@ -1290,7 +1350,15 @@ class account_tax_code(osv.osv): return False level -= 1 return True + + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + default = default.copy() + default.update({'line_ids': []}) + return super(account_tax_code, self).copy(cr, uid, id, default, context) + _constraints = [ (_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']) ] diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index ce6341cc9b2..1fa0a5c6cfa 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -30,7 +30,7 @@ from tools import config class account_analytic_line(osv.osv): _inherit = 'account.analytic.line' - _description = 'Analytic lines' + _description = 'Analytic Line' _columns = { 'product_uom_id' : fields.many2one('product.uom', 'UoM'), 'product_id' : fields.many2one('product.product', 'Product'), @@ -42,7 +42,7 @@ class account_analytic_line(osv.osv): } _defaults = { 'date': lambda *a: time.strftime('%Y-%m-%d'), - 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c), + 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c), } _order = 'date' @@ -118,7 +118,7 @@ account_analytic_line() class timesheet_invoice(osv.osv): _name = "report.hr.timesheet.invoice.journal" - _description = "Analytic account costs and revenues" + _description = "Analytic Account Costs and Revenues" _auto = False _columns = { 'name': fields.char('Year',size=64,required=False, readonly=True), diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index deb010c7cd0..81b6e3157a1 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -387,7 +387,7 @@ account_bank_statement() class account_bank_statement_reconcile(osv.osv): _name = "account.bank.statement.reconcile" - _description = "Statement reconcile" + _description = "Statement Reconcile" def _total_entry(self, cursor, user, ids, name, attr, context=None): result = {} @@ -558,35 +558,40 @@ class account_bank_statement_line(osv.osv): def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context={}): + res = {'value': {}} if not partner_id: - return {} - res_currency_obj = self.pool.get('res.currency') - res_users_obj = self.pool.get('res.users') - - company_currency_id = res_users_obj.browse(cursor, user, user, - context=context).company_id.currency_id.id - - if not currency_id: - currency_id = company_currency_id - - part = self.pool.get('res.partner').browse(cursor, user, partner_id, + return res + line = self.browse(cursor, user, line_id) + + if not line or (line and not line[0].account_id): + part = self.pool.get('res.partner').browse(cursor, user, partner_id, context=context) - if type == 'supplier': - account_id = part.property_account_payable.id - else: - account_id = part.property_account_receivable.id + if type == 'supplier': + account_id = part.property_account_payable.id + else: + account_id = part.property_account_receivable.id + res['value']['account_id'] = account_id - cursor.execute('SELECT sum(debit-credit) \ + if not line or (line and not line[0].amount): + res_users_obj = self.pool.get('res.users') + res_currency_obj = self.pool.get('res.currency') + company_currency_id = res_users_obj.browse(cursor, user, user, + context=context).company_id.currency_id.id + if not currency_id: + currency_id = company_currency_id + + cursor.execute('SELECT sum(debit-credit) \ FROM account_move_line \ WHERE (reconcile_id is null) \ AND partner_id = %s \ AND account_id=%s', (partner_id, account_id)) - res = cursor.fetchone() - balance = res and res[0] or 0.0 + pgres = cursor.fetchone() + balance = pgres and pgres[0] or 0.0 - balance = res_currency_obj.compute(cursor, user, company_currency_id, + balance = res_currency_obj.compute(cursor, user, company_currency_id, currency_id, balance, context=context) - return {'value': {'amount': balance, 'account_id': account_id}} + res['value']['amount'] = balance + return res def _reconcile_amount(self, cursor, user, ids, name, args, context=None): if not ids: @@ -625,7 +630,7 @@ class account_bank_statement_line(osv.osv): 'statement_id': fields.many2one('account.bank.statement', 'Statement', select=True, required=True, ondelete='cascade'), 'reconcile_id': fields.many2one('account.bank.statement.reconcile', - 'Reconcile', states={'confirm':[('readonly',True)]}), + 'Reconcile'), 'move_ids': fields.many2many('account.move', 'account_bank_statement_line_move_rel', 'move_id','statement_id', 'Moves'), @@ -633,7 +638,7 @@ class account_bank_statement_line(osv.osv): 'note': fields.text('Notes'), 'reconcile_amount': fields.function(_reconcile_amount, string='Amount reconciled', method=True, type='float'), - 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bank statement line."), + 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bank statement lines."), } _defaults = { 'name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement.line'), diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 2ce4324f7c6..2da7c71021c 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -478,9 +478,11 @@ - - + + + + res.partner.invoice.info.inherit res.partner diff --git a/addons/account/account_invoice_workflow.xml b/addons/account/account_invoice_workflow.xml index 374a436e9ac..4c919765596 100644 --- a/addons/account/account_invoice_workflow.xml +++ b/addons/account/account_invoice_workflow.xml @@ -50,7 +50,7 @@ write({'state':'open'}) paid - write({'state':'paid'}) + confirm_paid() function subflow.paid diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index 37d539a4b25..a2d18095618 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -22,6 +22,7 @@ groups="group_account_user"/> + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index a86fce20772..36b65d20dca 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -30,7 +30,7 @@ import tools class account_move_line(osv.osv): _name = "account.move.line" - _description = "Entry lines" + _description = "Entry Lines" def _query_get(self, cr, uid, obj='l', context={}): fiscalyear_obj = self.pool.get('account.fiscalyear') @@ -577,11 +577,12 @@ class account_move_line(osv.osv): merges_rec = [] for line in self.browse(cr, uid, ids, context): if line.reconcile_id: - raise osv.except_osv(_('Already Reconciled'), _('Already Reconciled')) + raise osv.except_osv(_('Warning'), _('Already Reconciled!')) if line.reconcile_partial_id: for line2 in line.reconcile_partial_id.line_partial_ids: if not line2.reconcile_id: - merges.append(line2.id) + if line2.id not in merges: + merges.append(line2.id) total += (line2.debit or 0.0) - (line2.credit or 0.0) merges_rec.append(line.reconcile_partial_id.id) else: @@ -774,6 +775,17 @@ class account_move_line(osv.osv): result['fields'] = self.fields_get(cr, uid, fields, context) return result + def _check_moves(self, cr, uid, context): + # use the first move ever created for this journal and period + cr.execute('select id, state, name from account_move where journal_id=%s and period_id=%s order by id limit 1', (context['journal_id'],context['period_id'])) + res = cr.fetchone() + if res: + if res[1] != 'draft': + raise osv.except_osv(_('UserError'), + _('The account move (%s) for centralisation ' \ + 'has been confirmed!') % res[2]) + return res + def unlink(self, cr, uid, ids, context={}, check=True): self._update_check(cr, uid, ids, context) result = False @@ -809,7 +821,7 @@ class account_move_line(osv.osv): return True def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): - if not context: + if context is None: context={} if vals.get('account_tax_id', False): raise osv.except_osv(_('Unable to change tax !'), _('You can not change the tax, you should remove and recreate lines !')) @@ -825,6 +837,24 @@ class account_move_line(osv.osv): if vals.get('date', False): todo_date = vals['date'] del vals['date'] + + for line in self.browse(cr, uid, ids,context=context): + ctx = context.copy() + if ('journal_id' not in ctx): + if line.move_id: + ctx['journal_id'] = line.move_id.journal_id.id + else: + ctx['journal_id'] = line.journal_id.id + if ('period_id' not in ctx): + if line.move_id: + ctx['period_id'] = line.move_id.period_id.id + else: + ctx['period_id'] = line.period_id.id + #Check for centralisation + journal = self.pool.get('account.journal').browse(cr, uid, ctx['journal_id'], context=ctx) + if journal.centralisation: + self._check_moves(cr, uid, context=ctx) + result = super(account_move_line, self).write(cr, uid, ids, vals, context) if check: @@ -891,14 +921,9 @@ class account_move_line(osv.osv): is_new_move = False if not move_id: if journal.centralisation: - # use the first move ever created for this journal and period - cr.execute('select id, state, name from account_move where journal_id=%s and period_id=%s order by id limit 1', (context['journal_id'],context['period_id'])) - res = cr.fetchone() + #Check for centralisation + res = self._check_moves(cr, uid, context) if res: - if res[1] != 'draft': - raise osv.except_osv(_('UserError'), - _('The Ledger Posting (%s) for centralisation ' \ - 'has been confirmed!') % res[2]) vals['move_id'] = res[0] if not vals.get('move_id', False): @@ -926,7 +951,7 @@ class account_move_line(osv.osv): break if journal.account_control_ids and not ok: for a in journal.account_control_ids: - if a.id==vals['account_id']: + if a.id == vals['account_id']: ok = True break if (account.currency_id) and 'amount_currency' not in vals and account.currency_id.id <> company_currency: @@ -941,7 +966,7 @@ class account_move_line(osv.osv): if not ok: raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !')) - if 'analytic_account_id' in vals and vals['analytic_account_id']: + if vals.get('analytic_account_id',False): if journal.analytic_journal_id: vals['analytic_lines'] = [(0,0, { 'name': vals['name'], @@ -961,8 +986,8 @@ class account_move_line(osv.osv): result = super(osv.osv, self).create(cr, uid, vals, context) # CREATE Taxes - if 'account_tax_id' in vals and vals['account_tax_id']: - tax_id=tax_obj.browse(cr,uid,vals['account_tax_id']) + if vals.get('account_tax_id',False): + tax_id = tax_obj.browse(cr, uid, vals['account_tax_id']) total = vals['debit'] - vals['credit'] if journal.refund_journal: base_code = 'ref_base_code_id' @@ -978,7 +1003,7 @@ class account_move_line(osv.osv): tax_sign = 'tax_sign' tmp_cnt = 0 - for tax in tax_obj.compute(cr,uid,[tax_id],total,1.00): + for tax in tax_obj.compute(cr, uid, [tax_id], total, 1.00): #create the base movement if tmp_cnt == 0: if tax[base_code]: @@ -1031,7 +1056,7 @@ class account_move_line(osv.osv): # if context and ('__last_update' in context): # del context['__last_update'] # self.pool.get('account.move').write(cr, uid, [move_id], {'date':vals['date']}, context=context) - if check and not context.get('no_store_function'): + if check and ((not context.get('no_store_function')) or journal.entry_posted): tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context) if journal.entry_posted and tmp: self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 5e514041d1d..1edb56d6044 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -351,7 +351,7 @@ - + @@ -531,7 +531,10 @@ + + + @@ -551,6 +554,7 @@ + @@ -562,7 +566,7 @@
- + @@ -648,9 +652,9 @@ - + - + @@ -1453,9 +1457,11 @@ - + - + + + Account Add wizard diff --git a/addons/account/i18n/eu.po b/addons/account/i18n/eu.po index 68a84f413de..84652c621ae 100644 --- a/addons/account/i18n/eu.po +++ b/addons/account/i18n/eu.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-05-17 13:10+0000\n" -"Last-Translator: Jon A. Ortuondo (Euskotec) \n" +"PO-Revision-Date: 2010-05-23 09:59+0000\n" +"Last-Translator: ninaiz \n" "Language-Team: Basque \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-05-18 05:15+0000\n" +"X-Launchpad-Export-Date: 2010-05-24 03:46+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -236,7 +236,7 @@ msgstr "" #: field:account.tax.template,amount:0 #: xsl:account.transfer:0 msgid "Amount" -msgstr "" +msgstr "Kopurua" #. module: account #: model:ir.actions.report.xml,name:account.account_3rdparty_ledger @@ -338,7 +338,7 @@ msgstr "" #: field:account.invoice,amount_tax:0 #: field:account.move.line,account_tax_id:0 msgid "Tax" -msgstr "" +msgstr "Zerga" #. module: account #: rml:account.general.journal:0 @@ -465,7 +465,7 @@ msgstr "" #. module: account #: rml:account.invoice:0 msgid "Disc.(%)" -msgstr "" +msgstr "Desk. (%)" #. module: account #: rml:account.general.ledger:0 diff --git a/addons/account/i18n/fr.po b/addons/account/i18n/fr.po index 1785d79bf38..e6bddde1647 100644 --- a/addons/account/i18n/fr.po +++ b/addons/account/i18n/fr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.1\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-02-18 09:24+0000\n" -"Last-Translator: Olivier Dony (OpenERP) \n" +"PO-Revision-Date: 2010-05-21 17:48+0000\n" +"Last-Translator: Christophe Chauvet - http://www.syleam.fr/ \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n" +"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -2495,7 +2495,8 @@ msgid "Analytic Entry" msgstr "Ecriture analytique" #. module: account -#: view:res.company:0 field:res.company,overdue_msg:0 +#: view:res.company:0 +#: field:res.company,overdue_msg:0 msgid "Overdue Payments Message" msgstr "Message pour les paiements en retard" @@ -2784,7 +2785,7 @@ msgstr "Ouvrir journal" #. module: account #: rml:account.analytic.account.journal:0 msgid "KI" -msgstr "" +msgstr "KI" #. module: account #: model:ir.actions.wizard,name:account.action_account_analytic_line @@ -3034,7 +3035,7 @@ msgstr "-" #. module: account #: rml:account.analytic.account.journal:0 msgid "asgfas" -msgstr "" +msgstr "asgfas" #. module: account #: model:ir.actions.act_window,name:account.action_account_analytic_account_tree2 @@ -6082,3 +6083,6 @@ msgid "" msgstr "" "Cochez cette case si l'utilisateur peut réconcilier les entrées dans ce " "compte." + +#~ msgid "account.config.wizard" +#~ msgstr "account.config.wizard" diff --git a/addons/account/i18n/oc.po b/addons/account/i18n/oc.po index 53532fba0ac..180ce8da31a 100644 --- a/addons/account/i18n/oc.po +++ b/addons/account/i18n/oc.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-03-13 10:33+0000\n" -"Last-Translator: Cédric VALMARY (Per Tot en òc) \n" +"PO-Revision-Date: 2010-05-18 08:45+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) \n" "Language-Team: Occitan (post 1500) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n" +"X-Launchpad-Export-Date: 2010-05-19 05:12+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -175,7 +175,7 @@ msgstr "" #. module: account #: view:account.move:0 msgid "Total Credit" -msgstr "Total crrdit" +msgstr "Credit Total" #. module: account #: field:account.config.wizard,charts:0 @@ -255,7 +255,7 @@ msgstr "Taxas provesidors" #. module: account #: view:account.move:0 msgid "Total Debit" -msgstr "Total debit" +msgstr "Debit Total" #. module: account #: rml:account.tax.code.entries:0 @@ -808,7 +808,6 @@ msgstr "" msgid "Move Lines" msgstr "" - #. module: account #: model:ir.actions.act_window,name:account.report_account_analytic_journal_tree #: model:ir.ui.menu,name:account.report_account_analytic_journal_print @@ -2136,7 +2135,8 @@ msgid "Analytic Entry" msgstr "" #. module: account -#: view:res.company:0 field:res.company,overdue_msg:0 +#: view:res.company:0 +#: field:res.company,overdue_msg:0 msgid "Overdue Payments Message" msgstr "" diff --git a/addons/account/i18n/th.po b/addons/account/i18n/th.po index 320fdc82290..7389cdda788 100644 --- a/addons/account/i18n/th.po +++ b/addons/account/i18n/th.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-03-15 03:12+0000\n" +"PO-Revision-Date: 2010-05-20 07:09+0000\n" "Last-Translator: Songpon Phusing \n" "Language-Team: Thai \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n" +"X-Launchpad-Export-Date: 2010-05-21 03:38+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -51,7 +51,7 @@ msgstr "" #. module: account #: model:account.account.type,name:account.account_type_asset msgid "Asset" -msgstr "" +msgstr "สินทรัพย์" #. module: account #: constraint:ir.actions.act_window:0 @@ -106,7 +106,7 @@ msgstr "" #: model:ir.actions.wizard,name:account.wizard_vat_declaration #: model:ir.ui.menu,name:account.menu_wizard_vat_declaration msgid "Print Taxes Report" -msgstr "" +msgstr "พิมพ์รายงานภาษี" #. module: account #: field:account.account,parent_id:0 @@ -2133,7 +2133,8 @@ msgid "Analytic Entry" msgstr "" #. module: account -#: view:res.company:0 field:res.company,overdue_msg:0 +#: view:res.company:0 +#: field:res.company,overdue_msg:0 msgid "Overdue Payments Message" msgstr "" diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 34c7aa3e6ba..dbaa321f329 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -23,8 +23,8 @@ import time import decimal_precision as dp import netsvc + from osv import fields, osv, orm -import ir import pooler from tools import config from tools.translate import _ @@ -217,6 +217,7 @@ class account_invoice(osv.osv): _name = "account.invoice" _description = 'Invoice' _order = "number" + _log_create = True _columns = { 'name': fields.char('Description', size=64, select=True,readonly=True, states={'draft':[('readonly',False)]}), 'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice."), @@ -333,7 +334,14 @@ class account_invoice(osv.osv): raise orm.except_orm(_('Configuration Error!'), _('There is no Accounting Journal of type Sale/Purchase defined!')) else: - raise + raise orm.except_orm(_('UnknownError'), str(e)) + + def confirm_paid(self, cr, uid, ids, context=None): + self.write(cr, uid, ids, {'state':'paid'}, context=context) + for (id,name) in self.name_get(cr, uid, ids): + message = _('Document ') + " '" + name + "' "+ _("has been paid.") + self.log(cr, uid, id, message) + return True def unlink(self, cr, uid, ids, context=None): invoices = self.read(cr, uid, ids, ['state']) @@ -350,7 +358,7 @@ class account_invoice(osv.osv): # res = self.pool.get('res.partner').address_get(cr, uid, [part], ['invoice']) # return [{}] def onchange_partner_id(self, cr, uid, ids, type, partner_id, - date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): + date_invoice=False, payment_term=False, partner_bank=False, company_id=False): invoice_addr_id = False contact_addr_id = False partner_payment_term = False @@ -415,7 +423,7 @@ class account_invoice(osv.osv): else: result['value']['date_due'] = False - if partner_bank_id != bank_id: + if partner_bank != bank_id: to_update = self.onchange_partner_bank(cr, uid, ids, bank_id) result['value'].update(to_update['value']) return result @@ -450,7 +458,7 @@ class account_invoice(osv.osv): def onchange_invoice_line(self, cr, uid, ids, lines): return {} - def onchange_partner_bank(self, cursor, user, ids, partner_bank_id): + def onchange_partner_bank(self, cursor, user, ids, partner_bank): return {'value': {}} def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id): @@ -650,6 +658,16 @@ class account_invoice(osv.osv): self.write(cr, uid, [inv.id], res['value']) return True + def finalize_invoice_move_lines(self, cr, uid, invoice_browse, move_lines): + """finalize_invoice_move_lines(cr, uid, invoice, move_lines) -> move_lines + Hook method to be overridden in additional modules to verify and possibly alter the + move lines to be created by an invoice, for special cases. + :param invoice_browse: browsable record of the invoice that is generating the move lines + :param move_lines: list of dictionaries with the account.move.lines (as for create()) + :return: the (possibly updated) final move_lines to create for this invoice + """ + return move_lines + def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj): if not inv.tax_line: for tax in compute_taxes.values(): @@ -912,7 +930,12 @@ class account_invoice(osv.osv): # will be automatically deleted too account_move_obj.unlink(cr, uid, [i['move_id'][0]]) if i['payment_ids']: - self.pool.get('account.move.line').write(cr, uid, i['payment_ids'], {'reconcile_partial_id': False}) + account_move_line_obj = self.pool.get('account.move.line') + pay_ids = account_move_line_obj.browse(cr, uid , i['payment_ids']) + for move_line in pay_ids: + if move_line.reconcile_partial_id and move_line.reconcile_partial_id.line_partial_ids: + raise osv.except_osv(_('Error !'), _('You cannot cancel the Invoice which is Partially Paid! You need to unreconcile concerned payment entries!')) + self.write(cr, uid, ids, {'state':'cancel', 'move_id':False}) self._log_event(cr, uid, ids,-1.0, 'Cancel Invoice') return True @@ -1147,14 +1170,14 @@ class account_invoice_line(osv.osv): t = t - (p * l[2].get('quantity')) taxes = l[2].get('invoice_line_tax_id') if len(taxes[0]) >= 3 and taxes[0][2]: - taxes=tax_obj.browse(cr, uid, taxes[0][2]) + taxes = tax_obj.browse(cr, uid, taxes[0][2]) for tax in tax_obj.compute(cr, uid, taxes, p,l[2].get('quantity'), context.get('address_invoice_id', False), l[2].get('product_id', False), context.get('partner_id', False)): t = t - tax['amount'] return t return 0 _name = "account.invoice.line" - _description = "Invoice line" + _description = "Invoice Line" _columns = { 'name': fields.char('Description', size=256, required=True), 'origin': fields.char('Origin', size=256, help="Reference of the document that produced this invoice."), @@ -1200,8 +1223,8 @@ class account_invoice_line(osv.osv): part = self.pool.get('res.partner').browse(cr, uid, partner_id) fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False - lang=part.lang - context.update({'lang': lang}) + if part.lang: + context.update({'lang': part.lang}) result = {} res = self.pool.get('product.product').browse(cr, uid, product, context=context) diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 494c0f71a48..edbe704d4db 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -113,6 +113,7 @@ + diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 71e57cb82e2..e57629d2618 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -25,13 +25,13 @@ - + @@ -97,6 +97,7 @@ form tree,graph,form + {"search_default_user_id":uid} @@ -188,11 +189,11 @@ - + @@ -202,6 +203,7 @@ ir.actions.act_window account.analytic.line form + {"search_default_user_id":uid} diff --git a/addons/account/project/report/analytic_check.py b/addons/account/project/report/analytic_check.py index 54fbaddc4d9..458827d8bf3 100644 --- a/addons/account/project/report/analytic_check.py +++ b/addons/account/project/report/analytic_check.py @@ -54,12 +54,12 @@ class account_analytic_analytic_check(report_sxw.rml_parse): self.cr.execute("SELECT abs(sum(amount)) AS balance \ FROM account_analytic_line \ - WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id'])) + WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id'])) (ad,) = self.cr.fetchone() ad = ad or 0.0 self.cr.execute("SELECT abs(sum(amount)) AS balance \ FROM account_analytic_line \ - WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id'])) + WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id'])) (ac,) = self.cr.fetchone() ac = ac or 0.0 diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index 09ff866d1a8..b411e404cac 100644 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -37,6 +37,8 @@ import compare_account_balance import account_invoice_report import account_report import account_analytic_report - +import account_account_report +import account_entries_report +import account_analytic_entries_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_account_report.py b/addons/account/report/account_account_report.py new file mode 100644 index 00000000000..55e5d7030c7 --- /dev/null +++ b/addons/account/report/account_account_report.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import tools +from osv import fields,osv + +class account_account_report(osv.osv): + _name = "account.account.report" + _description = "Account Report" + _auto = False + _columns = { + 'name': fields.char('Name', size=128, readonly=True), + 'code': fields.char('Code', size=64, readonly=True), + 'type': fields.selection([ + ('receivable', 'Receivable'), + ('payable', 'Payable'), + ('view', 'View'), + ('consolidation', 'Consolidation'), + ('other', 'Others'), + ('closed', 'Closed'), + ], 'Internal Type', readonly=True), + 'company_id': fields.many2one('res.company', 'Company', required=True), + 'currency_mode': fields.selection([('current', 'At Date'), ('average', 'Average Rate')], 'Outgoing Currencies Rate',readonly=True), + 'user_type': fields.many2one('account.account.type', 'Account Type',readonly=True), + 'quantity': fields.float('Quantity', readonly=True), + 'amount_total': fields.float('Total Amount', readonly=True), + 'credit': fields.float('Credit', readonly=True), + 'debit': fields.float('Debit', readonly=True), + 'balance': fields.float('Balance', readonly=True), + 'nbr': fields.integer('#Accounts', readonly=True), + 'parent_account_id': fields.many2one('account.account', 'Parent Account', required=True), + } + def init(self, cr): + tools.drop_view_if_exists(cr, 'account_account_report') + cr.execute(""" + create or replace view account_account_report as ( + select + min(a.id) as id, + count(distinct a.id) as nbr, + a.name, + a.code, + a.type as type, + a.company_id as company_id, + a.currency_mode as currency_mode, + a.user_type as user_type, + a.parent_id as parent_account_id, + sum(ail.quantity) as quantity, + sum(ail.price_subtotal) as amount_total, + sum(m.credit) as credit, + sum(m.debit) as debit, + (sum(m.credit)-sum(m.debit)) as balance + from + account_account as a + left join account_move_line as m on m.account_id=a.id + left join account_invoice_line as ail on ail.account_id=a.id + left join account_invoice as ai on ai.account_id=a.id + group by + a.name, + a.code, + a.type, + a.company_id, + a.currency_mode, + a.user_type, + m.account_id, + a.parent_id + ) + """) +account_account_report() diff --git a/addons/account/report/account_account_report_view.xml b/addons/account/report/account_account_report_view.xml new file mode 100644 index 00000000000..32e77be341f --- /dev/null +++ b/addons/account/report/account_account_report_view.xml @@ -0,0 +1,92 @@ + + + + + account.account.report.tree + account.account.report + tree + + + + + + + + + + + + + + + + + + + + + account.account.report.graph + account.account.report + graph + + + + + + + + + + + + account.account.report.search + account.account.report + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Accounts + account.account.report + form + tree,graph + {"search_default_Account":1,"search_default_At Date":1,'group_by_no_leaf':1,'group_by':[]} + + + + + + + diff --git a/addons/account/report/account_analytic_entries_report.py b/addons/account/report/account_analytic_entries_report.py new file mode 100644 index 00000000000..2a1b4ad993b --- /dev/null +++ b/addons/account/report/account_analytic_entries_report.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import tools +from osv import fields,osv + +class analytic_entries_report(osv.osv): + _name = "analytic.entries.report" + _description = "Analytic Entries Statistics" + _auto = False + _columns = { + 'date': fields.date('Date', readonly=True), + 'year': fields.char('Year', size=4, readonly=True), + 'day': fields.char('Day', size=128, readonly=True), + 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), + ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), + ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), + 'user_id' : fields.many2one('res.users', 'User',readonly=True), + 'name': fields.char('Description', size=64, readonly=True), + 'company_id': fields.many2one('res.company', 'Company', required=True), + 'currency_id': fields.many2one('res.currency', 'Currency', required=True), + 'account_id': fields.many2one('account.analytic.account', 'Account', required=True), + 'general_account_id': fields.many2one('account.account', 'General Account', required=True), + 'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True), + 'move_id': fields.many2one('account.move.line', 'Move', required=True), + 'product_id': fields.many2one('product.product', 'Product', required=True), + 'product_uom_id': fields.many2one('product.uom', 'Product UOM', required=True), + 'amount': fields.float('Amount', readonly=True), + 'unit_amount': fields.float('Unit Amount', readonly=True), + 'amount_currency': fields.float('Amount Currency', readonly=True), + 'nbr': fields.integer('#Entries', readonly=True), + } + def init(self, cr): + tools.drop_view_if_exists(cr, 'analytic_entries_report') + cr.execute(""" + create or replace view analytic_entries_report as ( + select + min(a.id) as id, + count(distinct a.id) as nbr, + a.create_date as date, + to_char(a.create_date, 'YYYY') as year, + to_char(a.create_date, 'MM') as month, + to_char(a.create_date, 'YYYY-MM-DD') as day, + a.user_id as user_id, + a.name as name, + a.company_id as company_id, + a.currency_id as currency_id, + a.account_id as account_id, + a.general_account_id as general_account_id, + a.journal_id as journal_id, + a.move_id as move_id, + a.product_id as product_id, + a.product_uom_id as product_uom_id, + sum(a.amount) as amount, + sum(a.unit_amount) as unit_amount, + sum(a.amount_currency) as amount_currency + from + account_analytic_line a + group by + a.create_date, a.user_id,a.name,company_id,a.currency_id, + a.account_id,a.general_account_id,a.journal_id, + a.move_id,a.product_id,a.product_uom_id + ) + """) +analytic_entries_report() diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml new file mode 100644 index 00000000000..41d9c0976f2 --- /dev/null +++ b/addons/account/report/account_analytic_entries_report_view.xml @@ -0,0 +1,112 @@ + + + + + analytic.entries.report.tree + analytic.entries.report + tree + + + + + + + + + + + + + + + + + + + + + + + + + analytic.entries.report.search + analytic.entries.report + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + account.analytic.entries.graph + analytic.entries.report + graph + + + + + + + + + + + Analytic Entries + analytic.entries.report + form + tree,graph + {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]} + + + + + + + diff --git a/addons/account/report/account_analytic_report.py b/addons/account/report/account_analytic_report.py index 45057d950bd..87912b4a3ef 100644 --- a/addons/account/report/account_analytic_report.py +++ b/addons/account/report/account_analytic_report.py @@ -35,7 +35,7 @@ class analytic_report(osv.osv): 'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', readonly=True), 'user_id' : fields.many2one('res.users', 'Account Manager',readonly=True), 'product_id' : fields.many2one('product.product', 'Product',readonly=True), - 'quantity': fields.float('Quantity',readonly=True), + 'total_quantity': fields.float('# Total Quantity',readonly=True), 'debit' : fields.float('Debit',readonly=True), 'credit' : fields.float('Credit',readonly=True), 'balance' : fields.float('Balance',readonly=True), @@ -43,6 +43,11 @@ class analytic_report(osv.osv): 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), + 'day': fields.char('Day', size=128, readonly=True), + 'nbr':fields.integer('# of Lines', readonly=True), + 'company_id': fields.many2one('res.company', 'Company', readonly=True), + 'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type'), + 'state': fields.selection([('draft','Draft'), ('open','Open'), ('pending','Pending'), @@ -50,6 +55,7 @@ class analytic_report(osv.osv): ('close','Close'), ('template', 'Template')], 'State', readonly=True), + } _order = 'date_start desc' def init(self, cr): @@ -60,15 +66,18 @@ class analytic_report(osv.osv): min(s.id) as id, to_char(s.create_date, 'YYYY') as year, to_char(s.create_date, 'MM') as month, + to_char(s.create_date, 'YYYY-MM-DD') as day, l.journal_id, l.product_id, s.parent_id, s.date_start, s.date as date_end, s.user_id, + s.company_id, + s.type, s.name, s.partner_id, - s.quantity, + sum(s.quantity) as total_quantity, s.debit, s.credit, s.balance, @@ -77,7 +86,8 @@ class analytic_report(osv.osv): from account_analytic_account s left join account_analytic_line l on (s.id=l.account_id) GROUP BY s.create_date,s.state,l.journal_id,s.name, - s.partner_id,s.date_start,s.date,s.user_id,s.quantity, + s.partner_id,s.date_start,s.date,s.user_id, + s.company_id,s.type, s.debit,s.credit,s.balance,s.parent_id,l.product_id ) """) diff --git a/addons/account/report/account_analytic_report_view.xml b/addons/account/report/account_analytic_report_view.xml index de97bfcb798..838cefe5898 100644 --- a/addons/account/report/account_analytic_report_view.xml +++ b/addons/account/report/account_analytic_report_view.xml @@ -9,23 +9,26 @@ - - - - - - - + + + + + + + + + + - + + - analytic.report.search analytic.report @@ -38,23 +41,15 @@ domain="[('year','=',time.strftime('%%Y'))]"/> + - - - - - - - - - - - - + + + + + + + + + @@ -70,40 +77,59 @@ string="Template" domain="[('state','=','template')]"/> + - - + + + + - - + + + + + + - - + + - + + account.analytic.report.graph + analytic.report + graph + + + + + + + + + + Analytic Accounts analytic.report form - tree - {'search_default_User':1,'search_default_user_id':uid} + tree,graph + {'search_default_This Month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]} - - + diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py new file mode 100644 index 00000000000..85ba8a058f7 --- /dev/null +++ b/addons/account/report/account_entries_report.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import tools +from osv import fields,osv + +class account_entries_report(osv.osv): + _name = "account.entries.report" + _description = "Entries" + _auto = False + _rec_name = 'date' + _columns = { + 'date': fields.date('Effective Date', readonly=True), + 'date_created': fields.date('Date Created', readonly=True), + 'date_maturity': fields.date('Date Maturity', readonly=True), + 'nbr':fields.integer('# of Entries', readonly=True), + 'nbl':fields.integer('# of Lines', readonly=True), + 'amount': fields.float('Amount',readonly=True), + 'year': fields.char('Year', size=4, readonly=True), + 'day': fields.char('Day', size=128, readonly=True), + 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), + ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), + ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), + 'ref': fields.char('Reference', size=64,readonly=True), + 'period_id': fields.many2one('account.period', 'Period', readonly=True), + 'account_id': fields.many2one('account.account', 'Account', readonly=True), + 'journal_id': fields.many2one('account.journal', 'Journal', readonly=True), + 'product_id': fields.many2one('product.product', 'Product', readonly=True), + 'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State',readonly=True, + help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'), + 'state_2': fields.selection([('draft','Draft'), ('valid','Valid')], 'State of Move Line', readonly=True, + help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'), + 'partner_id': fields.many2one('res.partner','Partner', readonly=True), + 'period_id2': fields.many2one('account.period', 'Move Line Period', readonly=True), + 'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True), + 'journal_id2': fields.many2one('account.journal', 'Move Line Journal', readonly=True), + 'type': fields.selection([ + ('pay_voucher','Cash Payment'), + ('bank_pay_voucher','Bank Payment'), + ('rec_voucher','Cash Receipt'), + ('bank_rec_voucher','Bank Receipt'), + ('cont_voucher','Contra'), + ('journal_sale_vou','Journal Sale'), + ('journal_pur_voucher','Journal Purchase'), + ('journal_voucher','Journal Voucher'), + ],'Type',readonly=True), + 'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True), + 'company_id': fields.many2one('res.company', 'Company', readonly=True), + } + _order = 'date desc' + + def init(self, cr): + tools.drop_view_if_exists(cr, 'account_entries_report') + cr.execute(""" + create or replace view account_entries_report as ( + select + min(l.id) as id, + am.ref as ref, + sum(l.quantity) as quantity, + am.state as state, + l.state as state_2, + am.date as date, + count(l.id) as nbr, + count(distinct am.id) as nbl, + l.debit as amount, + to_char(am.date, 'YYYY') as year, + to_char(am.date, 'MM') as month, + to_char(am.date, 'YYYY-MM-DD') as day, + am.company_id as company_id, + l.account_id as account_id, + l.analytic_account_id as analytic_account_id, + l.date_created as date_created, + l.date_maturity as date_maturity, + am.journal_id as journal_id, + l.journal_id as journal_id2, + l.period_id as period_id2, + am.period_id as period_id, + l.partner_id as partner_id, + l.product_id as product_id, + am.type as type + from + account_move_line l + left join + account_move am on (am.id=l.move_id) + group by am.ref, + am.state, + am.date, + am.company_id, + am.journal_id, + l.journal_id, + am.period_id, + l.period_id, + am.type, + l.partner_id, + l.analytic_account_id, + l.product_id, + l.date_created, + l.date_maturity, + l.account_id, + l.state, + l.debit + ) + """) + +account_entries_report() diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml new file mode 100644 index 00000000000..c6308ec9928 --- /dev/null +++ b/addons/account/report/account_entries_report_view.xml @@ -0,0 +1,127 @@ + + + + + account.entries.report.tree + account.entries.report + tree + + + + + + + + + + + + + + + + + + + + + + + + + + + + + account.entries.report.graph + account.entries.report + graph + + + + + + + + + account.entries.report.search + account.entries.report + search + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Entries + account.entries.report + form + tree,graph + {'search_default_This Month':1,'search_default_Journal':1,'group_by_no_leaf':1,'group_by':[]} + + + + + diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 36fa5a0d132..cd1477e79cf 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -61,6 +61,13 @@ class account_invoice_report(osv.osv): ('paid','Done'), ('cancel','Cancelled') ], 'Order State', readonly=True), + 'date_due': fields.date('Due Date', readonly=True), + 'address_contact_id': fields.many2one('res.partner.address', 'Contact Address Name', readonly=True), + 'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address Name', readonly=True), + 'account_id': fields.many2one('account.account', 'Account',readonly=True), + 'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',readonly=True), + 'residual':fields.float('Total Residual', readonly=True), + 'delay_to_pay':fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"), } _order = 'date desc' def init(self, cr): @@ -87,12 +94,24 @@ class account_invoice_report(osv.osv): (sum(l.quantity*l.price_unit)/sum(l.quantity * u.factor))::decimal(16,2) as price_average, count(*) as nbr, s.type as type, - s.state - from + s.state, + s.date_due as date_due, + s.address_contact_id as address_contact_id, + s.address_invoice_id as address_invoice_id, + s.account_id as account_id, + s.partner_bank as partner_bank, + s.residual as residual, + case when s.state != 'paid' then null else + extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2) + end as delay_to_pay + from account_invoice_line l left join account_invoice s on (s.id=l.invoice_id) - left join product_uom u on (u.id=l.uos_id) + left join product_uom u on (u.id=l.uos_id), + account_move_line am left join account_invoice i on (i.move_id=am.move_id) + where + am.account_id=i.account_id group by s.type, s.date_invoice, @@ -101,12 +120,18 @@ class account_invoice_report(osv.osv): l.uos_id, s.user_id, s.state, + s.residual, s.company_id, s.payment_term, s.period_id, s.fiscal_position, s.currency_id, - s.journal_id + s.journal_id, + s.date_due, + s.address_contact_id, + s.address_invoice_id, + s.account_id, + s.partner_bank ) """) account_invoice_report() diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index 5a833e454fb..b974afdb8a3 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -17,7 +17,6 @@ - @@ -27,6 +26,13 @@ + + + + + + + @@ -49,14 +55,14 @@ search - - + - + + help="Invoices of last 30 days"/> + - - - - + + - - - + - - - - - - + + + + + + + + + + + + + + + - - - - + + - - - - - + - - + + + + + + + + - + - + @@ -141,11 +147,11 @@ account.invoice.report form tree,graph - {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]} + {'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[],'search_default_user_id':uid} - + diff --git a/addons/account/report/account_report_view.xml b/addons/account/report/account_report_view.xml index f0f67b477e3..9b1688730aa 100644 --- a/addons/account/report/account_report_view.xml +++ b/addons/account/report/account_report_view.xml @@ -47,7 +47,7 @@ form tree,graph - + @@ -116,7 +116,7 @@ - + report.account.sales.tree @@ -169,7 +169,7 @@ graph,tree - + @@ -237,7 +237,7 @@ graph,tree - + diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml index 2713b665d06..e8e1a7dc84c 100644 --- a/addons/account/report/overdue.rml +++ b/addons/account/report/overdue.rml @@ -84,8 +84,8 @@ + - [[ repeatIn(objects,'o') ]] [[ setLang(o.lang) ]] @@ -177,16 +177,16 @@ [[ line['ref'] ]] - [[ line['date_maturity'] ]] + [[ line['date_maturity'] and formatLang(line['date_maturity'],date=True) or '' ]] - [[ formatLang(line['debit']) and formatLang(line['debit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]] + [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]] - [[ formatLang(line['credit']) and formatLang(line['credit'] * (line['account_id']['type'] == 'payable' and -1 or 1)) ]] + [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]] - [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d')) and ((line['debit'] - line['credit']) * (line['account_id']['type'] == 'payable' and -1 or 1))) ]] + [[ formatLang((line['date_maturity'] < time.strftime('%Y-%m-%d'))) and (line['debit'] - line['credit']) ]] [[ line['blocked'] and 'X' or '' ]] @@ -205,13 +205,13 @@ Sub-Total : - [[ formatLang((reduce(lambda x, y: x + (y['debit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]] - [[ formatLang((reduce(lambda x ,y: x + (y['credit'] * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]] - [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] + [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), filter(lambda x: x['date_maturity'] < time.strftime('%Y-%m-%d'), getLines(o)), 0))) ]] @@ -229,7 +229,7 @@ Balance : - [[ formatLang((reduce(lambda x, y: x +((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] + [[ formatLang((reduce(lambda x, y: x +(y['debit'] - y['credit']), getLines(o), 0))) ]] @@ -248,9 +248,9 @@ - Total amount due: [[ formatLang((reduce(lambda x, y: x + ((y['debit'] - y['credit']) * (y['account_id']['type'] == 'payable' and -1 or 1)), getLines(o), 0))) ]] [[ company.currency_id.name ]]. + Total amount due: [[ formatLang((reduce(lambda x, y: x + (y['debit'] - y['credit']), getLines(o), 0))) ]] [[ company.currency_id.name ]]. - + \ No newline at end of file diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index e1aa3b6510a..7458594d240 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -15,8 +15,8 @@ "access_account_move","account.move","model_account_move","account.group_account_user",1,1,1,1 "access_account_move_line","account.move.line","model_account_move_line","account.group_account_user",1,1,1,1 "access_account_move_reconcile","account.move.reconcile","model_account_move_reconcile","account.group_account_user",1,1,1,1 -"access_account_tax_code","account.tax.code","model_account_tax_code",,1,0,0,0 -"access_account_tax","account.tax","model_account_tax",,1,0,0,0 +"access_account_tax_code","account.tax.code","model_account_tax_code","account.group_account_invoice",1,0,0,0 +"access_account_tax","account.tax","model_account_tax","account.group_account_invoice",1,0,0,0 "access_account_model","account.model","model_account_model","account.group_account_user",1,1,1,1 "access_account_model_line","account.model.line","model_account_model_line","account.group_account_user",1,1,1,1 "access_account_subscription","account.subscription","model_account_subscription","account.group_account_user",1,1,1,1 @@ -93,3 +93,13 @@ "access_report_account_type_sales","report.account_type.sales","model_report_account_type_sales","account.group_account_manager",1,0,0,0 "access_report_account_sales","report.account.sales","model_report_account_sales","account.group_account_manager",1,0,0,0 "access_account_invoice_report","account.invoice.report","model_account_invoice_report","account.group_account_manager",1,0,0,0 +"access_project_account_analytic_line","project.account.analytic.line","model_project_account_analytic_line","account.group_account_manager",1,1,1,1 +"access_account_move_line_reconcile_select","account.move.line.reconcile.select","model_account_move_line_reconcile_select","account.group_account_manager",1,1,1,1 +"access_account_move_line_unreconcile_select","account.move.line.unreconcile.select","model_account_move_line_unreconcile_select","account.group_account_manager",1,1,1,1 +"access_account_invoice_refund","account.invoice.refund","model_account_invoice_refund","account.group_account_manager",1,1,1,1 +"access_account_move_journal","account.move.journal","model_account_move_journal","account.group_account_manager",1,1,1,1 +"access_account_move_bank_reconcile","account.move.bank.reconcile","model_account_move_bank_reconcile","account.group_account_manager",1,1,1,1 +"access_account_subscription_generate","account.subscription.generate","model_account_subscription_generate","account.group_account_manager",1,1,1,1 +"access_account_period_close","account.period.close","model_account_period_close","account.group_account_manager",1,1,1,1 +"access_account_fiscalyear_close_state","account.fiscalyear.close.state","model_account_fiscalyear_close_state","account.group_account_manager",1,1,1,1 +"access_account_chart","account.chart","model_account_chart","account.group_account_manager",1,1,1,1 diff --git a/addons/account/sequence.py b/addons/account/sequence.py index d48f23eb1cf..e23ec1e3def 100644 --- a/addons/account/sequence.py +++ b/addons/account/sequence.py @@ -42,7 +42,7 @@ class ir_sequence(osv.osv): _columns = { 'fiscal_ids' : fields.one2many('account.sequence.fiscalyear', 'sequence_main_id', 'Sequences') } - def get_id(self, cr, uid, sequence_id, test='id', context={}): + def get_id(self, cr, uid, sequence_id, test='id', context={}): cr.execute('select id from ir_sequence where '+test+'=%s and active=%s', (sequence_id, True,)) res = cr.dictfetchone() if res: diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index f7e9d79b27a..506155e1ff1 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -21,6 +21,7 @@ from osv import fields, osv from tools.translate import _ import netsvc +import time class account_invoice_refund(osv.osv_memory): @@ -29,10 +30,14 @@ class account_invoice_refund(osv.osv_memory): _name = "account.invoice.refund" _description = "Invoice Refund" _columns = { - 'date': fields.date('Operation date', required=False), + 'date': fields.date('Operation date', required=False, help='This date will be used as the invoice date for Refund Invoice and Period will be chosen accordingly!'), 'period': fields.many2one('account.period', 'Force period', required=False), 'description': fields.char('Description', size=150, required=True), - } + } + + _defaults = { + 'date': time.strftime('%Y-%m-%d'), + } def compute_refund(self, cr, uid, ids, mode, context=None): """ @@ -167,7 +172,7 @@ class account_invoice_refund(osv.osv_memory): xml_id = 'action_invoice_tree1' elif inv.type == 'in_invoice': xml_id = 'action_invoice_tree2' - elif type == 'out_refund': + elif inv.type == 'out_refund': xml_id = 'action_invoice_tree3' else: xml_id = 'action_invoice_tree4' diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py index 1f745419c5a..be0ebc40677 100644 --- a/addons/account/wizard/account_reconcile.py +++ b/addons/account/wizard/account_reconcile.py @@ -19,7 +19,6 @@ # ############################################################################## import time -import datetime from osv import fields, osv from tools.translate import _ diff --git a/addons/account/wizard/account_unreconcile.py b/addons/account/wizard/account_unreconcile.py index d50994a6f28..c1de3294c79 100644 --- a/addons/account/wizard/account_unreconcile.py +++ b/addons/account/wizard/account_unreconcile.py @@ -29,11 +29,17 @@ class account_unreconcile(osv.osv_memory): obj_move_reconcile = self.pool.get('account.move.reconcile') if context is None: context = {} - recs = obj_move_line.read(cr, uid, context['active_ids'], ['reconcile_id',]) - recs = filter(lambda x: x['reconcile_id'], recs) - rec_ids = [rec['reconcile_id'][0] for rec in recs] - if len(rec_ids): - obj_move_reconcile.unlink(cr, uid, rec_ids) + recs = pool.get('account.move.line').read(cr, uid, data['ids'], ['reconcile_id','reconcile_partial_id']) + unlink_ids = [] + full_recs = filter(lambda x: x['reconcile_id'], recs) + rec_ids = [rec['reconcile_id'][0] for rec in full_recs] + part_recs = filter(lambda x: x['reconcile_partial_id'], recs) + part_rec_ids = [rec['reconcile_partial_id'][0] for rec in part_recs] + unlink_ids += rec_ids + unlink_ids += part_rec_ids + + if len(unlink_ids): + pooler.get_pool(cr.dbname).get('account.move.reconcile').unlink(cr, uid, unlink_ids) return {} account_unreconcile() @@ -44,10 +50,11 @@ class account_unreconcile_reconcile(osv.osv_memory): def trans_unrec_reconcile(self, cr, uid, ids, context=None): obj_move_reconcile = self.pool.get('account.move.reconcile') + rec_ids = context['active_ids'] if context is None: context = {} if len(rec_ids): - obj_move_reconcile.unlink(cr, uid, context['active_ids']) + obj_move_reconcile.unlink(cr, uid, rec_ids) return {} account_unreconcile_reconcile() diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 7e4807a3f81..742ef74cc84 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -393,7 +393,7 @@ account_analytic_account() class account_analytic_account_summary_user(osv.osv): _name = "account_analytic_analysis.summary.user" - _description = "Hours summary by user" + _description = "Hours Summary by User" _order='user' _auto = False _rec_name = 'user' diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py index ab81e7d88fc..84fd933d9a9 100644 --- a/addons/account_analytic_default/account_analytic_default.py +++ b/addons/account_analytic_default/account_analytic_default.py @@ -25,7 +25,7 @@ import time class account_analytic_default(osv.osv): _name = 'account.analytic.default' - _description = 'Analytic Distributions' + _description = 'Analytic Distribution' _rec_name = 'analytic_id' _order = 'sequence' _columns = { @@ -69,7 +69,7 @@ account_analytic_default() class account_invoice_line(osv.osv): _inherit = 'account.invoice.line' - _description = 'account invoice line' + _description = 'Invoice Line' def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}): res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context) @@ -103,6 +103,8 @@ class sale_order_line(osv.osv): # Method overridden to set the analytic account by default on criterion match def invoice_line_create(self, cr, uid, ids, context={}): create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context) + if not ids: + return create_ids sale_line_obj = self.browse(cr, uid, ids[0], context) pool_inv_line = self.pool.get('account.invoice.line') diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 57acdb6dee5..db441d0931f 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -54,7 +54,7 @@ class one2many_mod2(fields.one2many): class account_analytic_plan(osv.osv): _name = "account.analytic.plan" - _description = "Analytic Plans" + _description = "Analytic Plan" _columns = { 'name': fields.char('Analytic Plan', size=64, required=True, select=True,), 'plan_ids': fields.one2many('account.analytic.plan.line','plan_id','Analytic Plans'), @@ -63,7 +63,7 @@ account_analytic_plan() class account_analytic_plan_line(osv.osv): _name = "account.analytic.plan.line" - _description = "Analytic Plan Lines" + _description = "Analytic Plan Line" _columns = { 'plan_id':fields.many2one('account.analytic.plan','Analytic Plan'), 'name': fields.char('Plan Name', size=64, required=True, select=True), @@ -297,14 +297,15 @@ class account_move_line(osv.osv): def create_analytic_lines(self, cr, uid, ids, context={}): super(account_move_line, self).create_analytic_lines(cr, uid, ids, context) + analytic_line_obj = self.pool.get('account.analytic.line') for line in self.browse(cr, uid, ids, context): if line.analytics_id: if not line.journal_id.analytic_journal_id: raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (line.journal_id.name,)) - toremove = self.pool.get('account.analytic.line').search(cr, uid, [('move_id','=',line.id)], context=context) + toremove = analytic_line_obj.search(cr, uid, [('move_id','=',line.id)], context=context) if toremove: - line.unlink(cr, uid, toremove, context=context) + analytic_line_obj.unlink(cr, uid, toremove, context=context) for line2 in line.analytics_id.account_ids: val = (line.credit or 0.0) - (line.debit or 0.0) amt=val * (line2.rate/100) @@ -321,7 +322,7 @@ class account_move_line(osv.osv): 'journal_id': line.journal_id.analytic_journal_id.id, 'ref': line.ref, } - ali_id=self.pool.get('account.analytic.line').create(cr,uid,al_vals) + ali_id=analytic_line_obj.create(cr, uid, al_vals, context=context) return True account_move_line() diff --git a/addons/account_anglo_saxon/purchase.py b/addons/account_anglo_saxon/purchase.py index 98694a3d5dd..ac2dffbfd22 100644 --- a/addons/account_anglo_saxon/purchase.py +++ b/addons/account_anglo_saxon/purchase.py @@ -24,7 +24,7 @@ from osv import fields, osv class purchase_order(osv.osv): _name = "purchase.order" _inherit = "purchase.order" - _description = "Purchase order" + _description = "Purchase Order" def inv_line_create(self, cr, uid, a, ol): line = super(purchase_order, self).inv_line_create(cr, uid, a, ol) @@ -37,5 +37,4 @@ class purchase_order(osv.osv): a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa) line[2].update({'account_id': a}) return line -purchase_order() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +purchase_order() diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py index 0fdb10c89a6..0e2ef2a363d 100644 --- a/addons/account_budget/crossovered_budget.py +++ b/addons/account_budget/crossovered_budget.py @@ -239,7 +239,7 @@ class crossovered_budget_lines(osv.osv): res[line.id]=0.00 return res _name="crossovered.budget.lines" - _description = "Budget Lines" + _description = "Budget Line" _columns = { 'crossovered_budget_id': fields.many2one('crossovered.budget', 'Budget', ondelete='cascade', select=True, required=True), 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account',required=True), diff --git a/addons/account_budget/i18n/oc.po b/addons/account_budget/i18n/oc.po new file mode 100644 index 00000000000..07ca10ef7d0 --- /dev/null +++ b/addons/account_budget/i18n/oc.po @@ -0,0 +1,486 @@ +# Occitan (post 1500) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-05-18 08:42+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) \n" +"Language-Team: Occitan (post 1500) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-19 05:12+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: account_budget +#: field:crossovered.budget,creating_user_id:0 +msgid "Responsible User" +msgstr "" + +#. module: account_budget +#: rml:account.budget:0 +msgid "% performance" +msgstr "" + +#. module: account_budget +#: model:ir.actions.act_window,name:account_budget.open_budget_post_form +#: model:ir.ui.menu,name:account_budget.menu_budget_post_form +msgid "Budgetary Positions" +msgstr "" + +#. module: account_budget +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "Nom del Modèl invalid per la definicion de l'accion." + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "Printed at:" +msgstr "" + +#. module: account_budget +#: view:crossovered.budget:0 +msgid "Confirm" +msgstr "Confirmar" + +#. module: account_budget +#: field:crossovered.budget,validating_user_id:0 +msgid "Validate User" +msgstr "" + +#. module: account_budget +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs " +"especials !" + +#. module: account_budget +#: selection:crossovered.budget,state:0 +msgid "Confirmed" +msgstr "" + +#. module: account_budget +#: field:account.budget.post.dotation,period_id:0 +msgid "Period" +msgstr "Periòde" + +#. module: account_budget +#: wizard_field:account.budget.report,init,date2:0 +#: wizard_field:wizard.analytic.account.budget.report,init,date_to:0 +#: wizard_field:wizard.crossovered.budget,init,date_to:0 +#: wizard_field:wizard.crossovered.budget.summary,init,date_to:0 +msgid "End of period" +msgstr "" + +#. module: account_budget +#: rml:account.budget:0 +msgid "Printing date:" +msgstr "" + +#. module: account_budget +#: selection:crossovered.budget,state:0 +msgid "Draft" +msgstr "Borrolhon" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "at" +msgstr "a" + +#. module: account_budget +#: view:account.budget.post:0 +msgid "Dotations" +msgstr "" + +#. module: account_budget +#: rml:account.budget:0 +msgid "Performance" +msgstr "Performància" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "Currency:" +msgstr "Devisa :" + +#. module: account_budget +#: rml:account.budget:0 +msgid "From" +msgstr "De" + +#. module: account_budget +#: field:crossovered.budget.lines,percentage:0 +msgid "Percentage" +msgstr "Percentatge" + +#. module: account_budget +#: rml:account.budget:0 +msgid "Results" +msgstr "Resultats" + +#. module: account_budget +#: field:crossovered.budget,state:0 +msgid "Status" +msgstr "Estat" + +#. module: account_budget +#: model:ir.module.module,description:account_budget.module_meta_information +msgid "" +"This module allows accountants to manage analytic and crossovered budgets.\n" +"\n" +"Once the Master Budgets and the Budgets defined (in Financial\n" +"Management/Budgets/), the Project Managers can set the planned amount on " +"each\n" +"Analytic Account.\n" +"\n" +"The accountant has the possibility to see the total of amount planned for " +"each\n" +"Budget and Master Budget in order to ensure the total planned is not\n" +"greater/lower than what he planned for this Budget/Master Budget. Each list " +"of\n" +"record can also be switched to a graphical view of it.\n" +"\n" +"Three reports are available:\n" +" 1. The first is available from a list of Budgets. It gives the " +"spreading, for these Budgets, of the Analytic Accounts per Master Budgets.\n" +"\n" +" 2. The second is a summary of the previous one, it only gives the " +"spreading, for the selected Budgets, of the Analytic Accounts.\n" +"\n" +" 3. The last one is available from the Analytic Chart of Accounts. It " +"gives the spreading, for the selected Analytic Accounts, of the Master " +"Budgets per Budgets.\n" +"\n" +msgstr "" + +#. module: account_budget +#: rml:account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "%" +msgstr "%" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "Description" +msgstr "Descripcion" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +msgid "Analytic Account :" +msgstr "Compte Analitic :" + +#. module: account_budget +#: wizard_button:account.budget.report,init,report:0 +#: wizard_button:wizard.analytic.account.budget.report,init,report:0 +#: wizard_button:wizard.crossovered.budget,init,report:0 +#: wizard_button:wizard.crossovered.budget.summary,init,report:0 +msgid "Print" +msgstr "Estampar" + +#. module: account_budget +#: rml:account.budget:0 +msgid "A/c No." +msgstr "" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "to" +msgstr "a" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "Total :" +msgstr "Total :" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: field:crossovered.budget.lines,planned_amount:0 +#: rml:crossovered.budget.report:0 +msgid "Planned Amount" +msgstr "" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "Perc(%)" +msgstr "" + +#. module: account_budget +#: rml:account.budget:0 +msgid "Period Budget" +msgstr "" + +#. module: account_budget +#: rml:account.budget:0 +msgid "Budget Analysis" +msgstr "" + +#. module: account_budget +#: view:crossovered.budget:0 +#: selection:crossovered.budget,state:0 +msgid "Done" +msgstr "Acabat" + +#. module: account_budget +#: view:crossovered.budget:0 +msgid "Validate" +msgstr "Validar" + +#. module: account_budget +#: wizard_view:wizard.crossovered.budget,init:0 +#: wizard_view:wizard.crossovered.budget.summary,init:0 +msgid "Select Options" +msgstr "" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: field:crossovered.budget.lines,practical_amount:0 +#: rml:crossovered.budget.report:0 +msgid "Practical Amount" +msgstr "" + +#. module: account_budget +#: field:crossovered.budget,date_to:0 +#: field:crossovered.budget.lines,date_to:0 +msgid "End Date" +msgstr "Data de fin" + +#. module: account_budget +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalid per l'arquitectura de la vista" + +#. module: account_budget +#: field:crossovered.budget.lines,theoritical_amount:0 +msgid "Theoritical Amount" +msgstr "" + +#. module: account_budget +#: field:account.budget.post,name:0 +#: field:account.budget.post.dotation,name:0 +#: field:crossovered.budget,name:0 +msgid "Name" +msgstr "Nom" + +#. module: account_budget +#: model:ir.actions.wizard,name:account_budget.wizard_crossovered_budget_menu_1 +msgid "Print Summary of Budgets" +msgstr "" + +#. module: account_budget +#: model:ir.actions.wizard,name:account_budget.wizard_budget_spread +msgid "Spread amount" +msgstr "" + +#. module: account_budget +#: view:account.analytic.account:0 +#: view:account.budget.post:0 +msgid "Lines" +msgstr "Linhas" + +#. module: account_budget +#: rml:account.budget:0 +#: view:crossovered.budget:0 +#: field:crossovered.budget.lines,crossovered_budget_id:0 +#: model:ir.actions.act_window,name:account_budget.act_crossovered_budget_view +#: model:ir.actions.wizard,name:account_budget.wizard_budget_report +#: model:ir.model,name:account_budget.model_crossovered_budget +#: model:ir.ui.menu,name:account_budget.menu_act_crossovered_budget_view +msgid "Budget" +msgstr "Budgèt" + +#. module: account_budget +#: field:account.budget.post.dotation,post_id:0 +msgid "Item" +msgstr "Element" + +#. module: account_budget +#: field:account.budget.post.dotation,amount:0 +#: wizard_field:account.budget.spread,init,amount:0 +msgid "Amount" +msgstr "Soma" + +#. module: account_budget +#: field:crossovered.budget.lines,paid_date:0 +msgid "Paid Date" +msgstr "" + +#. module: account_budget +#: model:ir.actions.act_window,name:account_budget.action_account_budget_post_tree +#: model:ir.ui.menu,name:account_budget.menu_action_account_budget_post_tree +#: model:ir.ui.menu,name:account_budget.next_id_31 +msgid "Budgets" +msgstr "" + +#. module: account_budget +#: selection:crossovered.budget,state:0 +msgid "Cancelled" +msgstr "Anullat" + +#. module: account_budget +#: view:account.budget.post.dotation:0 +#: model:ir.model,name:account_budget.model_account_budget_post_dotation +msgid "Budget Dotation" +msgstr "" + +#. module: account_budget +#: view:account.budget.post.dotation:0 +msgid "Budget Dotations" +msgstr "" + +#. module: account_budget +#: rml:account.budget:0 +msgid "Budget Item Detail" +msgstr "" + +#. module: account_budget +#: view:account.budget.post:0 +#: field:crossovered.budget.lines,general_budget_id:0 +#: model:ir.model,name:account_budget.model_account_budget_post +msgid "Budgetary Position" +msgstr "" + +#. module: account_budget +#: wizard_field:account.budget.report,init,date1:0 +#: wizard_field:wizard.analytic.account.budget.report,init,date_from:0 +#: wizard_field:wizard.crossovered.budget,init,date_from:0 +#: wizard_field:wizard.crossovered.budget.summary,init,date_from:0 +msgid "Start of period" +msgstr "" + +#. module: account_budget +#: model:ir.actions.report.xml,name:account_budget.account_analytic_account_budget +#: model:ir.actions.report.xml,name:account_budget.report_crossovered_budget +#: model:ir.actions.wizard,name:account_budget.account_analytic_account_budget_report +#: model:ir.actions.wizard,name:account_budget.wizard_crossovered_budget_menu +msgid "Print Budgets" +msgstr "" + +#. module: account_budget +#: field:account.budget.post,code:0 +#: field:crossovered.budget,code:0 +msgid "Code" +msgstr "Còde" + +#. module: account_budget +#: field:account.budget.post.dotation,tot_planned:0 +msgid "Total Planned Amount" +msgstr "" + +#. module: account_budget +#: wizard_view:wizard.analytic.account.budget.report,init:0 +msgid "Select Dates Period" +msgstr "" + +#. module: account_budget +#: field:account.budget.post,dotation_ids:0 +msgid "Spreading" +msgstr "" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "Theoretical Amount" +msgstr "" + +#. module: account_budget +#: wizard_field:account.budget.spread,init,fiscalyear:0 +msgid "Fiscal Year" +msgstr "" + +#. module: account_budget +#: field:crossovered.budget.lines,analytic_account_id:0 +msgid "Analytic Account" +msgstr "Compte Analitic" + +#. module: account_budget +#: rml:crossovered.budget.report:0 +msgid "Budget :" +msgstr "Budgèt :" + +#. module: account_budget +#: rml:account.budget:0 +#: view:account.budget.post:0 +#: wizard_view:account.budget.spread,init:0 +#: wizard_button:account.budget.spread,init,spread:0 +msgid "Spread" +msgstr "Difusir" + +#. module: account_budget +#: view:account.budget.post:0 +#: field:account.budget.post,account_ids:0 +msgid "Accounts" +msgstr "Comptes" + +#. module: account_budget +#: model:ir.actions.report.xml,name:account_budget.account_budget +msgid "Print Budget" +msgstr "" + +#. module: account_budget +#: view:account.analytic.account:0 +#: field:account.analytic.account,crossovered_budget_line:0 +#: view:account.budget.post:0 +#: field:account.budget.post,crossovered_budget_line:0 +#: view:crossovered.budget:0 +#: field:crossovered.budget,crossovered_budget_line:0 +#: view:crossovered.budget.lines:0 +#: model:ir.actions.act_window,name:account_budget.act_account_analytic_account_cb_lines +#: model:ir.actions.act_window,name:account_budget.act_crossovered_budget_lines_view +#: model:ir.model,name:account_budget.model_crossovered_budget_lines +#: model:ir.ui.menu,name:account_budget.menu_act_crossovered_budget_lines_view +msgid "Budget Lines" +msgstr "" + +#. module: account_budget +#: wizard_button:account.budget.report,init,end:0 +#: wizard_button:account.budget.spread,init,end:0 +#: view:crossovered.budget:0 +#: wizard_button:wizard.analytic.account.budget.report,init,end:0 +#: wizard_button:wizard.crossovered.budget,init,end:0 +#: wizard_button:wizard.crossovered.budget.summary,init,end:0 +msgid "Cancel" +msgstr "Anullar" + +#. module: account_budget +#: model:ir.module.module,shortdesc:account_budget.module_meta_information +msgid "Budget Management" +msgstr "" + +#. module: account_budget +#: field:crossovered.budget,date_from:0 +#: field:crossovered.budget.lines,date_from:0 +msgid "Start Date" +msgstr "Data de començament" + +#. module: account_budget +#: rml:account.analytic.account.budget:0 +#: rml:crossovered.budget.report:0 +msgid "Analysis from" +msgstr "" + +#. module: account_budget +#: selection:crossovered.budget,state:0 +msgid "Validated" +msgstr "" + +#. module: account_budget +#: wizard_view:account.budget.report,init:0 +msgid "Select period" +msgstr "Seleccionatz un periòde" diff --git a/addons/account_chart/i18n/th.po b/addons/account_chart/i18n/th.po new file mode 100644 index 00000000000..e53bfc9b6c2 --- /dev/null +++ b/addons/account_chart/i18n/th.po @@ -0,0 +1,23 @@ +# Thai translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-05-20 04:33+0000\n" +"Last-Translator: Songpon Phusing \n" +"Language-Team: Thai \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-21 03:38+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: account_chart +#: model:ir.module.module,description:account_chart.module_meta_information +msgid "Remove minimal account chart" +msgstr "ทำการลบตัวอย่างผังบัญชีแบบง่าย" diff --git a/addons/account_coda/__init__.py b/addons/account_coda/__init__.py new file mode 100644 index 00000000000..af866f5dc70 --- /dev/null +++ b/addons/account_coda/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import coda +import wizard +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_coda/__openerp__.py b/addons/account_coda/__openerp__.py new file mode 100644 index 00000000000..306098d137b --- /dev/null +++ b/addons/account_coda/__openerp__.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +{ + "name":"Account CODA - import bank statements from coda file", + "version":"1.0", + "author":"Tiny", + "category":"Account CODA", + "description":"""Module provides functionality to import + bank statements from coda files. + """, + "depends":["base", "account"], + "demo_xml":["coda_demo.xml"], + "init_xml":[], + "update_xml" : ["security/ir.model.access.csv","coda_wizard.xml","coda_view.xml"], + "active":False, + "installable":True, + +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_coda/coda.py b/addons/account_coda/coda.py new file mode 100644 index 00000000000..f37b563c245 --- /dev/null +++ b/addons/account_coda/coda.py @@ -0,0 +1,50 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import time +from osv import osv,fields + +class account_coda(osv.osv): + _name = "account.coda" + _description = "coda for an Account" + _columns = { + 'name': fields.binary('Coda file', readonly=True), + 'statement_ids': fields.one2many('account.bank.statement','coda_id','Generated Bank Statement', readonly=True), + 'note': fields.text('Import log', readonly=True), + 'journal_id': fields.many2one('account.journal','Bank Journal', readonly=True,select=True), + 'date': fields.date('Import Date', readonly=True,select=True), + 'user_id': fields.many2one('res.users','User', readonly=True, select=True), + } + _defaults = { + 'date': lambda *a: time.strftime('%Y-%m-%d'), + 'user_id': lambda self,cr,uid,context: uid, + } +account_coda() + +class account_bank_statement(osv.osv): + _inherit = "account.bank.statement" + _columns = { + 'coda_id':fields.many2one('account.coda','Coda'), + } +account_bank_statement() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_coda/coda_demo.xml b/addons/account_coda/coda_demo.xml new file mode 100644 index 00000000000..f91d34d4cbc --- /dev/null +++ b/addons/account_coda/coda_demo.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/addons/account_coda/coda_view.xml b/addons/account_coda/coda_view.xml new file mode 100644 index 00000000000..3813fe40bf0 --- /dev/null +++ b/addons/account_coda/coda_view.xml @@ -0,0 +1,63 @@ + + + + + + account.coda.form + account.coda + form + +
+ + + + + + + + + + + + + + +
+ + + + account.coda.tree + account.coda + tree + + + + + + + + + + + Coda import + ir.actions.act_window + account.coda + form + tree,form + + + + + + + + +
+
diff --git a/addons/account_coda/coda_wizard.xml b/addons/account_coda/coda_wizard.xml new file mode 100644 index 00000000000..ecd8eb65913 --- /dev/null +++ b/addons/account_coda/coda_wizard.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/addons/account_coda/i18n/account_coda.pot b/addons/account_coda/i18n/account_coda.pot new file mode 100644 index 00000000000..348fb035c0d --- /dev/null +++ b/addons/account_coda/i18n/account_coda.pot @@ -0,0 +1,163 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_coda +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-11-24 13:11:29+0000\n" +"PO-Revision-Date: 2009-11-24 13:11:29+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_coda +#: field:account.coda,journal_id:0 +#: wizard_field:account.coda_import,init,journal_id:0 +msgid "Bank Journal" +msgstr "" + +#. module: account_coda +#: constraint:ir.model:0 +msgid "The Object name must start with x_ and not contain any special character !" +msgstr "" + +#. module: account_coda +#: wizard_field:account.coda_import,extraction,note:0 +msgid "Log" +msgstr "" + +#. module: account_coda +#: wizard_button:account.coda_import,extraction,open:0 +msgid "_Open Statement" +msgstr "" + +#. module: account_coda +#: model:ir.module.module,shortdesc:account_coda.module_meta_information +msgid "Account CODA" +msgstr "" + +#. module: account_coda +#: field:account.coda,name:0 +msgid "Coda file" +msgstr "" + +#. module: account_coda +#: wizard_view:account.coda_import,init:0 +msgid "Clic on 'New' to select your file :" +msgstr "" + +#. module: account_coda +#: model:ir.actions.wizard,name:account_coda.wizard_account_coda_import +msgid "Import Coda File" +msgstr "" + +#. module: account_coda +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "" + +#. module: account_coda +#: field:account.coda,note:0 +msgid "Import log" +msgstr "" + +#. module: account_coda +#: wizard_field:account.coda_import,init,def_receivable:0 +msgid "Default receivable Account" +msgstr "" + +#. module: account_coda +#: model:ir.module.module,description:account_coda.module_meta_information +msgid "Module provides functionality to import\n" +" bank statements from .csv file.\n" +" Import coda file wizard is used to import bank statements." +msgstr "" + +#. module: account_coda +#: wizard_button:account.coda_import,extraction,end:0 +msgid "_Close" +msgstr "" + +#. module: account_coda +#: field:account.coda,statement_id:0 +msgid "Generated Bank Statement" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +#: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement +#: model:ir.actions.act_window,name:account_coda.action_account_coda +msgid "Coda import" +msgstr "" + +#. module: account_coda +#: field:account.coda,user_id:0 +msgid "User" +msgstr "" + +#. module: account_coda +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: account_coda +#: model:ir.model,name:account_coda.model_account_coda +msgid "coda for an Account" +msgstr "" + +#. module: account_coda +#: wizard_field:account.coda_import,init,def_payable:0 +msgid "Default Payable Account" +msgstr "" + +#. module: account_coda +#: model:ir.ui.menu,name:account_coda.menu_account_coda +msgid "Coda Statements" +msgstr "" + +#. module: account_coda +#: model:ir.ui.menu,name:account_coda.menu_account_coda_wizard +msgid "Import Coda Statements" +msgstr "" + +#. module: account_coda +#: wizard_button:account.coda_import,init,extraction:0 +msgid "_Ok" +msgstr "" + +#. module: account_coda +#: wizard_view:account.coda_import,extraction:0 +#: wizard_view:account.coda_import,init:0 +msgid "Import Coda Statement" +msgstr "" + +#. module: account_coda +#: field:account.bank.statement,coda_id:0 +msgid "Coda" +msgstr "" + +#. module: account_coda +#: wizard_view:account.coda_import,extraction:0 +msgid "Results :" +msgstr "" + +#. module: account_coda +#: wizard_field:account.coda_import,init,coda:0 +msgid "Coda File" +msgstr "" + +#. module: account_coda +#: field:account.coda,date:0 +msgid "Import Date" +msgstr "" + +#. module: account_coda +#: wizard_view:account.coda_import,init:0 +msgid "Select your bank journal :" +msgstr "" + diff --git a/addons/account_coda/i18n/fr_BE.po b/addons/account_coda/i18n/fr_BE.po new file mode 100644 index 00000000000..348fb035c0d --- /dev/null +++ b/addons/account_coda/i18n/fr_BE.po @@ -0,0 +1,163 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_coda +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-11-24 13:11:29+0000\n" +"PO-Revision-Date: 2009-11-24 13:11:29+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_coda +#: field:account.coda,journal_id:0 +#: wizard_field:account.coda_import,init,journal_id:0 +msgid "Bank Journal" +msgstr "" + +#. module: account_coda +#: constraint:ir.model:0 +msgid "The Object name must start with x_ and not contain any special character !" +msgstr "" + +#. module: account_coda +#: wizard_field:account.coda_import,extraction,note:0 +msgid "Log" +msgstr "" + +#. module: account_coda +#: wizard_button:account.coda_import,extraction,open:0 +msgid "_Open Statement" +msgstr "" + +#. module: account_coda +#: model:ir.module.module,shortdesc:account_coda.module_meta_information +msgid "Account CODA" +msgstr "" + +#. module: account_coda +#: field:account.coda,name:0 +msgid "Coda file" +msgstr "" + +#. module: account_coda +#: wizard_view:account.coda_import,init:0 +msgid "Clic on 'New' to select your file :" +msgstr "" + +#. module: account_coda +#: model:ir.actions.wizard,name:account_coda.wizard_account_coda_import +msgid "Import Coda File" +msgstr "" + +#. module: account_coda +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "" + +#. module: account_coda +#: field:account.coda,note:0 +msgid "Import log" +msgstr "" + +#. module: account_coda +#: wizard_field:account.coda_import,init,def_receivable:0 +msgid "Default receivable Account" +msgstr "" + +#. module: account_coda +#: model:ir.module.module,description:account_coda.module_meta_information +msgid "Module provides functionality to import\n" +" bank statements from .csv file.\n" +" Import coda file wizard is used to import bank statements." +msgstr "" + +#. module: account_coda +#: wizard_button:account.coda_import,extraction,end:0 +msgid "_Close" +msgstr "" + +#. module: account_coda +#: field:account.coda,statement_id:0 +msgid "Generated Bank Statement" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +#: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement +#: model:ir.actions.act_window,name:account_coda.action_account_coda +msgid "Coda import" +msgstr "" + +#. module: account_coda +#: field:account.coda,user_id:0 +msgid "User" +msgstr "" + +#. module: account_coda +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: account_coda +#: model:ir.model,name:account_coda.model_account_coda +msgid "coda for an Account" +msgstr "" + +#. module: account_coda +#: wizard_field:account.coda_import,init,def_payable:0 +msgid "Default Payable Account" +msgstr "" + +#. module: account_coda +#: model:ir.ui.menu,name:account_coda.menu_account_coda +msgid "Coda Statements" +msgstr "" + +#. module: account_coda +#: model:ir.ui.menu,name:account_coda.menu_account_coda_wizard +msgid "Import Coda Statements" +msgstr "" + +#. module: account_coda +#: wizard_button:account.coda_import,init,extraction:0 +msgid "_Ok" +msgstr "" + +#. module: account_coda +#: wizard_view:account.coda_import,extraction:0 +#: wizard_view:account.coda_import,init:0 +msgid "Import Coda Statement" +msgstr "" + +#. module: account_coda +#: field:account.bank.statement,coda_id:0 +msgid "Coda" +msgstr "" + +#. module: account_coda +#: wizard_view:account.coda_import,extraction:0 +msgid "Results :" +msgstr "" + +#. module: account_coda +#: wizard_field:account.coda_import,init,coda:0 +msgid "Coda File" +msgstr "" + +#. module: account_coda +#: field:account.coda,date:0 +msgid "Import Date" +msgstr "" + +#. module: account_coda +#: wizard_view:account.coda_import,init:0 +msgid "Select your bank journal :" +msgstr "" + diff --git a/addons/account_coda/security/ir.model.access.csv b/addons/account_coda/security/ir.model.access.csv new file mode 100644 index 00000000000..9c1e0a486dc --- /dev/null +++ b/addons/account_coda/security/ir.model.access.csv @@ -0,0 +1,3 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_account_coda","account.coda","model_account_coda","account.group_account_user",1,0,0,0 +"access_account_coda_manager","account.coda","model_account_coda","account.group_account_manager",1,1,1,1 \ No newline at end of file diff --git a/addons/account_coda/statement_coda.txt b/addons/account_coda/statement_coda.txt new file mode 100644 index 00000000000..44fe70220ca --- /dev/null +++ b/addons/account_coda/statement_coda.txt @@ -0,0 +1,10 @@ +0000006060712505 00000CPH CODA TINY 0047747270100477472701 00000 1 +1 049126201326907 EUR0BE 0000000015632900050607TINY COMPTE COURANT ORDINAIRE 049 +2100010000 0000000001150000060607001500000INVOICE OF 2006-12-19 0606070020100 +2200010000 EUR000000001150000 100 +2300010000301915554082 PROLIBRE SARL CAROUGE GE 000 +2100020000 0000000000500000060607001500000CONTRACT PARTNER ERREUR ECART YEA 0606070030100 +2200020000RTY CONTRACT PARTNER EUR000000000500000 100 +2300020000050000000017 SEDNACOM 43 ALLEE DES FOUGERES 9522 0 HERBLAY 000 +8049126201326907 0000000017282900060607 +9 000008000000000000000000000001650000 2 diff --git a/addons/account_coda/wizard/__init__.py b/addons/account_coda/wizard/__init__.py new file mode 100644 index 00000000000..72d3b950cf7 --- /dev/null +++ b/addons/account_coda/wizard/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import coda_import + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/account_coda/wizard/coda_import.py b/addons/account_coda/wizard/coda_import.py new file mode 100644 index 00000000000..5e1ffa365e8 --- /dev/null +++ b/addons/account_coda/wizard/coda_import.py @@ -0,0 +1,339 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import pooler +import time +import datetime +import wizard +import netsvc +import base64 +from osv import osv +from tools.translate import _ + +codawiz_form = """ +
+ + + + + + + + + +""" + +codawiz_fields = { + 'journal_id' : { + 'string':'Bank Journal', + 'type':'many2one', + 'relation':'account.journal', + 'required':True, + + }, + 'coda' : { + 'string':'Coda File', + 'type':'binary', + 'required':True, + }, + 'def_payable' : { + 'string' : 'Default Payable Account', + 'type' : 'many2one', + 'relation': 'account.account', + 'required':True, + 'domain':[('type','=','payable')], + 'help': 'Set here the payable account that will be used, by default, if the partner is not found', + }, + 'def_receivable' : { + 'string' : 'Default receivable Account', + 'type' : 'many2one', + 'relation': 'account.account', + 'required':True, + 'domain':[('type','=','receivable')], + 'help': 'Set here the receivable account that will be used, by default, if the partner is not found', + }, + 'awaiting_account' : { + 'string' : 'Default Account for Unrecognized Movement', + 'type' : 'many2one', + 'relation': 'account.account', + 'required':True, + 'help': 'Set here the default account that will be used, if the partner is found but does not have the bank account , or if he is domiciled', + + } + +} + +result_form = """ +
+ + + +""" + +result_fields = { + + 'note' : {'string':'Log','type':'text'} + +} + + +def _coda_parsing(self, cr, uid, data, context): + pool = pooler.get_pool(cr.dbname) + codafile = data['form']['coda'] + journal_code = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context).code + def_pay_acc = data['form']['def_payable'] + def_rec_acc = data['form']['def_receivable'] + + str_log = "" + err_log = "Errors:\n------\n" + nb_err=0 + std_log='' + str_log1 = "Coda File is Imported : " + str_not='' + str_not1='' + + bank_statements=[] + recordlist = base64.decodestring(codafile).split('\n') + recordlist.pop() + for line in recordlist: + if line[0] == '0': + # header data + bank_statement = {} + bank_statement["bank_statement_line"]={} + bank_statement_lines = {} + bank_statement['date'] = str2date(line[5:11]) + bank_statement['journal_id']=data['form']['journal_id'] + period_id = pool.get('account.period').search(cr,uid,[('date_start','<=',time.strftime('%Y-%m-%d',time.strptime(bank_statement['date'],"%y/%m/%d"))),('date_stop','>=',time.strftime('%Y-%m-%d',time.strptime(bank_statement['date'],"%y/%m/%d")))]) + bank_statement['period_id'] = period_id[0] + bank_statement['state']='draft' + elif line[0] == '1': + # old balance data + bal_start = list2float(line[43:58]) + if line[42] == '1': + bal_start = - bal_start + bank_statement["balance_start"]= bal_start + bank_statement["acc_number"]=line[5:17] + bank_statement["acc_holder"]=line[64:90] + bank_statement['name'] = journal_code + ' ' + str(line[2:5]) + + elif line[0]=='2': + # movement data record 2 + if line[1]=='1': + # movement data record 2.1 + if bank_statement_lines.has_key(line[2:6]): + continue + st_line = {} + st_line['extra_note'] = '' + st_line['statement_id']=0 + st_line['ref'] = line[2:10] + st_line['date'] = time.strftime('%Y-%m-%d',time.strptime(str2date(line[115:121]),"%y/%m/%d")), + st_line_amt = list2float(line[32:47]) + + if line[61]=='1': + st_line['toreconcile'] = True + st_line['name']=line[65:77] + else: + st_line['toreconcile'] = False + st_line['name']=line[62:115] + + st_line['free_comm'] = st_line['name'] + st_line['val_date']=time.strftime('%Y-%m-%d',time.strptime(str2date(line[47:53]),"%y/%m/%d")), + st_line['entry_date']=time.strftime('%Y-%m-%d',time.strptime(str2date(line[115:121]),"%y/%m/%d")), + st_line['partner_id']=0 + if line[31] == '1': + st_line_amt = - st_line_amt + st_line['account_id'] = def_pay_acc + else: + st_line['account_id'] = def_rec_acc + st_line['amount'] = st_line_amt + bank_statement_lines[line[2:6]]=st_line + bank_statement["bank_statement_line"]=bank_statement_lines + elif line[1] == '2': + st_line_name = line[2:6] + bank_statement_lines[st_line_name].update({'account_id': data['form']['awaiting_account']}) + + elif line[1] == '3': + # movement data record 3.1 + st_line_name = line[2:6] + st_line_partner_acc = str(line[10:47]).strip() + cntry_number=line[10:47].strip() + contry_name=line[47:125].strip() + bank_ids = pool.get('res.partner.bank').search(cr,uid,[('acc_number','=',st_line_partner_acc)]) + bank_statement_lines[st_line_name].update({'cntry_number': cntry_number, 'contry_name': contry_name}) + if bank_ids: + bank = pool.get('res.partner.bank').browse(cr,uid,bank_ids[0],context) + if line and bank.partner_id: + bank_statement_lines[st_line_name].update({'partner_id': bank.partner_id.id}) + if bank_statement_lines[st_line_name]['amount'] < 0 : + bank_statement_lines[st_line_name].update({'account_id': bank.partner_id.property_account_payable.id}) + else : + bank_statement_lines[st_line_name].update({'account_id': bank.partner_id.property_account_receivable.id}) + else: + nb_err += 1 + err_log += _('The bank account %s is not defined for the partner %s.\n')%(cntry_number,contry_name) + bank_statement_lines[st_line_name].update({'account_id': data['form']['awaiting_account']}) + + bank_statement["bank_statement_line"]=bank_statement_lines + elif line[0]=='3': + if line[1] == '1': + st_line_name = line[2:6] + bank_statement_lines[st_line_name]['extra_note'] += '\n' + line[40:113] + elif line[1] == '2': + st_line_name = line[2:6] + bank_statement_lines[st_line_name]['extra_note'] += '\n' + line[10:115] + elif line[1] == '3': + st_line_name = line[2:6] + bank_statement_lines[st_line_name]['extra_note'] += '\n' + line[10:100] + elif line[0]=='8': + # new balance record + bal_end = list2float(line[42:57]) + if line[41] == '1': + bal_end = - bal_end + bank_statement["balance_end_real"]= bal_end + + elif line[0]=='9': + # footer record + bank_statements.append(bank_statement) + #end for + bkst_list=[] + for statement in bank_statements: + try: + bk_st_id = pool.get('account.bank.statement').create(cr,uid,{ + 'journal_id': statement['journal_id'], + 'date':time.strftime('%Y-%m-%d',time.strptime(statement['date'],"%y/%m/%d")), + 'period_id':statement['period_id'], + 'balance_start': statement["balance_start"], + 'balance_end_real': statement["balance_end_real"], + 'state': 'draft', + 'name': statement['name'], + }) + lines=statement["bank_statement_line"] + for value in lines: + line=lines[value] + reconcile_id = False + if line['toreconcile']: + rec_id = pool.get('account.move.line').search(cr, uid, [('name','=',line['name']),('reconcile_id','=',False),('account_id.reconcile','=',True)]) + if rec_id: + reconcile_id = pool.get('account.bank.statement.reconcile').create(cr, uid, { + 'line_ids': [(6, 0, rec_id)] + }, context=context) + str_not1 = '' + if line.has_key('contry_name') and line.has_key('cntry_number'): + str_not1="Partner name:%s \n Partner Account Number:%s \n Communication:%s \n Value Date:%s \n Entry Date:%s \n"%(line["contry_name"],line["cntry_number"],line["free_comm"]+line['extra_note'],line["val_date"][0],line["entry_date"][0]) + id=pool.get('account.bank.statement.line').create(cr,uid,{ + 'name':line['name'], + 'date': line['date'], + 'amount': line['amount'], + 'partner_id':line['partner_id'] or 0, + 'account_id':line['account_id'], + 'statement_id': bk_st_id, + 'reconcile_id': reconcile_id, + 'note':str_not1, + 'ref':line['ref'], + }) + + str_not= "\n \n Account Number: %s \n Account Holder Name: %s " %(statement["acc_number"],statement["acc_holder"]) + std_log += "\nStatement : %s , Date : %s, Starting Balance : %.2f , Ending Balance : %.2f \n"\ + %(statement['name'], statement['date'], float(statement["balance_start"]), float(statement["balance_end_real"])) + bkst_list.append(bk_st_id) + + except osv.except_osv, e: + cr.rollback() + nb_err+=1 + err_log += '\n Application Error : ' + str(e) + raise # REMOVEME + + except Exception, e: + cr.rollback() + nb_err+=1 + err_log += '\n System Error : '+str(e) + raise # REMOVEME + except : + cr.rollback() + nb_err+=1 + err_log += '\n Unknown Error' + raise + err_log += '\n\nNumber of statements : '+ str(len(bkst_list)) + err_log += '\nNumber of error :'+ str(nb_err) +'\n' + + pool.get('account.coda').create(cr, uid,{ + 'name':codafile, + 'statement_ids': [(6, 0, bkst_list,)], + 'note':str_log1+str_not+std_log+err_log, + 'journal_id':data['form']['journal_id'], + 'date':time.strftime("%Y-%m-%d"), + 'user_id':uid, + }) + + return {'note':str_log1 + std_log + err_log ,'journal_id': data['form']['journal_id'], 'coda': data['form']['coda'],'statment_ids':bkst_list} + + +def str2date(date_str): + return time.strftime("%y/%m/%d",time.strptime(date_str,"%d%m%y")) + +def str2float(str): + try: + return float(str) + except: + return 0.0 + +def list2float(lst): + try: + return str2float((lambda s : s[:-3] + '.' + s[-3:])(lst)) + except: + return 0.0 + +class coda_import(wizard.interface): + def _action_open_window(self, cr, uid, data, context): + form=data['form'] + return { + 'domain':"[('id','in',%s)]"%(form['statment_ids']), + 'name': 'Statement', + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'account.bank.statement', + 'view_id': False, + 'type': 'ir.actions.act_window', + } + states = { + 'init' : { + 'actions' : [], + 'result' : {'type' : 'form', + 'arch' : codawiz_form, + 'fields' : codawiz_fields, + 'state' : [('end', '_Close'),('extraction', '_Ok') ]} + }, + 'extraction' : { + 'actions' : [_coda_parsing], + 'result' : {'type' : 'form', + 'arch' : result_form, + 'fields' : result_fields, + 'state' : [('end', '_Close'),('open', '_Open Statement')]} + }, + 'open': { + 'actions': [], + 'result': {'type': 'action', 'action': _action_open_window, 'state': 'end'} + + }, + + } +coda_import("account.coda_import") +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_followup/followup.py b/addons/account_followup/followup.py index 5eaa2a4e25a..c8bf9537f13 100644 --- a/addons/account_followup/followup.py +++ b/addons/account_followup/followup.py @@ -23,7 +23,7 @@ from osv import fields, osv class followup(osv.osv): _name = 'account_followup.followup' - _description = 'Follow-Ups' + _description = 'Follow-Up' _columns = { 'name': fields.char('Name', size=64, required=True), 'description': fields.text('Description'), @@ -34,7 +34,7 @@ followup() class followup_line(osv.osv): _name = 'account_followup.followup.line' - _description = 'Follow-Ups Criteria' + _description = 'Follow-Up Criteria' _columns = { 'name': fields.char('Name', size=64, required=True), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of follow-up lines."), diff --git a/addons/account_followup/followup_report.py b/addons/account_followup/followup_report.py index 79cd6006e2b..5ce062ebd0b 100644 --- a/addons/account_followup/followup_report.py +++ b/addons/account_followup/followup_report.py @@ -30,7 +30,7 @@ def _code_get(self, cr, uid, context={}): class account_followup_stat(osv.osv): _name = "account_followup.stat" - _description = "Followup statistics" + _description = "Followup Statistics" _auto = False _columns = { 'name': fields.many2one('res.partner', 'Partner', readonly=True), diff --git a/addons/account_followup/followup_view.xml b/addons/account_followup/followup_view.xml index 4b5e77beb87..ae31f7253a2 100644 --- a/addons/account_followup/followup_view.xml +++ b/addons/account_followup/followup_view.xml @@ -124,7 +124,7 @@ - + diff --git a/addons/account_invoice_layout/i18n/id.po b/addons/account_invoice_layout/i18n/id.po index 9f1682ad273..661f48b2b23 100644 --- a/addons/account_invoice_layout/i18n/id.po +++ b/addons/account_invoice_layout/i18n/id.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-01-07 13:19+0000\n" -"Last-Translator: opix \n" +"PO-Revision-Date: 2010-05-18 11:05+0000\n" +"Last-Translator: Pandu Pradana \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:12+0000\n" +"X-Launchpad-Export-Date: 2010-05-19 05:12+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_invoice_layout @@ -35,7 +35,7 @@ msgstr "" #. module: account_invoice_layout #: rml:account.invoice.layout:0 msgid "Cancelled Invoice" -msgstr "" +msgstr "Pembatalan Tagihan" #. module: account_invoice_layout #: selection:account.invoice.line,state:0 @@ -56,7 +56,7 @@ msgstr "Potongan (%)" #. module: account_invoice_layout #: rml:account.invoice.layout:0 msgid "(Incl. taxes):" -msgstr "" +msgstr "(Termasuk pajak):" #. module: account_invoice_layout #: selection:account.invoice.line,state:0 @@ -132,7 +132,7 @@ msgstr "Harga" #. module: account_invoice_layout #: rml:account.invoice.layout:0 msgid "/ (" -msgstr "" +msgstr "/ (" #. module: account_invoice_layout #: rml:account.invoice.layout:0 @@ -147,7 +147,7 @@ msgstr "Rekening Asal" #. module: account_invoice_layout #: model:ir.actions.act_window,name:account_invoice_layout.notify_mesage_tree_form msgid "Write Messages" -msgstr "" +msgstr "Tulis Pesan" #. module: account_invoice_layout #: rml:account.invoice.layout:0 @@ -212,7 +212,7 @@ msgstr "Invoice dengan Layout" #. module: account_invoice_layout #: rml:account.invoice.layout:0 msgid "Description / Taxes" -msgstr "" +msgstr "Penjelasan / Pajak" #. module: account_invoice_layout #: rml:account.invoice.layout:0 @@ -222,7 +222,7 @@ msgstr "Jumlah" #. module: account_invoice_layout #: rml:account.invoice.layout:0 msgid "Description/Taxes" -msgstr "" +msgstr "Penjelasan/Pajak" #. module: account_invoice_layout #: rml:account.invoice.layout:0 @@ -262,7 +262,7 @@ msgstr "Faktur Pembelian" #. module: account_invoice_layout #: rml:account.invoice.layout:0 msgid "Note :" -msgstr "" +msgstr "Catatan :" #. module: account_invoice_layout #: rml:account.invoice.layout:0 @@ -272,12 +272,12 @@ msgstr "Pajak" #. module: account_invoice_layout #: model:ir.module.module,shortdesc:account_invoice_layout.module_meta_information msgid "account_invoice_layout" -msgstr "" +msgstr "Tatanan_tagihan_akun" #. module: account_invoice_layout #: rml:account.invoice.layout:0 msgid "Total (Excl. taxes):" -msgstr "" +msgstr "Jumlah (Tidak termasuk pajak):" #. module: account_invoice_layout #: rml:account.invoice.layout:0 diff --git a/addons/account_payment/payment.py b/addons/account_payment/payment.py index 8f68bdaf46f..8e300f7072a 100644 --- a/addons/account_payment/payment.py +++ b/addons/account_payment/payment.py @@ -28,7 +28,7 @@ import pooler class payment_type(osv.osv): _name= 'payment.type' - _description= 'Payment type' + _description= 'Payment Type' _columns= { 'name': fields.char('Name', size=64, required=True,help='Payment Type'), 'code': fields.char('Code', size=64, required=True,help='Specifies the Code for Payment Type'), @@ -43,7 +43,7 @@ payment_type() class payment_mode(osv.osv): _name= 'payment.mode' - _description= 'Payment mode' + _description= 'Payment Mode' _columns= { 'name': fields.char('Name', size=64, required=True,help='Mode of Payment'), 'bank_id': fields.many2one('res.partner.bank', "Bank account", diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml index 63dd950520f..d238fe952fc 100644 --- a/addons/account_payment/payment_view.xml +++ b/addons/account_payment/payment_view.xml @@ -25,6 +25,8 @@ + + @@ -279,7 +281,6 @@ - diff --git a/addons/account_payment/wizard/account_payment_order.py b/addons/account_payment/wizard/account_payment_order.py index 001804c9e8a..266dcb535d8 100644 --- a/addons/account_payment/wizard/account_payment_order.py +++ b/addons/account_payment/wizard/account_payment_order.py @@ -104,7 +104,7 @@ class payment_order_create(osv.osv_memory): # Search for move line to pay: domain = [('reconcile_id', '=', False),('account_id.type', '=', 'payable'),('amount_to_pay', '>', 0)] - domain = domain + ['|',('date_maturity','<',search_due_date),('date_maturity','=',False)] + domain = domain + ['|',('date_maturity','<=',search_due_date),('date_maturity','=',False)] line_ids = line_obj.search(cr, uid, domain, context=context) context.update({'line_ids': line_ids}) model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_create_payment_order_lines')], context=context) diff --git a/addons/account_payment/wizard/account_payment_populate_statement.py b/addons/account_payment/wizard/account_payment_populate_statement.py index 3f8f9330343..381f0d0f8f7 100644 --- a/addons/account_payment/wizard/account_payment_populate_statement.py +++ b/addons/account_payment/wizard/account_payment_populate_statement.py @@ -106,5 +106,3 @@ class account_payment_populate_statement(osv.osv_memory): return {'type' : 'ir.actions.act_window_close'} account_payment_populate_statement() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_report/account.py b/addons/account_report/account.py index 7a6d65878f0..a3f92676111 100644 --- a/addons/account_report/account.py +++ b/addons/account_report/account.py @@ -32,7 +32,7 @@ from mx.DateTime import RelativeDateTime, now, DateTime, localtime class account_report(osv.osv): _name = "account.report.report" - _description = "Account reporting" + _description = "Account Reporting" # _color = [ # ('', ''), # ('green','Green'), diff --git a/addons/account_report/i18n/oc.po b/addons/account_report/i18n/oc.po new file mode 100644 index 00000000000..1469c5cb903 --- /dev/null +++ b/addons/account_report/i18n/oc.po @@ -0,0 +1,532 @@ +# Occitan (post 1500) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-05-18 08:43+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) \n" +"Language-Team: Occitan (post 1500) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-19 05:11+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: account_report +#: field:account.report.history,name:0 +#: selection:account.report.report,type:0 +#: model:ir.model,name:account_report.model_account_report_history +msgid "Indicator" +msgstr "" + +#. module: account_report +#: wizard_field:print.indicators.pdf,init,file:0 +msgid "Select a PDF File" +msgstr "" + +#. module: account_report +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "Nom del Modèl invalid per la definicion de l'accion." + +#. module: account_report +#: view:account.report.report:0 +msgid "Operators:" +msgstr "" + +#. module: account_report +#: field:account.report.report,parent_id:0 +msgid "Parent" +msgstr "Parent" + +#. module: account_report +#: field:account.report.report,disp_graph:0 +msgid "Display As Graph" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "Account Debit:" +msgstr "" + +#. module: account_report +#: selection:account.report.report,type:0 +msgid "Others" +msgstr "Autres" + +#. module: account_report +#: view:account.report.report:0 +msgid "balance(['ACCOUNT_CODE',],fiscalyear)" +msgstr "" + +#. module: account_report +#: rml:print.indicators:0 +msgid "Tabular Summary" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "Notes" +msgstr "Nòtas" + +#. module: account_report +#: view:account.report.report:0 +msgid "= Goodness Indicator Limit:" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "Very bad" +msgstr "" + +#. module: account_report +#: field:account.report.history,val:0 +#: field:account.report.report,amount:0 +msgid "Value" +msgstr "Valor" + +#. module: account_report +#: view:account.report.report:0 +msgid "= Badness Indicator Limit:" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +#: selection:account.report.report,status:0 +msgid "Bad" +msgstr "" + +#. module: account_report +#: wizard_view:print.indicators.pdf,init:0 +msgid "Select the PDF file on which Indicators will be printed." +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "> Goodness Indicator Limit:" +msgstr "" + +#. module: account_report +#: field:account.report.report,badness_limit:0 +msgid "Badness Indicator Limit" +msgstr "" + +#. module: account_report +#: selection:account.report.report,status:0 +msgid "Very Bad" +msgstr "" + +#. module: account_report +#: model:ir.actions.act_window,name:account_report.account_report_history_record_structure +msgid "Indicator history" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "credit(['ACCOUNT_CODE',],fiscalyear)" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "Report Amount:" +msgstr "" + +#. module: account_report +#: model:ir.actions.report.xml,name:account_report.fiscal_statements +msgid "Fiscal Statements" +msgstr "" + +#. module: account_report +#: wizard_button:print.indicators,init,next:0 +msgid "Next" +msgstr "Seguent" + +#. module: account_report +#: model:ir.module.module,shortdesc:account_report.module_meta_information +msgid "Reporting for accounting" +msgstr "" + +#. module: account_report +#: wizard_button:print.indicators,next,print:0 +#: wizard_button:print.indicators.pdf,init,print:0 +msgid "Print" +msgstr "Estampar" + +#. module: account_report +#: field:account.report.report,type:0 +msgid "Type" +msgstr "Tipe" + +#. module: account_report +#: model:ir.actions.report.xml,name:account_report.report_indicator_pdf +msgid "Print Indicators in PDF" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "Account Tax Code:" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +#: selection:account.report.report,status:0 +msgid "Good" +msgstr "Bon" + +#. module: account_report +#: view:account.report.history:0 +msgid "Account Report History" +msgstr "" + +#. module: account_report +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalid per l'arquitectura de la vista" + +#. module: account_report +#: help:account.report.report,badness_limit:0 +msgid "This Value sets the limit of badness." +msgstr "" + +#. module: account_report +#: wizard_field:print.indicators,init,select_base:0 +msgid "Choose Criteria" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "debit(['ACCOUNT_CODE',],fiscalyear)" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "Account Credit:" +msgstr "" + +#. module: account_report +#: wizard_view:print.indicators,init:0 +msgid "Select the criteria based on which Indicators will be printed." +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "< Badness Indicator Limit:" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +#: selection:account.report.report,status:0 +msgid "Very Good" +msgstr "" + +#. module: account_report +#: field:account.report.report,note:0 +msgid "Note" +msgstr "Nòta" + +#. module: account_report +#: rml:accounting.report:0 +#: rml:print.indicators:0 +msgid "Currency:" +msgstr "Devisa :" + +#. module: account_report +#: field:account.report.report,status:0 +msgid "Status" +msgstr "Estat" + +#. module: account_report +#: help:account.report.report,disp_tree:0 +msgid "" +"When the indicators are printed, if one indicator is set with this field to " +"True, then it will display one more graphs with all its children in tree" +msgstr "" + +#. module: account_report +#: selection:account.report.report,status:0 +msgid "Normal" +msgstr "Normala" + +#. module: account_report +#: view:account.report.report:0 +msgid "Example: (balance(['6','45'],-1) - credit(['7'])) / report('RPT1')" +msgstr "" + +#. module: account_report +#: field:account.report.report,active:0 +msgid "Active" +msgstr "Actiu" + +#. module: account_report +#: field:account.report.report,disp_tree:0 +msgid "Display Tree" +msgstr "" + +#. module: account_report +#: selection:print.indicators,init,select_base:0 +msgid "Based On Fiscal Years" +msgstr "" + +#. module: account_report +#: model:ir.model,name:account_report.model_account_report_report +msgid "Account reporting" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "Account Balance:" +msgstr "" + +#. module: account_report +#: rml:print.indicators:0 +msgid "Expression :" +msgstr "Expression :" + +#. module: account_report +#: view:account.report.report:0 +msgid "report('REPORT_CODE')" +msgstr "" + +#. module: account_report +#: field:account.report.report,expression:0 +msgid "Expression" +msgstr "Expression" + +#. module: account_report +#: view:account.report.report:0 +msgid "Accounting reporting" +msgstr "" + +#. module: account_report +#: model:ir.actions.act_window,name:account_report.action_account_report_form +#: model:ir.ui.menu,name:account_report.menu_action_account_report_form +msgid "New Reporting Item Formula" +msgstr "" + +#. module: account_report +#: field:account.report.report,code:0 +#: rml:accounting.report:0 +msgid "Code" +msgstr "Còde" + +#. module: account_report +#: field:account.report.history,tmp:0 +msgid "temp" +msgstr "" + +#. module: account_report +#: field:account.report.history,period_id:0 +msgid "Period" +msgstr "Periòde" + +#. module: account_report +#: view:account.report.report:0 +msgid "General" +msgstr "General" + +#. module: account_report +#: view:account.report.report:0 +msgid "Legend of operators" +msgstr "" + +#. module: account_report +#: wizard_button:print.indicators,init,end:0 +#: wizard_button:print.indicators,next,end:0 +#: wizard_button:print.indicators.pdf,init,end:0 +msgid "Cancel" +msgstr "Anullar" + +#. module: account_report +#: field:account.report.report,child_ids:0 +msgid "Children" +msgstr "Enfants" + +#. module: account_report +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs " +"especials !" + +#. module: account_report +#: help:account.report.report,goodness_limit:0 +msgid "This Value sets the limit of goodness." +msgstr "" + +#. module: account_report +#: model:ir.actions.wizard,name:account_report.wizard_print_indicators +#: model:ir.ui.menu,name:account_report.menu_wizard_print_indicators +#: wizard_view:print.indicators,init:0 +#: wizard_view:print.indicators,next:0 +msgid "Print Indicators" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "+ - * / ( )" +msgstr "+ - * / ( )" + +#. module: account_report +#: rml:accounting.report:0 +#: rml:print.indicators:0 +msgid "Printing date:" +msgstr "" + +#. module: account_report +#: model:ir.actions.wizard,name:account_report.wizard_indicators_with_pdf +msgid "Indicators in PDF" +msgstr "" + +#. module: account_report +#: rml:accounting.report:0 +#: rml:print.indicators:0 +msgid "at" +msgstr "a" + +#. module: account_report +#: rml:accounting.report:0 +msgid "Accounting Report" +msgstr "" + +#. module: account_report +#: field:account.report.report,goodness_limit:0 +msgid "Goodness Indicator Limit" +msgstr "" + +#. module: account_report +#: model:ir.actions.act_window,name:account_report.action_account_report_tree_view_other +#: model:ir.ui.menu,name:account_report.menu_action_account_report_tree_view_other +msgid "Other reports" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "" +"Note: The second arguement 'fiscalyear' and 'period' are optional " +"arguements.If the value is -1,previous fiscalyear or period is considered." +msgstr "" + +#. module: account_report +#: rml:print.indicators:0 +msgid ")" +msgstr ")" + +#. module: account_report +#: model:ir.actions.act_window,name:account_report.action_account_report_tree_view_fiscal +#: model:ir.ui.menu,name:account_report.menu_action_account_report_tree_view_fiscal +msgid "Fiscal Statements reporting" +msgstr "" + +#. module: account_report +#: selection:print.indicators,init,select_base:0 +msgid "Based on Fiscal Periods" +msgstr "" + +#. module: account_report +#: model:ir.actions.report.xml,name:account_report.report_print_indicators +#: rml:print.indicators:0 +msgid "Indicators" +msgstr "Indicadors" + +#. module: account_report +#: wizard_view:print.indicators.pdf,init:0 +msgid "Print Indicators with PDF" +msgstr "" + +#. module: account_report +#: model:ir.actions.act_window,name:account_report.action_account_report_tree_view_indicator +#: model:ir.ui.menu,name:account_report.menu_action_account_report_tree_view_indicator +msgid "Indicators reporting" +msgstr "" + +#. module: account_report +#: field:account.report.report,name:0 +#: rml:accounting.report:0 +#: rml:print.indicators:0 +msgid "Name" +msgstr "Nom" + +#. module: account_report +#: wizard_field:print.indicators,next,base_selection:0 +msgid "Select Criteria" +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "tax_code(['ACCOUNT_TAX_CODE',],period)" +msgstr "" + +#. module: account_report +#: field:account.report.history,fiscalyear_id:0 +msgid "Fiscal Year" +msgstr "" + +#. module: account_report +#: model:ir.actions.act_window,name:account_report.action_account_report_tree +#: model:ir.actions.act_window,name:account_report.action_account_report_tree_view +#: model:ir.ui.menu,name:account_report.menu_action_account_report_tree_define +#: model:ir.ui.menu,name:account_report.menu_action_account_report_tree_view +msgid "Custom reporting" +msgstr "" + +#. module: account_report +#: rml:print.indicators:0 +msgid "Page" +msgstr "Pagina" + +#. module: account_report +#: selection:account.report.report,type:0 +msgid "View" +msgstr "Afichatge" + +#. module: account_report +#: rml:print.indicators:0 +msgid "Indicators -" +msgstr "" + +#. module: account_report +#: help:account.report.report,disp_graph:0 +msgid "" +"If the field is set to True, information will be printed as a Graph, " +"otherwise as an array." +msgstr "" + +#. module: account_report +#: view:account.report.report:0 +msgid "Return value for status" +msgstr "" + +#. module: account_report +#: field:account.report.report,sequence:0 +msgid "Sequence" +msgstr "Sequéncia" + +#. module: account_report +#: rml:accounting.report:0 +msgid "Amount" +msgstr "Soma" + +#. module: account_report +#: rml:print.indicators:0 +msgid "1cm 27.7cm 20cm 27.7cm" +msgstr "1cm 27.7cm 20cm 27.7cm" + +#. module: account_report +#: model:ir.module.module,description:account_report.module_meta_information +msgid "" +"Financial and accounting reporting\n" +" Fiscal statements\n" +" Indicators\n" +" " +msgstr "" + +#. module: account_report +#: selection:account.report.report,type:0 +msgid "Fiscal Statement" +msgstr "" diff --git a/addons/account_reporting/account.py b/addons/account_reporting/account.py index ad1ce59f769..0b4a16b0dd8 100644 --- a/addons/account_reporting/account.py +++ b/addons/account_reporting/account.py @@ -30,7 +30,7 @@ from mx.DateTime import RelativeDateTime, now, DateTime, localtime class color_rml(osv.osv): _name = "color.rml" - _description = "Rml Colors" + _description = "Rml Color" _columns = { 'name': fields.char('Name', size=64, required=True), 'code': fields.char('code',size=64,required=True), diff --git a/addons/account_reporting/i18n/oc.po b/addons/account_reporting/i18n/oc.po new file mode 100644 index 00000000000..97cba6a7eea --- /dev/null +++ b/addons/account_reporting/i18n/oc.po @@ -0,0 +1,246 @@ +# Occitan (post 1500) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-05-18 08:40+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) \n" +"Language-Team: Occitan (post 1500) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-19 05:12+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: account_reporting +#: field:color.rml,code:0 +msgid "code" +msgstr "còde" + +#. module: account_reporting +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs " +"especials !" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Helvetica-Bold" +msgstr "Helvetica-Gras" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Helvetica" +msgstr "Helvetica" + +#. module: account_reporting +#: field:account.report.bs,note:0 +msgid "Note" +msgstr "Nòta" + +#. module: account_reporting +#: field:account.report.bs,report_type:0 +msgid "Report Type" +msgstr "" + +#. module: account_reporting +#: model:ir.ui.menu,name:account_reporting.action_account_report_bs_form +#: model:ir.ui.menu,name:account_reporting.menu_finan_config_BSheet +msgid "Balance Sheet Report" +msgstr "" + +#. module: account_reporting +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "Nom del Modèl invalid per la definicion de l'accion." + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Courier" +msgstr "" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Courier-BoldOblique" +msgstr "" + +#. module: account_reporting +#: wizard_button:account.account.balancesheet.report,init,report:0 +msgid "Print BalanceSheet" +msgstr "" + +#. module: account_reporting +#: help:account.account.balancesheet.report,init,periods:0 +msgid "All periods if empty" +msgstr "" + +#. module: account_reporting +#: field:account.report.bs,color_font:0 +msgid "Font Color" +msgstr "Color de la poliça" + +#. module: account_reporting +#: selection:account.report.bs,report_type:0 +msgid "Report Objects With Accounts and child of Accounts" +msgstr "" + +#. module: account_reporting +#: model:ir.module.module,description:account_reporting.module_meta_information +msgid "" +"Financial and accounting reporting\n" +" Balance Sheet Report" +msgstr "" + +#. module: account_reporting +#: selection:account.report.bs,report_type:0 +msgid "Report Objects With Accounts" +msgstr "" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Courier-Oblique" +msgstr "" + +#. module: account_reporting +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalid per l'arquitectura de la vista" + +#. module: account_reporting +#: field:account.report.bs,name:0 +#: field:color.rml,name:0 +msgid "Name" +msgstr "Nom" + +#. module: account_reporting +#: view:account.report.bs:0 +msgid "Account reporting" +msgstr "" + +#. module: account_reporting +#: model:ir.ui.menu,name:account_reporting.bs_report_action_form +msgid "Balance Sheet Report Form" +msgstr "" + +#. module: account_reporting +#: view:account.report.bs:0 +msgid "Notes" +msgstr "Nòtas" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Times-BoldItalic" +msgstr "" + +#. module: account_reporting +#: model:ir.model,name:account_reporting.model_account_report_bs +msgid "Account reporting for Balance Sheet" +msgstr "" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Courier-Bold" +msgstr "" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Times-Italic" +msgstr "" + +#. module: account_reporting +#: selection:account.report.bs,report_type:0 +msgid "Report Objects Only" +msgstr "" + +#. module: account_reporting +#: model:ir.model,name:account_reporting.model_color_rml +msgid "Rml Colors" +msgstr "" + +#. module: account_reporting +#: model:ir.module.module,shortdesc:account_reporting.module_meta_information +msgid "Reporting of Balancesheet for accounting" +msgstr "" + +#. module: account_reporting +#: field:account.report.bs,code:0 +msgid "Code" +msgstr "Còde" + +#. module: account_reporting +#: field:account.report.bs,parent_id:0 +msgid "Parent" +msgstr "Parent" + +#. module: account_reporting +#: field:account.report.bs,sequence:0 +msgid "Sequence" +msgstr "Sequéncia" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Times-Bold" +msgstr "" + +#. module: account_reporting +#: view:account.report.bs:0 +msgid "General" +msgstr "General" + +#. module: account_reporting +#: wizard_field:account.account.balancesheet.report,init,fiscalyear:0 +msgid "Fiscal year" +msgstr "Exercici fiscal" + +#. module: account_reporting +#: view:account.report.bs:0 +#: field:account.report.bs,account_id:0 +msgid "Accounts" +msgstr "Comptes" + +#. module: account_reporting +#: wizard_field:account.account.balancesheet.report,init,periods:0 +msgid "Periods" +msgstr "Periòdes" + +#. module: account_reporting +#: field:account.report.bs,color_back:0 +msgid "Back Color" +msgstr "" + +#. module: account_reporting +#: field:account.report.bs,child_id:0 +msgid "Children" +msgstr "Enfants" + +#. module: account_reporting +#: wizard_button:account.account.balancesheet.report,init,end:0 +msgid "Cancel" +msgstr "Anullar" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Times-Roman" +msgstr "" + +#. module: account_reporting +#: selection:account.report.bs,font_style:0 +msgid "Helvetica-Oblique" +msgstr "" + +#. module: account_reporting +#: field:account.report.bs,font_style:0 +msgid "Font" +msgstr "Poliça de caractèr" + +#. module: account_reporting +#: wizard_view:account.account.balancesheet.report,init:0 +msgid "Customize Report" +msgstr "" diff --git a/addons/account_voucher/i18n/oc.po b/addons/account_voucher/i18n/oc.po new file mode 100644 index 00000000000..94ee23ca205 --- /dev/null +++ b/addons/account_voucher/i18n/oc.po @@ -0,0 +1,601 @@ +# Occitan (post 1500) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-05-18 08:57+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) \n" +"Language-Team: Occitan (post 1500) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-19 05:12+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: account_voucher +#: model:ir.actions.act_window,name:account_voucher.act_account_acount_move_line_open1 +msgid "Opening Balance Entry" +msgstr "" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_receipt_bakreceipt_voucher_list +msgid "Bank Receipts" +msgstr "Recebuts bancaris" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Particulars" +msgstr "" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "State :" +msgstr "Estat :" + +#. module: account_voucher +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "Nom del Modèl invalid per la definicion de l'accion." + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Ref. :" +msgstr "Ref. :" + +#. module: account_voucher +#: selection:account.move,voucher_type:0 +#: selection:account.voucher,type:0 +#: selection:account.voucher.open,init,type:0 +#: model:ir.actions.act_window,name:account_voucher.action_view_cont_voucher_form +#: model:ir.ui.menu,name:account_voucher.menu_action_view_cont_voucher_form +msgid "Contra Voucher" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,company_id:0 +msgid "Company" +msgstr "Entrepresa" + +#. module: account_voucher +#: selection:account.move,voucher_type:0 +#: selection:account.voucher,type:0 +#: model:ir.actions.act_window,name:account_voucher.action_view_jour_voucher_form +#: model:ir.ui.menu,name:account_voucher.menu_action_view_jour_voucher_form +msgid "Journal Voucher" +msgstr "Jornal dels chèques" + +#. module: account_voucher +#: rml:voucher.cash_receipt.drcr:0 +msgid "," +msgstr "," + +#. module: account_voucher +#: view:account.voucher:0 +msgid "Set to Draft" +msgstr "Metre en Borrolhon" + +#. module: account_voucher +#: wizard_button:account.voucher.open,init,open:0 +msgid "Open Voucher Entries" +msgstr "" + +#. module: account_voucher +#: model:ir.model,name:account_voucher.model_account_voucher_line +msgid "Voucher Line" +msgstr "" + +#. module: account_voucher +#: view:account.move:0 +msgid "Total Credit" +msgstr "Credit Total" + +#. module: account_voucher +#: field:account.voucher,account_id:0 +#: field:account.voucher.line,account_id:0 +msgid "Account" +msgstr "Compte" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +msgid "D" +msgstr "D" + +#. module: account_voucher +#: field:account.account,level:0 +msgid "Level" +msgstr "Nivèl" + +#. module: account_voucher +#: view:account.move:0 +msgid "Account Entry Line" +msgstr "Linha d'escritura comptabla" + +#. module: account_voucher +#: view:account.move:0 +msgid "Total Debit" +msgstr "Debit Total" + +#. module: account_voucher +#: field:account.voucher,amount:0 +#: field:account.voucher.line,amount:0 +#: rml:voucher.cash_amount:0 +msgid "Amount" +msgstr "Soma" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Receiver's Signature" +msgstr "" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "No." +msgstr "N°" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Amount (in words) :" +msgstr "" + +#. module: account_voucher +#: field:account.voucher.line,account_analytic_id:0 +msgid "Analytic Account" +msgstr "Compte Analitic" + +#. module: account_voucher +#: selection:account.move,voucher_type:0 +#: selection:account.voucher,type:0 +#: selection:account.voucher.open,init,type:0 +#: model:ir.actions.act_window,name:account_voucher.action_view_jour_sale_voucher_form +#: model:ir.ui.menu,name:account_voucher.menu_action_view_jour_sale_voucher_form +msgid "Journal Sale Voucher" +msgstr "" + +#. module: account_voucher +#: model:ir.actions.act_window,name:account_voucher.action_receipt_vou_voucher_list +#: model:ir.ui.menu,name:account_voucher.menu_action_receipt_vou_voucher_list +msgid "Receipt Vouchers" +msgstr "" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +msgid "Account :" +msgstr "" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "On Account of :" +msgstr "" + +#. module: account_voucher +#: model:ir.actions.act_window,name:account_voucher.action_payments_bankpay_voucher_list +#: model:ir.actions.act_window,name:account_voucher.action_payments_cashpay_voucher_list +#: model:ir.actions.act_window,name:account_voucher.action_payments_voucher_list +#: model:ir.ui.menu,name:account_voucher.menu_action_payments_voucher_list +msgid "Payment Vouchers" +msgstr "" + +#. module: account_voucher +#: view:account.voucher:0 +msgid "Create" +msgstr "Crear" + +#. module: account_voucher +#: selection:account.account,type1:0 +#: selection:account.account.template,type1:0 +msgid "None" +msgstr "Pas cap" + +#. module: account_voucher +#: field:account.voucher,number:0 +msgid "Number" +msgstr "Numèro" + +#. module: account_voucher +#: view:account.move:0 +#: field:account.voucher,state:0 +#: wizard_field:account.voucher.open,init,state:0 +msgid "State" +msgstr "Estat" + +#. module: account_voucher +#: selection:account.account,type1:0 +#: selection:account.account.template,type1:0 +#: selection:account.voucher.line,type:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Debit" +msgstr "Debit" + +#. module: account_voucher +#: field:account.voucher,type:0 +#: field:account.voucher.line,type:0 +msgid "Type" +msgstr "Tipe" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_voucher_list +msgid "Voucher Entries" +msgstr "" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Authorised Signatory" +msgstr "" + +#. module: account_voucher +#: view:account.voucher:0 +#: model:ir.actions.act_window,name:account_voucher.action_voucher_list +msgid "Vouchers" +msgstr "" + +#. module: account_voucher +#: view:account.voucher:0 +#: field:account.voucher.line,voucher_id:0 +#: model:res.request.link,name:account_voucher.req_link_voucher +msgid "Voucher" +msgstr "" + +#. module: account_voucher +#: wizard_view:account.voucher.open,init:0 +#: model:ir.ui.menu,name:account_voucher.menu_wizard_account_voucher_open +msgid "Open Vouchers" +msgstr "" + +#. module: account_voucher +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalid per l'arquitectura de la vista" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Dated :" +msgstr "" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_receipt_cashreceipt_voucher_list +msgid "Cash Receipts" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,partner_id:0 +#: field:account.voucher.line,partner_id:0 +msgid "Partner" +msgstr "Partenari" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_view_bank_pay_voucher_form +msgid "New Bank Payment" +msgstr "" + +#. module: account_voucher +#: view:account.voucher:0 +#: field:account.voucher,payment_ids:0 +msgid "Voucher Lines" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,currency_id:0 +msgid "Currency" +msgstr "Devisa" + +#. module: account_voucher +#: view:account.move:0 +#: field:account.move,narration:0 +#: view:account.voucher:0 +#: field:account.voucher,narration:0 +msgid "Narration" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,reference:0 +msgid "Voucher Reference" +msgstr "" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_view_cash_rec_voucher_form +msgid "New Cash Receipt" +msgstr "" + +#. module: account_voucher +#: model:ir.actions.report.xml,name:account_voucher.report_account_voucher_amt +msgid "Voucher Report" +msgstr "" + +#. module: account_voucher +#: field:account.account,open_bal:0 +msgid "Opening Balance" +msgstr "" + +#. module: account_voucher +#: selection:account.voucher,state:0 +#: selection:account.voucher.open,init,state:0 +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Draft" +msgstr "Borrolhon" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "PRO-FORMA" +msgstr "PRO-FORMA" + +#. module: account_voucher +#: model:ir.actions.act_window,name:account_voucher.action_receipt_cashreceipt_voucher_list +msgid "Cash Receipt" +msgstr "" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_view_cash_pay_voucher_form +msgid "New Cash Payment" +msgstr "" + +#. module: account_voucher +#: view:account.move:0 +msgid "Optional Information" +msgstr "Entresenhas opcionalas" + +#. module: account_voucher +#: view:account.voucher:0 +msgid "General Entries" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,date:0 +msgid "Date" +msgstr "Data" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid ":" +msgstr ":" + +#. module: account_voucher +#: field:account.account,type1:0 +#: field:account.account.template,type1:0 +msgid "Dr/Cr" +msgstr "" + +#. module: account_voucher +#: model:ir.actions.report.xml,name:account_voucher.report_account_voucher +msgid "Voucher Report (Cr/Dr)" +msgstr "" + +#. module: account_voucher +#: field:account.move,voucher_type:0 +#: wizard_field:account.voucher.open,init,type:0 +msgid "Voucher Type" +msgstr "" + +#. module: account_voucher +#: selection:account.account,type1:0 +#: selection:account.account.template,type1:0 +#: selection:account.voucher.line,type:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Credit" +msgstr "Credit" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Through :" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,reference_type:0 +msgid "Reference Type" +msgstr "" + +#. module: account_voucher +#: model:ir.model,name:account_voucher.model_account_voucher +msgid "Accounting Voucher" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,period_id:0 +msgid "Period" +msgstr "Periòde" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_payments_bankpay_voucher_list +msgid "Bank Payments" +msgstr "" + +#. module: account_voucher +#: view:account.move:0 +msgid "General Information" +msgstr "Informacions generalas" + +#. module: account_voucher +#: wizard_field:account.voucher.open,init,period_ids:0 +msgid "Periods" +msgstr "Periòdes" + +#. module: account_voucher +#: view:account.voucher:0 +#: selection:account.voucher,state:0 +#: wizard_button:account.voucher.open,init,end:0 +#: selection:account.voucher.open,init,state:0 +msgid "Cancel" +msgstr "Anullar" + +#. module: account_voucher +#: view:account.voucher:0 +#: selection:account.voucher,state:0 +#: selection:account.voucher.open,init,state:0 +msgid "Pro-forma" +msgstr "Pro-forma" + +#. module: account_voucher +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs " +"especials !" + +#. module: account_voucher +#: view:account.voucher:0 +msgid "Other Info" +msgstr "" + +#. module: account_voucher +#: model:ir.module.module,shortdesc:account_voucher.module_meta_information +msgid "Accounting Voucher Entries" +msgstr "" + +#. module: account_voucher +#: field:res.currency,sub_name:0 +msgid "Sub Currency" +msgstr "" + +#. module: account_voucher +#: model:ir.actions.act_window,name:account_voucher.action_other_voucher_list +#: model:ir.ui.menu,name:account_voucher.menu_action_other_voucher_list +msgid "Other Vouchers" +msgstr "" + +#. module: account_voucher +#: field:account.voucher.line,name:0 +msgid "Description" +msgstr "Descripcion" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Canceled" +msgstr "Anullat" + +#. module: account_voucher +#: selection:account.move,voucher_type:0 +#: selection:account.voucher,type:0 +#: selection:account.voucher.open,init,type:0 +#: model:ir.actions.act_window,name:account_voucher.action_view_cash_pay_voucher_form +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Cash Payment Voucher" +msgstr "" + +#. module: account_voucher +#: model:ir.actions.act_window,name:account_voucher.action_receipt_bakreceipt_voucher_list +msgid "Bank Receipt" +msgstr "" + +#. module: account_voucher +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "-" +msgstr "-" + +#. module: account_voucher +#: selection:account.move,voucher_type:0 +#: selection:account.voucher,type:0 +#: selection:account.voucher.open,init,type:0 +#: model:ir.actions.act_window,name:account_voucher.action_view_jour_pur_voucher_form +#: model:ir.ui.menu,name:account_voucher.menu_action_view_jour_pur_voucher_form +msgid "Journal Purchase Voucher" +msgstr "" + +#. module: account_voucher +#: view:account.account:0 +msgid "Closing Balance" +msgstr "" + +#. module: account_voucher +#: field:account.voucher.line,ref:0 +msgid "Ref." +msgstr "Ref." + +#. module: account_voucher +#: selection:account.voucher,state:0 +#: selection:account.voucher.open,init,state:0 +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Posted" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,name:0 +msgid "Name" +msgstr "Nom" + +#. module: account_voucher +#: field:account.voucher,move_ids:0 +msgid "Real Entry" +msgstr "" + +#. module: account_voucher +#: model:ir.actions.wizard,name:account_voucher.wizard_account_voucher_open +msgid "Open a Voucher Entry" +msgstr "" + +#. module: account_voucher +#: field:account.voucher,move_id:0 +msgid "Account Entry" +msgstr "" + +#. module: account_voucher +#: view:account.voucher:0 +msgid "Entry Lines" +msgstr "" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_view_bank_rec_voucher_form +msgid "New Bank Receipt" +msgstr "" + +#. module: account_voucher +#: model:ir.ui.menu,name:account_voucher.menu_action_payments_cashpay_voucher_list +msgid "Cash Payments" +msgstr "" + +#. module: account_voucher +#: selection:account.move,voucher_type:0 +#: selection:account.voucher,type:0 +#: selection:account.voucher.open,init,type:0 +#: model:ir.actions.act_window,name:account_voucher.action_view_cash_rec_voucher_form +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Cash Receipt Voucher" +msgstr "" + +#. module: account_voucher +#: selection:account.move,voucher_type:0 +#: selection:account.voucher,type:0 +#: selection:account.voucher.open,init,type:0 +#: model:ir.actions.act_window,name:account_voucher.action_view_bank_pay_voucher_form +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Bank Payment Voucher" +msgstr "" + +#. module: account_voucher +#: selection:account.move,voucher_type:0 +#: selection:account.voucher,type:0 +#: selection:account.voucher.open,init,type:0 +#: model:ir.actions.act_window,name:account_voucher.action_view_bank_rec_voucher_form +#: rml:voucher.cash_amount:0 +#: rml:voucher.cash_receipt.drcr:0 +msgid "Bank Receipt Voucher" +msgstr "" + +#. module: account_voucher +#: field:account.account,journal_id:0 +#: field:account.voucher,journal_id:0 +msgid "Journal" +msgstr "Jornal" diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py index 66b701fb97a..140442aa02e 100644 --- a/addons/account_voucher/voucher.py +++ b/addons/account_voucher/voucher.py @@ -103,7 +103,7 @@ class account_voucher(osv.osv): ],'Type', readonly=True, select=True , size=128), 'date':fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}), 'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}), - 'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}), + 'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, domain=[('type','<>','view')]), 'payment_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=False, states={'proforma':[('readonly',True)]}), 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}), 'narration':fields.text('Narration', readonly=True, states={'draft':[('readonly',False)]}, required=True), @@ -167,15 +167,14 @@ class account_voucher(osv.osv): return {'value':{'account_id':account_id.id}} def open_voucher(self, cr, uid, ids, context={}): - obj=self.pool.get('account.voucher').browse(cr,uid,ids) - total=0 + obj = self.pool.get('account.voucher').browse(cr,uid,ids) + total = 0 for i in obj[0].payment_ids: - total+=i.amount - if total!=0: - self.write(cr,uid,ids,{'amount':total}) - self.write(cr, uid, ids, {'state':'proforma'}) + total += i.amount + if total != 0: + self.write(cr, uid, ids, {'amount':total, 'state':'proforma'}) else: - raise osv.except_osv('Invalid action !', 'You can not post to Pro-Forma a voucher with Total amount = 0') + raise osv.except_osv('Invalid action !', 'You cannot post to Pro-Forma a voucher with Total amount = 0 !') return True def proforma_voucher(self, cr, uid, ids, context={}): @@ -302,9 +301,9 @@ class account_voucher(osv.osv): name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) move = { - 'name': name, + 'name' : name, 'journal_id': journal_id, - 'voucher_type':inv.type, + 'type' : inv.type, 'narration' : inv.narration } if inv.period_id: @@ -487,7 +486,7 @@ class account_voucher_line(osv.osv): _columns = { 'voucher_id':fields.many2one('account.voucher', 'Voucher'), 'name':fields.char('Description', size=256, required=True), - 'account_id':fields.many2one('account.account','Account', required=True), + 'account_id':fields.many2one('account.account','Account', required=True, domain=[('type','<>','view')]), 'partner_id': fields.many2one('res.partner', 'Partner', change_default=True), 'amount':fields.float('Amount'), 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Type'), diff --git a/addons/analytic/project.py b/addons/analytic/project.py index c0f01322a6c..a3425c3925b 100644 --- a/addons/analytic/project.py +++ b/addons/analytic/project.py @@ -31,7 +31,7 @@ import decimal_precision as dp class account_analytic_account(osv.osv): _name = 'account.analytic.account' - _description = 'Analytic Accounts' + _description = 'Analytic Account' def _compute_currency_for_level_tree(self, cr, uid, ids, ids2, res, acc_set, context={}): # Handle multi-currency on each level of analytic account @@ -285,7 +285,7 @@ account_analytic_account() class account_analytic_line(osv.osv): _name = 'account.analytic.line' - _description = 'Analytic lines' + _description = 'Analytic Line' def _amount_currency(self, cr, uid, ids, field_name, arg, context={}): result = {} for rec in self.browse(cr, uid, ids, context): @@ -343,7 +343,7 @@ class account_analytic_line(osv.osv): } _defaults = { 'date': lambda *a: time.strftime('%Y-%m-%d'), - 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c), + 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=c), } _order = 'date' account_analytic_line() diff --git a/addons/analytic_journal_billing_rate/i18n/oc.po b/addons/analytic_journal_billing_rate/i18n/oc.po new file mode 100644 index 00000000000..22b337e0889 --- /dev/null +++ b/addons/analytic_journal_billing_rate/i18n/oc.po @@ -0,0 +1,66 @@ +# Occitan (post 1500) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-05-18 08:44+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) \n" +"Language-Team: Occitan (post 1500) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-19 05:12+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: analytic_journal_billing_rate +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalid per l'arquitectura de la vista" + +#. module: analytic_journal_billing_rate +#: field:analytic_journal_rate_grid,journal_id:0 +msgid "Analytic Journal" +msgstr "Jornal analitic" + +#. module: analytic_journal_billing_rate +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs " +"especials !" + +#. module: analytic_journal_billing_rate +#: view:analytic_journal_rate_grid:0 +msgid "Billing Rate per Journal for this Analytic Account" +msgstr "" + +#. module: analytic_journal_billing_rate +#: field:analytic_journal_rate_grid,account_id:0 +msgid "Analytic Account" +msgstr "Compte Analitic" + +#. module: analytic_journal_billing_rate +#: model:ir.model,name:analytic_journal_billing_rate.model_analytic_journal_rate_grid +msgid "Relation table between journals and billing rates" +msgstr "" + +#. module: analytic_journal_billing_rate +#: field:account.analytic.account,journal_rate_ids:0 +msgid "Invoicing Rate per Journal" +msgstr "" + +#. module: analytic_journal_billing_rate +#: model:ir.module.module,shortdesc:analytic_journal_billing_rate.module_meta_information +msgid "Analytic Journal Billing Rate" +msgstr "" + +#. module: analytic_journal_billing_rate +#: field:analytic_journal_rate_grid,rate_id:0 +msgid "Invoicing Rate" +msgstr "" diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index c5c2af729a0..fe238d373be 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -100,7 +100,7 @@ class hr_analytic_timesheet(osv.osv): 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) # Compute based on pricetype - amount_unit=self.on_change_unit_amount(cr, uid, ids, + amount_unit = self.on_change_unit_amount(cr, uid, ids, r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount'] amount = unit_amount * amount_unit @@ -136,7 +136,7 @@ class hr_analytic_timesheet(osv.osv): 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) # Compute based on pricetype - amount_unit=self.on_change_unit_amount(cr, uid, ids, + amount_unit = self.on_change_unit_amount(cr, uid, ids, r.product_id.id, unit_amount, r.product_id.uom_id.id)['value']['amount'] amount = unit_amount * amount_unit diff --git a/addons/auction/security/ir.model.access.csv b/addons/auction/security/ir.model.access.csv index 1c1df0828ca..cc3a2e304f7 100644 --- a/addons/auction/security/ir.model.access.csv +++ b/addons/auction/security/ir.model.access.csv @@ -32,3 +32,5 @@ "acess_auction_payer","auction.payer","model_auction_payer","base.group_user",1,0,0,0 "access_auction_pay_sel","auction.pay.sel","model_auction_payer_sel","base.group_user",1,0,0,0 "acess_auction_taken","auction.taken","model_auction_taken","base.group_user",1,0,0,0 +"access_auction_catalog_flagey","auction.catalog.flagey","model_auction_catalog_flagey","base.group_user",1,0,0,0 +"access_auction_lots_buyer_map_user","auction_lots_buyer_map_user","model_auction_lots_buyer_map","base.group_user",1,0,0,0 diff --git a/addons/audittrail/i18n/fr.po b/addons/audittrail/i18n/fr.po index 12c15bb34f4..fbe01ff7c9b 100644 --- a/addons/audittrail/i18n/fr.po +++ b/addons/audittrail/i18n/fr.po @@ -7,19 +7,19 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-09-08 14:56+0000\n" -"Last-Translator: Fabien (Open ERP) \n" +"PO-Revision-Date: 2010-05-21 17:51+0000\n" +"Last-Translator: Christophe Chauvet - http://www.syleam.fr/ \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-04-17 04:17+0000\n" +"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: audittrail #: model:ir.module.module,shortdesc:audittrail.module_meta_information msgid "Audit Trail" -msgstr "" +msgstr "Rapport de l' audit" #. module: audittrail #: constraint:ir.model:0 @@ -72,7 +72,7 @@ msgstr "Ancienne valeur" #. module: audittrail #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "" +msgstr "Nom de modèle invalide pour la définition de l'action" #. module: audittrail #: model:ir.actions.wizard,name:audittrail.wizard_audittrail_log @@ -143,7 +143,7 @@ msgstr "Règle AuditTrail" #. module: audittrail #: wizard_field:audittrail.view.log,init,to:0 msgid "Log To" -msgstr "" +msgstr "Connecter à" #. module: audittrail #: view:audittrail.log:0 @@ -158,6 +158,10 @@ msgid "" " Subscribe Rules for read, write, create and delete on objects and check " "logs" msgstr "" +"Autorise un administrateur à tracer toutes les manipulations des " +"utilisateurs sur tous les objets du système.\n" +" Règles d'abonnement pour la lecture, l'écriture, la création, la " +"suppression des objets et la consultation des journaux" #. module: audittrail #: field:audittrail.log,timestamp:0 diff --git a/addons/audittrail/i18n/oc.po b/addons/audittrail/i18n/oc.po new file mode 100644 index 00000000000..7699077394d --- /dev/null +++ b/addons/audittrail/i18n/oc.po @@ -0,0 +1,311 @@ +# Occitan (post 1500) translation for openobject-addons +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-08-28 16:01+0000\n" +"PO-Revision-Date: 2010-05-18 08:49+0000\n" +"Last-Translator: Cédric VALMARY (Tot en òc) \n" +"Language-Team: Occitan (post 1500) \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-05-19 05:12+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: audittrail +#: model:ir.module.module,shortdesc:audittrail.module_meta_information +msgid "Audit Trail" +msgstr "" + +#. module: audittrail +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs " +"especials !" + +#. module: audittrail +#: field:audittrail.log.line,log_id:0 +msgid "Log" +msgstr "Jornal" + +#. module: audittrail +#: selection:audittrail.rule,state:0 +msgid "Subscribed" +msgstr "Abonat" + +#. module: audittrail +#: view:audittrail.log:0 +msgid "Old Value : " +msgstr "" + +#. module: audittrail +#: selection:audittrail.log,method:0 +msgid "Create" +msgstr "Crear" + +#. module: audittrail +#: wizard_view:audittrail.view.log,init:0 +msgid "Audit Logs" +msgstr "" + +#. module: audittrail +#: field:audittrail.rule,state:0 +msgid "State" +msgstr "Estat" + +#. module: audittrail +#: selection:audittrail.rule,state:0 +msgid "Draft" +msgstr "Borrolhon" + +#. module: audittrail +#: field:audittrail.log.line,old_value:0 +msgid "Old Value" +msgstr "" + +#. module: audittrail +#: constraint:ir.actions.act_window:0 +msgid "Invalid model name in the action definition." +msgstr "Nom del Modèl invalid per la definicion de l'accion." + +#. module: audittrail +#: model:ir.actions.wizard,name:audittrail.wizard_audittrail_log +msgid "View log" +msgstr "" + +#. module: audittrail +#: model:ir.model,name:audittrail.model_audittrail_log_line +msgid "audittrail.log.line" +msgstr "" + +#. module: audittrail +#: field:audittrail.log,method:0 +msgid "Method" +msgstr "Metòde" + +#. module: audittrail +#: wizard_field:audittrail.view.log,init,from:0 +msgid "Log From" +msgstr "" + +#. module: audittrail +#: field:audittrail.log.line,log:0 +msgid "Log ID" +msgstr "" + +#. module: audittrail +#: field:audittrail.log,res_id:0 +msgid "Resource Id" +msgstr "" + +#. module: audittrail +#: selection:audittrail.log,method:0 +msgid "Write" +msgstr "Escriure" + +#. module: audittrail +#: model:ir.ui.menu,name:audittrail.menu_action_audittrail +msgid "Audittrails" +msgstr "" + +#. module: audittrail +#: view:audittrail.log:0 +msgid "Log Lines" +msgstr "" + +#. module: audittrail +#: view:audittrail.rule:0 +msgid "Subscribe" +msgstr "S'abonar" + +#. module: audittrail +#: selection:audittrail.log,method:0 +msgid "Read" +msgstr "Legir" + +#. module: audittrail +#: field:audittrail.log,object_id:0 +#: field:audittrail.rule,object_id:0 +msgid "Object" +msgstr "Objècte" + +#. module: audittrail +#: view:audittrail.rule:0 +msgid "AuditTrail Rule" +msgstr "" + +#. module: audittrail +#: wizard_field:audittrail.view.log,init,to:0 +msgid "Log To" +msgstr "" + +#. module: audittrail +#: view:audittrail.log:0 +msgid "New Value Text: " +msgstr "" + +#. module: audittrail +#: model:ir.module.module,description:audittrail.module_meta_information +msgid "" +"Allows the administrator to track every user operations on all objects of " +"the system.\n" +" Subscribe Rules for read, write, create and delete on objects and check " +"logs" +msgstr "" + +#. module: audittrail +#: field:audittrail.log,timestamp:0 +msgid "Date" +msgstr "Data" + +#. module: audittrail +#: field:audittrail.log,user_id:0 +msgid "User" +msgstr "Utilizaire" + +#. module: audittrail +#: view:audittrail.log:0 +msgid "Old Value Text : " +msgstr "" + +#. module: audittrail +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invalid per l'arquitectura de la vista" + +#. module: audittrail +#: field:audittrail.log,name:0 +msgid "Name" +msgstr "Nom" + +#. module: audittrail +#: field:audittrail.log,line_ids:0 +msgid "Log lines" +msgstr "" + +#. module: audittrail +#: model:ir.ui.menu,name:audittrail.menu_action_audittrail_rule_tree_sub +msgid "Subscribed Rules" +msgstr "" + +#. module: audittrail +#: field:audittrail.log.line,field_id:0 +msgid "Fields" +msgstr "Camps" + +#. module: audittrail +#: view:audittrail.rule:0 +msgid "AuditTrail Rules" +msgstr "" + +#. module: audittrail +#: model:ir.model,name:audittrail.model_audittrail_rule +msgid "audittrail.rule" +msgstr "" + +#. module: audittrail +#: view:audittrail.rule:0 +msgid "UnSubscribe" +msgstr "" + +#. module: audittrail +#: field:audittrail.rule,log_write:0 +msgid "Log writes" +msgstr "" + +#. module: audittrail +#: model:ir.model,name:audittrail.model_audittrail_log +msgid "audittrail.log" +msgstr "" + +#. module: audittrail +#: field:audittrail.log.line,field_description:0 +msgid "Field Description" +msgstr "" + +#. module: audittrail +#: selection:audittrail.log,method:0 +msgid "Delete" +msgstr "Suprimir" + +#. module: audittrail +#: wizard_button:audittrail.view.log,init,open:0 +msgid "Open Logs" +msgstr "" + +#. module: audittrail +#: field:audittrail.log.line,new_value_text:0 +msgid "New value Text" +msgstr "" + +#. module: audittrail +#: field:audittrail.rule,name:0 +msgid "Rule Name" +msgstr "" + +#. module: audittrail +#: field:audittrail.rule,log_read:0 +msgid "Log reads" +msgstr "" + +#. module: audittrail +#: model:ir.ui.menu,name:audittrail.menu_action_audittrail_log_tree +msgid "Logs" +msgstr "Jornals" + +#. module: audittrail +#: field:audittrail.log.line,new_value:0 +msgid "New Value" +msgstr "" + +#. module: audittrail +#: model:ir.ui.menu,name:audittrail.menu_action_log_tree2 +msgid "View Logs" +msgstr "" + +#. module: audittrail +#: field:audittrail.rule,log_create:0 +msgid "Log creates" +msgstr "" + +#. module: audittrail +#: view:audittrail.log:0 +msgid "AuditTrail Logs" +msgstr "" + +#. module: audittrail +#: model:ir.ui.menu,name:audittrail.menu_action_audittrail_rule_tree +msgid "Rules" +msgstr "Règlas" + +#. module: audittrail +#: view:audittrail.log:0 +msgid "New Value : " +msgstr "" + +#. module: audittrail +#: field:audittrail.rule,user_id:0 +msgid "Users" +msgstr "Utilizaires" + +#. module: audittrail +#: field:audittrail.log.line,old_value_text:0 +msgid "Old value Text" +msgstr "" + +#. module: audittrail +#: wizard_button:audittrail.view.log,init,end:0 +msgid "Cancel" +msgstr "Anullar" + +#. module: audittrail +#: field:audittrail.rule,log_unlink:0 +msgid "Log deletes" +msgstr "" diff --git a/addons/base_calendar/__openerp__.py b/addons/base_calendar/__openerp__.py index 44c36997495..de44f6e0333 100644 --- a/addons/base_calendar/__openerp__.py +++ b/addons/base_calendar/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,34 +15,35 @@ # 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 . # ############################################################################## { - "name" : "Basic Calendar Functionality", - "version" : "1.0", - "depends" : ["base"], + "name" : "Basic Calendar Functionality", + "version" : "1.0", + "depends" : ["base"], 'description': """Full featured calendar system that support: - Alerts (create requests) - Recurring events (*) - - Invitations to others people""", - "author" : "Tiny", - 'category': 'Generic Modules/Others', - 'website': 'http://www.openerp.com', + - Invitations to others people""", + "author" : "Tiny", + 'category': 'Generic Modules/Others', + 'website': 'http://www.openerp.com', "init_xml" : [ 'base_calendar_data.xml' - ], - "demo_xml" : [], + ], + "demo_xml" : [], "update_xml" : [ 'security/ir.model.access.csv', - 'wizard/calendar_event_edit_all_view.xml', - 'wizard/base_calendar_invite_attendee_view.xml', + 'wizard/calendar_event_edit_all_view.xml', + 'wizard/base_calendar_invite_attendee_view.xml', + 'wizard/base_calendar_set_exrule_view.xml', 'base_calendar_view.xml' - ], - "test" : ['test/base_calendar_test.yml'], - "installable" : True, - "active" : False, + ], + # "test" : ['test/base_calendar_test.yml'], + "installable" : True, + "active" : False, } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 5546a0e345e..4c3940301b3 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -44,7 +44,6 @@ def get_recurrent_dates(rrulestring, exdate, startdate=None, exrule=None): @param startdate: Startdate for computing recurrent dates @return: List of Recurrent dates """ - def todate(date): val = parser.parse(''.join((re.compile('\d')).findall(date))) return val @@ -97,7 +96,7 @@ def real_id2base_calendar_id(real_id, recurrent_date): return '%d-%s' % (real_id, recurrent_date) return real_id -def _links_get(self, cr, uid, context={}): +def _links_get(self, cr, uid, context=None): """ Get request link. @param cr: the current row, from the database cursor, @@ -213,7 +212,9 @@ class calendar_attendee(osv.osv): def _get_address(self, name=None, email=None): """ - Get Email Address + Gives email information in ical CAL-ADDRESS type format + @param name: Name for CAL-ADDRESS value + @param email: Email address for CAL-ADDRESS value """ if name and email: name += ':' @@ -221,7 +222,7 @@ class calendar_attendee(osv.osv): def _compute_data(self, cr, uid, ids, name, arg, context): """ - Compute data on field. + Compute data on function fields for attendee values . @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of calendar attendee’s IDs. @@ -241,6 +242,7 @@ class calendar_attendee(osv.osv): else: result[id][name] = self._get_address(attdata.sent_by_uid.name, \ attdata.sent_by_uid.address_id.email) + if name == 'cn': if attdata.user_id: result[id][name] = attdata.user_id.name @@ -248,40 +250,47 @@ class calendar_attendee(osv.osv): result[id][name] = attdata.partner_address_id.name or attdata.partner_id.name else: result[id][name] = attdata.email or '' + if name == 'delegated_to': todata = [] for child in attdata.child_ids: if child.email: todata.append('MAILTO:' + child.email) result[id][name] = ', '.join(todata) + if name == 'delegated_from': fromdata = [] for parent in attdata.parent_ids: if parent.email: fromdata.append('MAILTO:' + parent.email) result[id][name] = ', '.join(fromdata) + if name == 'event_date': if attdata.ref: result[id][name] = attdata.ref.date else: result[id][name] = False + if name == 'event_end_date': if attdata.ref: result[id][name] = attdata.ref.date_deadline else: result[id][name] = False + if name == 'sent_by_uid': if attdata.ref: result[id][name] = (attdata.ref.user_id.id, attdata.ref.user_id.name) else: result[id][name] = uid + if name == 'language': user_obj = self.pool.get('res.users') lang = user_obj.read(cr, uid, uid, ['context_lang'], context=context)['context_lang'] result[id][name] = lang.replace('_', '-') + return result - def _links_get(self, cr, uid, context={}): + def _links_get(self, cr, uid, context=None): """ Get request link for ref field in calendar attendee. @param cr: the current row, from the database cursor, @@ -297,7 +306,7 @@ class calendar_attendee(osv.osv): def _lang_get(self, cr, uid, context={}): """ - Get language for language function field. + Get language for language selection field. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values @@ -313,60 +322,60 @@ class calendar_attendee(osv.osv): 'cutype': fields.selection([('individual', 'Individual'), \ ('group', 'Group'), ('resource', 'Resource'), \ ('room', 'Room'), ('unknown', '') ], \ - 'Invite Type', help="Specify the type of Invitation"), - 'member': fields.char('Member', size=124, - help="Indicate the groups that the attendee belongs to"), + 'Invite Type', help="Specify the type of Invitation"), + 'member': fields.char('Member', size=124, + help="Indicate the groups that the attendee belongs to"), 'role': fields.selection([('req-participant', 'Participation required'), \ ('chair', 'Chair Person'), \ ('opt-participant', 'Optional Participation'), \ ('non-participant', 'For information Purpose')], 'Role', \ - help='Participation role for the calendar user'), - 'state': fields.selection([('tentative', 'Tentative'), - ('needs-action', 'Needs Action'), - ('accepted', 'Accepted'), - ('declined', 'Declined'), + help='Participation role for the calendar user'), + 'state': fields.selection([('tentative', 'Tentative'), + ('needs-action', 'Needs Action'), + ('accepted', 'Accepted'), + ('declined', 'Declined'), ('delegated', 'Delegated')], 'State', readonly=True, \ - help="Status of the attendee's participation"), - 'rsvp': fields.boolean('Required Reply?', - help="Indicats whether the favor of a reply is requested"), + help="Status of the attendee's participation"), + 'rsvp': fields.boolean('Required Reply?', + help="Indicats whether the favor of a reply is requested"), 'delegated_to': fields.function(_compute_data, method=True, \ string='Delegated To', type="char", size=124, store=True, \ multi='delegated_to', help="The users that the original \ -request was delegated to"), +request was delegated to"), 'delegated_from': fields.function(_compute_data, method=True, string=\ - 'Delegated From', type="char", store=True, size=124, multi='delegated_from'), + 'Delegated From', type="char", store=True, size=124, multi='delegated_from'), 'parent_ids': fields.many2many('calendar.attendee', 'calendar_attendee_parent_rel', \ - 'attendee_id', 'parent_id', 'Delegrated From'), + 'attendee_id', 'parent_id', 'Delegrated From'), 'child_ids': fields.many2many('calendar.attendee', 'calendar_attendee_child_rel', \ - 'attendee_id', 'child_id', 'Delegrated To'), + 'attendee_id', 'child_id', 'Delegrated To'), 'sent_by': fields.function(_compute_data, method=True, string='Sent By', \ type="char", multi='sent_by', store=True, size=124, \ - help="Specify the user that is acting on behalf of the calendar user"), + help="Specify the user that is acting on behalf of the calendar user"), 'sent_by_uid': fields.function(_compute_data, method=True, string='Sent By User', \ - type="many2one", relation="res.users", multi='sent_by_uid'), + type="many2one", relation="res.users", multi='sent_by_uid'), 'cn': fields.function(_compute_data, method=True, string='Common name', \ - type="char", size=124, multi='cn', store=True), + type="char", size=124, multi='cn', store=True), 'dir': fields.char('URI Reference', size=124, help="Reference to the URI\ -that points to the directory information corresponding to the attendee."), +that points to the directory information corresponding to the attendee."), 'language': fields.function(_compute_data, method=True, string='Language', \ type="selection", selection=_lang_get, multi='language', \ store=True, help="To specify the language for text values in a\ -property or property parameter."), - 'user_id': fields.many2one('res.users', 'User'), - 'partner_address_id': fields.many2one('res.partner.address', 'Contact'), +property or property parameter."), + 'user_id': fields.many2one('res.users', 'User'), + 'partner_address_id': fields.many2one('res.partner.address', 'Contact'), 'partner_id': fields.related('partner_address_id', 'partner_id', type='many2one', \ - relation='res.partner', string='Partner', help="Partner related to contact"), - 'email': fields.char('Email', size=124, help="Email of Invited Person"), + relation='res.partner', string='Partner', help="Partner related to contact"), + 'email': fields.char('Email', size=124, help="Email of Invited Person"), 'event_date': fields.function(_compute_data, method=True, string='Event Date', \ - type="datetime", multi='event_date'), + type="datetime", multi='event_date'), 'event_end_date': fields.function(_compute_data, method=True, \ string='Event End Date', type="datetime", \ - multi='event_end_date'), - 'ref': fields.reference('Event Ref', selection=_links_get, size=128), - 'availability': fields.selection([('free', 'Free'), ('busy', 'Busy')], 'Free/Busy', readonly="True"), + multi='event_end_date'), + 'ref': fields.reference('Event Ref', selection=_links_get, size=128), + 'availability': fields.selection([('free', 'Free'), ('busy', 'Busy')], 'Free/Busy', readonly="True"), } _defaults = { - 'state': lambda *x: 'needs-action', + 'state': lambda *x: 'needs-action', } def get_ics_file(self, cr, uid, event_obj, context=None): @@ -401,7 +410,7 @@ property or property parameter."), event.add('location').value = event_obj.location if event_obj.rrule: event.add('rrule').value = event_obj.rrule - + if event_obj.alarm_id: # computes alarm data valarm = event.add('valarm') @@ -422,10 +431,10 @@ property or property parameter."), if interval == 'minutes': delta = timedelta(minutes=duration) trigger.value = delta - + # Compute other details valarm.add('DESCRIPTION').value = alarm_data['name'] or 'OpenERP' - + for attendee in event_obj.attendee_ids: attendee_add = event.add('attendee') attendee_add.params['CUTYPE'] = [str(attendee.cutype)] @@ -435,15 +444,18 @@ property or property parameter."), res = cal.serialize() return res - def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context={}): + def _send_mail(self, cr, uid, ids, mail_to, email_from=tools.config.get('email_from', False), context=None): """ - Send mail for calendar attendee. + Send mail for event invitation to event attendees. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param ids: List of calendar attendee’s IDs. + @param ids: List of attendee’s IDs. + @param email_from: Email address for user sending the mail @param context: A standard dictionary for contextual values @return: True """ + if not context: + context = {} company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name for att in self.browse(cr, uid, ids, context=context): @@ -457,26 +469,26 @@ property or property parameter."), att_infos.append(((att2.user_id and att2.user_id.name) or \ (att2.partner_id and att2.partner_id.name) or \ att2.email) + ' - Status: ' + att2.state.title()) - body_vals = {'name': res_obj.name, - 'start_date': res_obj.date, - 'end_date': res_obj.date_deadline or False, - 'description': res_obj.description or '-', - 'location': res_obj.location or '-', - 'attendees': '
'.join(att_infos), - 'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User', - 'sign': sign, + body_vals = {'name': res_obj.name, + 'start_date': res_obj.date, + 'end_date': res_obj.date_deadline or False, + 'description': res_obj.description or '-', + 'location': res_obj.location or '-', + 'attendees': '
'.join(att_infos), + 'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User', + 'sign': sign, 'company': company } body = html_invitation % body_vals attach = self.get_ics_file(cr, uid, res_obj, context=context) if mail_to and email_from: tools.email_send( - email_from, - mail_to, - sub, - body, - attach=attach and [('invitation.ics', attach)] or None, - subtype='html', + email_from, + mail_to, + sub, + body, + attach=attach and [('invitation.ics', attach)] or None, + subtype='html', reply_to=email_from ) return True @@ -487,7 +499,7 @@ property or property parameter."), @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of calendar attendee’s IDs. - @param user_id: User id + @param user_id: Changed value of User id @return: dictionary of value. which put value in email and availability fields. """ @@ -498,24 +510,27 @@ property or property parameter."), return {'value': {'email': user.address_id.email, 'availability':user.availability}} def do_tentative(self, cr, uid, ids, context=None, *args): - """ @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of calendar attendee’s IDs - @param *args: Get Tupple value - @param context: A standard dictionary for contextual values """ + """ Makes event invitation as Tentative + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of calendar attendee’s IDs + @param *args: Get Tupple value + @param context: A standard dictionary for contextual values + """ self.write(cr, uid, ids, {'state': 'tentative'}, context) def do_accept(self, cr, uid, ids, context=None, *args): """ - Update state which value is accepted. + Update state of invitation as Accepted and + if the invited user is other then event user it will make a copy of this event for invited user @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of calendar attendee’s IDs. + @param context: A standard dictionary for contextual values @return: True """ - if not context: context = {} @@ -532,21 +547,23 @@ property or property parameter."), return True def do_decline(self, cr, uid, ids, context=None, *args): - """ @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of calendar attendee’s IDs - @param *args: Get Tupple value - @param context: A standard dictionary for contextual values """ + """ Marks event invitation as Declined + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of calendar attendee’s IDs + @param *args: Get Tupple value + @param context: A standard dictionary for contextual values """ self.write(cr, uid, ids, {'state': 'declined'}, context) def create(self, cr, uid, vals, context=None): - """ @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param vals: Get Values - @param context: A standard dictionary for contextual values """ + """ Overrides orm create method. + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param vals: Get Values + @param context: A standard dictionary for contextual values """ if not context: context = {} @@ -561,46 +578,50 @@ property or property parameter."), calendar_attendee() class res_alarm(osv.osv): + """Resource Alarm """ _name = 'res.alarm' _description = 'Basic Alarm Information' + _columns = { - 'name':fields.char('Name', size=256, required=True), + 'name':fields.char('Name', size=256, required=True), 'trigger_occurs': fields.selection([('before', 'Before'), \ ('after', 'After')], \ - 'Triggers', required=True), + 'Triggers', required=True), 'trigger_interval': fields.selection([('minutes', 'Minutes'), \ ('hours', 'Hours'), \ ('days', 'Days')], 'Interval', \ - required=True), - 'trigger_duration': fields.integer('Duration', required=True), + required=True), + 'trigger_duration': fields.integer('Duration', required=True), 'trigger_related': fields.selection([('start', 'The event starts'), \ ('end', 'The event ends')], \ - 'Related to', required=True), + 'Related to', required=True), 'duration': fields.integer('Duration', help="""Duration' and 'Repeat' \ -are both optional, but if one occurs, so MUST the other"""), - 'repeat': fields.integer('Repeat'), +are both optional, but if one occurs, so MUST the other"""), + 'repeat': fields.integer('Repeat'), 'active': fields.boolean('Active', help="If the active field is set to \ true, it will allow you to hide the event alarm information without removing it.") } _defaults = { - 'trigger_interval': lambda *x: 'minutes', - 'trigger_duration': lambda *x: 5, - 'trigger_occurs': lambda *x: 'before', - 'trigger_related': lambda *x: 'start', - 'active': lambda *x: 1, + 'trigger_interval': lambda *x: 'minutes', + 'trigger_duration': lambda *x: 5, + 'trigger_occurs': lambda *x: 'before', + 'trigger_related': lambda *x: 'start', + 'active': lambda *x: 1, } - def do_alarm_create(self, cr, uid, ids, model, date, context={}): + def do_alarm_create(self, cr, uid, ids, model, date, context=None): """ - Create Alarm for meeting. + Create Alarm for event. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of res alarm’s IDs. @param model: Model name. + @param date: Event date @param context: A standard dictionary for contextual values @return: True """ - + if not context: + context = {} alarm_obj = self.pool.get('calendar.alarm') ir_obj = self.pool.get('ir.model') model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0] @@ -615,20 +636,20 @@ true, it will allow you to hide the event alarm information without removing it. self.do_alarm_unlink(cr, uid, [data.id], model) if basic_alarm: vals = { - 'action': 'display', - 'description': data.description, - 'name': data.name, - 'attendee_ids': [(6, 0, map(lambda x:x.id, data.attendee_ids))], - 'trigger_related': basic_alarm.trigger_related, - 'trigger_duration': basic_alarm.trigger_duration, - 'trigger_occurs': basic_alarm.trigger_occurs, - 'trigger_interval': basic_alarm.trigger_interval, - 'duration': basic_alarm.duration, - 'repeat': basic_alarm.repeat, - 'state': 'run', - 'event_date': data[date], - 'res_id': data.id, - 'model_id': model_id, + 'action': 'display', + 'description': data.description, + 'name': data.name, + 'attendee_ids': [(6, 0, map(lambda x:x.id, data.attendee_ids))], + 'trigger_related': basic_alarm.trigger_related, + 'trigger_duration': basic_alarm.trigger_duration, + 'trigger_occurs': basic_alarm.trigger_occurs, + 'trigger_interval': basic_alarm.trigger_interval, + 'duration': basic_alarm.duration, + 'repeat': basic_alarm.repeat, + 'state': 'run', + 'event_date': data[date], + 'res_id': data.id, + 'model_id': model_id, 'user_id': uid } alarm_id = alarm_obj.create(cr, uid, vals) @@ -638,16 +659,17 @@ true, it will allow you to hide the event alarm information without removing it. cr.commit() return True - def do_alarm_unlink(self, cr, uid, ids, model, context={}): + def do_alarm_unlink(self, cr, uid, ids, model, context=None): """ Delete alarm specified in ids @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of res alarm’s IDs. - @param model: Model name. + @param model: Model name for which alarm is to be cleared. @return: True """ - + if not context: + context = {} alarm_obj = self.pool.get('calendar.alarm') ir_obj = self.pool.get('ir.model') model_id = ir_obj.search(cr, uid, [('model', '=', model)])[0] @@ -670,51 +692,53 @@ class calendar_alarm(osv.osv): __attribute__ = {} _columns = { - 'alarm_id': fields.many2one('res.alarm', 'Basic Alarm', ondelete='cascade'), + 'alarm_id': fields.many2one('res.alarm', 'Basic Alarm', ondelete='cascade'), 'name': fields.char('Summary', size=124, help="""Contains the text to be \ used as the message subject for email \ - or contains the text to be used for display"""), + or contains the text to be used for display"""), 'action': fields.selection([('audio', 'Audio'), ('display', 'Display'), \ ('procedure', 'Procedure'), ('email', 'Email') ], 'Action', \ - required=True, help="Defines the action to be invoked when an alarm is triggered"), + required=True, help="Defines the action to be invoked when an alarm is triggered"), 'description': fields.text('Description', help='Provides a more complete \ description of the calendar component, than that \ - provided by the "SUMMARY" property'), + provided by the "SUMMARY" property'), 'attendee_ids': fields.many2many('calendar.attendee', 'alarm_attendee_rel', \ - 'alarm_id', 'attendee_id', 'Attendees', readonly=True), + 'alarm_id', 'attendee_id', 'Attendees', readonly=True), 'attach': fields.binary('Attachment', help="""* Points to a sound resource,\ which is rendered when the alarm is triggered for audio, * File which is intended to be sent as message attachments for email, * Points to a procedure resource, which is invoked when\ - the alarm is triggered for procedure."""), - 'res_id': fields.integer('Resource ID'), - 'model_id': fields.many2one('ir.model', 'Model'), - 'user_id': fields.many2one('res.users', 'Owner'), - 'event_date': fields.datetime('Event Date'), - 'event_end_date': fields.datetime('Event End Date'), - 'trigger_date': fields.datetime('Trigger Date', readonly="True"), + the alarm is triggered for procedure."""), + 'res_id': fields.integer('Resource ID'), + 'model_id': fields.many2one('ir.model', 'Model'), + 'user_id': fields.many2one('res.users', 'Owner'), + 'event_date': fields.datetime('Event Date'), + 'event_end_date': fields.datetime('Event End Date'), + 'trigger_date': fields.datetime('Trigger Date', readonly="True"), 'state':fields.selection([ - ('draft', 'Draft'), - ('run', 'Run'), - ('stop', 'Stop'), - ('done', 'Done'), - ], 'State', select=True, readonly=True), + ('draft', 'Draft'), + ('run', 'Run'), + ('stop', 'Stop'), + ('done', 'Done'), + ], 'State', select=True, readonly=True), } _defaults = { - 'action': lambda *x: 'email', - 'state': lambda *x: 'run', + 'action': lambda *x: 'email', + 'state': lambda *x: 'run', } - def create(self, cr, uid, vals, context={}): + + def create(self, cr, uid, vals, context=None): """ - create new record. + Overrides orm create method. @param self: The object pointer @param cr: the current row, from the database cursor, @param vals: dictionary of fields value.{‘name_of_the_field’: value, ...} @param context: A standard dictionary for contextual values @return: new record id for calendar_alarm. """ - + if not context: + context = {} event_date = vals.get('event_date', False) if event_date: dtstart = datetime.strptime(vals['event_date'], "%Y-%m-%d %H:%M:%S") @@ -731,7 +755,7 @@ class calendar_alarm(osv.osv): def do_run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, \ context=None): - """ + """Scheduler for event reminder @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @@ -754,11 +778,11 @@ class calendar_alarm(osv.osv): for alarm in self.browse(cr, uid, alarm_ids): if alarm.action == 'display': value = { - 'name': alarm.name, - 'act_from': alarm.user_id.id, - 'act_to': alarm.user_id.id, - 'body': alarm.description, - 'trigger_date': alarm.trigger_date, + 'name': alarm.name, + 'act_from': alarm.user_id.id, + 'act_to': alarm.user_id.id, + 'body': alarm.description, + 'trigger_date': alarm.trigger_date, 'ref_doc1': '%s,%s' % (alarm.model_id.model, alarm.res_id) } request_id = request_obj.create(cr, uid, value) @@ -788,9 +812,9 @@ class calendar_alarm(osv.osv): mail_to.append(att.user_id.address_id.email) if mail_to: tools.email_send( - tools.config.get('email_from', False), - mail_to, - sub, + tools.config.get('email_from', False), + mail_to, + sub, body ) self.write(cr, uid, [alarm.id], {'state':'done'}) @@ -808,7 +832,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={}): - """ + """Sets duration as 24 Hours if event is selcted 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, @@ -820,23 +844,23 @@ class calendar_event(osv.osv): return {} event = self.browse(cr, uid, ids, context=context)[0] value = { - 'date': event.date and event.date[:11] + '00:00:00', - 'date_deadline': event.date_deadline and event.date_deadline[:11] + '00:00:00', 'duration': 24 } return {'value': value} - def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, allday=False, context={}): - """ + def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, allday=False, context=None): + """Returns duration and/or end date based on values passed @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of calendar event’s IDs. - @param start_date: Get starting date - @param duration: Get Duration between start date and end date or False - @param end_date: Get Ending Date or False + @param start_date: Starting date + @param duration: Duration between start date and end date + @param end_date: Ending Datee @param context: A standard dictionary for contextual values """ + if not context: + context = {} value = {} if not start_date: return value @@ -845,10 +869,7 @@ class calendar_event(osv.osv): value['duration'] = duration if allday: # For all day event - start = start_date[:11] + '00:00:00' value = { - 'date': start, - 'date_deadline': start, 'duration': 24 } return {'value': value} @@ -865,19 +886,21 @@ class calendar_event(osv.osv): return {'value': value} - def _set_rrulestring(self, cr, uid, id, name, value, arg, context): + def _set_rrulestring(self, cr, uid, id, name, value, arg, context=None): """ - Set rule string. + Sets values of fields that defines event recurrence from the value of rrule string @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @param context: A standard dictionary for contextual values @return: dictionary of rrule value. """ + if not context: + context = {} cr.execute("UPDATE %s set freq='None',interval=0,count=0,end_date=Null,\ mo=False,tu=False,we=False,th=False,fr=False,sa=False,su=False,\ day=0,select1='date',month_list=Null ,byday=Null where id=%s" % (self._table, id)) - + if not value: cr.execute("UPDATE %s set rrule_type='none' where id=%s" % (self._table, id)) return True @@ -906,19 +929,19 @@ class calendar_event(osv.osv): for day in val['byday'].split(','): new_val[day] = True val.pop('byday') - + if val.get('until'): until = parser.parse(''.join((re.compile('\d')).findall(val.get('until')))) new_val['end_date'] = until.strftime('%Y-%m-%d') val.pop('until') new_val.pop('until') - + if val.get('bymonthday'): new_val['day'] = val.get('bymonthday') val.pop('bymonthday') new_val['select1'] = 'date' new_val.pop('bymonthday') - + if val.get('byday'): d = val.get('byday') if '-' in d: @@ -928,12 +951,12 @@ class calendar_event(osv.osv): new_val['byday'] = d[:1] new_val['week_list'] = d[1:3].upper() new_val['select1'] = 'day' - + if val.get('bymonth'): new_val['month_list'] = val.get('bymonth') val.pop('bymonth') new_val.pop('bymonth') - + for k, v in new_val.items(): temp = ", %s='%s'" % (k, v) qry += temp @@ -941,16 +964,16 @@ class calendar_event(osv.osv): whr = " where id=%(id)s" qry = qry + whr val.update({ - 'table': self._table, - 'rule_type': rrule_type, - 'id': id, + 'table': self._table, + 'rule_type': rrule_type, + 'id': id, }) cr.execute(qry % val) return True def _get_rulestring(self, cr, uid, ids, name, arg, context=None): """ - Get rule string. + Gets Recurrence rule string according to value type RECUR of iCalendar from the values given. @param self: The object pointer @param cr: the current row, from the database cursor, @param id: List of calendar event's ids. @@ -968,7 +991,7 @@ class calendar_event(osv.osv): raise osv.except_osv('Warning!', 'Interval can not be Negative') if datas.get('count', 0) < 0: raise osv.except_osv('Warning!', 'Count can not be Negative') - rrule_custom = self.compute_rule_string(cr, uid, datas,\ + rrule_custom = self.compute_rule_string(cr, uid, datas, \ context=context) result[event] = rrule_custom else: @@ -977,40 +1000,40 @@ class calendar_event(osv.osv): return result _columns = { - 'id': fields.integer('ID'), - 'sequence': fields.integer('Sequence'), - 'name': fields.char('Description', size=64, required=True), - 'date': fields.datetime('Date'), - 'date_deadline': fields.datetime('Deadline'), - 'create_date': fields.datetime('Created', readonly=True), - 'duration': fields.float('Duration'), - 'description': fields.text('Your action'), + 'id': fields.integer('ID'), + 'sequence': fields.integer('Sequence'), + 'name': fields.char('Description', size=64, required=False), + 'date': fields.datetime('Date'), + 'date_deadline': fields.datetime('Deadline'), + 'create_date': fields.datetime('Created', readonly=True), + 'duration': fields.float('Duration'), + 'description': fields.text('Your action'), 'class': fields.selection([('public', 'Public'), ('private', 'Private'), \ - ('confidential', 'Confidential')], 'Mark as'), - 'location': fields.char('Location', size=264, help="Location of Event"), + ('confidential', 'Confidential')], 'Mark as'), + 'location': fields.char('Location', size=264, help="Location of Event"), 'show_as': fields.selection([('free', 'Free'), ('busy', 'Busy')], \ - 'Show as'), - 'base_calendar_url': fields.char('Caldav URL', size=264), + 'Show as'), + 'base_calendar_url': fields.char('Caldav URL', size=264), 'exdate': fields.text('Exception Date/Times', help="This property \ -defines the list of date/time exceptions for arecurring calendar component."), +defines the list of date/time exceptions for arecurring calendar component."), 'exrule': fields.char('Exception Rule', size=352, help="defines a \ -rule or repeating pattern for an exception to a recurrence set"), +rule or repeating pattern for an exception to a recurrence set"), 'rrule': fields.function(_get_rulestring, type='char', size=124, method=True, \ string='Recurrent Rule', store=True, \ fnct_inv=_set_rrulestring, help='Defines a\ rule or repeating pattern for recurring events\n\ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\ - FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU'), + FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU'), 'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \ ('weekly', 'Weekly'), ('monthly', 'Monthly'), \ - ('yearly', 'Yearly'), ('custom', 'Custom')], 'Recurrency'), - 'alarm_id': fields.many2one('res.alarm', 'Alarm'), - 'base_calendar_alarm_id': fields.many2one('calendar.alarm', 'Alarm'), - 'recurrent_uid': fields.integer('Recurrent ID'), - 'recurrent_id': fields.datetime('Recurrent ID date'), + ('yearly', 'Yearly'), ('custom', 'Custom')], 'Recurrency'), + 'alarm_id': fields.many2one('res.alarm', 'Alarm'), + 'base_calendar_alarm_id': fields.many2one('calendar.alarm', 'Alarm'), + 'recurrent_uid': fields.integer('Recurrent ID'), + 'recurrent_id': fields.datetime('Recurrent ID date'), 'vtimezone': fields.related('user_id', 'context_tz', type='char', size=24, \ - string='Timezone', store=True), - 'user_id': fields.many2one('res.users', 'Responsible'), + string='Timezone', store=True), + 'user_id': fields.many2one('res.users', 'Responsible'), 'freq': fields.selection([('None', 'No Repeat'), \ ('secondly', 'Secondly'), \ ('minutely', 'Minutely'), \ @@ -1018,44 +1041,44 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\ ('daily', 'Daily'), \ ('weekly', 'Weekly'), \ ('monthly', 'Monthly'), \ - ('yearly', 'Yearly')], 'Frequency'), - 'interval': fields.integer('Interval'), - 'count': fields.integer('Count'), - 'mo': fields.boolean('Mon'), - 'tu': fields.boolean('Tue'), - 'we': fields.boolean('Wed'), - 'th': fields.boolean('Thu'), - 'fr': fields.boolean('Fri'), - 'sa': fields.boolean('Sat'), - 'su': fields.boolean('Sun'), + ('yearly', 'Yearly')], 'Frequency'), + 'interval': fields.integer('Interval'), + 'count': fields.integer('Count'), + 'mo': fields.boolean('Mon'), + 'tu': fields.boolean('Tue'), + 'we': fields.boolean('Wed'), + 'th': fields.boolean('Thu'), + 'fr': fields.boolean('Fri'), + 'sa': fields.boolean('Sat'), + 'su': fields.boolean('Sun'), 'select1': fields.selection([('date', 'Date of month'), \ - ('day', 'Day of month')], 'Option'), - 'day': fields.integer('Date of month'), + ('day', 'Day of month')], 'Option'), + 'day': fields.integer('Date of month'), 'week_list': fields.selection([('MO', 'Monday'), ('TU', 'Tuesday'), \ ('WE', 'Wednesday'), ('TH', 'Thursday'), \ ('FR', 'Friday'), ('SA', 'Saturday'), \ - ('SU', 'Sunday')], 'Weekday'), + ('SU', 'Sunday')], 'Weekday'), 'byday': fields.selection([('1', 'First'), ('2', 'Second'), \ ('3', 'Third'), ('4', 'Fourth'), \ ('5', 'Fifth'), ('-1', 'Last')], 'By day'), 'month_list': fields.selection(months.items(), 'Month'), 'end_date': fields.date('Repeat Until'), - 'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel',\ - 'event_id', 'attendee_id', 'Attendees'), + 'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel', \ + 'event_id', 'attendee_id', 'Attendees'), 'allday': fields.boolean('All Day'), 'active': fields.boolean('Active', help="If the active field is set to \ true, it will allow you to hide the event alarm information without removing it.") } _defaults = { - 'class': lambda *a: 'public', - 'show_as': lambda *a: 'busy', - 'freq': lambda *x: 'None', - 'select1': lambda *x: 'date', - 'interval': lambda *x: 1, - 'active': lambda *x: 1, + 'class': lambda *a: 'public', + 'show_as': lambda *a: 'busy', + 'freq': lambda *x: 'None', + 'select1': lambda *x: 'date', + 'interval': lambda *x: 1, + 'active': lambda *x: 1, } - + def open_event(self, cr, uid, ids, context=None): """ Open Event From for Editing @@ -1067,11 +1090,11 @@ true, it will allow you to hide the event alarm information without removing it. """ if not context: context = {} - + data_obj = self.pool.get('ir.model.data') - + value = {} - + id2 = data_obj._get_id(cr, uid, 'base_calendar', 'event_form_view') id3 = data_obj._get_id(cr, uid, 'base_calendar', 'event_tree_view') id4 = data_obj._get_id(cr, uid, 'base_calendar', 'event_calendar_view') @@ -1088,32 +1111,32 @@ true, it will allow you to hide the event alarm information without removing it. 'view_mode': 'form,tree', 'res_model': 'calendar.event', 'view_id': False, - 'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar')], + 'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar')], 'type': 'ir.actions.act_window', 'res_id': base_calendar_id2real_id(id), 'nodestroy': True } - + return value def modify_this(self, cr, uid, event_id, defaults, real_date, context=None, *args): - """ + """Modifies only one event record out of virtual recurrent events + and creates new event as a specific instance of a Recurring Event", @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param event_id: Get Event_id - @param real_date: Get Real Date + @param event_id: Id of Recurring Event + @param real_date: Date of event recurrence that is being modified @param context: A standard dictionary for contextual values - @param *args: Get Tuppel Value - + @param *args: Get Tupple Value """ event_id = base_calendar_id2real_id(event_id) datas = self.read(cr, uid, event_id, context=context) defaults.update({ - 'recurrent_uid': base_calendar_id2real_id(datas['id']), - 'recurrent_id': defaults.get('date') or real_date, - 'rrule_type': 'none', + 'recurrent_uid': base_calendar_id2real_id(datas['id']), + 'recurrent_id': defaults.get('date') or real_date, + 'rrule_type': 'none', 'rrule': '' }) exdate = datas['exdate'] and datas['exdate'].split(',') or [] @@ -1125,13 +1148,14 @@ true, it will allow you to hide the event alarm information without removing it. def modify_all(self, cr, uid, event_ids, defaults, context=None, *args): """ - Modify name, date, date_deadline fields. + Modifies the recurring event @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param event_ids: List of crm meeting’s IDs. + @param context: A standard dictionary for contextual values @return: True """ - + for event_id in event_ids: event_id = base_calendar_id2real_id(event_id) @@ -1146,11 +1170,12 @@ true, it will allow you to hide the event alarm information without removing it. qry += ", location = '%(location)s'" qry += "WHERE id = %s" % (event_id) cr.execute(qry %(defaults)) - + return True def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100): - """ + """Gives virtual event ids for recurring events based on value of Recurrence Rule + This method gives ids of dates that comes between start date and end date of calendar views @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @@ -1167,7 +1192,7 @@ true, it will allow you to hide the event alarm information without removing it. result = [] if ids and (base_start_date or base_until_date): cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \ - m.exdate from " + self._table + \ + m.exdate, m.exrule from " + self._table + \ " m where m.id in ("\ + ','.join(map(lambda x: str(x), ids))+")") @@ -1214,7 +1239,7 @@ true, it will allow you to hide the event alarm information without removing it. new_rule = '%s=%s' % (name, value) new_rrule_str.append(new_rule) new_rrule_str = ';'.join(new_rrule_str) - rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date) + rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date, data['exrule']) for rdate in rdates: r_date = datetime.strptime(rdate, "%Y-%m-%d %H:%M:%S") if start_date and r_date < start_date: @@ -1229,15 +1254,16 @@ true, it will allow you to hide the event alarm information without removing it. if isinstance(select, (str, int, long)): return ids and ids[0] or False return ids - + def compute_rule_string(self, cr, uid, datas, context=None, *args): """ - Compute rule string. + Compute rule string according to value type RECUR of iCalendar from the values given. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param datas: dictionary of freq and interval value. - @return: string value which compute FREQILY;INTERVAL + @param context: A standard dictionary for contextual values + @return: String value of the format RECUR of iCalendar """ weekdays = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su'] @@ -1248,9 +1274,9 @@ true, it will allow you to hide the event alarm information without removing it. freq = datas.get('freq') if freq == 'None': return '' - + interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or '' - + if freq == 'weekly': byday = map(lambda x: x.upper(), filter(lambda x: datas.get(x) and x in weekdays, datas)) @@ -1286,7 +1312,7 @@ true, it will allow you to hide the event alarm information without removing it. return rrule_string - def search(self, cr, uid, args, offset=0, limit=100, order=None, + def search(self, cr, uid, args, offset=0, limit=100, order=None, context=None, count=False): """ Overrides orm search method. @@ -1295,6 +1321,8 @@ true, it will allow you to hide the event alarm information without removing it. @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @param offset: The Number of Results to Pass @param limit: The Number of Results to Return + @param context: A standard dictionary for contextual values + @param count: If its True the method returns number of records instead of ids @return: List of id """ args_without_date = [] @@ -1317,14 +1345,16 @@ true, it will allow you to hide the event alarm information without removing it. return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit) + def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): """ - Writes values in one or several fields. + Overrides orm write method. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of crm meeting's ids @param vals: Dictionary of field value. + @param context: A standard dictionary for contextual values @return: True """ if not context: @@ -1348,7 +1378,7 @@ true, it will allow you to hide the event alarm information without removing it. event_id = base_calendar_id2real_id(event_id) if not event_id in new_ids: new_ids.append(event_id) - + res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context) if vals.has_key('alarm_id') or vals.has_key('base_calendar_alarm_id'): alarm_obj = self.pool.get('res.alarm') @@ -1364,6 +1394,7 @@ true, it will allow you to hide the event alarm information without removing it. @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of crm meeting's ids + @param context: A standard dictionary for contextual values @return: the object list. """ if isinstance(ids, (str, int, long)): @@ -1378,15 +1409,19 @@ true, it will allow you to hide the event alarm information without removing it. return res - def read(self, cr, uid, ids, fields=None, context={}, load='_classic_read'): + def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'): """ Overrides orm Read method.Read List of fields for calendar event. @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @param ids: List of calendar event's id. @param fields: List of fields. + @param context: A standard dictionary for contextual values @return: List of Dictionary of form [{‘name_of_the_field’: value, ...}, ...] """ + if not context: + context = {} + if isinstance(ids, (str, int, long)): select = [ids] else: @@ -1408,14 +1443,17 @@ true, it will allow you to hide the event alarm information without removing it. return result and result[0] or False return result - def copy(self, cr, uid, id, default=None, context={}): + def copy(self, cr, uid, id, default=None, context=None): """ Duplicate record on specified id. @param self: the object pointer. @param cr: the current row, from the database cursor, @param id: id of record from which we duplicated. + @param context: A standard dictionary for contextual values @return: Duplicate record id. """ + if not context: + context = {} res = super(calendar_event, self).copy(cr, uid, base_calendar_id2real_id(id), default, context) alarm_obj = self.pool.get('res.alarm') alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date') @@ -1428,6 +1466,7 @@ true, it will allow you to hide the event alarm information without removing it. @param self: the object pointer. @param cr: the current row, from the database cursor, @param id: List of calendar event's id. + @param context: A standard dictionary for contextual values @return: True """ res = False @@ -1454,15 +1493,18 @@ true, it will allow you to hide the event alarm information without removing it. alarm_obj.do_alarm_unlink(cr, uid, ids, self._name) return res - def create(self, cr, uid, vals, context={}): + def create(self, cr, uid, vals, context=None): """ Create new record. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param vals: dictionary of every field value. + @param context: A standard dictionary for contextual values @return: new created record id. """ + if not context: + context = {} 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') @@ -1478,7 +1520,7 @@ class calendar_todo(osv.osv): _description = "Calendar Task" def _get_date(self, cr, uid, ids, name, arg, context): - """ + """ Get Date @param self: The object pointer @param cr: the current row, from the database cursor, @@ -1494,7 +1536,7 @@ class calendar_todo(osv.osv): return res def _set_date(self, cr, uid, id, name, value, arg, context): - """ + """ Set Date @param self: The object pointer @param cr: the current row, from the database cursor, @@ -1512,8 +1554,8 @@ class calendar_todo(osv.osv): _columns = { 'date': fields.function(_get_date, method=True, fnct_inv=_set_date, \ - string='Duration', store=True, type='datetime'), - 'duration': fields.integer('Duration'), + string='Duration', store=True, type='datetime'), + 'duration': fields.integer('Duration'), } __attribute__ = {} @@ -1526,7 +1568,7 @@ class ir_attachment(osv.osv): _inherit = 'ir.attachment' def search_count(self, cr, user, args, context=None): - """ + """ @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user’s ID for security checks, @@ -1539,9 +1581,9 @@ class ir_attachment(osv.osv): args1.append(map(lambda x:str(x).split('-')[0], arg)) return super(ir_attachment, self).search_count(cr, user, args1, context) - def search(self, cr, uid, args, offset=0, limit=None, order=None, + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): - """ + """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @@ -1555,8 +1597,8 @@ class ir_attachment(osv.osv): for i, arg in enumerate(new_args): if arg[0] == 'res_id': new_args[i] = (arg[0], arg[1], base_calendar_id2real_id(arg[2])) - return super(ir_attachment, self).search(cr, uid, new_args, offset=offset, - limit=limit, order=order, + return super(ir_attachment, self).search(cr, uid, new_args, offset=offset, + limit=limit, order=order, context=context, count=False) ir_attachment() @@ -1565,12 +1607,12 @@ class ir_values(osv.osv): def set(self, cr, uid, key, key2, name, models, value, replace=True, \ isobject=False, meta=False, preserve_user=False, company=False): - """ + """ Set IR Values @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param model: Get The Model + @param model: Get The Model """ new_model = [] @@ -1582,16 +1624,17 @@ class ir_values(osv.osv): return super(ir_values, self).set(cr, uid, key, key2, name, new_model, \ value, replace, isobject, meta, preserve_user, company) - def get(self, cr, uid, key, key2, models, meta=False, context={}, \ + def get(self, cr, uid, key, key2, models, meta=False, context=None, \ res_id_req=False, without_user=True, key2_req=True): - """ + """ Get IR Values @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param model: Get The Model + @param model: Get The Model """ - + if not context: + context = {} new_model = [] for data in models: if type(data) in (list, tuple): @@ -1607,38 +1650,36 @@ class ir_model(osv.osv): _inherit = 'ir.model' - def read(self, cr, uid, ids, fields=None, context={}, + def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'): """ - Read IR Model + Overrides orm read method. @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of IR Model’s IDs. - @param context: A standard dictionary for contextual values + @param context: A standard dictionary for contextual values """ - - if isinstance(ids, (str, int, long)): - ids = [ids] - + if not context: + context = {} data = super(ir_model, self).read(cr, uid, ids, fields=fields, \ context=context, load=load) if data: for val in data: val['id'] = base_calendar_id2real_id(val['id']) - return data + return isinstance(ids, (str, int, long)) and data[0] or data ir_model() class virtual_report_spool(web_services.report_spool): def exp_report(self, db, uid, object, ids, datas=None, context=None): - """ + """ Export Report @param self: The object pointer @param db: get the current database, @param uid: the current user’s ID for security checks, - @param context: A standard dictionary for contextual values + @param context: A standard dictionary for contextual values """ if object == 'printscreen.list': @@ -1658,19 +1699,19 @@ class res_users(osv.osv): def _get_user_avail(self, cr, uid, ids, context=None): """ - Get USer Availability + Get User Availability @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of res user’s IDs. - @param context: A standard dictionary for contextual values + @param context: A standard dictionary for contextual values """ current_datetime = datetime.now().strftime('%Y-%m-%d %H:%M:%S') res = {} attendee_obj = self.pool.get('calendar.attendee') attendee_ids = attendee_obj.search(cr, uid, [ - ('event_date', '<=', current_datetime), ('event_end_date', '<=', current_datetime), + ('event_date', '<=', current_datetime), ('event_end_date', '<=', current_datetime), ('state', '=', 'accepted'), ('user_id', 'in', ids) ]) @@ -1689,12 +1730,12 @@ class res_users(osv.osv): def _get_user_avail_fun(self, cr, uid, ids, name, args, context=None): """ - Get USer Availability Function + Get User Availability Function @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of res user’s IDs. - @param context: A standard dictionary for contextual values + @param context: A standard dictionary for contextual values """ return self._get_user_avail(cr, uid, ids, context=context) @@ -1702,8 +1743,9 @@ class res_users(osv.osv): _columns = { 'availability': fields.function(_get_user_avail_fun, type='selection', \ selection=[('free', 'Free'), ('busy', 'Busy')], \ - string='Free/Busy', method=True), + string='Free/Busy', method=True), } + res_users() diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml index 0c8a52260ef..d31266c9090 100644 --- a/addons/base_calendar/base_calendar_view.xml +++ b/addons/base_calendar/base_calendar_view.xml @@ -1,6 +1,8 @@ + + calendar.attendee.form @@ -65,6 +67,8 @@
+ + calendar.attendee.tree @@ -77,10 +81,14 @@ + + - + + + calendar.attendee.search calendar.attendee @@ -99,11 +107,26 @@ + + + + + + + + + - + + Event Invitations ir.actions.act_window @@ -115,10 +138,12 @@ + + @@ -138,9 +163,6 @@ - - - @@ -162,7 +184,8 @@ - + + Available Alarms ir.actions.act_window @@ -170,6 +193,8 @@ form tree,form + + + diff --git a/addons/base_calendar/wizard/__init__.py b/addons/base_calendar/wizard/__init__.py index 27614aacd88..8b45dc18a17 100644 --- a/addons/base_calendar/wizard/__init__.py +++ b/addons/base_calendar/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,12 +15,13 @@ # 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 calendar_event_edit_all import base_calendar_invite_attendee +import base_calendar_set_exrule # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml b/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml index 4fe55998e59..bea5ea66a84 100644 --- a/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml +++ b/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml @@ -13,37 +13,38 @@ - - - + colspan="6" /> -