Odoo Help


wizard form value browsing [Closed]

on 5/2/13, 10:32 AM 3,372 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 05/19/2014 13:33:18

class lead_target_wizard(osv.osv_memory): _name = 'lead.target.wizard' _description = 'lead target wizard report'

_columns = {
    'target_selection': fields.selection([('daily','daily'),('weekly','weekly'),('monthly','monthly')], 'Selection',select=True),
def check_report(self, cr, uid, ids, context=None):
    datas = {}
    if context is None:
        context = {}
    data = self.read(cr, uid, ids, [], context=context)[0]
    datas = {
         'ids': context.get('active_ids',[]),
         'model': 'account.invoice',
         'form': data
    return {
        'type': 'ir.actions.report.xml',
        'report_name': 'leadtarget_crm.lead',
        'datas': datas,


#####################and I have a XML File################ <openerp> <data>

    <record id="crm_lead_target_view" model="ir.ui.view">
        <field name="name">Lead Target</field>
        <field name="model">lead.target.wizard</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Target Lead">
                <group colspan="4" col="6">
                    <field name="target_selection"/>
                <separator colspan="4"/>
                <group colspan="4" col="6">
                    <button special="cancel" string="Cancel" icon="gtk-cancel"/>
                    <button name="check_report" string="Print" type="object" icon="gtk-print"/>

    <record id="action_lead_target" model="ir.actions.act_window">
        <field name="name">Lead Target111</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">lead.target.wizard</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="crm_lead_target_view"/>
        <field name="target">new</field>

    <record model="ir.values" id="crm_lead_target_report_values">
        <field name="model_id" ref="account.model_account_invoice" />
        <field name="object" eval="1" />
        <field name="name">Lead Target</field>
        <field name="key2">client_print_multi</field>
        <field name="value" eval="'ir.actions.act_window,' + str(ref('action_lead_target'))" />
        <field name="key">action</field>
        <field name="model">crm.lead</field>



##############UPto this are working fine, and wizard form is open I need to browse the selection field val in my report folder python file how to do this can any one help me ##########

mport time from report import report_sxw #from tools import amount_to_text_en import pooler from tools import amount_to_text #from tools.amount_to_text import amount_to_text_infrom tools.translate import _

class lead_target(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(lead_target, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time,
'get_name':self.get_name, #'get_parenttax':self.get_parenttax, }) self.context = context def get_name(self, form): here I need to get the selection value daily, weekly, monthly print target_selection, "print the selection field value how to get that" plz can any one help me............


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 5/2/13, 10:44 AM

You can do so by data['form'['your_field_name']

def get_name(self, form):
    print form['target_selection]

This will print value selected in wizard.

thanks friend Mr.sudhir arya it's working fine

on 5/3/13, 2:39 AM

ok it is working fine we can browse the wizard form selection value but i could not browse the crm.lead table(self.pool.get(crm.lead) not working) how to do that plz ans me

on 5/3/13, 7:39 AM

What error/problem you are facing during crm.lead browse?

Sudhir Arya (ERP Harbor Consulting Services)
on 5/3/13, 8:33 AM

i tried to browse the crm.lead in that same function it's show me a error, cr is not defined plz tell me how to browse val (get_name function)

on 5/3/13, 10:04 AM

in report parsing py you cannot ur cr, uid directly. You should use self.cr, self.uid. It will work.

Sudhir Arya (ERP Harbor Consulting Services)
on 5/5/13, 2:21 AM

thank you very much Mr.arya It's working fine I added one more question search method compare of current date which is date format with date_open is crm_lead field which is string format. i Have given the code just look at that............. advance thanks

on 5/6/13, 6:54 AM

I have arrised a quistion in this subject name(wizard report error __new__() takes exactly 1 argument (2 given)) -----> i know you can this question plz read it and ans me advanced thanks

on 5/8/13, 7:54 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/2/13, 10:32 AM
Seen: 3372 times
Last updated: 3/16/15, 8:10 AM