diff --git a/addons/account/account.py b/addons/account/account.py index 5908fa737e0..997fe2b3c59 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -78,7 +78,7 @@ class account_payment_term_line(osv.osv): 'value': fields.selection([('procent','Percent'),('balance','Balance'),('fixed','Fixed Amount')], 'Value',required=True), 'value_amount': fields.float('Value Amount'), 'days': fields.integer('Number of Days',required=True, help="Number of days to add before computation of the day of month."), - 'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the end of the month)."), + 'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), 'payment_id': fields.many2one('account.payment.term','Payment Term', required=True, select=True), } _defaults = { @@ -681,6 +681,7 @@ account_fiscalyear() class account_move(osv.osv): _name = "account.move" _description = "Account Entry" + _order = 'id desc' def name_get(self, cursor, user, ids, context=None): if not len(ids): @@ -712,15 +713,16 @@ class account_move(osv.osv): return result _columns = { - 'name': fields.char('Entry Number', size=64, required=True), + 'name': fields.char('Number', size=64, required=True), 'ref': fields.char('Ref', size=64), 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'posted':[('readonly',True)]}), 'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'Status', required=True, readonly=True), 'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}), 'to_check': fields.boolean('To Be Verified'), - 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True), - 'amount': fields.function(_amount_compute, method=True, string='Amount', digits=(16,2), store=True), + 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"), + 'amount': fields.function(_amount_compute, method=True, string='Amount', digits=(16,2)), + 'date': fields.date('Date', required=True), 'type': fields.selection([ ('pay_voucher','Cash Payment'), ('bank_pay_voucher','Bank Payment'), @@ -737,6 +739,7 @@ class account_move(osv.osv): 'state': lambda *a: 'draft', 'period_id': _get_period, 'type' : lambda *a : 'journal_voucher', + 'date': lambda *a:time.strftime('%Y-%m-%d'), } def _check_centralisation(self, cursor, user, ids): @@ -1994,9 +1997,9 @@ class wizard_multi_charts_accounts(osv.osv_memory): #create the account_account dig = obj_multi.code_digits - code_main = len(account_template.code) - code_acc = account_template.code - if code_main<=dig and account_template.type != 'view': + code_main = account_template.code and len(account_template.code) or 0 + code_acc = account_template.code or '' + if code_main>0 and code_main<=dig and account_template.type != 'view': 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, diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index e2b06ce9b78..75dc00a0eeb 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -137,24 +137,26 @@ 2
- - - - + + + + + + + + - - - + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index d32e2c7b003..ffef364ae37 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -110,7 +110,11 @@ class account_move_line(osv.osv): account = journal_obj.default_credit_account_id else: account = journal_obj.default_debit_account_id - data['account_id'] = account.id + + + if account and ((not fields) or ('debit' in fields) or ('credit' in fields)): + data['account_id'] = account.id + s = -total_new data['debit'] = s>0 and s or 0.0 data['credit'] = s<0 and -s or 0.0 @@ -122,7 +126,6 @@ class account_move_line(osv.osv): return data period_obj = self.pool.get('account.period') - tax_obj=self.pool.get('account.tax') # Compute the current move move_id = False @@ -190,7 +193,13 @@ class account_move_line(osv.osv): else: account = move.journal_id.default_debit_account_id - data['account_id'] = account.id + if account and ((not fields) or ('debit' in fields) or ('credit' in fields)): + data['account_id'] = account.id + # Propose the price VAT excluded, the VAT will be added when confirming line + if account.tax_ids: + tax = account.tax_ids + for t in self.pool.get('account.tax').compute_inv(cr, uid, tax, total, 1): + total -= t['amount'] s = -total data['debit'] = s>0 and s or 0.0 @@ -301,6 +310,13 @@ class account_move_line(osv.osv): return [('id', '=', '0')] return [('id', 'in', [x[0] for x in res])] + def _get_move_lines(self, cr, uid, ids, context={}): + result = [] + for move in self.pool.get('account.move').browse(cr, uid, ids, context=context): + for line in move.line_id: + result.append(line.id) + return result + _columns = { 'name': fields.char('Name', size=64, required=True), 'quantity': fields.float('Quantity', digits=(16,2), help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very usefull for some reports."), @@ -324,7 +340,10 @@ class account_move_line(osv.osv): 'partner_id': fields.many2one('res.partner', 'Partner Ref.'), 'date_maturity': fields.date('Maturity date', help="This field is used for payable and receivable entries. You can put the limit date for the payment of this entry line."), - 'date': fields.date('Effective date', required=True), + 'date': fields.related('move_id','date', string='Effective date', type='date', required=True, + store={ + 'account.move': (_get_move_lines, ['date'], 20) + }), 'date_created': fields.date('Creation date'), 'analytic_lines': fields.one2many('account.analytic.line', 'move_id', 'Analytic lines'), 'centralisation': fields.selection([('normal','Normal'),('credit','Credit Centralisation'),('debit','Debit Centralisation')], 'Centralisation', size=6), @@ -339,7 +358,7 @@ class account_move_line(osv.osv): #TODO: remove this 'amount_taxed':fields.float("Taxed Amount",digits=(16,2)), 'parent_move_lines':fields.many2many('account.move.line', 'account_move_line_rel', 'child_id', 'parent_id', 'Parent'), - 'reconcile_implicit':fields.boolean('Implicit Reconciliaiton') + 'reconcile_implicit':fields.boolean('Implicit Reconciliation') } def _get_date(self, cr, uid, context): @@ -630,7 +649,7 @@ class account_move_line(osv.osv): return False def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False): - result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context) + result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context,toolbar=toolbar) if view_type=='tree' and 'journal_id' in context: title = self.view_header_get(cr, uid, view_id, view_type, context) journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id']) @@ -705,6 +724,11 @@ class account_move_line(osv.osv): if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals) or ('date' in vals): self._update_check(cr, uid, ids, context) + todo_date = None + if vals.get('date', False): + todo_date = vals['date'] + del vals['date'] + print 'Writing', vals, 'to move_line', ids result = super(account_move_line, self).write(cr, uid, ids, vals, context) if check: @@ -713,6 +737,8 @@ class account_move_line(osv.osv): if line.move_id.id not in done: done.append(line.move_id.id) self.pool.get('account.move').validate(cr, uid, [line.move_id.id], context) + if todo_date: + self.pool.get('account.move').write(cr, uid, [line.move_id.id], {'date': todo_date}, context=context) return result def _update_journal_check(self, cr, uid, journal_id, period_id, context={}): @@ -778,9 +804,9 @@ class account_move_line(osv.osv): if not vals.get('move_id', False): if journal.sequence_id: - name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) + #name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) v = { - 'name': name, + 'date': vals.get('date', time.strftime('%Y-%m-%d')), 'period_id': context['period_id'], 'journal_id': context['journal_id'] } @@ -788,6 +814,10 @@ class account_move_line(osv.osv): vals['move_id'] = move_id else: raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.')) + else: + if 'date' in vals: + self.pool.get('account.move').write(cr, uid, [move_id], {'date':vals['date']}, context=context) + del vals['date'] ok = not (journal.type_control_ids or journal.account_control_ids) if ('account_id' in vals): @@ -820,7 +850,7 @@ class account_move_line(osv.osv): if journal.analytic_journal_id: vals['analytic_lines'] = [(0,0, { 'name': vals['name'], - 'date': vals['date'], + 'date': vals.get('date', time.strftime('%Y-%m-%d')), 'account_id': vals['analytic_account_id'], 'unit_amount':'quantity' in vals and vals['quantity'] or 1.0, 'amount': vals['debit'] or vals['credit'], diff --git a/addons/account/account_unit_test.xml b/addons/account/account_unit_test.xml index 6da81e996d9..f321d311b21 100644 --- a/addons/account/account_unit_test.xml +++ b/addons/account/account_unit_test.xml @@ -1,6 +1,6 @@ - + @@ -40,10 +40,11 @@ + + diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 85a2d50f84b..319431615f7 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -468,8 +468,9 @@ tree - + + @@ -665,14 +666,13 @@ - + - - + + - - + @@ -724,10 +724,10 @@ - + @@ -800,13 +800,15 @@ tree - - + + + - + + @@ -822,18 +824,20 @@ - - - + + + + + +
- - + @@ -853,15 +857,16 @@ - - + + + @@ -1330,7 +1335,6 @@ - diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 96da3233651..7307a2fbd3b 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -187,23 +187,23 @@ class account_invoice(osv.osv): 'move_id': fields.many2one('account.move', 'Invoice Movement', readonly=True, help="Link to the automatically generated account moves."), 'amount_untaxed': fields.function(_amount_all, method=True, digits=(16,2),string='Untaxed', store={ - 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 10), - 'account.invoice.tax': (_get_invoice_tax, None, 10), - 'account.invoice.line': (_get_invoice_line, None, 10), + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 20), + 'account.invoice.tax': (_get_invoice_tax, None, 20), + 'account.invoice.line': (_get_invoice_line, None, 20), }, multi='all'), 'amount_tax': fields.function(_amount_all, method=True, digits=(16,2), string='Tax', store={ - 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 10), - 'account.invoice.tax': (_get_invoice_tax, None, 10), - 'account.invoice.line': (_get_invoice_line, None, 10), + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 20), + 'account.invoice.tax': (_get_invoice_tax, None, 20), + 'account.invoice.line': (_get_invoice_line, None, 20), }, multi='all'), 'amount_total': fields.function(_amount_all, method=True, digits=(16,2), string='Total', store={ - 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 10), - 'account.invoice.tax': (_get_invoice_tax, None, 10), - 'account.invoice.line': (_get_invoice_line, None, 10), + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 20), + 'account.invoice.tax': (_get_invoice_tax, None, 20), + 'account.invoice.line': (_get_invoice_line, None, 20), }, multi='all'), 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), @@ -217,8 +217,9 @@ class account_invoice(osv.osv): 'move_lines':fields.function(_get_lines , method=True,type='many2many' , relation='account.move.line',string='Move Lines'), 'residual': fields.function(_amount_residual, method=True, digits=(16,2),string='Residual', store={ - 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 12), - 'account.invoice.tax': (_get_invoice_tax, None, 12), + 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 50), + 'account.invoice.tax': (_get_invoice_tax, None, 50), + 'account.invoice.line': (_get_invoice_line, None, 50), }, help="Remaining amount due."), 'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'), @@ -601,15 +602,11 @@ class account_invoice(osv.osv): journal_id = inv.journal_id.id #self._get_journal(cr, uid, {'type': inv['type']}) journal = self.pool.get('account.journal').browse(cr, uid, journal_id) - if journal.sequence_id and not inv.move_name: - name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) - else: - name = inv.move_name if journal.centralisation: raise osv.except_osv(_('UserError'), _('Can not create invoice move on centralized journal')) - move = {'name': name, 'line_id': line, 'journal_id': journal_id} + move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date} period_id=inv.period_id and inv.period_id.id or False if not period_id: period_ids= self.pool.get('account.period').search(cr,uid,[('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))]) @@ -629,7 +626,6 @@ class account_invoice(osv.osv): def line_get_convert(self, cr, uid, x, part, date, context={}): return { - 'date':date, 'date_maturity': x.get('date_maturity', False), 'partner_id':part, 'name':x['name'][:64], @@ -662,6 +658,9 @@ class account_invoice(osv.osv): ref = self._convert_ref(cr, uid, number) cr.execute('UPDATE account_invoice SET number=%s ' \ 'WHERE id=%s', (number, id)) + cr.execute('UPDATE account_move SET ref=%s ' \ + 'WHERE id=%s AND (ref is null OR ref = \'\')', + (ref, move_id)) cr.execute('UPDATE account_move_line SET ref=%s ' \ 'WHERE move_id=%s AND (ref is null OR ref = \'\')', (ref, move_id)) @@ -813,16 +812,7 @@ class account_invoice(osv.osv): assert len(ids)==1, "Can only pay one invoice at a time" invoice = self.browse(cr, uid, ids[0]) src_account_id = invoice.account_id.id - journal = self.pool.get('account.journal').browse(cr, uid, pay_journal_id) - if journal.sequence_id: - name = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) - else: - raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.')) # Take the seq as name for move - if journal.sequence_id: - seq = self.pool.get('ir.sequence').get_id(cr, uid, journal.sequence_id.id) - else: - raise osv.except_osv('No piece number !', 'Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.') types = {'out_invoice': -1, 'in_invoice': 1, 'out_refund': 1, 'in_refund': -1} direction = types[invoice.type] #take the choosen date @@ -831,26 +821,22 @@ class account_invoice(osv.osv): else: date=time.strftime('%Y-%m-%d') l1 = { - 'name': name, 'debit': direction * pay_amount>0 and direction * pay_amount, 'credit': direction * pay_amount<0 and - direction * pay_amount, 'account_id': src_account_id, 'partner_id': invoice.partner_id.id, - 'date': date, 'ref':invoice.number, } l2 = { - 'name':name, 'debit': direction * pay_amount<0 and - direction * pay_amount, 'credit': direction * pay_amount>0 and direction * pay_amount, 'account_id': pay_account_id, 'partner_id': invoice.partner_id.id, - 'date': date, 'ref':invoice.number, } lines = [(0, 0, l1), (0, 0, l2)] - move = {'name': seq, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id} + move = {'ref': inv.number, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date} move_id = self.pool.get('account.move').create(cr, uid, move) line_ids = [] diff --git a/addons/account/wizard/wizard_account_chart.py b/addons/account/wizard/wizard_account_chart.py index a2edc2fec2f..60608ea7198 100644 --- a/addons/account/wizard/wizard_account_chart.py +++ b/addons/account/wizard/wizard_account_chart.py @@ -59,12 +59,7 @@ class wizard_account_chart(wizard.interface): result = mod_obj._get_id(cr, uid, 'account', 'action_account_tree') id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] - result = act_obj.read(cr, uid, [id])[0] - if 'lang' in context: - import tools - trans_name = tools.translate(cr, 'ir.actions.act_window,name', 'model', context['lang'], result['name']) - if trans_name: - result['name'] = trans_name + result = act_obj.read(cr, uid, [id], context=context)[0] result['context'] = str({'fiscalyear': data['form']['fiscalyear'],'target_move':data['form']['target_move']}) if data['form']['fiscalyear']: result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code'] diff --git a/addons/account_reporting/account_view.xml b/addons/account_reporting/account_view.xml index 8e12951ee84..1eb4daf6dc9 100644 --- a/addons/account_reporting/account_view.xml +++ b/addons/account_reporting/account_view.xml @@ -2,62 +2,62 @@ - - account.report.bs.form - account.report.bs - form - -
- - - - - - - - - - - - - - - - - -
-
-
+ + account.report.bs.form + account.report.bs + form + +
+ + + + + + + + + + + + + + + + + +
+
+
- - account.report.report.tree.bs - account.report.bs - tree - child_id - - - - - - - - - ir.actions.act_window - account.report.bs - [('parent_id','=',False)] - tree - - - - + + account.report.report.tree.bs + account.report.bs + tree + child_id + + + + + + + + + ir.actions.act_window + account.report.bs + [('parent_id','=',False)] + tree + + + + - - ir.actions.act_window - account.report.bs - form - - - + + ir.actions.act_window + account.report.bs + form + + + diff --git a/addons/account_tax_include/invoice_tax_incl.py b/addons/account_tax_include/invoice_tax_incl.py index 68b4a944966..36abef3fe5e 100644 --- a/addons/account_tax_include/invoice_tax_incl.py +++ b/addons/account_tax_include/invoice_tax_incl.py @@ -107,9 +107,9 @@ class account_invoice_line(osv.osv): return result.keys() _columns = { 'price_subtotal': fields.function(_amount_line2, method=True, string='Subtotal w/o tax', multi='amount', - store={'account.invoice':(_get_invoice,['price_type']), 'account.invoice.line': (lambda self,cr,uid,ids,c={}: ids, None)}), + store={'account.invoice':(_get_invoice,['price_type'],10), 'account.invoice.line': (lambda self,cr,uid,ids,c={}: ids, None,10)}), 'price_subtotal_incl': fields.function(_amount_line2, method=True, string='Subtotal', multi='amount', - store={'account.invoice':(_get_invoice,['price_type']), 'account.invoice.line': (lambda self,cr,uid,ids,c={}: ids, None)}), + store={'account.invoice':(_get_invoice,['price_type'],10), 'account.invoice.line': (lambda self,cr,uid,ids,c={}: ids, None,10)}), } _defaults = { diff --git a/addons/auction/barcode/test.py b/addons/auction/barcode/test.py index 5bbd508184d..d22df49b08d 100644 --- a/addons/auction/barcode/test.py +++ b/addons/auction/barcode/test.py @@ -1,4 +1,4 @@ -#!/usr/pkg/bin/python +#!/usr/bin/python from common import * from code39 import * from code93 import * @@ -52,4 +52,4 @@ def run(): if __name__=='__main__': run() - \ No newline at end of file + diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index d24b9bde649..289b0b48dc7 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -59,10 +59,10 @@ class res_partner_contact(osv.osv): res = [] for r in self.read(cr, user, ids, ['name','first_name','title']): addr = r['title'] and str(r['title'])+" " or '' - addr +=str(r['name'] or '') + addr += r.get('name', '') if r['name'] and r['first_name']: addr += ' ' - addr += str(r['first_name'] or '') + addr += (r.get('first_name', '') or '') res.append((r['id'], addr)) return res res_partner_contact() @@ -79,7 +79,7 @@ class res_partner_address(osv.osv): res.append((r['id'], r['partner_id'][1])) else: addr = str('') - addr += str(r['street'] or '') + ' ' + str(r['zip'] or '') + ' ' + str(r['city'] or '') + addr += "%s %s %s" % ( r.get('street', ''), r.get('zip', ''), r.get('city', '') ) res.append((r['id'], addr.strip() or '/')) return res diff --git a/addons/base_contact/base_contact_view.xml b/addons/base_contact/base_contact_view.xml index 4ee308221ff..3abb67c98c5 100644 --- a/addons/base_contact/base_contact_view.xml +++ b/addons/base_contact/base_contact_view.xml @@ -45,7 +45,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -277,7 +277,7 @@ - + @@ -314,7 +314,7 @@ - + diff --git a/addons/base_module_record/base_module_record_wizard.xml b/addons/base_module_record/base_module_record_wizard.xml index 11113e12f5a..abced76678a 100644 --- a/addons/base_module_record/base_module_record_wizard.xml +++ b/addons/base_module_record/base_module_record_wizard.xml @@ -1,58 +1,63 @@ - - + + - - + + - + + + - + - + - - + + - + diff --git a/addons/crm/__terp__.py b/addons/crm/__terp__.py index 7bf93a5c550..b3d8e255876 100644 --- a/addons/crm/__terp__.py +++ b/addons/crm/__terp__.py @@ -30,7 +30,7 @@ people to intelligently and efficiently manage tasks, issues, and requests. It manages key tasks such as communication, identification, prioritization, assignment, resolution and notification. -Open ERP ensures that all cases are successfly tracked by users, customers and +Open ERP ensures that all cases are successfully tracked by users, customers and suppliers. It can automatically send reminders, escalate the request, trigger specific methods and lots of others actions based on your enterprise own rules. diff --git a/addons/crm_profiling/crm_profiling.py b/addons/crm_profiling/crm_profiling.py index 65f11e8bfba..c5a8b118b0f 100644 --- a/addons/crm_profiling/crm_profiling.py +++ b/addons/crm_profiling/crm_profiling.py @@ -131,22 +131,23 @@ class questionnaire(osv.osv): query = """ select name, id from crm_profiling_question - where id in ( select question from profile_questionnaire_quest_rel where questionnaire = %s)"""% data['form']['questionnaire_name'] - cr.execute(query) + where id in ( select question from profile_questionnaire_quest_rel where questionnaire = %s)""" + res = cr.execute(query, data['form']['questionnaire_name']) + result = cr.fetchall() quest_fields={} quest_form='''
''' % _('Questionnaire') - for x in cr.fetchall(): + for x in result: quest_form = quest_form + '''''' quest_fields['quest_form'+str(x[1])] = {'string': str(x[0]), 'type': 'many2one', 'relation': 'crm_profiling.answer', 'domain': [('question_id','=',x[1])] } quest_form = quest_form + '''''' return quest_form,quest_fields - _columns={ + _columns = { 'name': fields.char("Questionnaire",size=128, required=True), 'description':fields.text("Description", required=True), 'questions_ids': fields.many2many('crm_profiling.question','profile_questionnaire_quest_rel','questionnaire', 'question', "Questions"), - } + } questionnaire() diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index 320560dd0a8..db555876467 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -21,7 +21,7 @@ ############################################################################## import time import netsvc -from osv import fields,osv,orm +from osv import fields,osv from tools.translate import _ class delivery_carrier(osv.osv): @@ -38,7 +38,10 @@ class delivery_carrier(osv.osv): if order_id: order = sale_obj.browse(cr, uid, [order_id])[0] carrier_grid=self.grid_get(cr,uid,[carrier.id],order.partner_shipping_id.id,context) - price=grid_obj.get_price(cr, uid, carrier_grid, order, time.strftime('%Y-%m-%d'), context) + if carrier_grid: + price=grid_obj.get_price(cr, uid, carrier_grid, order, time.strftime('%Y-%m-%d'), context) + else: + price = 0.0 res[carrier.id]=price return res _columns = { @@ -124,7 +127,7 @@ class delivery_grid(osv.osv): ok = True break if not ok: - raise except_osv(_('No price avaible !'), _('No line matched this order in the choosed delivery grids !')) + raise osv.except_osv(_('No price available !'), _('No line matched this order in the choosed delivery grids !')) return price diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index a0bdd2ef4c2..ad8a28e80b8 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -96,7 +96,7 @@ - + @@ -113,7 +113,7 @@ - +
diff --git a/addons/document/ftpserver/abstracted_fs.py b/addons/document/ftpserver/abstracted_fs.py index 9cc0f2d5868..c0f0bdf3407 100644 --- a/addons/document/ftpserver/abstracted_fs.py +++ b/addons/document/ftpserver/abstracted_fs.py @@ -70,6 +70,7 @@ class abstracted_fs: # Ok def db_list(self): + return pooler.pool_dic.keys() s = netsvc.LocalService('db') result = s.list() self.db_name_list = [] @@ -89,8 +90,9 @@ class abstracted_fs: finally: if cr is not None: cr.close() - if db is not None: - pooler.close_db(db_name) + #if db is not None: + # pooler.close_db(db_name) + print 'Return', self.db_name_list return self.db_name_list # Ok diff --git a/addons/hr_attendance/__terp__.py b/addons/hr_attendance/__terp__.py index 10abc85aa66..3ffc44ac9a7 100644 --- a/addons/hr_attendance/__terp__.py +++ b/addons/hr_attendance/__terp__.py @@ -21,7 +21,7 @@ ############################################################################## { "name" : "Attendances Of Employees", - "version" : "1.0", + "version" : "1.1", "author" : "Tiny", "category" : "Generic Modules/Human Resources", "description": "This module aims to manage employee's attendances.", diff --git a/addons/hr_attendance/hr_attendance_demo.xml b/addons/hr_attendance/hr_attendance_demo.xml index 640d6b5257a..93908662470 100644 --- a/addons/hr_attendance/hr_attendance_demo.xml +++ b/addons/hr_attendance/hr_attendance_demo.xml @@ -1,10 +1,8 @@ - - - + - + sign_in diff --git a/addons/hr_expense/report/expense.rml b/addons/hr_expense/report/expense.rml index 82321f43dec..7c1ecd03635 100644 --- a/addons/hr_expense/report/expense.rml +++ b/addons/hr_expense/report/expense.rml @@ -198,7 +198,7 @@ [[ '%.2f' % line.unit_amount or '' ]] - [[ company.currency_id.name ]] + [[ o.currency_id.name ]] [[ '%.2f' % line.unit_quantity or '' ]] @@ -207,7 +207,7 @@ [[ '%.2f' % line.total_amount or '' ]] - [[ company.currency_id.name ]] + [[ o.currency_id.name ]] @@ -276,7 +276,7 @@ [[ '%.2f' % o.amount ]] - [[ company.currency_id.name ]] + [[ o.currency_id.name ]] @@ -297,4 +297,4 @@ This document must be dated and signed for reimbursment - \ No newline at end of file + diff --git a/addons/l10n_chart_uk_minimal/__terp__.py b/addons/l10n_chart_uk_minimal/__terp__.py index fc998f167cf..94da21b59ac 100644 --- a/addons/l10n_chart_uk_minimal/__terp__.py +++ b/addons/l10n_chart_uk_minimal/__terp__.py @@ -66,8 +66,8 @@ "depends" : ["base", "account", "base_iban", "base_vat", "account_chart"], "init_xml" : [], "demo_xml" : [], - "update_xml" : ["account_chart.xml", - "account_tax.xml"], + "update_xml" : ["account_types.xml","account_chart.xml", + "account_tax.xml","l10n_uk_wizard.xml"], "installable": True } diff --git a/addons/l10n_chart_uk_minimal/account_chart.xml b/addons/l10n_chart_uk_minimal/account_chart.xml index 683252462f3..507c836c7e2 100755 --- a/addons/l10n_chart_uk_minimal/account_chart.xml +++ b/addons/l10n_chart_uk_minimal/account_chart.xml @@ -1,345 +1,186 @@ - - - - - - - - - - + + 0 - Account Chart UK - - view - - + - - - - - - + Balance Sheet - - view - - + - - - - + Fixed Assets - - view - - + - - - - + Fixed Asset Account - - - asset - - + other + - - - - + Net Current Assets - - view - - + - - - - + Current Assets - - view - - + - - - - + - Purchased Stocks - - - asset - - + other + - - - - + - Debtors - - receivable - - - + - - + - - - - - - + Output VAT - - - tax - - + other + - - - - + Bank Current Account - - - cash - - + other + - - - - + - Cash - - - cash - - + other + - - - - + Current Liabilities - - view - - + - - - - + - Creditors - - payable - - - + - - + - - - - - - + Input VAT - - - tax - - + other + - - - - - - + Profit and Loss - - view - - + - - - - + Revenue - - view - - + - - - - + - Product Sales - - - income - - + other + - - + - - - - - - + Cost of Sales - - view - - + - - - - + - Cost of Goods Sold - - - expense - - + other + - - - - + Overheads - - view - - + - - - - + - Expenses - - - expense - - + other + - - - + + + - - - diff --git a/addons/l10n_chart_uk_minimal/account_tax.xml b/addons/l10n_chart_uk_minimal/account_tax.xml index c1b254865c7..51d5c3f349f 100755 --- a/addons/l10n_chart_uk_minimal/account_tax.xml +++ b/addons/l10n_chart_uk_minimal/account_tax.xml @@ -1,444 +1,249 @@ - - - - - - - - - - - - - VAT balance to pay - + + Plan Fees UK + + VAT Balance to Pay + + - - - + Input VAT - - - - - - - Input VAT rate S (17.5%) - + + Input VAT Rate S (15%) - - - - - - Input VAT rate R (5%) - + + Input VAT Rate R (5%) - - - - - - - + Output VAT - - - - - - - Output VAT rate S (17.5%) - + + Output VAT Rate S (15%) - - - - - - Output VAT rate R (5%) - + + Output VAT Rate R (5%) - - - - - - - - - - Tax bases - + + Tax Bases + - - - - - Taxable purchases base - + + Taxable Purchases Base - - - - - - Taxable purchases rated S (17.5%) - + + Taxable Purchases Rated S (15%) - - - - - - Taxable purchases rated R (5%) - + + Taxable Purchases Rated R (5%) - - - - - - Taxable purchases rated Z (0%) - + + Taxable Purchases Rated Z (0%) - - - - - - Taxable purchases type X (Exempt) - + + Taxable Purchases Type X (Exempt) - - - - - - Taxable purchases type O (Out of scope) - + + Taxable Purchases Type O (Out of scope) - - - - - - - - Base of taxable sales - + + Base of Taxable Sales - - - - - - Taxable sales rated S (17.5%) - + + Taxable Sales Rated S (15%) - - - - - - Taxable sales rated R (5%) - + + Taxable Sales Rated R (5%) - - - - - - Taxable sales rated Z (0%) - + + Taxable Sales Rated Z (0%) - - - - - - Taxable sales type X (Exempt) - + + Taxable Sales Type X (Exempt) - - - - - - Taxable sales type O (Out of scope) - + + Taxable Sales Type O (Out of scope) - + - - + + UK Minimal Account Chart Template + + + + + + + + - - - - - - - + + IVAT S - - - + percent - - - - - + + - - - - - - - - + + IVAT R - - percent - - - - - + + - - - - - - - - + + IVAT Z - - percent - - - - - - - + + IVAT X - - percent - - - - - - - + + IVAT O - - percent - - - - - - + - - - - + + OVAT S - - - + percent - - - - - + + - - - - - - - - + + OVAT R - - percent - - - - - + + - - - - - - - - + + OVAT Z - - percent - - - - - - - + + OVAT X - - percent - - - - - - - + + OVAT O - - percent - - - - - - - - - + \ No newline at end of file diff --git a/addons/l10n_chart_uk_minimal/account_types.xml b/addons/l10n_chart_uk_minimal/account_types.xml new file mode 100644 index 00000000000..51040cadbbd --- /dev/null +++ b/addons/l10n_chart_uk_minimal/account_types.xml @@ -0,0 +1,60 @@ + + + + + + Receivable + receivable + unreconciled + + + + Payable + payable + unreconciled + + + + View + view + none + + + + Income + income + none + + + + Expense + expense + none + + + + Tax + tax + unreconciled + + + + Cash + cash + balance + + + + Asset + asset + balance + + + + Equity + equity + balance + + + + diff --git a/addons/l10n_chart_uk_minimal/l10n_uk_wizard.xml b/addons/l10n_chart_uk_minimal/l10n_uk_wizard.xml new file mode 100644 index 00000000000..2ba2fa7478a --- /dev/null +++ b/addons/l10n_chart_uk_minimal/l10n_uk_wizard.xml @@ -0,0 +1,14 @@ + + + + + + Generate Chart of Accounts from a Chart Template + Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated. + This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. + + open + + + + \ No newline at end of file diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 288d17f4244..331af2aeb99 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -634,7 +634,7 @@ class mrp_production(osv.osv): } res_final_id = self.pool.get('stock.move').create(cr, uid, data) - self.write(cr, uid, [production.id], {'move_created_ids': [(6, 'WTF', [res_final_id])]}) + self.write(cr, uid, [production.id], {'move_created_ids': [(6, 0, [res_final_id])]}) moves = [] for line in production.product_lines: move_id=False @@ -776,7 +776,15 @@ class mrp_procurement(osv.osv): 'property_ids': fields.many2many('mrp.property', 'mrp_procurement_property_rel', 'procurement_id','property_id', 'Properties'), 'message': fields.char('Latest error', size=64), - 'state': fields.selection([('draft','Draft'),('confirmed','Confirmed'),('exception','Exception'),('running','Running'),('cancel','Cancel'),('done','Done'),('waiting','Waiting')], 'Status') + 'state': fields.selection([ + ('draft','Draft'), + ('confirmed','Confirmed'), + ('exception','Exception'), + ('running','Running'), + ('cancel','Cancel'), + ('ready','Ready'), + ('done','Done'), + ('waiting','Waiting')], 'Status') } _defaults = { 'state': lambda *a: 'draft', @@ -1072,7 +1080,7 @@ class mrp_procurement(osv.osv): return True def action_check_finnished(self, cr, uid, ids): - return True + return self.check_move_done(cr, uid, ids) def action_check(self, cr, uid, ids): ok = False @@ -1082,17 +1090,21 @@ class mrp_procurement(osv.osv): ok = True return ok + def action_ready(self, cr, uid, ids): + res = self.write(cr, uid, ids, {'state':'ready'}) + return res + def action_done(self, cr, uid, ids): for procurement in self.browse(cr, uid, ids): if procurement.move_id: if procurement.close_move and (procurement.move_id.state <> 'done'): self.pool.get('stock.move').action_done(cr, uid, [procurement.move_id.id]) res = self.write(cr, uid, ids, {'state':'done', 'date_close':time.strftime('%Y-%m-%d')}) - wf_service = netsvc.LocalService("workflow") for id in ids: wf_service.trg_trigger(uid, 'mrp.procurement', id, cr) return res + def run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, context=None): ''' use_new_cursor: False or the dbname diff --git a/addons/mrp/mrp_order_point.xml b/addons/mrp/mrp_order_point.xml index aa6909e2601..ba2e56e8515 100644 --- a/addons/mrp/mrp_order_point.xml +++ b/addons/mrp/mrp_order_point.xml @@ -10,7 +10,7 @@ - + 50.0 @@ -18,7 +18,7 @@ - + 20.0 @@ -26,7 +26,7 @@ - + 50.0 @@ -34,7 +34,7 @@ - + 5.0 @@ -42,7 +42,7 @@ - + 50.0 @@ -50,7 +50,7 @@ - +
diff --git a/addons/mrp/mrp_workflow.xml b/addons/mrp/mrp_workflow.xml index 74fe78b64c0..69c7840ceaf 100644 --- a/addons/mrp/mrp_workflow.xml +++ b/addons/mrp/mrp_workflow.xml @@ -185,7 +185,9 @@ - done + ready + function + action_ready() @@ -301,14 +303,9 @@ - check_move_done() - stock.move - [move_id.id] - - - - - check_move_cancel() + True + + @@ -348,8 +345,8 @@ - - not action_check_finnished() + + check_move_cancel() diff --git a/addons/process/process_view.xml b/addons/process/process_view.xml index 3f294ef0302..8083ba278d4 100644 --- a/addons/process/process_view.xml +++ b/addons/process/process_view.xml @@ -4,7 +4,7 @@ diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index a8509f1c06f..2ca74463dfd 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -36,14 +36,11 @@ class price_type(osv.osv): sale and purchase prices based on some fields of the product. """ def _price_field_get(self, cr, uid, context={}): - import tools - cr.execute('select name, field_description, model from ir_model_fields where model in (%s,%s) and ttype=%s order by name', ('product.product', 'product.template', 'float')) + mf = self.pool.get('ir.model.fields') + ids = mf.search(cr, uid, [('model','in', (('product.product'),('product.template'))), ('ttype','=','float')], context=context) res = [] - for field in cr.dictfetchall(): - desc = tools.translate(cr, field['model'] + ',' + field['name'], 'field', context.get('lang', False) or 'en_US') - if not desc: - desc = field['field_description'] - res.append((field['name'], desc)) + for field in mf.browse(cr, uid, ids, context=context): + res.append((field.name, field.field_description)) return res def _get_currency(self, cr, uid, ctx): @@ -304,14 +301,11 @@ product_pricelist_version() class product_pricelist_item(osv.osv): def _price_field_get(self, cr, uid, context={}): - cr.execute('select id,name from product_price_type where active') - import tools + pt = self.pool.get('product.price.type') + ids = pt.search(cr, uid, [], context=context) result = [] - for line in cr.fetchall(): - transl_name = tools.translate(cr, 'product.price.type,name', 'model', ('lang' in context) and context['lang'] or 'en_US', line[1]) - if not transl_name: - transl_name = line[1] - result.append((line[0], transl_name)) + for line in pt.browse(cr, uid, ids, context=context): + result.append((line.id, line.name)) result.append((-1, _('Other Pricelist'))) result.append((-2, _('Partner section of the product form'))) diff --git a/addons/product/product.py b/addons/product/product.py index e830ea91cee..74d9549a78c 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -160,7 +160,7 @@ class product_ul(osv.osv): _name = "product.ul" _description = "Shipping Unit" _columns = { - 'name' : fields.char('Name', size=64,select=True), + 'name' : fields.char('Name', size=64,select=True, required=True), 'type' : fields.selection([('unit','Unit'),('pack','Pack'),('box', 'Box'), ('palet', 'Palet')], 'Type', required=True), } product_ul() @@ -337,7 +337,10 @@ class product_product(osv.osv): pricelist = context.get('pricelist', False) if pricelist: for id in ids: - price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, context=context)[pricelist] + try: + price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, context=context)[pricelist] + except: + price = 0.0 res[id] = price for id in ids: res.setdefault(id, 0.0) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 0159e019572..17813b80bdf 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -249,8 +249,8 @@ on_change="onchange_planned(planned_hours,effective_hours)"/> - -