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

« back to all changes in this revision

Viewing changes to invoice_report_multicompany/order.py

  • Committer: nhomar at vauxoo
  • Date: 2011-09-14 00:54:21 UTC
  • Revision ID: nhomar@vauxoo.com-20110914005421-hgla9f4xtyqirfgz
[ADD] Multicompany Invoice Report

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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):
 
7
    """
 
8
    OpenERP Model : sale_order_line
 
9
    """
 
10
    _inherit = 'sale.order.line'
 
11
    _columns = {
 
12
        'att_bro':fields.boolean('Attach Brochure', required=False, help="If you ccheck this option, the first attachment related to the product_id marked as brochure will be printed as extra info with sale order"),
 
13
    }
 
14
sale_order_line()
 
15
 
 
16
class sale_order(osv.osv):
 
17
    """
 
18
    OpenERP Model : sale_order_line
 
19
    """
 
20
    _inherit = 'sale.order'
 
21
    def print_with_attachment(self, cr, user, ids, context={}):
 
22
        for o in self.browse(cr,user,ids,context):
 
23
            for ol in o.order_line:
 
24
                if ol.att_bro:
 
25
                    print "Im Here i will go to print %s " % ol.name
 
26
        return True
 
27
sale_order()