How To Create Many2many Field In Odoo

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • 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/odoo...
    Email: odoomates@gmail.com

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

  • @yelinhtut5154
    @yelinhtut5154 2 หลายเดือนก่อน

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

    • @OdooMates
      @OdooMates  2 หลายเดือนก่อน +1

      Glad you liked ❤️❤️❤️

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

    love your videos bro

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

      Happy to hear those words

  • @abhinavm.s1410
    @abhinavm.s1410 4 ปีที่แล้ว +1

    Very helpful

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

    Thnks champ...❤

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

      Welcome brother

  • @MuhammadUmarAkram4
    @MuhammadUmarAkram4 3 ปีที่แล้ว +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

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

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

      Great suggestion!

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

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

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

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

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

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

    Thanks!

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

  • @DannyMolinaMorales
    @DannyMolinaMorales 2 หลายเดือนก่อน

    how to add custom colum to relation many2many?

    • @OdooMates
      @OdooMates  2 หลายเดือนก่อน

      Can you tell me with a sample

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

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