How to Add One2many Fields In Odoo

Поделиться
HTML-код
  • Опубликовано: 4 дек 2024

Комментарии • 100

  • @rodolfosanchezflores
    @rodolfosanchezflores 4 года назад +6

    the best free tutorial really!

  • @Albaraa-Omar
    @Albaraa-Omar Год назад +1

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

  • @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 года назад

      ❤️

  • @Jahen222
    @Jahen222 5 лет назад +2

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

  • @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.

  • @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 ❤️

  • @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: ruclips.net/video/DKxwcMxV02U/видео.html
      v14: ruclips.net/video/DJyPx5u6sd0/видео.html
      v12: ruclips.net/video/BDepk0LhVuI/видео.html

  • @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

  • @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

  • @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: ruclips.net/video/Mg80GxrKDOc/видео.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: ruclips.net/video/j981dytxE28/видео.html

  • @gefr1mx
    @gefr1mx 4 года назад

    Cómo agrego un one2many relacionado?

  • @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: ruclips.net/video/LE7E2O4lBrQ/видео.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

  • @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: ruclips.net/video/BDepk0LhVuI/видео.html

  • @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

  • @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

  • @abduljabbar8383
    @abduljabbar8383 3 года назад +1

    thanks

  • @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

  • @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

  • @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 года назад

      ruclips.net/video/50cecNF3OyQ/видео.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

  • @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

  • @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 :)

  • @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.

  • @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

  • @AliRazaiamaliraza
    @AliRazaiamaliraza 5 лет назад +1

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

  • @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

  • @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, ruclips.net/video/W5ya521uTlo/видео.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

      ruclips.net/video/pBN3IC9ipWw/видео.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

  • @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