~vauxoo/addons-vauxoo/8.0-import_tax_tariff-dev-yani-rev-2

« back to all changes in this revision

Viewing changes to account_anglo_saxon_stock_move/model/stock.py

  • Committer: Humberto Arocha
  • Date: 2014-08-17 05:26:48 UTC
  • mto: (543.318.36 addons-vauxoo-cicsa)
  • mto: This revision was merged to the branch mainline in revision 873.
  • Revision ID: hbto@vauxoo.com-20140817052648-68sugz088vyhashf
[ADD] Added module allows to creates a reference from stock_move into invoice lines

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- encoding: utf-8 -*-
 
3
###############################################################################
 
4
#    Module Writen to OpenERP, Open Source Management Solution
 
5
#    Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
 
6
#    All Rights Reserved
 
7
############# Credits #########################################################
 
8
#    Coded by: Humberto Arocha <hbto@vauxoo.com>
 
9
#    Planified by: Humberto Arocha <hbto@vauxoo.com>
 
10
#    Audited by: Humberto Arocha <hbto@vauxoo.com>
 
11
###############################################################################
 
12
#    This program is free software: you can redistribute it and/or modify
 
13
#    it under the terms of the GNU Affero General Public License as published
 
14
#    by the Free Software Foundation, either version 3 of the License, or
 
15
#    (at your option) any later version.
 
16
#
 
17
#    This program is distributed in the hope that it will be useful,
 
18
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
#    GNU Affero General Public License for more details.
 
21
#
 
22
#    You should have received a copy of the GNU Affero General Public License
 
23
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
24
###############################################################################
 
25
 
 
26
from openerp.osv import osv
 
27
 
 
28
class stock_picking(osv.osv):
 
29
    _inherit = "stock.picking"
 
30
    _description = "Picking List"
 
31
 
 
32
    def _prepare_invoice_line(self, cr, uid, group, picking, move_line, invoice_id,
 
33
        invoice_vals, context=None):
 
34
        """Overwrite to add move_id reference"""
 
35
        res = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id, invoice_vals, context=context)
 
36
        res.update({
 
37
            'move_id': move_line.id,
 
38
        })
 
39
        return res