How to Add One2many Fields In Odoo

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ธ.ค. 2024

ความคิดเห็น • 100

  • @metalmlover
    @metalmlover 2 ปีที่แล้ว +1

    Hello Odoo Mates. Hope you're doing great. Is there technically any difference between creating a one2many field on patient model for appointments and creating a model appointments with required patient_id like we did in the course?

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว +1

      both will have same effect in the db

    • @metalmlover
      @metalmlover 2 ปีที่แล้ว +1

      @@OdooMates Thank you ❤️

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      ❤️

  • @Albaraa-Omar
    @Albaraa-Omar ปีที่แล้ว +1

    Thank you very much, you have solved a very big problem for me❤

    • @OdooMates
      @OdooMates  ปีที่แล้ว

      happy that it helps

  • @rodolfosanchezflores
    @rodolfosanchezflores 4 ปีที่แล้ว +6

    the best free tutorial really!

  • @renaacer
    @renaacer 2 ปีที่แล้ว +1

    Hi, can I grant access rights to specific fields into one2many field?
    example
    You added a one2many with product_id, product_qty and appointment_id but I want that user a only add product but no set product_qty and user b set product_qty but no change product_id

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      Ifs possible to hide a field or make a field readonly field based on user group

    • @renaacer
      @renaacer 2 ปีที่แล้ว +1

      @@OdooMates I will investigate how to do it, you're excellent

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      ❤️❤️ thanks for all the support ❤️

  • @altelasoftware2992
    @altelasoftware2992 2 ปีที่แล้ว +1

    Hello, after adding products inside the item list, all of the product becomes the same name to each other. For example i put "remote, glass, phone" inside the list but when saving its all changed to "remote, remote, remote". Do you have this kind of problem before? please advice thank you!

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว +1

      Not yet faced the same, can we see your code

    • @altelasoftware2992
      @altelasoftware2992 2 ปีที่แล้ว

      ​@@OdooMates I already solved the issue, the problem is caused by wrong configuration of inverse name inside One2many fields. inverse name supposed to be the "list_id" of the product lines, but i fill it with "product_id" instead.
      The code at first is look like this :
      product_lines = fields.One2many('combine.stock.lines', 'product_id')
      But then i solved to this :
      product_lines = fields.One2many('combine.stock.lines', 'list_id')
      Thank you for the video! Great content you have as always brother

  • @sasindrans6059
    @sasindrans6059 2 ปีที่แล้ว +1

    if i do what you did in this video can i get this results iam taking about the xml file ,because i have only created module and added fields into it and save it in a tree view that why im asking can you please clarify me

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      Please try to follow this playlist:
      v15: th-cam.com/video/DKxwcMxV02U/w-d-xo.html
      v14: th-cam.com/video/DJyPx5u6sd0/w-d-xo.html
      v12: th-cam.com/video/BDepk0LhVuI/w-d-xo.html

  • @dronix1969
    @dronix1969 2 ปีที่แล้ว +1

    excellent video thanks for the contribution, a query in the one2many fields can create an additional field where each record that is entered in one2many is counted.

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      ❤️ is the query is about how to generate serial number for one2many lines, like 1 2 3 etc ?

    • @dronix1969
      @dronix1969 2 ปีที่แล้ว

      @@OdooMates Yes, have a field that increases with each record in the one2many, that the field goes 1 2 3 etc.

  • @Jahen222
    @Jahen222 5 ปีที่แล้ว +2

    No le doy un beso porque lo pinto, papasito me salvo la vida!! i love you

  • @melvinguerra9563
    @melvinguerra9563 2 ปีที่แล้ว +1

    Is there anyway to make this using odoo studio?

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      Yes, it's possible to add a one2many field using studio

    • @melvinguerra9563
      @melvinguerra9563 2 ปีที่แล้ว +1

      @@OdooMates Is there any video explaining this?

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      We haven't made yet, but it easy, just enable studio mode, then open the form view, then from the right side you can drag and add new field of type one2many

    • @melvinguerra9563
      @melvinguerra9563 2 ปีที่แล้ว +1

      @@OdooMates It says I first need a many2one field and I cant understand what It means cause I already have one

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      @@melvinguerra9563 first you have to create a many2one field in the one2many model, like we are creating a one2many between sale.order and sale.order.line, first add a many2one field in sale.order.line to sale.order, then from sale order add a one2many field and select the added many2one field as relation, if this is not clear for you, let us know

  • @muneebhaider5861
    @muneebhaider5861 2 ปีที่แล้ว +1

    Hi Odoo Mates.
    Can anyone tell me how to show "Add a section" option in my one2many line view
    I am using widget="section_and_note_one2many" and the "Add a section option is showing but it is working same as "add a line"
    Thanks

  • @Kirill0094
    @Kirill0094 3 ปีที่แล้ว +1

    Odoo Mates, How can i change the height of each line of the field one2many ? style not working :(

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว

      is it really needed

    • @Kirill0094
      @Kirill0094 3 ปีที่แล้ว +1

      @@OdooMates Is this impossible to do?

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว

      @@Kirill0094 not tried it yet

  • @viharikaarisetty7183
    @viharikaarisetty7183 2 ปีที่แล้ว +1

    hi sir i want to set record limit for one2many field can you help me sir

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      Use constrains in odoo

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      th-cam.com/video/50cecNF3OyQ/w-d-xo.html

    • @viharikaarisetty7183
      @viharikaarisetty7183 2 ปีที่แล้ว +1

      but it is not working

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว

      @@viharikaarisetty7183 you can debug it right ? like whats the mistake you made ? need help in it or you feel you can solve it ? have a try brother

  • @aboidrees
    @aboidrees 3 ปีที่แล้ว +1

    i cannot recognise to which playlist this video belongs, can you help with this 😰

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว +1

      sure.
      The playlist: th-cam.com/video/BDepk0LhVuI/w-d-xo.html

  • @mudassarali9582
    @mudassarali9582 4 ปีที่แล้ว +2

    raise ValueError(message)
    ValueError: Field `appointment_line` does not exist
    any one i'm getting this error

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว

      Can i see the code ?

    • @mudassarali9582
      @mudassarali9582 4 ปีที่แล้ว

      @@OdooMates sir after spending hours on this i just restart my computer and the error is gone

  • @asadasif4430
    @asadasif4430 4 ปีที่แล้ว +1

    Hello,
    Thanks for your tutorials, they really help us a lot.
    Can you also please show how to add the Unit Price, Subtotal and Grand total to the order line like we have on the Sales Order?
    Thanks

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว

      if it is really urgent for you, see the video of adding compute fields: th-cam.com/video/Mg80GxrKDOc/w-d-xo.html

    • @asadasif4430
      @asadasif4430 4 ปีที่แล้ว +1

      @@OdooMates thanks for the information. Its not that urgent for me, but I thought that tutorial in the future could be useful for all of us.
      Keep Up The Good Work :)

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว

      See this: th-cam.com/video/j981dytxE28/w-d-xo.html

  • @supreetlaghate22
    @supreetlaghate22 3 ปีที่แล้ว +1

    Hii. How to make one2many fields responsive with onchange function? Different one2many fields as per onchange function.

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว

      To update one2many in onchange, see this video: th-cam.com/video/LE7E2O4lBrQ/w-d-xo.html

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว

      if you need to control the visibilty of one2many fields, you can do it using the attrs in xml, by setting a temparory boolean field

  • @muneebhaider5861
    @muneebhaider5861 2 ปีที่แล้ว

    Hi
    Hope you are fine.
    I have a list of records and i want to display the names of all the records in my list in the Validation error can you plz tell me how to achieve it
    Thank you.

    • @OdooMates
      @OdooMates  2 ปีที่แล้ว +1

      ",".join(list)

    • @muneebhaider5861
      @muneebhaider5861 2 ปีที่แล้ว

      @@OdooMates can you plz explain a little bit i am stuck

  • @muhanadtaifour4241
    @muhanadtaifour4241 3 ปีที่แล้ว +1

    All your playlists are not in order
    Could you please write down ordered links

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว

      First of all sorry for the inconvenience caused,
      We have tried to kept all the playlist in order, how we have created, if there is something missing or in mis order, can you help us to find it out, if so we will look and re arrange accordingly

    • @muhanadtaifour4241
      @muhanadtaifour4241 3 ปีที่แล้ว +1

      @@OdooMates Actually i just found ordered links in the description and in your github, I'm very gratitude for your great work, one of the best tutorials in the web.

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว

      @@muhanadtaifour4241 Thanks for the support brother

  • @muzamilanwer7603
    @muzamilanwer7603 4 ปีที่แล้ว +1

    There is a little changing in product_id
    instead of product.product
    In our HospitalAppointmentLines class
    write this
    product_id = fields.Many2one('product.category', string='Medicine')

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว

      its upto user, to decide whether to choose the category or product. Thanks for suggestion

  • @Al-yf1bh
    @Al-yf1bh 4 ปีที่แล้ว +1

    how we can hide the selected medicine in the tree view of our o2m field
    so its not appear anymore when we gonna add new medicine

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว

      Hi, It cannot be done easily.Instead you can show a warning if same product is selected twice in the lines, is that okay ?

    • @Al-yf1bh
      @Al-yf1bh 4 ปีที่แล้ว

      @@OdooMates can u show a direct code for it??

    • @Al-yf1bh
      @Al-yf1bh 4 ปีที่แล้ว

      im having problem with it

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว

      @@Al-yf1bh www.odoo.com/forum/help-1/question/how-to-prevent-selecting-the-same-value-in-one2many-field-in-odoo-10-131152

    • @Al-yf1bh
      @Al-yf1bh 4 ปีที่แล้ว

      @@OdooMates thankyou mr odoo mates
      currently im working with odoo and this is my first time
      u know your video make me know more about odoo and help me to solve something like i never face before in odoo

  • @gefr1mx
    @gefr1mx 4 ปีที่แล้ว

    Cómo agrego un one2many relacionado?

  • @KamranAli-lx6cm
    @KamranAli-lx6cm 5 ปีที่แล้ว

    Can i get the source code i have need a custom table view and i didn't understand it how to do

    • @OdooMates
      @OdooMates  5 ปีที่แล้ว

      Download it from here: apps.odoo.com/apps/modules/12.0/om_hospital/

    • @ghulammohaiudin5080
      @ghulammohaiudin5080 4 ปีที่แล้ว +1

      larkayyy

  • @sylvainbonnet9227
    @sylvainbonnet9227 4 ปีที่แล้ว

    Hello Sir, i would need few tipps for developpment, is it possible to ask you durectly or hire your service ? i would like to thank you to share your knowlegdes with us. Best regards, Sylvain

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว

      Hope we have replied you in email :)

  • @AliRazaiamaliraza
    @AliRazaiamaliraza 5 ปีที่แล้ว +1

    Parent model can't identify related ID from child model, in this case "appointment_id"

  • @juliancarrera9433
    @juliancarrera9433 4 ปีที่แล้ว +1

    Hello when implementing this code in odoo 13, I have the following error. Sorry, you do not have permission to access documents of unknown type. no group currently allows this operation. (Operation: read, User: 2)

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว

      Did you add the access rights for the new model ?

    • @juliancarrera9433
      @juliancarrera9433 4 ปีที่แล้ว

      @@OdooMates
      If I did it like you do in this video, th-cam.com/video/W5ya521uTlo/w-d-xo.html

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว +1

      @@juliancarrera9433 just to confirm the issue, can you switch to super user mode and see whether the same error is there or not

    • @OdooMates
      @OdooMates  4 ปีที่แล้ว +1

      th-cam.com/video/pBN3IC9ipWw/w-d-xo.html

    • @juliancarrera9433
      @juliancarrera9433 4 ปีที่แล้ว +1

      @@OdooMates I'm going to work, when I come back I will try it and tell you. Thanks a lot

  • @Jahen222
    @Jahen222 5 ปีที่แล้ว

    lo volvería a besar!!! muaaaackkkk jejejeje

    • @OdooMates
      @OdooMates  5 ปีที่แล้ว

      Gracias ... si los videos son útiles, por favor, denle me gusta y espero que suscriban el canal y nos apoyen.

  • @abduljabbar8383
    @abduljabbar8383 3 ปีที่แล้ว +1

    thanks

  • @mudassarali9582
    @mudassarali9582 4 ปีที่แล้ว

    sir i have send you an email kindly reply me

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว

      hope we have replied

  • @victordominguez7152
    @victordominguez7152 3 ปีที่แล้ว +1

    Any one have had this error "psycopg2.ProgrammingError: relation "solicitud_aliniamiento_definicion_paramentos" does not exist
    LINE 1: ...citud_aliniamiento_definicion_paramentos".id FROM "solicitud..." when adding a one2Many field

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว +1

      can i see the code that you have added

    • @victordominguez7152
      @victordominguez7152 3 ปีที่แล้ว +1

      @@OdooMates Thank you! it was my mistake, i was using a related field that already existed in another one2Many field.

    • @OdooMates
      @OdooMates  3 ปีที่แล้ว +1

      @@victordominguez7152 happy that you have found the reason and resolved the case