~camptocamp/stock-logistic-flows/7.0-stock_picking_priority-selection-extendable

« back to all changes in this revision

Viewing changes to stock_picking_invoice_link/stock.py

[IMP] stock_picking_invoice_link: one2many from invoice to pickings and display this one2many in the invoice view (in a dedicated tab).
[IMP] stock_picking_invoice_link: Minor coding style improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
##############################################################################
20
20
 
21
21
from openerp.osv import fields, orm
22
 
from openerp.tools.translate import _
23
22
 
24
23
 
25
24
class stock_move(orm.Model):
68
67
        'invoice_id': fields.many2one(
69
68
            'account.invoice', 'Invoice', readonly=True),
70
69
    }
 
70
 
 
71
 
 
72
class account_invoice(orm.Model):
 
73
    _inherit = "account.invoice"
 
74
 
 
75
    _columns = {
 
76
        'picking_ids': fields.one2many(
 
77
            'stock.picking', 'invoice_id', 'Related Pickings', readonly=True,
 
78
            help="Related pickings (only when the invoice has been generated from the picking)."),
 
79
    }
 
80
 
 
81
 
 
82
class account_invoice_line(orm.Model):
 
83
    _inherit = "account.invoice.line"
 
84
 
 
85
    _columns = {
 
86
        'move_line_ids': fields.one2many(
 
87
            'stock.move', 'invoice_line_id', 'Related Stock Moves',
 
88
            readonly=True,
 
89
            help="Related stock moves (only when the invoice has been generated from the picking)."),
 
90
        }