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

« back to all changes in this revision

Viewing changes to sale_multi_report/order.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:
1
1
# -*- encoding: utf-8 -*-
2
 
from osv import osv
3
 
from osv import fields
4
 
from tools.translate import _
5
 
 
6
 
class sale_order_line(osv.osv):
 
2
from openerp.osv import fields, osv
 
3
from openerp.tools.translate import _
 
4
 
 
5
 
 
6
 
 
7
class sale_order_line(osv.Model):
7
8
    """
8
9
    OpenERP Model : sale_order_line
9
10
    """
10
11
    _inherit = 'sale.order.line'
11
12
    _columns = {
12
 
        'att_bro':fields.boolean('Attach Brochure', required=False, help="If you check this option, the first attachment related to the product_id marked as brochure will be printed as extra info with sale order"),
 
13
        'att_bro': fields.boolean('Attach Brochure', required=False, help="If you check this option, the first attachment related to the product_id marked as brochure will be printed as extra info with sale order"),
13
14
    }
14
 
sale_order_line()
15
 
 
16
 
class sale_order(osv.osv):
 
15
 
 
16
 
 
17
class sale_order(osv.Model):
17
18
    """
18
19
    OpenERP Model : sale_order_line
19
20
    """
20
21
    _inherit = 'sale.order'
 
22
 
21
23
    def print_with_attachment(self, cr, user, ids, context={}):
22
 
        for o in self.browse(cr,user,ids,context):
 
24
        for o in self.browse(cr, user, ids, context):
23
25
            for ol in o.order_line:
24
26
                if ol.att_bro:
25
27
                    print "Im Here i will go to print %s " % ol.name
26
28
        return True
27
 
sale_order()