diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 5ba019b5621..6f3675392e0 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -45,7 +45,6 @@ module named account_voucher. 'init_xml': [], "depends" : ["product", "analytic", "process","board"], 'update_xml': [ - #'test/test_parent_structure.yml', 'security/account_security.xml', 'security/ir.model.access.csv', 'account_menuitem.xml', @@ -53,6 +52,7 @@ module named account_voucher. 'wizard/account_statement_from_invoice_view.xml', 'wizard/account_move_bank_reconcile_view.xml', 'wizard/account_use_model_view.xml', + 'account_installer.xml', 'account_view.xml', 'account_report.xml', 'wizard/account_report_common_view.xml', @@ -60,6 +60,7 @@ module named account_voucher. 'wizard/account_period_close_view.xml', 'wizard/account_fiscalyear_close_state.xml', 'wizard/account_chart_view.xml', + 'wizard/account_tax_chart_view.xml', 'wizard/account_move_journal_view.xml', 'wizard/account_move_line_reconcile_select_view.xml', 'wizard/account_open_closed_fiscalyear_view.xml', @@ -80,7 +81,6 @@ module named account_voucher. 'wizard/account_invoice_state_view.xml', 'wizard/account_report_partner_balance_view.xml', 'wizard/account_report_account_balance_view.xml', -# 'wizard/account_move_line_select_view.xml', 'wizard/account_report_aged_partner_balance_view.xml', 'wizard/account_compare_account_balance_report_view.xml', 'wizard/account_report_partner_ledger_view.xml', @@ -110,19 +110,15 @@ module named account_voucher. 'process/supplier_invoice_process.xml', 'sequence_view.xml', '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', 'board_account_view.xml', "wizard/account_report_profit_loss_view.xml", "wizard/account_report_balance_sheet_view.xml" ], 'demo_xml': [ - #'demo/price_accuracy00.yml', 'account_demo.xml', 'project/project_demo.xml', 'project/analytic_account_demo.xml', @@ -137,7 +133,6 @@ module named account_voucher. 'test/chart_of_account.yml', 'test/account_period_close.yml', 'test/account_fiscalyear_close_state.yml', - #'test/account_invoice_state.yml', 'test/account_use_model.yml', 'test/account_validate_account_move.yml', 'test/account_fiscalyear_close.yml', diff --git a/addons/account/account.py b/addons/account/account.py index b050f43ad4e..f132c933821 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -138,7 +138,6 @@ class account_payment_term_line(osv.osv): account_payment_term_line() - class account_account_type(osv.osv): _name = "account.account.type" _description = "Account Type" @@ -198,19 +197,6 @@ class account_account(osv.osv): _parent_store = True logger = netsvc.Logger() - def _get_children_and_consol(self, cr, uid, ids, context={}): - ids2=[] - temp=[] - read_data= self.read(cr, uid, ids,['id','child_id'], context) - for data in read_data: - ids2.append(data['id']) - if data['child_id']: - temp=[] - for x in data['child_id']: - temp.append(x) - ids2 += self._get_children_and_consol(cr, uid, temp, context) - return ids2 - def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): if context is None: @@ -245,7 +231,9 @@ class account_account(osv.osv): return super(account_account, self).search(cr, uid, args, offset, limit, order, context=context, count=count) - def _get_children_and_consol(self, cr, uid, ids, context={}): + def _get_children_and_consol(self, cr, uid, ids, context=None): + if context is None: + context = {} #this function search for all the children and all consolidated children (recursively) of the given account ids ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context) ids3 = [] @@ -413,24 +401,13 @@ class account_account(osv.osv): 'manage this. So if you import from another software system you may have to use the rate at date. ' \ 'Incoming transactions always use the rate at date.', \ required=True), - 'check_history': fields.boolean('Display History', - help="Check this box if you want to print all entries when printing the General Ledger, "\ - "otherwise it will only print its balance."), 'level': fields.function(_get_level, string='Level', method=True, store=True, type='integer'), } - def _default_company(self, cr, uid, context={}): - user = self.pool.get('res.users').browse(cr, uid, uid, context=context) - if user.company_id: - return user.company_id.id - return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] - _defaults = { 'type': lambda *a : 'view', 'reconcile': lambda *a: False, - 'company_id': _default_company, 'active': lambda *a: True, - 'check_history': lambda *a: True, 'currency_mode': lambda *a: 'current', 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c), } @@ -618,7 +595,7 @@ class account_journal(osv.osv): _columns = { 'name': fields.char('Journal Name', size=64, required=True, translate=True,help="Name of the journal"), 'code': fields.char('Code', size=16,required=True,help="Code of the journal"), - 'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'),('expense', 'Expense'), ('cash', 'Cash'), ('bank', 'Bank'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True, + 'type': fields.selection([('sale', 'Sale'),('sale_refund','Sale Refund'), ('purchase', 'Purchase'), ('purchase_refund','Purchase Refund'),('expense', 'Expense'), ('cash', 'Cash'), ('bank', 'Bank and Cheques'), ('general', 'General'), ('situation', 'Situation')], 'Type', size=32, required=True, help="Select 'Sale' for Sale journal to be used at the time of making invoice."\ " Select 'Purchase' for Purchase Journal to be used at the time of approving purchase order."\ " Select 'Cash' to be used at the time of making payment."\ @@ -632,15 +609,15 @@ class account_journal(osv.osv): 'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]", help="It acts as a default account for debit amount"), 'centralisation': fields.boolean('Centralised counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."), 'update_posted': fields.boolean('Allow Cancelling Entries', help="Check this box if you want to allow the cancellation the entries related to this journal or of the invoice related to this journal"), - 'group_invoice_lines': fields.boolean('Group invoice lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."), + 'group_invoice_lines': fields.boolean('Group Invoice Lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."), 'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="The sequence gives the display order for a list of journals", required=False), 'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"), 'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'), 'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'), 'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'), 'company_id': fields.many2one('res.company', 'Company', required=True, select=1, help="Company related to this journal"), - 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \ - help="The sequence used for invoice numbers in this journal."), +# 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \ +# help="The sequence used for invoice numbers in this journal."), 'allow_date':fields.boolean('Check Date not in the Period', help= 'If set to True then do not accept the entry if the entry date is not into the period dates'), } @@ -648,7 +625,7 @@ class account_journal(osv.osv): 'user_id': lambda self,cr,uid,context: uid, 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } - + def write(self, cr, uid, ids, vals, context=None): obj=[] if 'company_id' in vals: @@ -674,21 +651,21 @@ class account_journal(osv.osv): 'purchase_refund':'seq_out_refund', 'sale_refund':'seq_in_refund' } - + seq_pool = self.pool.get('ir.sequence') seq_typ_pool = self.pool.get('ir.sequence.type') date_pool = self.pool.get('ir.model.data') - + result = True - + journal = self.browse(cr, uid, ids[0], context) - code = journal.code.lower() + code = journal.code.lower() types = { 'name':journal.name, 'code':code } type_id = seq_typ_pool.create(cr, uid, types) - + seq = { 'name':journal.name, 'code':code, @@ -698,54 +675,41 @@ class account_journal(osv.osv): 'number_increment':1 } seq_id = seq_pool.create(cr, uid, seq) - + res = {} if not journal.sequence_id: res.update({ 'sequence_id':seq_id }) - if journal.type in journal_type and not journal.invoice_sequence_id: - res_ids = date_pool.search(cr, uid, [('model','=','ir.sequence'), ('name','=',journal_seq.get(journal.type, 'sale'))]) - inv_seq_id = date_pool.browse(cr, uid, res_ids[0]).res_id - inv_seq_id - res.update({ - 'invoice_sequence_id':inv_seq_id - }) - result = self.write(cr, uid, [journal.id], res) - + return result - + def create(self, cr, uid, vals, context={}): journal_id = super(account_journal, self).create(cr, uid, vals, context) self.create_sequence(cr, uid, [journal_id], context) - -# journal_name = self.browse(cr, uid, [journal_id])[0].code -# periods = self.pool.get('account.period') -# ids = periods.search(cr, uid, [('date_stop','>=',time.strftime('%Y-%m-%d'))]) -# for period in periods.browse(cr, uid, ids): -# self.pool.get('account.journal.period').create(cr, uid, { -# 'name': (journal_name or '')+':'+(period.code or ''), -# 'journal_id': journal_id, -# 'period_id': period.id -# }) return journal_id - def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=100): + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100): if not args: args = [] + if context is None: + context = {} ids = [] + if context.get('journal_type', False): + args += [('type','=',context.get('journal_type'))] if name: - ids = self.search(cr, user, [('code','ilike',name)]+ args, limit=limit, context=context) + 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, context=context) + ids = self.search(cr, user, [('name', 'ilike', name)]+ args, limit=limit, context=context)#fix it ilike should be replace with operator + return self.name_get(cr, user, ids, context=context) def onchange_type(self, cr, uid, ids, type, currency): data_pool = self.pool.get('ir.model.data') user_pool = self.pool.get('res.users') - + type_map = { 'sale':'account_sp_journal_view', 'sale_refund':'account_sp_refund_journal_view', @@ -757,23 +721,23 @@ class account_journal(osv.osv): 'general':'account_journal_view', 'situation':'account_journal_view' } - + res = {} - + view_id = type_map.get(type, 'general') - + user = user_pool.browse(cr, uid, uid) if type in ('cash', 'bank') and currency and user.company_id.currency_id.id != currency: view_id = 'account_journal_bank_view_multi' - + data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=',view_id)]) data = data_pool.browse(cr, uid, data_id[0]) - + res.update({ 'centralisation':type == 'situation', 'view_id':data.res_id, }) - + return { 'value':res } @@ -790,10 +754,8 @@ class account_fiscalyear(osv.osv): 'date_start': fields.date('Start Date', required=True), 'date_stop': fields.date('End Date', required=True), 'period_ids': fields.one2many('account.period', 'fiscalyear_id', 'Periods'), - 'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True, - help='When fiscal year is created. The state is \'Draft\'. At the end of the year it is in \'Done\' state.'), + 'state': fields.selection([('draft','Open'), ('done','Closed')], 'State', readonly=True), } - _defaults = { 'state': lambda *a: 'draft', 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, @@ -850,9 +812,9 @@ class account_fiscalyear(osv.osv): 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) 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) return self.name_get(cr, user, ids, context=context) account_fiscalyear() @@ -870,11 +832,10 @@ class account_period(osv.osv): 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True), 'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True, help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'), - 'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True) + 'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True) } _defaults = { - 'state': lambda *a: 'draft', - 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, + 'state': 'draft', } _order = "date_start" @@ -922,13 +883,10 @@ class account_period(osv.osv): return ids def action_draft(self, cr, uid, ids, *args): - users_roles = self.pool.get('res.users').browse(cr, uid, uid).roles_id - for role in users_roles: - if role.name=='Period': - mode = 'draft' - for id in ids: - 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)) + mode = 'draft' + for id in ids: + 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={}, limit=80): @@ -1005,7 +963,6 @@ class account_journal_period(osv.osv): _defaults = { 'state': lambda *a: 'draft', 'active': lambda *a: True, - 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } _order = "period_id" @@ -1027,6 +984,38 @@ class account_move(osv.osv): _description = "Account Entry" _order = 'id desc' + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + """ + Returns a list of tupples containing id, name, as internally it is called {def name_get} + result format : {[(id, name), (id, name), ...]} + + @param cr: A database cursor + @param user: ID of the user currently logged in + @param name: name to search + @param args: other arguments + @param operator: default operator is 'ilike', it can be changed + @param context: context arguments, like lang, time zone + @param limit: Returns first 'n' ids of complete result, default is 80. + + @return: Returns a list of tupples containing id and name + """ + + if not args: + args=[] + if not context: + context={} + ids = [] + if name: + ids += self.search(cr, user, [('name','ilike',name)]+args, limit=limit, context=context) + + if not ids and name and type(name) == int: + ids += self.search(cr, user, [('id','=',name)]+args, limit=limit, context=context) + + if not ids: + ids += self.search(cr, user, args, limit=limit, context=context) + + return self.name_get(cr, user, ids, context=context) + def name_get(self, cursor, user, ids, context=None): if not len(ids): return [] @@ -1059,21 +1048,25 @@ class account_move(osv.osv): return result def _search_amount(self, cr, uid, obj, name, args, context): - ids = [] - cr.execute('select move_id,sum(debit) from account_move_line group by move_id') - result = dict(cr.fetchall()) - - for item in args: - if item[1] == '>=': - res = [('id', 'in', [k for k,v in result.iteritems() if v >= item[2]])] + ids = set() + for cond in args: + amount = cond[2] + if isinstance(cond[2],(list,tuple)): + if cond[1] in ['in','not in']: + amount = tuple(cond[2]) + else: + continue else: - res = [('id', 'in', [k for k,v in result.iteritems() if v <= item[2]])] - ids += res - - if not ids: - return [('id', '>', '0')] - - return ids + if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']: + continue + + cr.execute("select move_id from account_move_line group by move_id having sum(debit) %s %%s" % (cond[1]) ,(amount,)) + res_ids = set(id[0] for id in cr.fetchall()) + ids = ids and (ids & res_ids) or res_ids + if ids: + return [('id','in',tuple(ids))] + else: + return [('id', '=', '0')] _columns = { 'name': fields.char('Number', size=64, required=True), @@ -1126,18 +1119,24 @@ class account_move(osv.osv): 'You cannot create entries on different periods/journals in the same move', ['line_id']), ] - + def post(self, cr, uid, ids, context=None): + invoice = context.get('invoice', False) if self.validate(cr, uid, ids, context) and len(ids): for move in self.browse(cr, uid, ids): if move.name =='/': new_name = False journal = move.journal_id - if journal.sequence_id: - c = {'fiscalyear_id': move.period_id.fiscalyear_id.id} - new_name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id, context=c) + + if invoice and invoice.internal_number: + new_name = invoice.internal_number else: - raise osv.except_osv(_('Error'), _('No sequence defined in the journal !')) + if journal.sequence_id: + c = {'fiscalyear_id': move.period_id.fiscalyear_id.id} + new_name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id, context=c) + else: + raise osv.except_osv(_('Error'), _('No sequence defined in the journal !')) + if new_name: self.write(cr, uid, [move.id], {'name':new_name}) @@ -1185,7 +1184,7 @@ class account_move(osv.osv): 'balance':False, 'account_tax_id':False, }) - + if 'journal_id' in vals and vals.get('journal_id', False): for l in vals['line_id']: if not l[0]: @@ -1391,8 +1390,6 @@ class account_move(osv.osv): self.pool.get('account.move.line').write(cr, uid, line_ids, { 'journal_id': move.journal_id.id, 'period_id': move.period_id.id, - #'tax_code_id': False, - #'tax_amount': False, 'state': 'draft' }, context, check=False) # Create analytic lines for the valid moves @@ -1634,15 +1631,15 @@ class account_tax(osv.osv): """ Returns a list of tupples containing id, name, as internally it is called {def name_get} result format : {[(id, name), (id, name), ...]} - + @param cr: A database cursor @param user: ID of the user currently logged in - @param name: name to search + @param name: name to search @param args: other arguments @param operator: default operator is 'ilike', it can be changed @param context: context arguments, like lang, time zone @param limit: Returns first 'n' ids of complete result, default is 80. - + @return: Returns a list of tupples containing id and name """ if not args: @@ -1652,10 +1649,10 @@ class account_tax(osv.osv): ids = [] ids = self.search(cr, user, args, limit=limit, context=context) return self.name_get(cr, user, ids, context=context) - + def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): journal_pool = self.pool.get('account.journal') - + if context and context.has_key('type'): if context.get('type') in ('out_invoice','out_refund'): args += [('type_tax_use','in',['sale','all'])] @@ -1666,7 +1663,7 @@ class account_tax(osv.osv): journal = journal_pool.browse(cr, uid, context.get('journal_id')) if journal.type in ('sale', 'purchase'): args += [('type_tax_use','in',[journal.type,'all'])] - + return super(account_tax, self).search(cr, uid, args, offset, limit, order, context, count) def name_get(self, cr, uid, ids, context={}): @@ -1683,7 +1680,7 @@ class account_tax(osv.osv): if user.company_id: return user.company_id.id return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] - + _defaults = { 'python_compute': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or None\n# partner : res.partner object or None\n\nresult = price_unit * 0.10''', 'python_compute_inv': lambda *a: '''# price_unit\n# address : res.partner.address object or False\n# product : product.product object or False\n\nresult = price_unit * 0.10''', @@ -1803,11 +1800,11 @@ class account_tax(osv.osv): tin = self.compute_inv(cr, uid, tin, price_unit, quantity, address_id=address_id, product=product, partner=partner) for r in tin: totalex -= r['amount'] - totlex_qty=0.0 + totlex_qty=0.0 try: totlex_qty=totalex/quantity except: - pass + pass tex = self._compute(cr, uid, tex, totlex_qty, quantity, address_id=address_id, product=product, partner=partner) for r in tex: totalin += r['amount'] @@ -1875,8 +1872,6 @@ class account_tax(osv.osv): amount = localdict['result'] elif tax.type=='balance': amount = cur_price_unit - reduce(lambda x,y: y.get('amount',0.0)+x, res, 0.0) -# data['balance'] = cur_price_unit - if tax.include_base_amount: cur_price_unit -= amount @@ -1951,12 +1946,14 @@ class account_model(osv.osv): 'name': fields.char('Model Name', size=64, required=True, help="This is a model for recurring accounting entries"), 'ref': fields.char('Reference', size=64), 'journal_id': fields.many2one('account.journal', 'Journal', required=True), + 'company_id': fields.many2one('res.company', 'Company', required=True), 'lines_id': fields.one2many('account.model.line', 'model_id', 'Model Entries'), 'legend' :fields.text('Legend', readonly=True, size=100), } _defaults = { 'legend': lambda self, cr, uid, context:_('You can specify year, month and date in the name of the model using the following labels:\n\n%(year)s : To Specify Year \n%(month)s : To Specify Month \n%(date)s : Current Date\n\ne.g. My model on %(date)s'), + 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id } def generate(self, cr, uid, ids, datas={}, context={}): move_ids = [] @@ -2113,11 +2110,10 @@ class account_subscription_line(osv.osv): 'date': fields.date('Date', required=True), 'move_id': fields.many2one('account.move', 'Entry'), } - _defaults = { - } - def move_create(self, cr, uid, ids, context={}): + + def move_create(self, cr, uid, ids, context=None): tocheck = {} - for line in self.browse(cr, uid, ids, context): + for line in self.browse(cr, uid, ids, context=context): datas = { 'date': line.date, } @@ -2126,7 +2122,8 @@ class account_subscription_line(osv.osv): self.write(cr, uid, [line.id], {'move_id':ids[0]}) if tocheck: self.pool.get('account.subscription').check(cr, uid, tocheck.keys(), context) - return True + return ids + _rec_name = 'date' account_subscription_line() @@ -2205,7 +2202,6 @@ class account_add_tmpl_wizard(osv.osv_memory): def _get_def_cparent(self, cr, uid, context): acc_obj=self.pool.get('account.account') tmpl_obj=self.pool.get('account.account.template') - #print "Searching for ",context tids=tmpl_obj.read(cr, uid, [context['tmpl_ids']], ['parent_id']) if not tids or not tids[0]['parent_id']: return False @@ -2230,12 +2226,8 @@ class account_add_tmpl_wizard(osv.osv_memory): data= self.read(cr, uid, ids) company_id = acc_obj.read(cr, uid, [data[0]['cparent_id']], ['company_id'])[0]['company_id'][0] account_template = tmpl_obj.browse(cr, uid, context['tmpl_ids']) - #tax_ids = [] - #for tax in account_template.tax_ids: - # tax_ids.append(tax_template_ref[tax.id]) vals={ 'name': account_template.name, - #'sign': account_template.sign, 'currency_id': account_template.currency_id and account_template.currency_id.id or False, 'code': account_template.code, 'type': account_template.type, @@ -2244,10 +2236,8 @@ class account_add_tmpl_wizard(osv.osv_memory): 'shortcut': account_template.shortcut, 'note': account_template.note, 'parent_id': data[0]['cparent_id'], - # 'tax_ids': [(6,0,tax_ids)], todo!! 'company_id': company_id, } - # print "Creating:", vals new_account = acc_obj.create(cr, uid, vals) return {'type':'state', 'state': 'end' } @@ -2310,6 +2300,7 @@ class account_chart_template(osv.osv): 'property_account_income_categ': fields.many2one('account.account.template','Income Category Account'), 'property_account_expense': fields.many2one('account.account.template','Expense Account on Product Template'), 'property_account_income': fields.many2one('account.account.template','Income Account on Product Template'), + 'property_reserve_and_surplus_account': fields.many2one('account.account.template', 'Reserve and Surplus Account', domain=[('type', '=', 'payable')] , help='This Account is used for transferring Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profilt & Loss Report'), } account_chart_template() @@ -2561,7 +2552,6 @@ class wizard_multi_charts_accounts(osv.osv_memory): code_acc=str(code_acc) + (str('0'*(dig-code_main))) vals={ 'name': (obj_acc_root.id == account_template.id) and obj_multi.company_id.name or account_template.name, - #'sign': account_template.sign, 'currency_id': account_template.currency_id and account_template.currency_id.id or False, 'code': code_acc, 'type': account_template.type, @@ -2591,7 +2581,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')]) data = data_pool.browse(cr, uid, data_id[0]) view_id = data.res_id - + seq_id = obj_sequence.search(cr, uid, [('name','=','Account Journal')])[0] if obj_multi.seq_journal: @@ -2632,16 +2622,16 @@ class wizard_multi_charts_accounts(osv.osv_memory): data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view')]) data = data_pool.browse(cr, uid, data_id[0]) view_id_cash = data.res_id - + data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_journal_bank_view_multi')]) data = data_pool.browse(cr, uid, data_id[0]) - ref_acc_bank = data.res_id + view_id_cur = data.res_id ref_acc_bank = obj_multi.chart_template_id.bank_account_view_id current_num = 1 for line in obj_multi.bank_accounts_id: #create the account_account for this bank journal - tmp = self.pool.get('res.partner.bank').name_get(cr, uid, [line.acc_no.id])[0][1] + tmp = line.acc_name dig = obj_multi.code_digits if ref_acc_bank.code: try: @@ -2649,7 +2639,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): except Exception,e: new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)),'0')) + str(current_num) vals = { - 'name': line.acc_no.bank and line.acc_no.bank.name+' '+tmp or tmp, + 'name': tmp, 'currency_id': line.currency_id and line.currency_id.id or False, 'code': new_code, 'type': 'other', @@ -2693,7 +2683,8 @@ class wizard_multi_charts_accounts(osv.osv_memory): ('property_account_expense_categ','product.category','account.account'), ('property_account_income_categ','product.category','account.account'), ('property_account_expense','product.template','account.account'), - ('property_account_income','product.template','account.account') + ('property_account_income','product.template','account.account'), + ('property_reserve_and_surplus_account','res.company','account.account') ] for record in todo_list: r = [] @@ -2706,6 +2697,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'fields_id': field[0], 'value': account and 'account.account,'+str(acc_template_ref[account.id]) or False, } + if r: #the property exist: modify it property_obj.write(cr, uid, r, vals) @@ -2742,15 +2734,15 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'position_id' : new_fp, } obj_ac_fp.create(cr, uid, vals_acc) - + #fially inactive the demo chart of accounts data_id = data_pool.search(cr, uid, [('model','=','account.account'), ('name','=','chart0')]) if data_id: data = data_pool.browse(cr, uid, data_id[0]) account_id = data.res_id - if account_id: - cr.execute("update account_account set active='f' where id=%s" % (account_id)) - + acc_ids = obj_acc._get_children_and_consol(cr, uid, [account_id]) + if acc_ids: + cr.execute("update account_account set active='f' where id in " + str(tuple(acc_ids))) wizard_multi_charts_accounts() class account_bank_accounts_wizard(osv.osv_memory): diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index 1792525a7f6..36fc350dfb8 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -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', context=c), - } + } _order = 'date' def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): @@ -65,7 +65,6 @@ class account_analytic_line(osv.osv): return False return True _constraints = [ -# (_check_company, 'You can not create analytic line that is not in the same company than the account line', ['account_id']) ] # Compute the cost based on the price type define into company diff --git a/addons/account/account_assert_test.xml b/addons/account/account_assert_test.xml index 585c6bda124..88025514763 100644 --- a/addons/account/account_assert_test.xml +++ b/addons/account/account_assert_test.xml @@ -1,28 +1,8 @@ - + - - - diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 59637edb546..32403f658fc 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -20,9 +20,9 @@ ############################################################################## import time + import netsvc from osv import fields, osv - from tools.misc import currency from tools.translate import _ import decimal_precision as dp @@ -52,13 +52,13 @@ class account_bank_statement(osv.osv): journal_pool = self.pool.get('account.journal') journal_type = context.get('journal_type', False) journal_id = False - + if journal_type: ids = journal_pool.search(cr, uid, [('type', '=', journal_type)]) if ids: journal_id = ids[0] - - return journal_id + + return journal_id def _default_balance_start(self, cr, uid, context={}): cr.execute('select id from account_bank_statement where journal_id=%s order by date desc limit 1', (1,)) @@ -126,12 +126,12 @@ class account_bank_statement(osv.osv): currency_id = res[statement_id] res[statement_id] = (currency_id, currency_names[currency_id]) return res - + _order = "date desc" _name = "account.bank.statement" _description = "Bank Statement" _columns = { - 'name': fields.char('Name', size=64, required=True, states={'confirm': [('readonly', True)]}), + 'name': fields.char('Name', size=64, required=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself', states={'confirm': [('readonly', True)]}), 'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'bank')]), @@ -185,7 +185,7 @@ class account_bank_statement(osv.osv): context.update({ 'period_id':pids[0] }) - + return { 'value':res, 'context':context, @@ -194,16 +194,19 @@ class account_bank_statement(osv.osv): def button_dummy(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {}, context) return True - - def button_confirm_bank(self, cr, uid, ids, context={}): + + def button_confirm_bank(self, cr, uid, ids, context=None): done = [] res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') - account_bank_statement_line_obj = \ - self.pool.get('account.bank.statement.line') + account_analytic_line_obj = self.pool.get('account.analytic.line') + account_bank_statement_line_obj = self.pool.get('account.bank.statement.line') + obj_seq = self.pool.get('ir.sequence') + if context is None: + context = {} company_currency_id = res_users_obj.browse(cr, uid, uid, context=context).company_id.currency_id.id @@ -220,6 +223,11 @@ class account_bank_statement(osv.osv): raise osv.except_osv(_('Configuration Error !'), _('Please verify that an account is defined in the journal.')) + if not st.name == '/': + next_number = st.name + else: + next_number = obj_seq.get(cr, uid, 'account.bank.statement') + for line in st.move_line_ids: if line.state <> 'valid': raise osv.except_osv(_('Error !'), @@ -228,14 +236,18 @@ class account_bank_statement(osv.osv): # In line we get reconcile_id on bank.ste.rec. # in bank stat.rec we get line_new_ids on bank.stat.rec.line for move in st.line_ids: - context.update({'date':move.date}) + if move.analytic_account_id: + if not st.journal_id.analytic_journal_id: + raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (st.journal_id.name,)) + + context.update({'date': move.date}) move_id = account_move_obj.create(cr, uid, { 'journal_id': st.journal_id.id, 'period_id': st.period_id.id, 'date': move.date, }, context=context) account_bank_statement_line_obj.write(cr, uid, [move.id], { - 'move_ids': [(4,move_id, False)] + 'move_ids': [(4, move_id, False)] }) if not move.amount: continue @@ -266,6 +278,7 @@ class account_bank_statement(osv.osv): 'journal_id': st.journal_id.id, 'period_id': st.period_id.id, 'currency_id': st.currency.id, + 'analytic_account_id': move.analytic_account_id and move.analytic_account_id.id or False } amount = res_currency_obj.compute(cr, uid, st.currency.id, @@ -287,7 +300,28 @@ class account_bank_statement(osv.osv): account=acc_cur) val['amount_currency'] = amount_cur - torec.append(account_move_line_obj.create(cr, uid, val , context=context)) + move_line_id = account_move_line_obj.create(cr, uid, val , context=context) + torec.append(move_line_id) + + if move.analytic_account_id: + anal_val = {} + amt = (val['credit'] or 0.0) - (val['debit'] or 0.0) + anal_val = { + 'name': val['name'], + 'ref': val['ref'], + 'date': val['date'], + 'amount': amt, + 'account_id': val['analytic_account_id'], + 'currency_id': val['currency_id'], + 'general_account_id': val['account_id'], + 'journal_id': st.journal_id.analytic_journal_id.id, + 'period_id': val['period_id'], + 'user_id': uid, + 'move_id': move_line_id + } + if val.get('amount_currency', False): + anal_val['amount_currency'] = val['amount_currency'] + account_analytic_line_obj.create(cr, uid, anal_val, context=context) if move.reconcile_id and move.reconcile_id.line_new_ids: for newline in move.reconcile_id.line_new_ids: @@ -336,7 +370,7 @@ class account_bank_statement(osv.osv): context=context): if line.state <> 'valid': raise osv.except_osv(_('Error !'), - _('Ledger Posting line "%s" is not valid') % line.name) + _('Journal Item "%s" is not valid') % line.name) if move.reconcile_id and move.reconcile_id.line_ids: ## Search if move has already a partial reconciliation @@ -365,17 +399,12 @@ class account_bank_statement(osv.osv): account_move_line_obj.reconcile(cr, uid, torec, 'statement', writeoff_acc_id=writeoff_acc_id, writeoff_period_id=st.period_id.id, writeoff_journal_id=st.journal_id.id, context=context) else: account_move_line_obj.reconcile_partial(cr, uid, torec, 'statement', context) - #except: - # raise osv.except_osv(_('Error !'), _('Unable to reconcile entry "%s": %.2f') % (move.name, move.amount)) + move_name = next_number + ' - ' + str(move.sequence) + account_move_obj.write(cr, uid, [move_id], {'name': move_name, 'state': 'posted'}) # Bank statements will not consider boolean on journal entry_posted - if st.journal_id.entry_posted: - account_move_obj.write(cr, uid, [move_id], {'state':'posted'}) - self.log(cr, uid, st.id, 'Statement %s is confirmed and entries are created.' % st.name) done.append(st.id) - - next_number = self.pool.get('ir.sequence').get(cr, uid, 'account.bank.statement') - self.write(cr, uid, [st.id], {'name':next_number}, context) + self.write(cr, uid, [st.id], {'name': next_number}, context=context) self.write(cr, uid, done, {'state':'confirm'}, context=context) return True @@ -394,28 +423,15 @@ class account_bank_statement(osv.osv): return True def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None): - if not journal_id: - return {'value': {'currency': False}} - account_journal_obj = self.pool.get('account.journal') res_users_obj = self.pool.get('res.users') - res_currency_obj = self.pool.get('res.currency') - cursor.execute('SELECT balance_end_real \ FROM account_bank_statement \ - WHERE journal_id = %s \ - ORDER BY date DESC,id DESC LIMIT 1', (journal_id,)) + WHERE journal_id = %s AND NOT state = %s \ + ORDER BY date DESC,id DESC LIMIT 1', (journal_id, 'draft')) res = cursor.fetchone() balance_start = res and res[0] or 0.0 - - currency_id = account_journal_obj.browse(cursor, user, journal_id, - context=context).currency.id - if not currency_id: - currency_id = res_users_obj.browse(cursor, user, user, - context=context).company_id.currency_id.id - currency = res_currency_obj.name_get(cursor, user, [currency_id], - context=context)[0] - return {'value': {'balance_start': balance_start, 'currency': currency}} + return {'value': {'balance_start': balance_start}} def unlink(self, cr, uid, ids, context=None): stat = self.read(cr, uid, ids, ['state']) @@ -600,26 +616,27 @@ class account_bank_statement_reconcile_line(osv.osv): 'account_id': fields.many2one('account.account', 'Account', required=True), 'line_id': fields.many2one('account.bank.statement.reconcile', 'Reconcile'), 'amount': fields.float('Amount', required=True), - 'analytic_id': fields.many2one('account.analytic.account',"Analytic Account") + 'analytic_id': fields.many2one('account.analytic.account',"Analytic Account", domain=[('parent_id', '!=', False)]) } _defaults = { - 'name': lambda *a: 'Write-Off', + 'name': 'Write-Off', } account_bank_statement_reconcile_line() class account_bank_statement_line(osv.osv): - def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context={}): + def onchange_partner_id(self, cursor, user, line_id, partner_id, type, currency_id, context=None): res = {'value': {}} - + obj_partner = self.pool.get('res.partner') + if context is None: + context = {} if not 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) + part = obj_partner.browse(cursor, user, partner_id, context=context) if type == 'supplier': account_id = part.property_account_payable.id else: @@ -645,10 +662,6 @@ class account_bank_statement_line(osv.osv): balance = res_currency_obj.compute(cursor, user, company_currency_id, currency_id, balance, context=context) res['value']['amount'] = balance - - if context.get('amount', 0) > 0: - res['value']['amount'] = context.get('amount') - return res def _reconcile_amount(self, cursor, user, ids, name, args, context=None): @@ -670,7 +683,7 @@ class account_bank_statement_line(osv.osv): res[line.id] = 0.0 return res - _order = "date,name desc" + _order = "statement_id desc, sequence" _name = "account.bank.statement.line" _description = "Bank Statement Line" _columns = { @@ -689,6 +702,7 @@ class account_bank_statement_line(osv.osv): select=True, required=True, ondelete='cascade'), 'reconcile_id': fields.many2one('account.bank.statement.reconcile', 'Reconcile'), + 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account'), 'move_ids': fields.many2many('account.move', 'account_bank_statement_line_move_rel', 'move_id','statement_id', 'Moves'), @@ -707,7 +721,4 @@ class account_bank_statement_line(osv.osv): account_bank_statement_line() - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index e5298fa2f9d..42837ad1fb7 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -28,14 +28,14 @@ from tools.translate import _ import decimal_precision as dp class account_cashbox_line(osv.osv): - + """ Cash Box Details """ - + _name = 'account.cashbox.line' _description = 'CashBox Line' def _sub_total(self, cr, uid, ids, name, arg, context=None): - + """ Calculates Sub total @param name: Names of fields. @param arg: User defined arguments @@ -51,7 +51,7 @@ class account_cashbox_line(osv.osv): """ Calculates Sub total on change of number @param pieces: Names of fields. @param number: - """ + """ sub=pieces*number return {'value':{'subtotal': sub or 0.0}} @@ -65,9 +65,9 @@ class account_cashbox_line(osv.osv): account_cashbox_line() class account_cash_statement(osv.osv): - + _inherit = 'account.bank.statement' - + def _get_starting_balance(self, cr, uid, ids, context=None): """ Find starting balance @@ -78,23 +78,23 @@ class account_cash_statement(osv.osv): res ={} for statement in self.browse(cr, uid, ids): amount_total=0.0 - + if statement.journal_id.type not in('cash'): continue - + for line in statement.starting_details_ids: amount_total+= line.pieces * line.number res[statement.id] = { 'balance_start':amount_total } return res - + def _balance_end_cash(self, cr, uid, ids, name, arg, context=None): """ Find ending balance " @param name: Names of fields. @param arg: User defined arguments @return: Dictionary of values. - """ + """ res ={} for statement in self.browse(cr, uid, ids): amount_total=0.0 @@ -102,7 +102,7 @@ class account_cash_statement(osv.osv): amount_total+= line.pieces * line.number res[statement.id]=amount_total return res - + def _get_sum_entry_encoding(self, cr, uid, ids, name, arg, context=None): """ Find encoding total of statements " @@ -118,19 +118,6 @@ class account_cash_statement(osv.osv): res2[statement.id]=encoding_total return res2 -# def _default_journal_id(self, cr, uid, context={}): - -# """ To get default journal for the object" -# @param name: Names of fields. -# @return: journal -# """ -# company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id -# journal = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)]) -# if journal: -# return journal[0] -# else: -# return False - def _end_balance(self, cursor, user, ids, name, attr, context=None): res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') @@ -163,7 +150,7 @@ class account_cash_statement(osv.osv): for r in res: res[r] = round(res[r], 2) return res - + def _get_company(self, cr, uid, ids, context={}): user_pool = self.pool.get('res.users') company_pool = self.pool.get('res.company') @@ -171,7 +158,7 @@ class account_cash_statement(osv.osv): company_id = user.company_id and user.company_id.id if not company_id: company_id = company_pool.search(cr, uid, [])[0] - + return company_id def _get_cash_open_box_lines(self, cr, uid, ids, context={}): @@ -195,14 +182,14 @@ class account_cash_statement(osv.osv): } res.append((0, 0, dct)) return res - + _columns = { 'company_id':fields.many2one('res.company', 'Company', required=False), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'cash')]), 'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm':[('readonly', True)]}, help="closing balance entered by the cashbox verifier"), 'state': fields.selection( [('draft', 'Draft'), - ('confirm', 'Confirm'), + ('confirm', 'Confirmed'), ('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"), 'total_entry_encoding':fields.function(_get_sum_entry_encoding, method=True, store=True, string="Cash Transaction", help="Total cash transactions"), 'closing_date':fields.datetime("Closed On"), @@ -210,7 +197,7 @@ class account_cash_statement(osv.osv): 'balance_end_cash': fields.function(_balance_end_cash, method=True, store=True, string='Balance', help="Closing balance based on cashBox"), 'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'), 'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'), - 'name': fields.char('Name', size=64, required=True, readonly=True), + 'name': fields.char('Name', size=64, required=True, readonly=False, help='if you give the Name other then / , its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'), 'user_id':fields.many2one('res.users', 'Responsible', required=False), } _defaults = { @@ -226,8 +213,8 @@ class account_cash_statement(osv.osv): company_id = vals and vals.get('company_id',False) if company_id: sql = [ - ('company_id', '=', vals['company_id']), - ('journal_id', '=', vals['journal_id']), + ('company_id', '=', vals['company_id']), + ('journal_id', '=', vals['journal_id']), ('state', '=', 'open') ] open_jrnl = self.search(cr, uid, sql) @@ -247,112 +234,112 @@ class account_cash_statement(osv.osv): res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context) self.write(cr, uid, [res_id], {}) return res_id - + def write(self, cr, uid, ids, vals, context=None): """ Update redord(s) comes in {ids}, with new value comes as {vals} return True on success, False otherwise - + @param cr: cursor to database @param user: id of current user @param ids: list of record ids to be update @param vals: dict of new values to be set @param context: context arguments, like lang, time zone - + @return: True on success, False otherwise """ - + super(account_cash_statement, self).write(cr, uid, ids, vals) res = self._get_starting_balance(cr, uid, ids) for rs in res: super(account_cash_statement, self).write(cr, uid, rs, res.get(rs)) return True - + def onchange_journal_id(self, cr, uid, statement_id, journal_id, context={}): - """ Changes balance start and starting details if journal_id changes" + """ Changes balance start and starting details if journal_id changes" @param statement_id: Changed statement_id @param journal_id: Changed journal_id @return: Dictionary of changed values """ - + cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement') res = {} balance_start = 0.0 - + if not journal_id: res.update({ 'balance_start': balance_start }) return res - - + + res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context) return res - + def _equal_balance(self, cr, uid, ids, statement, context={}): if statement.balance_end != statement.balance_end_cash: return False else: return True - + def _user_allow(self, cr, uid, ids, statement, context={}): return True - + def button_open(self, cr, uid, ids, context=None): - + """ Changes statement state to Running. - @return: True + @return: True """ cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement') statement = statement_pool.browse(cr, uid, ids[0]) vals = {} - + if not self._user_allow(cr, uid, ids, statement, context={}): raise osv.except_osv(_('Error !'), _('User %s does not have rights to access %s journal !' % (statement.user_id.name, statement.journal_id.name))) - + if statement.name and statement.name == '/': number = self.pool.get('ir.sequence').get(cr, uid, 'account.cash.statement') vals.update({ 'name':number }) - -# if len(statement.starting_details_ids) > 0: -# sid = [] -# for line in statement.starting_details_ids: -# sid.append(line.id) -# cash_pool.unlink(cr, uid, sid) -# -# cr.execute("select id from account_bank_statement where journal_id=%s and user_id=%s and state=%s order by id desc limit 1", (statement.journal_id.id, uid, 'confirm')) -# rs = cr.fetchone() -# rs = rs and rs[0] or None -# if rs: -# statement = statement_pool.browse(cr, uid, rs) -# balance_start = statement.balance_end_real or 0.0 -# open_ids = cash_pool.search(cr, uid, [('ending_id','=',statement.id)]) -# for sid in open_ids: -# default = { -# 'ending_id': False, -# 'starting_id':ids[0] -# } -# cash_pool.copy(cr, uid, sid, default) -# + + cr.execute("select id from account_bank_statement where journal_id=%s and user_id=%s and state=%s order by id desc limit 1", (statement.journal_id.id, uid, 'confirm')) + rs = cr.fetchone() + rs = rs and rs[0] or None + if rs: + if len(statement.starting_details_ids) > 0: + sid = [] + for line in statement.starting_details_ids: + sid.append(line.id) + cash_pool.unlink(cr, uid, sid) + + statement = statement_pool.browse(cr, uid, rs) + balance_start = statement.balance_end_real or 0.0 + open_ids = cash_pool.search(cr, uid, [('ending_id','=',statement.id)]) + for sid in open_ids: + default = { + 'ending_id': False, + 'starting_id':ids[0] + } + cash_pool.copy(cr, uid, sid, default) + vals.update({ - 'date':time.strftime("%Y-%m-%d %H:%M:%S"), + 'date':time.strftime("%Y-%m-%d %H:%M:%S"), 'state':'open', - + }) - + self.write(cr, uid, ids, vals) return True def button_confirm_cash(self, cr, uid, ids, context={}): - - """ Check the starting and ending detail of statement - @return: True + + """ Check the starting and ending detail of statement + @return: True """ done = [] res_currency_obj = self.pool.get('res.currency') @@ -360,24 +347,20 @@ class account_cash_statement(osv.osv): account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement_line_obj = self.pool.get('account.bank.statement.line') - + company_currency_id = res_users_obj.browse(cr, uid, uid, context=context).company_id.currency_id.id for st in self.browse(cr, uid, ids, context): - + self.write(cr, uid, [st.id], {'balance_end_real':st.balance_end}) st.balance_end_real = st.balance_end - + if not st.state == 'open': continue - + if not self._equal_balance(cr, uid, ids, st, context): raise osv.except_osv(_('Error !'), _('CashBox Balance is not matching with Calculated Balance !')) - -# if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001): -# raise osv.except_osv(_('Error !'), -# _('The statement balance is incorrect !\n') + -# _('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end)) + if (not st.journal_id.default_credit_account_id) \ or (not st.journal_id.default_debit_account_id): raise osv.except_osv(_('Configuration Error !'), @@ -499,7 +482,7 @@ class account_cash_statement(osv.osv): context=context): if line.state <> 'valid': raise osv.except_osv(_('Error !'), - _('Ledger Posting line "%s" is not valid') % line.name) + _('Journal Item "%s" is not valid') % line.name) if move.reconcile_id and move.reconcile_id.line_ids: torec += map(lambda x: x.id, move.reconcile_id.line_ids) @@ -519,7 +502,7 @@ class account_cash_statement(osv.osv): if st.journal_id.entry_posted: account_move_obj.write(cr, uid, [move_id], {'state':'posted'}) done.append(st.id) - + vals = { 'state':'confirm', 'closing_date':time.strftime("%Y-%m-%d %H:%M:%S") diff --git a/addons/account/account_demo.xml b/addons/account/account_demo.xml index a8a1d1405cd..5ef0ee4992d 100644 --- a/addons/account/account_demo.xml +++ b/addons/account/account_demo.xml @@ -1,10 +1,10 @@ - + + Fiscal year + --> @@ -15,11 +15,12 @@ + Fiscal Periods + --> - + + @@ -27,7 +28,8 @@ - + + @@ -35,7 +37,8 @@ - + + @@ -43,7 +46,8 @@ - + + @@ -51,7 +55,8 @@ - + + @@ -59,7 +64,8 @@ - + + @@ -67,7 +73,8 @@ - + + @@ -75,7 +82,8 @@ - + + @@ -83,7 +91,8 @@ - + + @@ -91,7 +100,8 @@ - + + @@ -99,7 +109,8 @@ - + + @@ -107,7 +118,8 @@ - + + diff --git a/addons/account/account_end_fy.xml b/addons/account/account_end_fy.xml index fe7b6e682fe..a33544ffacc 100644 --- a/addons/account/account_end_fy.xml +++ b/addons/account/account_end_fy.xml @@ -14,7 +14,7 @@ action="action_account_period_tree" id="menu_action_account_period_close_tree" parent="account.menu_account_end_year_treatments" - sequence="0"/> + sequence="0" groups="base.group_extended"/> diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml index 479f9bf1c65..b0a0e8e059e 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -1,101 +1,140 @@ - - - account.installer.view - account.installer - form - - - -
- Accounting Modules Installation -
+ + + account.installer.form + account.installer + form + + + +
+ Accounting System Configuration +
+ + Configure Your Accounting System + + + From this screen, you can configure your accounting system. Choose a Chart of Account matched to your accounting system or the Generic Chart of Account which allows you to configure which suit your needs. + + + Configure + + + 23 + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + +
+
+
+
+
- - Configure Your Accounting System - - - From this screen, you can configure your accounting system. Choose a Chart of Account matched to your accounting system or the Generic Chart of Account which allows you to configure which suit your needs. - - - Configure - - - 23 - - - - - - - - - - - - - - -
- - - + + account.installer.modules.form + account.installer.modules + form + + + + + Extra Accounting Modules Installation - - - - - - -
- - - - - - - - - - - - - -
-
-
-
-
+ + Install Extra Accounting Modules In Your Accounting System + + + From this screen, you can install extra accounting modules in your accounting system. Select the modules to directly install them. If you do not think you need any of these right now, you can easily install them later. + + + 23 + + + + + + + + + + + + + +
+ + - - Accounting Modules Installation - ir.actions.act_window - account.installer - - form - form - new - + + Accounting Chart Configuration + ir.actions.act_window + account.installer + + form + form + new + - - - 3 - onskip - + + Accounting Modules Installation + ir.actions.act_window + account.installer.modules + + form + form + new + - - ir.actions.todo - account_installer_action_replace - tree - - - - - - - -
diff --git a/addons/account_voucher_payment/i18n/account_voucher_payment.pot b/addons/account_voucher_payment/i18n/account_voucher_payment.pot deleted file mode 100644 index 0a6e050af91..00000000000 --- a/addons/account_voucher_payment/i18n/account_voucher_payment.pot +++ /dev/null @@ -1,82 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_voucher_payment -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0dev\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-05-13 20:11:36+0000\n" -"PO-Revision-Date: 2009-05-13 20:11:36+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_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "If you unreconciliate transactions, you must also verify all the actions that are linked to those transactions because they will not be disable" -msgstr "" - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "" - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "" - -#. module: account_voucher_payment -#: field:account.voucher,partner_id:0 -msgid "Partner" -msgstr "" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "" - diff --git a/addons/account_voucher_payment/i18n/ca.po b/addons/account_voucher_payment/i18n/ca.po deleted file mode 100644 index 225da8f9e95..00000000000 --- a/addons/account_voucher_payment/i18n/ca.po +++ /dev/null @@ -1,95 +0,0 @@ -# Catalan 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-05-13 20:11+0000\n" -"PO-Revision-Date: 2010-08-10 15:03+0000\n" -"Last-Translator: Jordi Esteve (www.zikzakmedia.com) " -"\n" -"Language-Team: Catalan \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 04:08+0000\n" -"X-Generator: Launchpad (build Unknown)\n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "XML invàlid per a la definició de la vista!" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "Trenca conciliació de transaccions" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" -"Aquest mòdul inclou:\n" -" * Concilia factures de proveïdors i clients mentre són pagades " -"mitjançant \n" -" comprovants comptables\n" -" " - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "" -"If you unreconciliate transactions, you must also verify all the actions " -"that are linked to those transactions because they will not be disable" -msgstr "" -"Si trenqueu conciliació de transaccions, també heu de comprovar totes les " -"accions que estan relacionades amb aquestes transaccions ja que no seran " -"eliminades" - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "Línies de comprovant" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "Pagaments i rebuts de factures per comprovant." - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "Trenca conciliació entrades" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "Factura" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "Cancel·la" - -#. module: account_voucher_payment -#: field:account.voucher,partner_id:0 -msgid "Partner" -msgstr "" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "Trenca conciliació" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "Trenca conciliació" diff --git a/addons/account_voucher_payment/i18n/ca_ES.po b/addons/account_voucher_payment/i18n/ca_ES.po deleted file mode 100644 index 6bafc34d136..00000000000 --- a/addons/account_voucher_payment/i18n/ca_ES.po +++ /dev/null @@ -1,81 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_voucher_payment -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0dev\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-05-13 19:47:47+0000\n" -"PO-Revision-Date: 2009-05-16 18:57+0100\n" -"Last-Translator: Jordi Esteve \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "XML invàlid per a la definició de la vista!" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "Trenca conciliació de transaccions" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "Factura" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "If you unreconciliate transactions, you must also verify all the actions that are linked to those transactions because they will not be disable" -msgstr "Si trenqueu conciliació de transaccions, també heu de comprovar totes les accions que estan relacionades amb aquestes transaccions ja que no seran eliminades" - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "Línies de comprovant" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "Pagaments i rebuts de factures per comprovant." - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "Trenca conciliació entrades" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" -"Aquest mòdul inclou:\n" -" * Concilia factures de proveïdors i clients mentre són pagades mitjançant \n" -" comprovants comptables\n" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "Cancel·la" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "Trenca conciliació" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "Trenca conciliació" - diff --git a/addons/account_voucher_payment/i18n/el.po b/addons/account_voucher_payment/i18n/el.po deleted file mode 100644 index 5531e87022f..00000000000 --- a/addons/account_voucher_payment/i18n/el.po +++ /dev/null @@ -1,93 +0,0 @@ -# Greek 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-05-13 20:11+0000\n" -"PO-Revision-Date: 2010-06-22 05:05+0000\n" -"Last-Translator: Panayiotis Konstantinidis \n" -"Language-Team: Greek \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 04:08+0000\n" -"X-Generator: Launchpad (build Unknown)\n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Λανθασμένο XML για αρχιτεκτονική όψης!" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "Ασυμβίβαστες συναλλαγές" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" -"Αυτή η μονάδα περιλαμβάνει :\n" -" * Εναρμονίζει το τιμολόγιο ( προμηθευτή, πελάτη ) καθώς πληρώνει απο τον " -"\n" -" Λογαριασμό Παραστατικών\n" -" " - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "" -"If you unreconciliate transactions, you must also verify all the actions " -"that are linked to those transactions because they will not be disable" -msgstr "" -"Αν ακυρώσετε συμφωνημένες συναλλαγές θα πρέπει να ελέγξετε όλες τις " -"ενέργειες που συνδέονται με αυτές διότι δεν θα διαγραφούν." - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "Γραμμές Παραστατικού" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "Πληρωμή Τιμολογίου/ Απόδειξη απο Παραστατικό" - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "Ασυμβίβαστες εγγραφές" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "Τιμολόγιο" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "Ακύρωση" - -#. module: account_voucher_payment -#: field:account.voucher,partner_id:0 -msgid "Partner" -msgstr "Συνεργάτης" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "Ακυρώνω" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "Ακύρωση" diff --git a/addons/account_voucher_payment/i18n/es.po b/addons/account_voucher_payment/i18n/es.po deleted file mode 100644 index 134c11751e9..00000000000 --- a/addons/account_voucher_payment/i18n/es.po +++ /dev/null @@ -1,94 +0,0 @@ -# Spanish 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-05-13 20:11+0000\n" -"PO-Revision-Date: 2010-08-11 05:38+0000\n" -"Last-Translator: Jordi Esteve (www.zikzakmedia.com) " -"\n" -"Language-Team: Spanish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 04:08+0000\n" -"X-Generator: Launchpad (build Unknown)\n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "¡XML inválido para la definición de la vista!" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "Romper conciliación de transacciones" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" -"Este módulo incluye :\n" -" * Concilia facturas de proveedores y clientes mientras son pagadas " -"mediante \n" -" comprobantes contables\n" -" " - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "" -"If you unreconciliate transactions, you must also verify all the actions " -"that are linked to those transactions because they will not be disable" -msgstr "" -"Si rompe conciliación de transacciones, también debe verificar todas las " -"acciones que están enlazadas a estas transacciones porque no serán eliminadas" - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "Líneas de comprobante" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "Pagos y recibos de facturas por comprobantes." - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "Romper concilación entradas" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "Factura" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "Cancelar" - -#. module: account_voucher_payment -#: field:account.voucher,partner_id:0 -msgid "Partner" -msgstr "Compañero" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "Romper conciliación" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "Romper conciliación" diff --git a/addons/account_voucher_payment/i18n/es_ES.po b/addons/account_voucher_payment/i18n/es_ES.po deleted file mode 100644 index 28765ce533a..00000000000 --- a/addons/account_voucher_payment/i18n/es_ES.po +++ /dev/null @@ -1,81 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_voucher_payment -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0dev\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-05-13 19:47:47+0000\n" -"PO-Revision-Date: 2009-05-16 18:57+0100\n" -"Last-Translator: Jordi Esteve \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "¡XML inválido para la definición de la vista!" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "Romper conciliación de transacciones" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "Factura" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "If you unreconciliate transactions, you must also verify all the actions that are linked to those transactions because they will not be disable" -msgstr "Si rompe conciliación de transacciones, también debe verificar todas las acciones que están enlazadas a estas transacciones porque no serán eliminadas" - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "Líneas de comprobante" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "Pagos y recibos de facturas por comprobantes." - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "Romper concilación entradas" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" -"Este módulo incluye :\n" -" * Concilia facturas de proveedores y clientes mientras son pagadas mediante \n" -" comprobantes contables\n" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "Cancelar" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "Romper conciliación" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "Romper conciliación" - diff --git a/addons/account_voucher_payment/i18n/et.po b/addons/account_voucher_payment/i18n/et.po deleted file mode 100644 index ff959abf935..00000000000 --- a/addons/account_voucher_payment/i18n/et.po +++ /dev/null @@ -1,86 +0,0 @@ -# Estonian 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-05-13 20:11+0000\n" -"PO-Revision-Date: 2010-06-08 17:42+0000\n" -"Last-Translator: lyyser \n" -"Language-Team: Estonian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 04:08+0000\n" -"X-Generator: Launchpad (build Unknown)\n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Vigane XML vaate arhitektuurile!" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "Mittesobivad tehingud" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "" -"If you unreconciliate transactions, you must also verify all the actions " -"that are linked to those transactions because they will not be disable" -msgstr "" - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "Tähiku read" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "" - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "Kooskõlastamatta kirjed" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "Arve" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "Katkesta" - -#. module: account_voucher_payment -#: field:account.voucher,partner_id:0 -msgid "Partner" -msgstr "Partner" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "" diff --git a/addons/account_voucher_payment/i18n/fr_BE.po b/addons/account_voucher_payment/i18n/fr_BE.po deleted file mode 100644 index 07044b31a84..00000000000 --- a/addons/account_voucher_payment/i18n/fr_BE.po +++ /dev/null @@ -1,77 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_voucher_payment -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0dev\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-11-26 06:54:11+0000\n" -"PO-Revision-Date: 2009-11-26 06:54:11+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_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "If you unreconciliate transactions, you must also verify all the actions that are linked to those transactions because they will not be disable" -msgstr "" - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_meta_information -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "" - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_meta_information -msgid "This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "" - diff --git a/addons/account_voucher_payment/i18n/pt_BR.po b/addons/account_voucher_payment/i18n/pt_BR.po deleted file mode 100644 index 65d8341d436..00000000000 --- a/addons/account_voucher_payment/i18n/pt_BR.po +++ /dev/null @@ -1,89 +0,0 @@ -# Brazilian Portuguese 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-05-13 20:11+0000\n" -"PO-Revision-Date: 2010-07-28 14:21+0000\n" -"Last-Translator: Leandro Chaves \n" -"Language-Team: Brazilian Portuguese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 04:08+0000\n" -"X-Generator: Launchpad (build Unknown)\n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "XML inválido para a arquitetura de exibição" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "Transações não conciliadas" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "" -"If you unreconciliate transactions, you must also verify all the actions " -"that are linked to those transactions because they will not be disable" -msgstr "" -"Se você desfazer a reconciliação de transações, você deve também verificar " -"todas as ações que estão ligadas a essas operações, porque elas não serão " -"desfeitas pelo sistema" - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "Linhas de Comprovantes" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "" - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "Anular reconciliação de lançamentos" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "Fatura" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "Cancelar" - -#. module: account_voucher_payment -#: field:account.voucher,partner_id:0 -msgid "Partner" -msgstr "Parceiro" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "Não concilidado" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "Desconciliação" diff --git a/addons/account_voucher_payment/i18n/sl.po b/addons/account_voucher_payment/i18n/sl.po deleted file mode 100644 index f090b7071f9..00000000000 --- a/addons/account_voucher_payment/i18n/sl.po +++ /dev/null @@ -1,88 +0,0 @@ -# Slovenian 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-05-13 20:11+0000\n" -"PO-Revision-Date: 2010-07-28 12:23+0000\n" -"Last-Translator: Simon Vidmar \n" -"Language-Team: Slovenian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 04:08+0000\n" -"X-Generator: Launchpad (build Unknown)\n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Neveljaven XML za arhitekturo pogleda!" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "Preklic uskladitve transakcij" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "" -"If you unreconciliate transactions, you must also verify all the actions " -"that are linked to those transactions because they will not be disable" -msgstr "" -"Če prekličete uskladitev transakcij, morate tudi preveriti vse akcije, ki so " -"povezane s temi transakcijami, kajti le te ne bodo onemogočene." - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "" - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "Prekliči uskladitev vknjižb" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "Račun" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "Prekliči" - -#. module: account_voucher_payment -#: field:account.voucher,partner_id:0 -msgid "Partner" -msgstr "Partner" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "Prekliči uskladitev" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "Preklic uskladitve" diff --git a/addons/account_voucher_payment/i18n/zh_CN.po b/addons/account_voucher_payment/i18n/zh_CN.po deleted file mode 100644 index 00ccf4661a2..00000000000 --- a/addons/account_voucher_payment/i18n/zh_CN.po +++ /dev/null @@ -1,90 +0,0 @@ -# Chinese (Simplified) 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-05-13 20:11+0000\n" -"PO-Revision-Date: 2010-07-14 03:27+0000\n" -"Last-Translator: Black Jack \n" -"Language-Team: Chinese (Simplified) \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 04:08+0000\n" -"X-Generator: Launchpad (build Unknown)\n" - -#. module: account_voucher_payment -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "无效XML视图结构!" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation transactions" -msgstr "取消对账" - -#. module: account_voucher_payment -#: model:ir.module.module,description:account_voucher_payment.module_name_translation -msgid "" -"This module includes :\n" -" * It reconcile the invoice (supplier, customer) while paying through \n" -" Accounting Vouchers\n" -" " -msgstr "" -"这模块包括:\n" -" *在支付时核销发票(供应商, 客户) \n" -" 原始凭证\n" -" " - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "" -"If you unreconciliate transactions, you must also verify all the actions " -"that are linked to those transactions because they will not be disable" -msgstr "如果取消交易的核销, 你必须检验链接该交易的所有操作. 因为他们不会被禁止." - -#. module: account_voucher_payment -#: view:account.voucher:0 -#: field:account.voucher,voucher_line_ids:0 -msgid "Voucher Lines" -msgstr "原始凭证明细" - -#. module: account_voucher_payment -#: model:ir.module.module,shortdesc:account_voucher_payment.module_name_translation -msgid "Invoice Payment/Receipt by Vouchers." -msgstr "发票付款/ 收入的原始凭证" - -#. module: account_voucher_payment -#: model:ir.actions.wizard,name:account_voucher_payment.wizard_unreconcile_voucher -msgid "Unreconcile entries" -msgstr "取消核销" - -#. module: account_voucher_payment -#: field:account.move.line,voucher_invoice:0 -#: field:account.voucher.line,invoice_id:0 -msgid "Invoice" -msgstr "发票" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,end:0 -msgid "Cancel" -msgstr "取消" - -#. module: account_voucher_payment -#: field:account.voucher,partner_id:0 -msgid "Partner" -msgstr "业务伙伴" - -#. module: account_voucher_payment -#: wizard_button:account.voucher.unreconcile,init,unrec:0 -msgid "Unreconcile" -msgstr "取消核销" - -#. module: account_voucher_payment -#: wizard_view:account.voucher.unreconcile,init:0 -msgid "Unreconciliation" -msgstr "取消对账" diff --git a/addons/account_voucher_payment/security/ir.model.access.csv b/addons/account_voucher_payment/security/ir.model.access.csv deleted file mode 100644 index 0343f29f43a..00000000000 --- a/addons/account_voucher_payment/security/ir.model.access.csv +++ /dev/null @@ -1 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" diff --git a/addons/account_voucher_payment/test/account_voucher_payment.yml b/addons/account_voucher_payment/test/account_voucher_payment.yml deleted file mode 100644 index 8bcea6a23a4..00000000000 --- a/addons/account_voucher_payment/test/account_voucher_payment.yml +++ /dev/null @@ -1,118 +0,0 @@ -- - In order to test account_voucher_payment module in OpenERP I create an invoice and paid it through voucher -- - I create a customer invoice record -- - !record {model: account.invoice, id: account_invoice_voucher_payment}: - account_id: account.a_recv - address_contact_id: base.res_partner_address_3000 - address_invoice_id: base.res_partner_address_3000 - company_id: base.main_company - currency_id: base.EUR - invoice_line: - - account_id: account.a_sale - name: '[PC1] Basic PC' - price_unit: 450.0 - quantity: 1.0 - product_id: product.product_product_pc1 - uos_id: product.product_uom_unit - journal_id: account.sales_journal - partner_id: base.res_partner_desertic_hispafuentes - reference_type: none - -- - I check that Initially customer invoice is in the "Draft" state -- - !assert {model: account.invoice, id: account_invoice_voucher_payment}: - - state == 'draft' -- - I change the state of invoice to "Proforma2" by clicking PRO-FORMA button -- - !workflow {model: account.invoice, action: invoice_proforma2, ref: account_invoice_voucher_payment} -- - I check that the invoice state is now "Proforma2" -- - !assert {model: account.invoice, id: account_invoice_voucher_payment}: - - state == 'proforma2' -- - I create invoice by clicking on Create button -- - !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_voucher_payment} -- - I check that the invoice state is "Open" -- - !assert {model: account.invoice, id: account_invoice_voucher_payment}: - - state == 'open' - -- - I create a voucher record for above invoice -- - !record {model: account.voucher, id: account_voucher_voucherforaxelor1}: - account_id: account.cash - company_id: base.main_company - currency_id: base.EUR - journal_id: account.bank_journal - name: Voucher for Axelor - narration: Basic Pc - payment_ids: - - account_id: account.a_recv - amount: 450.0 - name: Voucher for Axelor - partner_id: base.res_partner_desertic_hispafuentes - invoice_id: account_invoice_voucher_payment - type: cr - period_id: account.period_6 - reference_type: none - -- - I check that Initially customer voucher is in the "Draft" state -- - !assert {model: account.voucher, id: account_voucher_voucherforaxelor1}: - - state == 'draft' -- - I change the state of voucher to "proforma" by clicking PRO-FORMA button -- - !workflow {model: account.voucher, action: open_voucher, ref: account_voucher_voucherforaxelor1} -- - I check that the voucher state is now "proforma" -- - !assert {model: account.voucher, id: account_voucher_voucherforaxelor1}: - - state == 'proforma' -- - I create voucher by clicking on Create button -- - !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucherforaxelor1} -- - I check that the voucher state is "Waiting for re-checking" -- - !assert {model: account.voucher, id: account_voucher_voucherforaxelor1}: - - state == 'recheck' -- - I clicked on Validate Button -- - !workflow {model: account.voucher, action: recheck_voucher, ref: account_voucher_voucherforaxelor1} -- - I check that the voucher state is "posted" -- - !assert {model: account.voucher, id: account_voucher_voucherforaxelor1}: - - state == 'posted' - -- - I check that Moves get created for this voucher -- - !python {model: account.voucher}: | - acc_id=self.browse(cr, uid, ref("account_voucher_voucherforaxelor1")) - assert(acc_id.move_id) - -- - I check that the invoice state is now Done -- - !assert {model: account.invoice, id: account_invoice_voucher_payment}: - - state == 'paid' - - - - - - - diff --git a/addons/analytic/__openerp__.py b/addons/analytic/__openerp__.py index e0411506dd8..1f21fb3fce3 100644 --- a/addons/analytic/__openerp__.py +++ b/addons/analytic/__openerp__.py @@ -19,7 +19,6 @@ # ############################################################################## - { "name" : "Analytic Account", "version": "1.1", @@ -30,11 +29,12 @@ "description": """Module for defining analytic accounting object. """, "init_xml" : [], - "update_xml": ["security/ir.model.access.csv", + "update_xml": ['security/analytic_security.xml', + "security/ir.model.access.csv", ], 'demo_xml': [ ], 'installable': True, 'active': False, } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 77a881744bc..e5dd9d52ce1 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -25,19 +25,15 @@ import operator from osv import fields, osv import decimal_precision as dp -# -# Object definition -# - class account_analytic_account(osv.osv): _name = 'account.analytic.account' _description = 'Analytic Account' - def _compute_currency_for_level_tree(self, cr, uid, ids, ids2, res, context={}): + def _compute_currency_for_level_tree(self, cr, uid, ids, ids2, res, context=None): # Handle multi-currency on each level of analytic account # This is a refactoring of _balance_calc computation cr.execute("SELECT a.id, r.currency_id FROM account_analytic_account a INNER JOIN res_company r ON (a.company_id = r.id) where a.id IN %s" , (tuple(ids2),)) - currency= dict(cr.fetchall()) + currency = dict(cr.fetchall()) res_currency= self.pool.get('res.currency') for id in ids: if id not in ids2: @@ -50,7 +46,7 @@ class account_analytic_account(osv.osv): else: res[id] += res.get(child, 0.0) - cur_obj = res_currency.browse(cr, uid, currency.values(), context) + cur_obj = res_currency.browse(cr, uid, currency.values(), context=context) cur_obj = dict([(o.id, o) for o in cur_obj]) for id in ids: if id in ids2: @@ -58,9 +54,10 @@ class account_analytic_account(osv.osv): return dict([(i, res[i]) for i in ids ]) - - def _credit_calc(self, cr, uid, ids, name, arg, context={}): + def _credit_calc(self, cr, uid, ids, name, arg, context=None): res = {} + if context is None: + context = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) for i in ids: res.setdefault(i,0.0) @@ -69,16 +66,18 @@ class account_analytic_account(osv.osv): return res where_date = '' - if context.get('from_date',False): + if context.get('from_date', False): where_date += " AND l.date >= '" + context['from_date'] + "'" - if context.get('to_date',False): + if context.get('to_date', False): where_date += " AND l.date <= '" + context['to_date'] + "'" cr.execute("SELECT a.id, COALESCE(SUM(l.amount_currency),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount_currency<0 and a.id IN %s GROUP BY a.id",(tuple(parent_ids),)) r = dict(cr.fetchall()) return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, r, context) - def _debit_calc(self, cr, uid, ids, name, arg, context={}): + def _debit_calc(self, cr, uid, ids, name, arg, context=None): res = {} + if context is None: + context = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) for i in ids: res.setdefault(i,0.0) @@ -92,11 +91,14 @@ class account_analytic_account(osv.osv): if context.get('to_date',False): where_date += " AND l.date <= '" + context['to_date'] + "'" cr.execute("SELECT a.id, COALESCE(SUM(l.amount_currency),0) FROM account_analytic_account a LEFT JOIN account_analytic_line l ON (a.id=l.account_id "+where_date+") WHERE l.amount_currency>0 and a.id IN %s GROUP BY a.id" ,(tuple(parent_ids),)) - r= dict(cr.fetchall()) - return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, r, context) + r = dict(cr.fetchall()) + return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, r, context=context) - def _balance_calc(self, cr, uid, ids, name, arg, context={}): + def _balance_calc(self, cr, uid, ids, name, arg, context=None): res = {} + if context is None: + context = {} + parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) for i in ids: res.setdefault(i,0.0) @@ -114,11 +116,14 @@ class account_analytic_account(osv.osv): for account_id, sum in cr.fetchall(): res[account_id] = sum - return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context) + return self._compute_currency_for_level_tree(cr, uid, ids, parent_ids, res, context=context) - def _quantity_calc(self, cr, uid, ids, name, arg, context={}): + def _quantity_calc(self, cr, uid, ids, name, arg, context=None): #XXX must convert into one uom res = {} + if context is None: + context = {} + parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) for i in ids: @@ -150,7 +155,7 @@ class account_analytic_account(osv.osv): res[id] += res.get(child, 0.0) return dict([(i, res[i]) for i in ids]) - def name_get(self, cr, uid, ids, context={}): + def name_get(self, cr, uid, ids, context=None): if not len(ids): return [] res = [] @@ -168,13 +173,13 @@ class account_analytic_account(osv.osv): res = self.name_get(cr, uid, ids) return dict(res) - def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}): + def _get_company_currency(self, cr, uid, ids, field_name, arg, context=None): result = {} for rec in self.browse(cr, uid, ids, context): result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.code) or False return result - def _get_account_currency(self, cr, uid, ids, field_name, arg, context={}): + def _get_account_currency(self, cr, uid, ids, field_name, arg, context=None): result=self._get_company_currency(cr, uid, ids, field_name, arg, context={}) return result @@ -209,19 +214,20 @@ class account_analytic_account(osv.osv): 'currency_id': fields.function(_get_account_currency, method=True, type='many2one', relation='res.currency', string='Account currency', store=True), } - def _default_company(self, cr, uid, context={}): + def _default_company(self, cr, uid, context=None): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) if user.company_id: return user.company_id.id return self.pool.get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] + _defaults = { - 'type' : lambda *a : 'normal', + 'type' : 'normal', 'company_id': _default_company, - 'state' : lambda *a : 'open', + 'state' : 'open', 'user_id' : lambda self, cr, uid, ctx : uid, 'partner_id': lambda self, cr, uid, ctx: ctx.get('partner_id', False), 'contact_id': lambda self, cr, uid, ctx: ctx.get('contact_id', False), - 'date_start': lambda *a: time.strftime('%Y-%m-%d') + 'date_start': time.strftime('%Y-%m-%d') } def check_recursion(self, cr, uid, ids, parent=None): @@ -238,14 +244,13 @@ class account_analytic_account(osv.osv): vals['code'] = self.pool.get('ir.sequence').get(cr, uid, 'account.analytic.account') return super(account_analytic_account, self).create(cr, uid, vals, context=context) - def copy(self, cr, uid, id, default=None, context={}): + def copy(self, cr, uid, id, default=None, context=None): if not default: default = {} default['code'] = False default['line_ids'] = [] return super(account_analytic_account, self).copy(cr, uid, id, default, context=context) - def on_change_parent(self, cr, uid, id, parent_id): if not parent_id: return {} @@ -281,9 +286,9 @@ account_analytic_account() class account_analytic_line(osv.osv): _name = 'account.analytic.line' _description = 'Analytic Line' - def _amount_currency(self, cr, uid, ids, field_name, arg, context={}): + def _amount_currency(self, cr, uid, ids, field_name, arg, context=None): result = {} - for rec in self.browse(cr, uid, ids, context): + for rec in self.browse(cr, uid, ids, context=context): cmp_cur_id=rec.company_id.currency_id.id aa_cur_id=rec.account_id.currency_id.id # Always provide the amount in currency @@ -298,14 +303,14 @@ class account_analytic_line(osv.osv): else: result[rec.id]=rec.amount return result - - def _get_account_currency(self, cr, uid, ids, field_name, arg, context={}): + + def _get_account_currency(self, cr, uid, ids, field_name, arg, context=None): result = {} for rec in self.browse(cr, uid, ids, context): # Always provide second currency result[rec.id] = (rec.account_id.currency_id.id,rec.account_id.currency_id.code) return result - def _get_account_line(self, cr, uid, ids, context={}): + def _get_account_line(self, cr, uid, ids, context=None): aac_ids = {} for acc in self.pool.get('account.analytic.account').browse(cr, uid, ids): aac_ids[acc.id] = True @@ -337,10 +342,12 @@ class account_analytic_line(osv.osv): } _defaults = { - 'date': lambda *a: time.strftime('%Y-%m-%d'), + 'date': 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', context=c), } + _order = 'date' + account_analytic_line() - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/analytic/i18n/de.po b/addons/analytic/i18n/de.po new file mode 100644 index 00000000000..e9f672dcf4f --- /dev/null +++ b/addons/analytic/i18n/de.po @@ -0,0 +1,269 @@ +# German 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: 2010-06-18 10:59+0000\n" +"PO-Revision-Date: 2010-08-23 06:40+0000\n" +"Last-Translator: Ferdinand-chricar \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-08-25 03:56+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: analytic +#: field:account.analytic.account,child_ids:0 +msgid "Child Accounts" +msgstr "untergeordnete Konten" + +#. module: analytic +#: help:account.analytic.line,amount_currency:0 +msgid "" +"The amount expressed in the related account currency if not equal to the " +"company one." +msgstr "Der Betrag in Fremdwährung, wenn diese von der Hauptwährung abweicht" + +#. module: analytic +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Der Objektname muss mit \"x_\" beginnen und darf keine Sonderzeichen " +"beinhalten!" + +#. module: analytic +#: field:account.analytic.account,name:0 +msgid "Account Name" +msgstr "Kontenbezeichnung" + +#. module: analytic +#: help:account.analytic.line,unit_amount:0 +msgid "Specifies the amount of quantity to count." +msgstr "Definiert die zu zählende Menge" + +#. module: analytic +#: help:account.analytic.line,currency_id:0 +msgid "The related account currency if not equal to the company one." +msgstr "" + +#. module: analytic +#: model:ir.module.module,description:analytic.module_meta_information +msgid "" +"Module for defining analytic accounting object.\n" +" " +msgstr "" +"Diese Module definiert analytische Kostenrechnung\n" +" " + +#. module: analytic +#: field:account.analytic.account,state:0 +msgid "State" +msgstr "Status" + +#. module: analytic +#: field:account.analytic.account,user_id:0 +msgid "Account Manager" +msgstr "Konto Manager" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Draft" +msgstr "Entwurf" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Closed" +msgstr "Abgeschlossen" + +#. module: analytic +#: field:account.analytic.account,debit:0 +msgid "Debit" +msgstr "Soll" + +#. module: analytic +#: help:account.analytic.account,state:0 +msgid "" +"* When an account is created its in 'Draft' state. " +" \n" +"* If any associated partner is there, it can be in 'Open' state. " +" \n" +"* If any pending balance is there it can be in 'Pending'. " +" \n" +"* And finally when all the transactions are over, it can be in 'Close' " +"state. \n" +"* The project can be in either if the states 'Template' and 'Running'.\n" +" If it is template then we can make projects based on the template projects. " +"If its in 'Running' state it is a normal project. " +" \n" +" If it is to be reviewed then the state is 'Pending'.\n" +" When the project is completed the state is set to 'Done'." +msgstr "" + +#. module: analytic +#: field:account.analytic.account,type:0 +msgid "Account Type" +msgstr "" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Template" +msgstr "Vorlage" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Pending" +msgstr "Unerledigt" + +#. module: analytic +#: model:ir.model,name:analytic.model_account_analytic_line +msgid "Analytic Line" +msgstr "Analyse Zeile" + +#. module: analytic +#: field:account.analytic.account,description:0 +#: field:account.analytic.line,name:0 +msgid "Description" +msgstr "Beschreibung" + +#. module: analytic +#: help:account.analytic.line,amount:0 +msgid "" +"Calculated by multiplying the quantity and the price given in the Product's " +"cost price." +msgstr "Ergebnis aus Menge * Produkt Einstandspreis" + +#. module: analytic +#: field:account.analytic.account,company_id:0 +#: field:account.analytic.line,company_id:0 +msgid "Company" +msgstr "Mandant" + +#. module: analytic +#: field:account.analytic.account,quantity_max:0 +msgid "Maximum Quantity" +msgstr "Max. Menge" + +#. module: analytic +#: field:account.analytic.line,user_id:0 +msgid "User" +msgstr "Benutzer" + +#. module: analytic +#: field:account.analytic.account,parent_id:0 +msgid "Parent Analytic Account" +msgstr "Übergeordnetes Analyse Konto" + +#. module: analytic +#: field:account.analytic.line,date:0 +msgid "Date" +msgstr "Datum" + +#. module: analytic +#: field:account.analytic.account,currency_id:0 +#: field:account.analytic.line,currency_id:0 +msgid "Account currency" +msgstr "Währung des Kontos" + +#. module: analytic +#: selection:account.analytic.account,type:0 +msgid "View" +msgstr "Ansicht" + +#. module: analytic +#: help:account.analytic.account,quantity_max:0 +msgid "Sets the higher limit of quantity of hours." +msgstr "Obergrenze der Stunden" + +#. module: analytic +#: field:account.analytic.account,credit:0 +msgid "Credit" +msgstr "Haben" + +#. module: analytic +#: field:account.analytic.line,amount:0 +msgid "Amount" +msgstr "Betrag" + +#. module: analytic +#: field:account.analytic.account,contact_id:0 +msgid "Contact" +msgstr "Ansprechpartner" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Cancelled" +msgstr "Abgebrochen" + +#. module: analytic +#: field:account.analytic.account,balance:0 +msgid "Balance" +msgstr "Saldo" + +#. module: analytic +#: field:account.analytic.account,date_start:0 +msgid "Date Start" +msgstr "Startdatum" + +#. module: analytic +#: field:account.analytic.account,quantity:0 +#: field:account.analytic.line,unit_amount:0 +msgid "Quantity" +msgstr "Menge" + +#. module: analytic +#: field:account.analytic.account,date:0 +msgid "Date End" +msgstr "Enddatum" + +#. module: analytic +#: field:account.analytic.account,code:0 +msgid "Account Code" +msgstr "Kontonummer" + +#. module: analytic +#: selection:account.analytic.account,type:0 +msgid "Normal" +msgstr "Normal" + +#. module: analytic +#: field:account.analytic.account,complete_name:0 +msgid "Full Account Name" +msgstr "vollständiger Kontoname" + +#. module: analytic +#: field:account.analytic.line,account_id:0 +#: model:ir.model,name:analytic.model_account_analytic_account +#: model:ir.module.module,shortdesc:analytic.module_meta_information +msgid "Analytic Account" +msgstr "Analytisches Konto" + +#. module: analytic +#: field:account.analytic.account,company_currency_id:0 +msgid "Currency" +msgstr "Währung" + +#. module: analytic +#: field:account.analytic.line,amount_currency:0 +msgid "Amount currency" +msgstr "Betrag in Währung" + +#. module: analytic +#: field:account.analytic.account,partner_id:0 +msgid "Associated Partner" +msgstr "Zugehöriger Partner" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Open" +msgstr "Offen" + +#. module: analytic +#: field:account.analytic.account,line_ids:0 +msgid "Analytic Entries" +msgstr "Analytische Buchungen" diff --git a/addons/analytic/i18n/it.po b/addons/analytic/i18n/it.po new file mode 100644 index 00000000000..0d94a043b00 --- /dev/null +++ b/addons/analytic/i18n/it.po @@ -0,0 +1,284 @@ +# Italian 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: 2010-06-18 10:59+0000\n" +"PO-Revision-Date: 2010-08-17 10:07+0000\n" +"Last-Translator: OpenERP Administrators \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2010-08-18 10:34+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#. module: analytic +#: field:account.analytic.account,child_ids:0 +msgid "Child Accounts" +msgstr "Conto figlio" + +#. module: analytic +#: help:account.analytic.line,amount_currency:0 +msgid "" +"The amount expressed in the related account currency if not equal to the " +"company one." +msgstr "" +"L'importo espresso nella valuta del conto non è uguale a quella della " +"Compagnia" + +#. module: analytic +#: constraint:ir.model:0 +msgid "" +"The Object name must start with x_ and not contain any special character !" +msgstr "" +"Il nome dell'oggetto deve iniziare per x_ e non deve contenere caratteri " +"speciali!" + +#. module: analytic +#: field:account.analytic.account,name:0 +msgid "Account Name" +msgstr "Nome del conto" + +#. module: analytic +#: help:account.analytic.line,unit_amount:0 +msgid "Specifies the amount of quantity to count." +msgstr "Specifica la quantità da sommare" + +#. module: analytic +#: help:account.analytic.line,currency_id:0 +msgid "The related account currency if not equal to the company one." +msgstr "La relativa valuta del conto non è uguale a quella della Compagnia" + +#. module: analytic +#: model:ir.module.module,description:analytic.module_meta_information +msgid "" +"Module for defining analytic accounting object.\n" +" " +msgstr "" +"Modulo per definire gli oggetti dei conti analitici\n" +" " + +#. module: analytic +#: field:account.analytic.account,state:0 +msgid "State" +msgstr "Stato" + +#. module: analytic +#: field:account.analytic.account,user_id:0 +msgid "Account Manager" +msgstr "Gestore Conti" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Draft" +msgstr "Bozza" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Closed" +msgstr "Chiuso" + +#. module: analytic +#: field:account.analytic.account,debit:0 +msgid "Debit" +msgstr "Debito" + +#. module: analytic +#: help:account.analytic.account,state:0 +msgid "" +"* When an account is created its in 'Draft' state. " +" \n" +"* If any associated partner is there, it can be in 'Open' state. " +" \n" +"* If any pending balance is there it can be in 'Pending'. " +" \n" +"* And finally when all the transactions are over, it can be in 'Close' " +"state. \n" +"* The project can be in either if the states 'Template' and 'Running'.\n" +" If it is template then we can make projects based on the template projects. " +"If its in 'Running' state it is a normal project. " +" \n" +" If it is to be reviewed then the state is 'Pending'.\n" +" When the project is completed the state is set to 'Done'." +msgstr "" +"* Quando un conto è creato è nello stato \"Draft\". " +" \n" +"* Se c'è qualche partner associato, puà essere nello stato \"Open\".\n" +"* Se c'è qualche pendenza può essere in \"Pending\".\n" +"* E, per conlcudere, quando tutte le transazioni sono finite, può essere " +"nello stato \"Closed\".\n" +"* Il progetto può essere in entrambe gli stati \"Template\" e \"Running\".\n" +"Se è nello stato template, allora possiamo creare progetti basati su di " +"esso. Se è in \"Running\" state è in progetto normale. Se deve essere " +"revisionato allora lo stato è \"Pending\".\n" +"Quando il progetto è completato lo stato è \"Done\"." + +#. module: analytic +#: field:account.analytic.account,type:0 +msgid "Account Type" +msgstr "Tipo di conto" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Template" +msgstr "Modello" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Pending" +msgstr "In sospeso" + +#. module: analytic +#: model:ir.model,name:analytic.model_account_analytic_line +msgid "Analytic Line" +msgstr "Linea conto analitico" + +#. module: analytic +#: field:account.analytic.account,description:0 +#: field:account.analytic.line,name:0 +msgid "Description" +msgstr "Descrizione" + +#. module: analytic +#: help:account.analytic.line,amount:0 +msgid "" +"Calculated by multiplying the quantity and the price given in the Product's " +"cost price." +msgstr "" +"Calcolato multiplicando la quantità e il prezzo dato nel campo " +"\"costo/prezzo del prodotto\"" + +#. module: analytic +#: field:account.analytic.account,company_id:0 +#: field:account.analytic.line,company_id:0 +msgid "Company" +msgstr "Compagnia" + +#. module: analytic +#: field:account.analytic.account,quantity_max:0 +msgid "Maximum Quantity" +msgstr "Quantità massima" + +#. module: analytic +#: field:account.analytic.line,user_id:0 +msgid "User" +msgstr "Utente" + +#. module: analytic +#: field:account.analytic.account,parent_id:0 +msgid "Parent Analytic Account" +msgstr "Conto Analitico padre" + +#. module: analytic +#: field:account.analytic.line,date:0 +msgid "Date" +msgstr "Data" + +#. module: analytic +#: field:account.analytic.account,currency_id:0 +#: field:account.analytic.line,currency_id:0 +msgid "Account currency" +msgstr "Valuta del Conto" + +#. module: analytic +#: selection:account.analytic.account,type:0 +msgid "View" +msgstr "Visualizza" + +#. module: analytic +#: help:account.analytic.account,quantity_max:0 +msgid "Sets the higher limit of quantity of hours." +msgstr "Imposta il limite superiore della quantità di ore" + +#. module: analytic +#: field:account.analytic.account,credit:0 +msgid "Credit" +msgstr "Credito" + +#. module: analytic +#: field:account.analytic.line,amount:0 +msgid "Amount" +msgstr "Importo" + +#. module: analytic +#: field:account.analytic.account,contact_id:0 +msgid "Contact" +msgstr "Contatto" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Cancelled" +msgstr "Cancellato" + +#. module: analytic +#: field:account.analytic.account,balance:0 +msgid "Balance" +msgstr "Saldo" + +#. module: analytic +#: field:account.analytic.account,date_start:0 +msgid "Date Start" +msgstr "Data Inizio" + +#. module: analytic +#: field:account.analytic.account,quantity:0 +#: field:account.analytic.line,unit_amount:0 +msgid "Quantity" +msgstr "Quantità" + +#. module: analytic +#: field:account.analytic.account,date:0 +msgid "Date End" +msgstr "Data Fine" + +#. module: analytic +#: field:account.analytic.account,code:0 +msgid "Account Code" +msgstr "Codifica Conto" + +#. module: analytic +#: selection:account.analytic.account,type:0 +msgid "Normal" +msgstr "Normale" + +#. module: analytic +#: field:account.analytic.account,complete_name:0 +msgid "Full Account Name" +msgstr "Nome Conto completa" + +#. module: analytic +#: field:account.analytic.line,account_id:0 +#: model:ir.model,name:analytic.model_account_analytic_account +#: model:ir.module.module,shortdesc:analytic.module_meta_information +msgid "Analytic Account" +msgstr "Conto Analitico" + +#. module: analytic +#: field:account.analytic.account,company_currency_id:0 +msgid "Currency" +msgstr "Valuta" + +#. module: analytic +#: field:account.analytic.line,amount_currency:0 +msgid "Amount currency" +msgstr "Importo valuta" + +#. module: analytic +#: field:account.analytic.account,partner_id:0 +msgid "Associated Partner" +msgstr "Partner associato" + +#. module: analytic +#: selection:account.analytic.account,state:0 +msgid "Open" +msgstr "Aperto" + +#. module: analytic +#: field:account.analytic.account,line_ids:0 +msgid "Analytic Entries" +msgstr "Voci Conto Analitico" diff --git a/addons/analytic/security/analytic_security.xml b/addons/analytic/security/analytic_security.xml new file mode 100644 index 00000000000..a382380d962 --- /dev/null +++ b/addons/analytic/security/analytic_security.xml @@ -0,0 +1,11 @@ + + + + + analytic company rule + + + [('company_id','=',user.company_id.id)] + + + diff --git a/addons/analytic_journal_billing_rate/analytic_journal_billing_rate_view.xml b/addons/analytic_journal_billing_rate/analytic_journal_billing_rate_view.xml index 3288ca9daf8..39be4c76a23 100644 --- a/addons/analytic_journal_billing_rate/analytic_journal_billing_rate_view.xml +++ b/addons/analytic_journal_billing_rate/analytic_journal_billing_rate_view.xml @@ -35,7 +35,6 @@ - diff --git a/addons/analytic_journal_billing_rate/i18n/it.po b/addons/analytic_journal_billing_rate/i18n/it.po index 800c261112b..0a128b7cb77 100644 --- a/addons/analytic_journal_billing_rate/i18n/it.po +++ b/addons/analytic_journal_billing_rate/i18n/it.po @@ -7,24 +7,24 @@ 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-02-03 08:33+0000\n" -"Last-Translator: Fabien (Open ERP) \n" +"PO-Revision-Date: 2010-08-17 09:58+0000\n" +"Last-Translator: OpenERP Administrators \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-08-12 04:04+0000\n" +"X-Launchpad-Export-Date: 2010-08-18 10:34+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 non valido per Visualizzazione Architettura!" +msgstr "XML non valido per Visualizzare l'architettura!" #. module: analytic_journal_billing_rate #: field:analytic_journal_rate_grid,journal_id:0 msgid "Analytic Journal" -msgstr "" +msgstr "Giornale conti analitici" #. module: analytic_journal_billing_rate #: constraint:ir.model:0 @@ -37,29 +37,29 @@ msgstr "" #. module: analytic_journal_billing_rate #: view:analytic_journal_rate_grid:0 msgid "Billing Rate per Journal for this Analytic Account" -msgstr "" +msgstr "Tasso di fatturazione per Giornale per questo Conto Analitico" #. module: analytic_journal_billing_rate #: field:analytic_journal_rate_grid,account_id:0 msgid "Analytic Account" -msgstr "" +msgstr "Conto analitico" #. 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 "" +msgstr "Tabella di relazione tra Giornali e tassi di fatturazione" #. module: analytic_journal_billing_rate #: field:account.analytic.account,journal_rate_ids:0 msgid "Invoicing Rate per Journal" -msgstr "" +msgstr "Tasso di fatturazione diviso per Giornale" #. module: analytic_journal_billing_rate #: model:ir.module.module,shortdesc:analytic_journal_billing_rate.module_meta_information msgid "Analytic Journal Billing Rate" -msgstr "" +msgstr "Giornale Conti Analitici Tasso di fatturazione" #. module: analytic_journal_billing_rate #: field:analytic_journal_rate_grid,rate_id:0 msgid "Invoicing Rate" -msgstr "" +msgstr "Tasso di fatturazione" diff --git a/addons/analytic_journal_billing_rate/i18n/tr.po b/addons/analytic_journal_billing_rate/i18n/tr.po index b850089e14c..f2418771b3c 100644 --- a/addons/analytic_journal_billing_rate/i18n/tr.po +++ b/addons/analytic_journal_billing_rate/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:03+0000\n" +"PO-Revision-Date: 2010-08-29 09:43+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 04:04+0000\n" +"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: analytic_journal_billing_rate diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index 2f5152faea6..0bb9afc3386 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . # ############################################################################## @@ -54,7 +54,7 @@ class hr_analytic_timesheet(osv.osv): # Look in account, if no value for the user => look in parent until there is no more parent to look # Take the first found... if nothing found => return False def _get_related_user_account_recursiv(self, cr, uid, user_id, account_id): - + temp=self.pool.get('analytic_user_funct_grid').search(cr, uid, [('user_id', '=', user_id),('account_id', '=', account_id) ]) account=self.pool.get('account.analytic.account').browse(cr, uid, account_id) if temp: @@ -64,21 +64,19 @@ class hr_analytic_timesheet(osv.osv): return self._get_related_user_account_recursiv(cr, uid, user_id, account.parent_id.id) else: return False - - + + def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0): - #{'value': {'to_invoice': False, 'amount': (-162.0,), 'product_id': 7, 'general_account_id': (5,)}} res = {} if not (account_id): #avoid a useless call to super - return res + return res if not (user_id): return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids, account_id) #get the browse record related to user_id and account_id temp = self._get_related_user_account_recursiv(cr, uid, user_id, account_id) - # temp = self.pool.get('analytic_user_funct_grid').search(cr, uid, [('user_id', '=', user_id),('account_id', '=', account_id) ]) if not temp: #if there isn't any record for this user_id and account_id return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids, account_id) @@ -100,9 +98,9 @@ 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 res ['value']['amount']= - round(amount, 2) res ['value']['general_account_id']= a @@ -112,19 +110,18 @@ class hr_analytic_timesheet(osv.osv): res = {} if not (user_id): #avoid a useless call to super - return res + return res #get the old values from super res = super(hr_analytic_timesheet, self).on_change_user_id(cr, uid, ids, user_id) if account_id: #get the browse record related to user_id and account_id - # temp = self.pool.get('analytic_user_funct_grid').search(cr, uid, [('user_id', '=', user_id),('account_id', '=', account_id) ]) temp = self._get_related_user_account_recursiv(cr, uid, user_id, account_id) if temp: #add the value from the new relation analytic_user_funct_grid r = self.pool.get('analytic_user_funct_grid').browse(cr, uid, temp)[0] - res['value']['product_id'] = r.product_id.id + res['value']['product_id'] = r.product_id.id #the change of product has to impact the amount, uom and general_account_id a = r.product_id.product_tmpl_id.property_account_expense.id @@ -136,9 +133,9 @@ 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 res ['value']['amount']= - round(amount, 2) res ['value']['general_account_id']= a diff --git a/addons/analytic_user_function/i18n/tr.po b/addons/analytic_user_function/i18n/tr.po index 15f03fe170c..8078b09134e 100644 --- a/addons/analytic_user_function/i18n/tr.po +++ b/addons/analytic_user_function/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:46+0000\n" +"PO-Revision-Date: 2010-08-29 09:43+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 04:05+0000\n" +"X-Launchpad-Export-Date: 2010-08-30 03:58+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: analytic_user_function diff --git a/addons/association/profile_association.xml b/addons/association/profile_association.xml index 88a8c2940d0..032005010e0 100644 --- a/addons/association/profile_association.xml +++ b/addons/association/profile_association.xml @@ -9,7 +9,7 @@
- Install Extra Modules + Association Profile Configuration
@@ -63,7 +63,7 @@
- + diff --git a/addons/auction/__openerp__.py b/addons/auction/__openerp__.py index 75b50113028..69fef0748c4 100644 --- a/addons/auction/__openerp__.py +++ b/addons/auction/__openerp__.py @@ -43,14 +43,11 @@ 'init_xml': ['auction_sequence.xml', 'auction_data.xml'], 'update_xml': [ 'security/ir.model.access.csv', - # 'wizard/auction_lots_able_view.xml', - # 'wizard/auction_lots_enable_view.xml', 'wizard/auction_lots_make_invoice_buyer_view.xml', 'wizard/auction_lots_make_invoice_view.xml', 'wizard/auction_taken_view.xml', 'wizard/auction_lots_auction_move_view.xml', 'wizard/auction_pay_buy_view.xml', - #'wizard/auction_payer_sel_view.xml', 'wizard/auction_lots_sms_send_view.xml', 'wizard/auction_catalog_flagey_view.xml', 'wizard/auction_lots_buyer_map_view.xml', @@ -59,12 +56,11 @@ 'report/report_auction_view.xml', 'auction_wizard.xml', 'board_auction_view.xml', - # 'board_auction_manager_view.xml', ], 'demo_xml': ['auction_demo.xml','board_auction_demo.xml'], 'test': ['test/auction.yml'], - + 'installable': True, 'active': False, 'certificate': '0039333102717', diff --git a/addons/auction/auction.py b/addons/auction/auction.py index f6aebbb5077..5ea2441e6fd 100644 --- a/addons/auction/auction.py +++ b/addons/auction/auction.py @@ -35,10 +35,10 @@ import tools class auction_artists(osv.osv): _name = "auction.artists" _columns = { - 'name': fields.char('Artist/Author Name', size=64, required=True), - 'pseudo': fields.char('Pseudo', size=64), - 'birth_death_dates':fields.char('Birth / Death dates', size=64), - 'biography': fields.text('Biography'), + 'name': fields.char('Artist/Author Name', size=64, required=True), + 'pseudo': fields.char('Pseudo', size=64), + 'birth_death_dates':fields.char('Birth / Death dates', size=64), + 'biography': fields.text('Biography'), } auction_artists() @@ -49,10 +49,10 @@ class auction_dates(osv.osv): """Auction Dates""" _name = "auction.dates" _description=__doc__ - + def _adjudication_get(self, cr, uid, ids, prop, unknow_none, unknow_dict): res={} - total = 0.0 + total = 0.0 lots_obj = self.pool.get('auction.lots') for auction in self.browse(cr, uid, ids): lots_ids = lots_obj.search(cr, uid, [('auction_id', '=', auction.id)]) @@ -71,27 +71,27 @@ class auction_dates(osv.osv): return name _columns = { - 'name': fields.char('Auction Name', size=64, required=True), - 'expo1': fields.date('First Exposition Day', required=True, help="Beginning Exposition Date For Auction"), - 'expo2': fields.date('Last Exposition Day', required=True, help="Last Exposition Date For Auction"), - 'auction1': fields.date('First Auction Day', required=True, help="Start Date Of Auction"), - 'auction2': fields.date('Last Auction Day', required=True, help="End Date Of Auction"), - 'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True, help="Account Journal For Buyer"), - 'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True, help="Account Journal For Seller"), - 'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs', help="Account Tax For Buyer"), - 'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs', help="Account Tax For Seller"), - 'acc_income': fields.many2one('account.account', 'Income Account', required=True), - 'acc_expense': fields.many2one('account.account', 'Expense Account', required=True), - 'adj_total': fields.function(_adjudication_get, method=True, string='Total Adjudication', store=True), - 'state': fields.selection((('draft', 'Draft'), ('closed', 'Closed')), 'State', select=1, readonly=True, - help='When auction starts the state is \'Draft\'.\n At the end of auction, the state becomes \'Closed\'.'), - 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True), + 'name': fields.char('Auction Name', size=64, required=True), + 'expo1': fields.date('First Exposition Day', required=True, help="Beginning Exposition Date For Auction"), + 'expo2': fields.date('Last Exposition Day', required=True, help="Last Exposition Date For Auction"), + 'auction1': fields.date('First Auction Day', required=True, help="Start Date Of Auction"), + 'auction2': fields.date('Last Auction Day', required=True, help="End Date Of Auction"), + 'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True, help="Account Journal For Buyer"), + 'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True, help="Account Journal For Seller"), + 'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs', help="Account Tax For Buyer"), + 'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs', help="Account Tax For Seller"), + 'acc_income': fields.many2one('account.account', 'Income Account', required=True), + 'acc_expense': fields.many2one('account.account', 'Expense Account', required=True), + 'adj_total': fields.function(_adjudication_get, method=True, string='Total Adjudication', store=True), + 'state': fields.selection((('draft', 'Draft'), ('closed', 'Closed')), 'State', select=1, readonly=True, + help='When auction starts the state is \'Draft\'.\n At the end of auction, the state becomes \'Closed\'.'), + 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True), } - + _defaults = { - 'state': lambda *a: 'draft', + 'state': lambda *a: 'draft', } - + _order = "auction1 desc" def close(self, cr, uid, ids, context=None): @@ -112,7 +112,7 @@ class auction_dates(osv.osv): new_seller_invoice = lots_obj.seller_trans_create(cr, uid, lots_ids2, {}) self.write(cr, uid, ids, {'state': 'closed'}) #close the auction return True - + auction_dates() #---------------------------------------------------------- @@ -120,27 +120,27 @@ auction_dates() #---------------------------------------------------------- class auction_deposit(osv.osv): """Auction Deposit Border""" - + _name = "auction.deposit" _description=__doc__ _order = "id desc" _columns = { - 'transfer' : fields.boolean('Transfer'), - 'name': fields.char('Depositer Inventory', size=64, required=True), - 'partner_id': fields.many2one('res.partner', 'Seller', required=True, change_default=True), - 'date_dep': fields.date('Deposit date', required=True), - 'method': fields.selection((('keep', 'Keep until sold'), ('decease', 'Decrease limit of 10%'), ('contact', 'Contact the Seller')), 'Withdrawned method', required=True), - 'tax_id': fields.many2one('account.tax', 'Expenses'), - 'create_uid': fields.many2one('res.users', 'Created by', readonly=True), - 'info': fields.char('Description', size=64), - 'lot_id': fields.one2many('auction.lots', 'bord_vnd_id', 'Objects'), - 'specific_cost_ids': fields.one2many('auction.deposit.cost', 'deposit_id', 'Specific Costs'), - 'total_neg': fields.boolean('Allow Negative Amount'), + 'transfer' : fields.boolean('Transfer'), + 'name': fields.char('Depositer Inventory', size=64, required=True), + 'partner_id': fields.many2one('res.partner', 'Seller', required=True, change_default=True), + 'date_dep': fields.date('Deposit date', required=True), + 'method': fields.selection((('keep', 'Keep until sold'), ('decease', 'Decrease limit of 10%'), ('contact', 'Contact the Seller')), 'Withdrawned method', required=True), + 'tax_id': fields.many2one('account.tax', 'Expenses'), + 'create_uid': fields.many2one('res.users', 'Created by', readonly=True), + 'info': fields.char('Description', size=64), + 'lot_id': fields.one2many('auction.lots', 'bord_vnd_id', 'Objects'), + 'specific_cost_ids': fields.one2many('auction.deposit.cost', 'deposit_id', 'Specific Costs'), + 'total_neg': fields.boolean('Allow Negative Amount'), } _defaults = { - 'method': lambda *a: 'keep', - 'total_neg': lambda *a: False, - 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'auction.deposit'), + 'method': lambda *a: 'keep', + 'total_neg': lambda *a: False, + 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'auction.deposit'), } auction_deposit() @@ -149,16 +149,16 @@ auction_deposit() # (Specific) Deposit Costs #---------------------------------------------------------- class auction_deposit_cost(osv.osv): - + """Auction Deposit Cost""" - + _name = 'auction.deposit.cost' _description=__doc__ _columns = { - 'name': fields.char('Cost Name', required=True, size=64), - 'amount': fields.float('Amount'), - 'account': fields.many2one('account.account', 'Destination Account', required=True), - 'deposit_id': fields.many2one('auction.deposit', 'Deposit'), + 'name': fields.char('Cost Name', required=True, size=64), + 'amount': fields.float('Amount'), + 'account': fields.many2one('account.account', 'Destination Account', required=True), + 'deposit_id': fields.many2one('auction.deposit', 'Deposit'), } auction_deposit_cost() @@ -166,16 +166,16 @@ auction_deposit_cost() # Lots Categories #---------------------------------------------------------- class aie_category(osv.osv): - + _name="aie.category" _order = "name" _columns={ - 'name': fields.char('Name', size=64, required=True), - 'code':fields.char('Code', size=64), - 'parent_id': fields.many2one('aie.category', 'Parent aie Category', ondelete='cascade'), - 'child_ids': fields.one2many('aie.category', 'parent_id', help="Childs aie category") + 'name': fields.char('Name', size=64, required=True), + 'code':fields.char('Code', size=64), + 'parent_id': fields.many2one('aie.category', 'Parent aie Category', ondelete='cascade'), + 'child_ids': fields.one2many('aie.category', 'parent_id', help="Childs aie category") } - + def name_get(self, cr, uid, ids, context=None): if not context: context = {} @@ -189,22 +189,22 @@ class aie_category(osv.osv): name = record['parent_id'][1] + ' / ' + name res.append((record['id'], name)) return res - -aie_category() - + +aie_category() + class auction_lot_category(osv.osv): """Auction Lots Category""" - + _name = 'auction.lot.category' _description=__doc__ _columns = { - 'name': fields.char('Category Name', required=True, size=64), - 'priority': fields.float('Priority'), - 'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the auction lot category without removing it."), - 'aie_categ': fields.many2one('aie.category', 'Category', ondelete='cascade'), + 'name': fields.char('Category Name', required=True, size=64), + 'priority': fields.float('Priority'), + 'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the auction lot category without removing it."), + 'aie_categ': fields.many2one('aie.category', 'Category', ondelete='cascade'), } _defaults = { - 'active' : lambda *a: 1, + 'active' : lambda *a: 1, } auction_lot_category() @@ -217,11 +217,11 @@ def _type_get(self, cr, uid, context=None): obj = self.pool.get('auction.lot.category') ids = obj.search(cr, uid, []) res = obj.read(cr, uid, ids, ['name'], context) - res = [(r['name'], r['name']) for r in res] - return res + res = [(r['name'], r['name']) for r in res] + return res class auction_lots(osv.osv): - + """Auction Object""" _name = "auction.lots" _order = "obj_num,lot_num,id" @@ -231,7 +231,7 @@ class auction_lots(osv.osv): if not context: context={} return self.write(cr, uid, ids, {'state':'unsold'}) - + def button_taken_away(self, cr, uid, ids, context=None): if not context: context={} @@ -256,7 +256,7 @@ class auction_lots(osv.osv): """ if not context: context = {} - + res = {} account_analytic_line_obj = self.pool.get('account.analytic.line') lots = self.browse(cr, uid, ids, context) @@ -289,24 +289,24 @@ class auction_lots(osv.osv): elif name == "gross_revenue": if lot.auction_id: result = lot.buyer_price - lot.seller_price - + elif name == "net_revenue": if lot.auction_id: result = lot.buyer_price - lot.seller_price - lot.costs - + elif name == "gross_margin": if ((lot.obj_price==0) and (lot.state=='draft')): amount = lot.lot_est1 - else: + else: amount = lot.obj_price if amount > 0: result = (lot.gross_revenue * 100) / amount result = round(result,2) - + elif name == "net_margin": if ((lot.obj_price==0) and (lot.state=='draft')): amount = lot.lot_est1 - else: + else: amount = lot.obj_price if amount > 0: result = (lot.net_revenue * 100) / amount @@ -320,8 +320,8 @@ class auction_lots(osv.osv): auct_id = lot.auction_id.id lot_count = self.search(cr, uid, [('auction_id', '=', auct_id)], count=True) line_ids = account_analytic_line_obj.search(cr, uid, [ - ('account_id', '=', lot.auction_id.account_analytic_id.id), - ('journal_id', '<>', lot.auction_id.journal_id.id), + ('account_id', '=', lot.auction_id.account_analytic_id.id), + ('journal_id', '<>', lot.auction_id.journal_id.id), ('journal_id', '<>', lot.auction_id.journal_seller_id.id)]) indir_cost = lot.bord_vnd_id.specific_cost_ids for r in lot.bord_vnd_id.specific_cost_ids: @@ -330,20 +330,20 @@ class auction_lots(osv.osv): if line.amount: som -= line.amount result = som/lot_count - + elif name=="paid_ach": result = False if lot.ach_inv_id and lot.ach_inv_id.state == 'paid': result = True - + elif name=="paid_vnd": result = False if lot.sel_inv_id and lot.sel_inv_id.state == 'paid': - result = True - + result = True + res[lot.id][name] = result - - + + return res def onchange_obj_ret(self, cr, uid, ids, obj_ret, context=None): @@ -354,66 +354,66 @@ class auction_lots(osv.osv): return {} _columns = { - 'bid_lines':fields.one2many('auction.bid_line', 'lot_id', 'Bids'), - 'auction_id': fields.many2one('auction.dates', 'Auction', select=1, help="Auction For Object"), - 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Provide Deposit Information: seller, Withdrawned Method, Object, Deposit Costs"), - 'name': fields.char('Title', size=64, required=True, help='Auction Object Name'), - 'name2': fields.char('Short Description (2)', size=64), - 'lot_type': fields.selection(_type_get, 'Object category', size=64), - 'author_right': fields.many2one('account.tax', 'Author rights', help="Account Tax For Author Commission"), - 'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price"), - 'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price"), - 'lot_num': fields.integer('List Number', required=True, select=1, help="List Number In Depositer Inventory"), - 'create_uid': fields.many2one('res.users', 'Created by', readonly=True), - 'history_ids':fields.one2many('auction.lot.history', 'lot_id', 'Auction history'), - 'lot_local':fields.char('Location', size=64, help="Auction Location"), - 'artist_id':fields.many2one('auction.artists', 'Artist/Author'), - 'artist2_id':fields.many2one('auction.artists', 'Artist/Author2'), - 'important':fields.boolean('To be Emphatized'), - 'product_id':fields.many2one('product.product', 'Product', required=True), - 'obj_desc': fields.text('Object Description'), - 'obj_num': fields.integer('Catalog Number'), - 'obj_ret': fields.float('Price retired', help="Object Ret"), - 'obj_comm': fields.boolean('Commission'), - 'obj_price': fields.float('Adjudication price', help="Object Price"), - 'ach_avance': fields.float('Buyer Advance'), - 'ach_login': fields.char('Buyer Username', size=64), + 'bid_lines':fields.one2many('auction.bid_line', 'lot_id', 'Bids'), + 'auction_id': fields.many2one('auction.dates', 'Auction', select=1, help="Auction For Object"), + 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Provide Deposit Information: seller, Withdrawned Method, Object, Deposit Costs"), + 'name': fields.char('Title', size=64, required=True, help='Auction Object Name'), + 'name2': fields.char('Short Description (2)', size=64), + 'lot_type': fields.selection(_type_get, 'Object category', size=64), + 'author_right': fields.many2one('account.tax', 'Author rights', help="Account Tax For Author Commission"), + 'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price"), + 'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price"), + 'lot_num': fields.integer('List Number', required=True, select=1, help="List Number In Depositer Inventory"), + 'create_uid': fields.many2one('res.users', 'Created by', readonly=True), + 'history_ids':fields.one2many('auction.lot.history', 'lot_id', 'Auction history'), + 'lot_local':fields.char('Location', size=64, help="Auction Location"), + 'artist_id':fields.many2one('auction.artists', 'Artist/Author'), + 'artist2_id':fields.many2one('auction.artists', 'Artist/Author2'), + 'important':fields.boolean('To be Emphatized'), + 'product_id':fields.many2one('product.product', 'Product', required=True), + 'obj_desc': fields.text('Object Description'), + 'obj_num': fields.integer('Catalog Number'), + 'obj_ret': fields.float('Price retired', help="Object Ret"), + 'obj_comm': fields.boolean('Commission'), + 'obj_price': fields.float('Adjudication price', help="Object Price"), + 'ach_avance': fields.float('Buyer Advance'), + 'ach_login': fields.char('Buyer Username', size=64), 'ach_uid': fields.many2one('res.partner', 'Buyer'), - 'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True), - 'ach_emp': fields.boolean('Taken Away', readonly=True, help="When state is Taken Away, This field is Marked as True"), - 'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Bank statement', This field is Marked"), - 'ach_inv_id': fields.many2one('account.invoice', 'Buyer Invoice', readonly=True, states={'draft':[('readonly', False)]}), - 'sel_inv_id': fields.many2one('account.invoice', 'Seller Invoice', readonly=True, states={'draft':[('readonly', False)]}), - 'vnd_lim': fields.float('Seller limit'), - 'vnd_lim_net': fields.boolean('Net limit ?', readonly=True), - 'image': fields.binary('Image', help="Object Image"), - 'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', This field is selected as True."), - 'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', method=True, type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', This field is selected as True."), + 'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True), + 'ach_emp': fields.boolean('Taken Away', readonly=True, help="When state is Taken Away, This field is Marked as True"), + 'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Bank statement', This field is Marked"), + 'ach_inv_id': fields.many2one('account.invoice', 'Buyer Invoice', readonly=True, states={'draft':[('readonly', False)]}), + 'sel_inv_id': fields.many2one('account.invoice', 'Seller Invoice', readonly=True, states={'draft':[('readonly', False)]}), + 'vnd_lim': fields.float('Seller limit'), + 'vnd_lim_net': fields.boolean('Net limit ?', readonly=True), + 'image': fields.binary('Image', help="Object Image"), + 'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', This field is selected as True."), + 'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', method=True, type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', This field is selected as True."), 'state': fields.selection(( - ('draft', 'Draft'), - ('unsold', 'Unsold'), - ('paid', 'Paid'), - ('sold', 'Sold'), - ('taken_away', 'Taken away')), 'State', required=True, readonly=True, + ('draft', 'Draft'), + ('unsold', 'Unsold'), + ('paid', 'Paid'), + ('sold', 'Sold'), + ('taken_away', 'Taken away')), 'State', required=True, readonly=True, help=' * The \'Draft\' state is used when a object is encoding as a new object. \ \n* The \'Unsold\' state is used when object does not sold for long time, user can also set it as draft state after unsold. \ \n* The \'Paid\' state is used when user pay for the object \ - \n* The \'Sold\' state is used when user buy the object.'), - 'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Buyer Price"), - 'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price", help="Seller Price"), - 'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"), - 'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"), - 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Deposit cost"), - 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement Line For Given Buyer"), - 'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"), - 'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"), + \n* The \'Sold\' state is used when user buy the object.'), + 'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Buyer Price"), + 'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price", help="Seller Price"), + 'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"), + 'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"), + 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Deposit cost"), + 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement Line For Given Buyer"), + 'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"), + 'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"), } _defaults = { - 'state':lambda *a: 'draft', - 'lot_num':lambda *a:1, - 'is_ok': lambda *a: False, + 'state':lambda *a: 'draft', + 'lot_num':lambda *a:1, + 'is_ok': lambda *a: False, } - + def name_get(self, cr, user, ids, context=None): if not context: context={} @@ -467,7 +467,7 @@ class auction_lots(osv.osv): amount+=t['amount'] amount_total['value']= amount amount_total['amount']= amount - + return amount_total @@ -481,7 +481,7 @@ class auction_lots(osv.osv): tax_cost_ids.append(border_id.tax_id) elif lot.auction_id and lot.auction_id.seller_costs: tax_cost_ids += lot.auction_id.seller_costs - + tax_costs = self.pool.get('account.tax').compute_all(cr, uid, tax_cost_ids, lot.obj_price, 1)['taxes'] # delete useless keys from the costs computed by the tax object... this is useless but cleaner... for cost in tax_costs: @@ -497,13 +497,13 @@ class auction_lots(osv.osv): #FIXME:the string passes have lot 'should go through the system translations. obj_price_wh_costs = reduce(lambda x, y: x + y['amount'], tax_costs, lot.obj_price) if obj_price_wh_costs < lot.vnd_lim: - costs.append({ 'type': 1, - 'id': lot.obj_num, - 'name': 'Remise lot '+ str(lot.obj_num), + costs.append({ 'type': 1, + 'id': lot.obj_num, + 'name': 'Remise lot '+ str(lot.obj_num), 'amount': lot.vnd_lim - obj_price_wh_costs} ) return costs - + def compute_seller_costs(self, cr, uid, ids, manual_only=False): lots = self.browse(cr, uid, ids) costs = [] @@ -543,9 +543,9 @@ class auction_lots(osv.osv): # sum remise limite net and ristourne def compute_seller_costs_summed(self, cr, uid, ids): #ach_pay_id - + """This Fuction sum Net remittance limit and refund""" - + taxes = self.compute_seller_costs(cr, uid, ids) taxes_summed = {} for tax in taxes: @@ -567,7 +567,7 @@ class auction_lots(osv.osv): return taxes_summed.values() def buyer_proforma(self, cr, uid, ids, context=None): - + if not context: context={} invoices = {} @@ -589,11 +589,10 @@ class auction_lots(osv.osv): if not invoice_addr_id: raise orm.except_orm(_('No Invoice Address'), _('The Buyer "%s" has no Invoice Address.') % (contact_addr_id,)) inv = { - 'name': 'Auction proforma:' +lot.name, - 'journal_id': lot.auction_id.journal_id.id, - 'partner_id': partner_ref, - 'type': 'out_invoice', - # 'state':'proforma', + 'name': 'Auction proforma:' +lot.name, + 'journal_id': lot.auction_id.journal_id.id, + 'partner_id': partner_ref, + 'type': 'out_invoice', } inv.update(inv_ref.onchange_partner_id(cr, uid, [], 'out_invoice', partner_ref)['value']) inv['account_id'] = inv['account_id'] and inv['account_id'][0] @@ -618,7 +617,7 @@ class auction_lots(osv.osv): 'price_unit': lot.obj_price, } inv_line_obj.create(cr, uid, inv_line, context) - inv_ref.button_compute(cr, uid, invoice.values()) + inv_ref.button_compute(cr, uid, invoices.values()) wf_service.trg_validate(uid, 'account.invoice', inv_id, 'invoice_proforma2', cr) return invoices.values() @@ -648,10 +647,10 @@ class auction_lots(osv.osv): contact_addr_id = res['contact'] invoice_addr_id = res['invoice'] inv = { - 'name': 'Auction:' +lot.name, - 'journal_id': lot.auction_id.journal_seller_id.id, - 'partner_id': lot.bord_vnd_id.partner_id.id, - 'type': 'in_invoice', + 'name': 'Auction:' +lot.name, + 'journal_id': lot.auction_id.journal_seller_id.id, + 'partner_id': lot.bord_vnd_id.partner_id.id, + 'type': 'in_invoice', } inv.update(inv_ref.onchange_partner_id(cr, uid, [], 'in_invoice', lot.bord_vnd_id.partner_id.id)['value']) inv_id = inv_ref.create(cr, uid, inv, context) @@ -666,14 +665,14 @@ class auction_lots(osv.osv): taxes += map(lambda x: x.id, lot.auction_id.seller_costs) inv_line= { - 'invoice_id': inv_id, - 'quantity': 1, - 'product_id': lot.product_id.id, - 'name': '['+str(lot.obj_num)+'] '+lot.auction_id.name, - 'invoice_line_tax_id': [(6, 0, taxes)], - 'account_analytic_id': lot.auction_id.account_analytic_id.id, - 'account_id': lot.auction_id.acc_expense.id, - 'price_unit': lot.obj_price, + 'invoice_id': inv_id, + 'quantity': 1, + 'product_id': lot.product_id.id, + 'name': '['+str(lot.obj_num)+'] '+lot.auction_id.name, + 'invoice_line_tax_id': [(6, 0, taxes)], + 'account_analytic_id': lot.auction_id.account_analytic_id.id, + 'account_id': lot.auction_id.acc_expense.id, + 'price_unit': lot.obj_price, } inv_line_obj.create(cr, uid, inv_line, context) inv_ref.button_compute(cr, uid, invoices.values()) @@ -715,11 +714,11 @@ class auction_lots(osv.osv): price = lot.obj_price or 0.0 lot_name =lot.obj_num inv = { - 'name':lot.auction_id.name or '', - 'reference': lot.ach_login, - 'journal_id': lot.auction_id.journal_id.id, - 'partner_id': lot.ach_uid.id, - 'type': 'out_invoice', + 'name':lot.auction_id.name or '', + 'reference': lot.ach_login, + 'journal_id': lot.auction_id.journal_id.id, + 'partner_id': lot.ach_uid.id, + 'type': 'out_invoice', } if invoice_number: inv['number'] = invoice_number @@ -734,14 +733,14 @@ class auction_lots(osv.osv): taxes.append(lot.author_right.id) inv_line= { - 'invoice_id': inv_id, - 'quantity': 1, - 'product_id': lot.product_id.id, - 'name': '['+str(lot.obj_num)+'] '+ lot.name, - 'invoice_line_tax_id': [(6, 0, taxes)], - 'account_analytic_id': lot.auction_id.account_analytic_id.id, - 'account_id': lot.auction_id.acc_income.id, - 'price_unit': lot.obj_price, + 'invoice_id': inv_id, + 'quantity': 1, + 'product_id': lot.product_id.id, + 'name': '['+str(lot.obj_num)+'] '+ lot.name, + 'invoice_line_tax_id': [(6, 0, taxes)], + 'account_analytic_id': lot.auction_id.account_analytic_id.id, + 'account_id': lot.auction_id.acc_income.id, + 'price_unit': lot.obj_price, } inv_line_obj.create(cr, uid, inv_line, context) inv_ref.button_compute(cr, uid, [inv_id]) @@ -756,21 +755,21 @@ auction_lots() #---------------------------------------------------------- class auction_bid(osv.osv): """Bid Auctions""" - + _name = "auction.bid" _description=__doc__ _order = 'id desc' _columns = { - 'partner_id': fields.many2one('res.partner', 'Buyer Name', required=True), - 'contact_tel':fields.char('Contact', size=64), - 'name': fields.char('Bid ID', size=64, required=True), - 'auction_id': fields.many2one('auction.dates', 'Auction Date', required=True), - 'bid_lines': fields.one2many('auction.bid_line', 'bid_id', 'Bid'), + 'partner_id': fields.many2one('res.partner', 'Buyer Name', required=True), + 'contact_tel':fields.char('Contact', size=64), + 'name': fields.char('Bid ID', size=64, required=True), + 'auction_id': fields.many2one('auction.dates', 'Auction Date', required=True), + 'bid_lines': fields.one2many('auction.bid_line', 'bid_id', 'Bid'), } _defaults = { - 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'auction.bid'), + 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'auction.bid'), } - + def onchange_contact(self, cr, uid, ids, partner_id): if not partner_id: return {'value': {'contact_tel':False}} @@ -785,13 +784,13 @@ auction_bid() class auction_lot_history(osv.osv): """Lot History""" - + _name = "auction.lot.history" _description=__doc__ _columns = { - 'name': fields.date('Date', size=64), - 'lot_id': fields.many2one('auction.lots', 'Object', required=True, ondelete='cascade'), - 'auction_id': fields.many2one('auction.dates', 'Auction date', required=True, ondelete='cascade'), + 'name': fields.date('Date', size=64), + 'lot_id': fields.many2one('auction.lots', 'Object', required=True, ondelete='cascade'), + 'auction_id': fields.many2one('auction.dates', 'Auction date', required=True, ondelete='cascade'), 'price': fields.float('Withdrawn price', digits=(16, 2)) } _defaults = { @@ -804,11 +803,11 @@ class auction_bid_lines(osv.osv): _description="Bid" _columns = { - 'name': fields.char('Bid date', size=64), - 'bid_id': fields.many2one('auction.bid', 'Bid ID', required=True, ondelete='cascade'), - 'lot_id': fields.many2one('auction.lots', 'Object', required=True, ondelete='cascade'), - 'call': fields.boolean('To be Called'), - 'price': fields.float('Maximum Price'), + 'name': fields.char('Bid date', size=64), + 'bid_id': fields.many2one('auction.bid', 'Bid ID', required=True, ondelete='cascade'), + 'lot_id': fields.many2one('auction.lots', 'Object', required=True, ondelete='cascade'), + 'call': fields.boolean('To be Called'), + 'price': fields.float('Maximum Price'), 'auction': fields.char(string='Auction Name', size=64) } _defaults = { diff --git a/addons/auction/auction_demo.xml b/addons/auction/auction_demo.xml index 45b157e6545..51d9c166178 100644 --- a/addons/auction/auction_demo.xml +++ b/addons/auction/auction_demo.xml @@ -11,7 +11,7 @@ Auction Adjudications - 0 + A0 view @@ -22,7 +22,7 @@ Auction Adjudication Expenses - 1 + A1 view @@ -33,16 +33,16 @@ Auction Adjudications - 7x* - + A7x* + receivable - + Auction Adjudication Expenses - 6x* + A6x* payable @@ -51,7 +51,7 @@ Auction Buyer Costs - 8x* + A8x* payable @@ -59,7 +59,7 @@ Auction Seller Costs - 9x* + A9x* receivable @@ -128,7 +128,7 @@ default - + Louvain-la-Neuve Thomas Passot @@ -141,12 +141,12 @@ - + Philippe Lavilier 1345-1450 - + POREAU OSWALD 1877-1955 @@ -195,7 +195,7 @@ - + TVA 0.12 @@ -211,7 +211,7 @@ - + Buyer Costs 0.21 @@ -219,7 +219,7 @@ - + Seller Costs1 -0.10 @@ -227,7 +227,7 @@ - + Seller Costs -0.10 @@ -253,7 +253,7 @@ - + Oeuvres a 21% @@ -267,7 +267,7 @@ 1 - + Furniture 2 @@ -279,7 +279,7 @@ 2 - + Sculpture 10 @@ -389,7 +389,6 @@ - @@ -403,10 +402,8 @@ 4 0.00 - - @@ -420,17 +417,14 @@ 4 375 - - Plastic glass 5 - 300 500 show pices @@ -462,7 +456,6 @@ bresslet 7 - 150 400 show pices @@ -478,7 +471,6 @@ gold chain 11 - 400 700 show pices @@ -494,7 +486,6 @@ fiber glass 8 - 300 500 show pices @@ -510,7 +501,6 @@ lake photos 9 - 100 200 show pices @@ -526,7 +516,6 @@ mobile photos 10 - 4500 4700 show models @@ -542,7 +531,6 @@ Antique photos 11 - 1600 2200 show map Items @@ -558,7 +546,6 @@ Hardware photos 12 - 2600 2800 show map Items @@ -590,7 +577,6 @@ mobile accesories photos 13 - 1600 2200 show map Items @@ -606,7 +592,6 @@ pikes-candles 14 - 30 50 show map Items @@ -622,7 +607,6 @@ Coffee Service 15 - 10 20 show map Items @@ -823,9 +807,7 @@ Demo - - @@ -836,43 +818,43 @@ sign_in - + sign_out - + sign_in - + sign_out - + sign_in - + sign_out - + sign_in - + sign_out @@ -886,43 +868,43 @@ sign_in - + sign_out - + sign_in - + sign_out - + sign_in - + sign_out - + sign_in - + sign_out diff --git a/addons/auction/auction_report.xml b/addons/auction/auction_report.xml index 885c08582ee..4df44c9c96a 100644 --- a/addons/auction/auction_report.xml +++ b/addons/auction/auction_report.xml @@ -1,7 +1,6 @@ - - - - - - - - - - - - diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml index 20b6dede1f6..648d8f271e8 100644 --- a/addons/auction/auction_view.xml +++ b/addons/auction/auction_view.xml @@ -5,9 +5,9 @@ - + - + auction.artists.tree auction.artists @@ -42,9 +42,9 @@ - - - + + + auction.lot.category.tree auction.lot.category @@ -55,7 +55,7 @@ - + auction.lot.category.form auction.lot.category @@ -71,17 +71,17 @@ - + auction.lot.category form - + - + - + Auction dates auction.dates @@ -95,7 +95,7 @@ - + Auction dates auction.dates @@ -122,8 +122,8 @@ - - + + @@ -194,7 +194,7 @@ Auctions auction.dates form - tree,form,calendar + tree,form,calendar {"search_default_draft": "1"} @@ -208,8 +208,8 @@ - - + + Auction lots auction.lots @@ -246,13 +246,13 @@ - - + + - + @@ -295,7 +295,7 @@ - + @@ -306,7 +306,7 @@ - + @@ -314,8 +314,8 @@