2
#-*- encoding:utf-8 -*-
3
##############################################################################
5
# OpenERP, Open Source Management Solution
6
# Copyright (C) 2011 TeMPO Consulting, MSF. All Rights Reserved
7
# Developer: Olivier DOSSMANN
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU Affero General Public License as
11
# published by the Free Software Foundation, either version 3 of the
12
# License, or (at your option) any later version.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU Affero General Public License for more details.
19
# You should have received a copy of the GNU Affero General Public License
20
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
##############################################################################
25
from osv import fields
27
class analytic_distribution(osv.osv):
28
_name = 'analytic.distribution'
29
_inherit = 'analytic.distribution'
32
'purchase_ids': fields.one2many('purchase.order', 'analytic_distribution_id', string="Purchases"),
33
'purchase_line_ids': fields.one2many('purchase.order.line', 'analytic_distribution_id', string="Purchase Lines"),
34
'sale_order_ids': fields.one2many('sale.order', 'analytic_distribution_id', string="Sales"),
35
'sale_order_line_ids': fields.one2many('sale.order.line', 'analytic_distribution_id', string="Sale Order Lines"),
38
def copy(self, cr, uid, id, default=None, context=None):
40
Delete one2many fields
47
# Delete purchase_ids and purchase_line_ids links
49
'purchase_ids': False,
50
'purchase_line_ids': False,
51
'sale_order_ids': False,
52
'sale_order_line_ids': False,
54
return super(analytic_distribution, self).copy(cr, uid, id, default, context)
56
analytic_distribution()
57
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: