35
36
class wiz_productCatalog(wizard.interface):
36
37
def _get_language(self, cr, uid, context):
37
lang_obj = pooler.get_pool(cr.dbname).get('res.lang')
38
ids = lang_obj.search(cr, uid, [('active', '=', True), ])
39
langs = lang_obj.browse(cr, uid, ids)
40
return [(lang.code, lang.name) for lang in langs]
38
lang_obj=pooler.get_pool(cr.dbname).get('res.lang')
39
ids=lang_obj.search(cr, uid, [('active', '=', True),])
40
langs=lang_obj.browse(cr, uid, ids)
41
return [(lang.code, lang.name ) for lang in langs]
43
'report_lang': {'string': 'Language', 'type': 'selection', 'selection': _get_language, },
44
'categories': {'string': 'Select Category', 'type': 'many2many', 'relation': 'product.category', 'required': True},
44
'report_lang': {'string':'Language', 'type':'selection', 'selection':_get_language,},
45
'categories': {'string':'Select Category', 'type':'many2many', 'relation':'product.category', 'required':True},
47
def _load(self, cr, uid, data, context):
48
partner_obj = pooler.get_pool(cr.dbname).get('res.partner')
49
partners = partner_obj.browse(cr, uid, [data['id']])
51
data['form']['report_lang'] = partners[0].lang
48
def _load(self,cr,uid,data,context):
49
partner_obj=pooler.get_pool(cr.dbname).get('res.partner')
50
partners=partner_obj.browse(cr, uid, [data['id']])
52
data['form']['report_lang']=partners[0].lang
52
53
return data['form']
55
56
'actions': [_load],
56
'result': {'type': 'form', 'arch': _lang_form, 'fields': _lang_fields, 'state': [('end', 'Cancel'), ('print', 'Print Product Catalog')]}
57
'result': {'type': 'form', 'arch':_lang_form, 'fields':_lang_fields, 'state':[('end','Cancel'),('print','Print Product Catalog') ]}
60
'result': {'type': 'print', 'report': 'product_catalog', 'state': 'end'}
61
'result': {'type': 'print', 'report': 'product_catalog', 'state':'end'}
63
64
wiz_productCatalog('res.partner.product_catalog')
64
65
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: