This question has been flagged
2 Replies
5096 Views

I have this issue

Traceback:
Error: NameError: name 'active_id' is not defined
    at PY_ensurepy (http://localhost:8069/web/content/250-6137903/web.assets_backend.js:88:65)
    at Object.py.evaluate (http://localhost:8069/web/content/250-6137903/web.assets_backend.js:205:8)
    at Object.py.evaluate (http://localhost:8069/web/content/250-6137903/web.assets_backend.js:215:194)
    at Object.py.eval (http://localhost:8069/web/content/250-6137903/web.assets_backend.js:219:284)
    at http://localhost:8069/web/content/250-6137903/web.assets_backend.js:362:110
    at iterator (http://localhost:8069/web/content/240-b701a57/web.assets_common.js:110:183)
    at Function. (http://localhost:8069/web/content/240-b701a57/web.assets_common.js:113:8)
    at _. [as reduce] (http://localhost:8069/web/content/240-b701a57/web.assets_common.js:165:526)
    at eval_contexts (http://localhost:8069/web/content/250-6137903/web.assets_backend.js:360:136)
    at http://localhost:8069/web/content/250-6137903/web.assets_backend.js:362:253
<recordid="estate_property_type_action"model="ir.actions.act_window">
    <
fieldname="name">Property Typefield>
    <
fieldname="res_model">estate.property.typefield>
    <
fieldname="view_mode">tree,formfield>
    <
fieldname="domain">[('property_type', '=', active_id)]field>
    <
fieldname="context">{'default_property_type_id': active_id}field>
record>


<record id="estate_property_type_view_tree"model="ir.ui.view">
    <
field name="name">estate.property.type.treefield>
    <
field name="model">estate.property.typefield>
    <
field name="arch" type="xml">
        <
form>
            <
sheet>
                <
div class="oe_button_box" name="button_box">
                    <
button class="oe_stat_button" type="action" name="%
                        (estate_property_type_action)d" 
icon="fa-money">
                        <
field string="Offer" name="offer_count" widget="statinfo"/>
                    
button>
                
div>
                <
group>
                    <
h1>
                        <
tree>
                            <
field name="name"/>
                        
tree>
                    
h1>
                
group>
                <
group>
                    <
notebook>
                        <
page string="Properties">
                            <
field name="property_ids" readonly='True'>
                                <
tree>
                                    <
field name="sequence" widget="handle"/>
                                    <
field name="name"/>
                                    <
field name="expected_price"/>
                                    <
field name="state"/>
                                
tree>
                            
field>
                        
page>
                    
notebook>
                
group>
            
sheet>
        
form>
    
field>
record>

Avatar
Discard
Best Answer

Hi,

Instead of  [('property_type', '=', active_id)]field> try this [('property_id.property_type_id', '=', active_id)]

Avatar
Discard
Best Answer

Dear Nelson Miranda,


active_id is used for geting current page id so in your code you have to use active_id in xml so it was geeting error so because activr_id is not defined so first of all you can defince active_id in your relate py file then after you can put in xml.



something like that:-


active_id = self . env . context


I hope after doing this your problem will be solved.




Feel free for further assistance on contact@geminatecs.com

Thank you
Geminate Consultancy Services

Avatar
Discard