~camptocamp/c2c-rd-addons/8.0a

« back to all changes in this revision

Viewing changes to chricar_account_analytic/account_analytic.py

  • Committer: openerp@bazaar.camptocamp.net
  • Date: 2011-12-01 13:17:51 UTC
  • mfrom: (167.1.7 c2c-rd-addons)
  • Revision ID: openerp@bazaar.camptocamp.net-20111201131751-rkq2c0250qvazq3x
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
class account_move_line(osv.osv):
226
226
    _inherit = "account.move.line"
227
227
    
228
 
 
 
228
    _columns = {
 
229
       'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True)
 
230
    }
229
231
    def onchange_account(self, cr, uid, ids, account_id,tax_id, amount, partner_id):
230
232
 
231
233
        result = super(account_move_line,self).onchange_account_id( cr, uid, ids, account_id, partner_id)
343
345
class account_invoice_line(osv.osv):
344
346
    _inherit = "account.invoice.line"
345
347
 
 
348
    _columns = {
 
349
       'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True)
 
350
    }
346
351
    # we need this to fill default analytic for imported invoice lines
347
352
    def write(self, cr, uid, ids, vals, context=None):
348
353
        if not vals.get('account_analytic_id',False) and  vals.get('account_id',False):