Odoo 도움말

0

0
4 응답
0
Avatar

subbarao India

--subbarao--

1400
| 5 3 8
Chennai, India
--subbarao--


subbarao India
19. 2. 10. 오후 10:40

Hello

In your one2many tree view add editable='bottom', so you can able to edit here it self(instead of pop-up) 

0
Joinlearn United States
19. 9. 22. 오전 6:58

Hello plz help ,

I'd like to change the type of section when I click in 'add section' in sale.order in field order_line field in odoo 12, It's a Char field and I'd like to change it to Many2one field

0
Paulo Matos 앙골라
19. 2. 11. 오후 12:07

I am writing a new "answer" because I need to refer both @subbarao and @sehrish.

Thank you guys.

I have tried as you said but unfortunately I could not get the complete workflow as desired.

Using the "<tree editable ="bottom"> (or top), now I am able to edit the record on the same form without the "pop-up" window... but...

I am still unable to "choose the record from a list of existing records" and cannot see the (Create and Edit option).

@subbarao says that I should add this "editable = "bottom" to the tree view of my "one2many" field.

Do you mean add it to the "model" where I have the relation to the Many2one field?  

These are my classes:

class mymodule_director(models.Model):   
    _name = 'mymodule.director'   
    name = fields.Char('Name', size=50, required=True)   
    phone = fields.Char('Phone', size=17, default="00244 ")   
    email = fields.Char('Email')   
    location_id = fields.Many2one('mymodule.locations','Location', required=True)   
    customer_ids = fields.Many2one('mymodule.customers','director_ids')


class mymodule.customers(models.Model):   
     _name='mymodule.customers'   
     name=fields.Char('Name', required=True)   
    address = fields.Char('Address')   
    city = fields.Char('City')   
    province=fields.Char('Province')   
    email=fields.Char('Email')   
    director_ids = fields.One2many('mymodule.director','customer_ids', string="Director")


Tree view:

- mymodule.director model

<record id="mymodule_director_tree_view" model="ir.ui.view">
    <field name="name">Director List View</field>
    <field name="model">mymodule.director</field>
    <field name="arch" type="xml">
      <tree editable="bottom">    ------->>>>> ADDED AS PER INSTRUCTIONS
         <field name="name"/>
         <field name="phone"/>
         <field name="email"/>
         <field name="location_id"/>
         <field name="customer_ids" string="Customer"/>
      </tree>
    </field>
  </record>


- mymodule.customers model FORM view (where the relation should appear on form view)

  <record id="mymodule_customers_form_view" model="ir.ui.view">
    <field name="name">mymodule.customers.form.view</field>
    <field name="model">mymodule.customers</field>
    <field name="type">form</field>
    <field name="arch" type="xml">
      <sheet>
        <form>
          <group>
            <field name="name"/>
            <field name="address"/>
            <field name="city"/>
            <field name="province"/>
            <field name="email"/>
          </group>
            <notebook>                        ----------------->>>>>> TRIED TO ADD "editable = "bottom" FROM THIS POINT WITH NO SUCESS
              <page string="Directors">
                  <field name="director_ids"/>
              </page>
            </notebook>
      </form>
      </sheet>
    </field>
  </record> 


Adding it to the "tree view" above, I can get "almost" what I want. The problem is that existing records are not shown on the form...


 Thank you once again


0
Sehrish Pakistan
19. 2. 11. 오전 2:29

Try this one

<notebook>
<page string="Detail">
<field name="one2many_field">
<tree editable="top">
<field name="field1" />
<field name="field2"/>
<field name="field3">
</field>
</tree>
</field>
</page>
</notebook>



질문하기
Writer
태그
Keep Informed
1 팔로워
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.

Register
Odoo Training Center

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

Test it now