How To Create Many2many Field In Odoo

Поделиться
HTML-код
  • Опубликовано: 6 апр 2020
  • How to create many2many field in Odoo. Add many2many field in Odoo. Many2many field does not add field to model, instead it will create new relational table with fields have foreign keys to other this models. Many2many field in Odoo. Working of many2many field in Odoo.
    Support and Donate: ko-fi.com/odoomates
    Email: odoomates@gmail.com
  • НаукаНаука

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

  • @yelinhtut5154
    @yelinhtut5154 25 дней назад

    Thanks, It's so full of information about many2many fields.

    • @OdooMates
      @OdooMates  25 дней назад +1

      Glad you liked ❤️❤️❤️

  • @bram5782
    @bram5782 3 года назад

    I got your point to shortened table name for m2m rel.
    Thanks mates!
    However, I think it is better to explain how to drop column inside postgres, instead of uninstalling the module. I'd love to know the error(s) of doing it (drop column) and the solution besides uninstalling module.

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

    Thnks champ...❤

  • @abhinavm.s1410
    @abhinavm.s1410 3 года назад +1

    Very helpful

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

    Thanks!

  • @MuhammadUmarAkram4
    @MuhammadUmarAkram4 2 года назад +1

    Hi. My question is, if I put a python in compute in the form A and having a many2many field of that form A in another form B, does the compute work there in form B?

    • @OdooMates
      @OdooMates  2 года назад

      If there is proper dependency for the compute function it will get computed/recomputed

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

    love your videos bro

    • @OdooMates
      @OdooMates  3 года назад

      Happy to hear those words

  • @ramcharanmadasu4591
    @ramcharanmadasu4591 4 года назад +1

    sir, i have a doubt...
    after authentication, i'm getting session id
    how to show the homepage directly by using session id
    cause i am using webview in react native.
    authentication part is done by myself in react
    but i need to show a webview of homepage in my app.
    please help me.
    Thanks.

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

      You can add a condition if authentication is success load the URL like that... The URL will be in authentication response, or you can hard code

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

    Thanks for the video. I'm making a custom report and I need the values from many2many checkbox. Is there a way to do that.

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

      Yes it can be printed in reports, did you done ?

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

      @@OdooMates No I haven't done it yet

  • @mahsaghaempanah8414
    @mahsaghaempanah8414 4 года назад +2

    Hello, I am really in need of making an editable table in odoo 12. I could not find any solution for that. But I have recently found that x2many field might help me, however I do not know how it works. Do you have any tutorial video that could help me about it?
    many thanks in advance

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

      how you checked this video explaining the many2many field concept in odoo ?

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

      @@OdooMates Because in the following link :
      apps.odoo.com/apps/modules/12.0/web_widget_x2many_2d_matrix/?fbclid=IwAR2UPcumlaq3yT5WdhndijIxCgaFo_wd_qlENb5AOG58WDiWTGci3vDcr6o
      which explains how to make the structure of "2D matrix for x2many field", it is needed to define a many2many field. But in this process, I can not connect to the considered model, and address "filed_x_axis", "field_y_axis" and "field_value". In fact my code can not refer to them.

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

      I have exactly the same problem but I am pretty new in odoo. Is there any simple way to create something like an excel table, with cells which are editable? The user must be able to write either a value or a string in it.
      I also thought about the widget ‘x2many_2d_matrix‘ but cannot get it done.

      Is x2many_2d_matrix the right one for this purpose? Do you have any video which covers it?

  • @maaneadel2815
    @maaneadel2815 3 года назад

    hi again bro, Sorry for all of this questions, it's my graduation project and I'm new to odoo.
    i did all this but i get this :
    psycopg2.errors.UndefinedTable: relation "gi_courclass_rel" does not exist
    the code :
    cours = fields.Many2many('gi.cours','gi_courclass_rel','classroom_id','cour_id',string='Cours')
    classroom =fields.Many2many('gi.classroom','gi_courclass_rel','cour_id','classroom_id',string="Groupes",required=True)
    thanks for all your reply its help me

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

      its solve
      i just upgrade the module and restart pycharm

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

      @@maaneadel2815 happy that you ] found the problem and solved

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

    how to make several checkboxes related to the same field

    • @OdooMates
      @OdooMates  4 года назад +2

      There is widget many2many_checkbox

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

      @@OdooMates yes and also if field selection can be using radio with options

    • @ibrahimhalouane8130
      @ibrahimhalouane8130 4 года назад +1

      @@OdooMates I guess it is: "many2many_checkboxes" not "many2many_checkbox"

  • @viharikaarisetty7183
    @viharikaarisetty7183 2 года назад +1

    hello sir in my work i want use many2many for one field based on that automatically it has to add the amount in another there is only two fields
    activity_ids = fields.Many2many('pappaya.activitymaster', string="Activty")
    activity_fees = fields.Float(string="Activity Fees")
    if i select the one item in activity_ids that amount is displaying in activity_fees but if i select 2 items in activity_ids but that second item amount is not adding in activity_fees
    so please give me solution for this

    • @viharikaarisetty7183
      @viharikaarisetty7183 2 года назад

      sir i need solution for this its an emergency

    • @OdooMates
      @OdooMates  2 года назад

      @@viharikaarisetty7183 can you tell us or show us how the value to the amount field is assigned

  • @kaoutherayadi5771
    @kaoutherayadi5771 2 года назад +1

    great video but i have view model class ProjectMilestoneInvoicing(models.Model):
    _name = "budget.milestone.invoicing"
    _auto = False
    and i try what youdo but every time i got psycopg relation problem

    • @OdooMates
      @OdooMates  2 года назад

      can you uninstall and try to install the module again and see whether it makes any difference ?

  • @DannyMolinaMorales
    @DannyMolinaMorales 16 дней назад

    how to add custom colum to relation many2many?

    • @OdooMates
      @OdooMates  15 дней назад

      Can you tell me with a sample

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

    How to add many2many in the same model.
    Eg:
    _inherit='hr.leave'
    Multiple_leave=fields.Many2many('hr.leave')

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

      is the above code not working ?

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

      @@OdooMatesno it is not working.
      I want to access the same model for displaying to the treeview.
      i need to access to the same model.like parent child .
      Parent model is 'hr.leave' and child model is also 'hr.leave' for that what I have to do?