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

« back to all changes in this revision

Viewing changes to m321_customization/invoice.py

  • Committer: Nhomar Hernandez
  • Date: 2013-04-19 20:33:12 UTC
  • mfrom: (542.1.314 addons-vauxoo)
  • Revision ID: nhomar@gmail.com-20130419203312-o35v7dn79l6vur0t
[MERGE - PEP8 AND V7-MIG] All migrated to V7 Just
improved osv.osv => osv.Model, osv.osv_memory => osv.TransientModel
import inside openerp.* enviroment
Erased class instansiation no necesarry anymore in V7
AUTOPEP8 run, Left PEP8 long lines manually.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
# along with this program; if not, write to the Free Software
26
26
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27
27
###############################################################################
28
 
from osv import osv
29
 
from osv import fields
30
 
from tools.translate import _
 
28
from openerp.osv import fields, osv
 
29
from openerp.tools.translate import _
 
30
 
31
31
import decimal_precision as dp
32
32
 
33
 
class inherited_invoice(osv.osv):
 
33
 
 
34
class inherited_invoice(osv.Model):
34
35
    """
35
36
    M321 Customizations for account.invoice model
36
37
    """
37
38
    _inherit = "account.invoice"
38
39
    _columns = {
39
 
            'profit_code': fields.integer("Code from profit", help="Invoice code from profit"),
40
 
        }
41
 
 
42
 
inherited_invoice()
43
 
 
44
 
class inherited_invoice_line(osv.osv):
 
40
        'profit_code': fields.integer("Code from profit", help="Invoice code from profit"),
 
41
    }
 
42
 
 
43
 
 
44
 
 
45
class inherited_invoice_line(osv.Model):
45
46
    _inherit = "account.invoice.line"
46
47
    _columns = {
47
 
        'net_discount': fields.float('Net Discount', required=False, \
48
 
        digits_compute= dp.get_precision('Account'), \
 
48
        'net_discount': fields.float('Net Discount', required=False,
 
49
        digits_compute=dp.get_precision('Account'),
49
50
        help="""Loaded from data imported from Profit is equal to sale price minus real sold price"""),
50
51
        'discount_code_profit': fields.char('Discount code from profit', size=7)
51
52
    }
52
53
 
53
54
    _defaults = {
54
 
        'net_discount' : 0.0
 
55
        'net_discount': 0.0
55
56
    }
56
57
 
57
 
inherited_invoice_line()
58