~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to analytic_distribution_purchase/analytic_distribution.py

  • Committer: Quentin THEURET
  • Date: 2011-12-12 08:02:59 UTC
  • mto: This revision was merged to the branch mainline in revision 724.
  • Revision ID: qt@tempo-consulting.fr-20111212080259-oul1f0g37hcpubyc
UF-641 [ADD] Added the empty purchase_followup module

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
    _columns = {
32
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"),
36
 
        'partner_type': fields.text(string='Partner Type of FO/PO', required=False, readonly=True),#UF-2138: added the ref to partner type of FO/PO
 
33
        'purchase_line_ids': fields.one2many('purchase.order.line', 'analytic_distribution_id', string="Purchase lines"),
37
34
    }
38
35
 
39
 
    def copy(self, cr, uid, d_id, default=None, context=None):
40
 
        """
41
 
        Delete one2many fields
42
 
        """
43
 
        # Some verifications
44
 
        if not context:
45
 
            context = {}
46
 
        if not default:
47
 
            default = {}
48
 
        # Delete purchase_ids and purchase_line_ids links
49
 
        default.update({
50
 
            'purchase_ids': False,
51
 
            'purchase_line_ids': False,
52
 
            'sale_order_ids': False,
53
 
            'sale_order_line_ids': False,
54
 
        })
55
 
        return super(analytic_distribution, self).copy(cr, uid, d_id, default, context)
56
 
 
57
36
analytic_distribution()
58
37
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 
38
 
 
39
 
 
40
 
 
41