[IMP] sale_analytic_plans: clean code
bzr revid: mra@mra-laptop-20100809073859-iei4gtbj9dsny2ky
This commit is contained in:
parent
5fd17de915
commit
da1b9356ba
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -24,5 +24,6 @@
|
|||
#----------------------------------------------------------
|
||||
|
||||
import sale_analytic_plans
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Sales Analytic Distribution Management',
|
||||
'version': '1.0',
|
||||
|
@ -37,4 +36,4 @@
|
|||
'active': False,
|
||||
'certificate': '0066055860861',
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -18,22 +18,23 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
|
||||
from osv import fields, osv
|
||||
|
||||
class sale_order_line(osv.osv):
|
||||
_inherit = 'sale.order.line'
|
||||
_columns = {
|
||||
'analytics_id':fields.many2one('account.analytic.plan.instance','Analytic Distribution'),
|
||||
'analytics_id': fields.many2one('account.analytic.plan.instance', 'Analytic Distribution'),
|
||||
}
|
||||
def invoice_line_create(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
line_obj = self.pool.get('account.invoice.line')
|
||||
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context=context)
|
||||
i = 0
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
line_obj.write(cr, uid, [create_ids[i]], {'analytics_id':line.analytics_id.id})
|
||||
i = i+1
|
||||
line_obj.write(cr, uid, [create_ids[i]], {'analytics_id': line.analytics_id.id})
|
||||
i = i + 1
|
||||
return create_ids
|
||||
|
||||
sale_order_line()
|
||||
|
|
Loading…
Reference in New Issue