تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
13794 أدوات العرض

I have this model.


class A(models.Model):

    list = fields.One2many('B',)

     @api.onchange('field')

             data = {}

             a.list.new(data)


I now change a field, how should I build Class B this model, Class B is a new model

class B(models.Model):

    aaa = fields.One2many('C',)

class C(models.Model):

    ccc = fields.many2one('product.product')



الصورة الرمزية
إهمال

hello! I would like to help but i dont clearly understand your problem

أفضل إجابة

Hi,


'categories': fields.one2many('p_c.category', 'property_id', 'Categories'),
Parameters
  • comodel_name -- name of the target model (string)
  • inverse_name -- name of the inverse Many2one field in comodel_name (string)
  • domain -- an optional domain to set on candidate values on the client side (domain or string)
  • context -- an optional context to use on the client side when handling that field (dictionary)
  • auto_join -- whether JOINs are generated upon search through that field (boolean, by default False)
  • limit -- optional limit to use upon read (integer)
الصورة الرمزية
إهمال
أفضل إجابة
Hope this may be helpful:

(0, 0, { values }) link to a new record that needs to be created with the given values dictionary (1, ID, { values }) update the linked record with id = ID (write *values* on it) (2, ID) remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well) (3, ID) cut the link to the linked record with id = ID (delete the relationship between the two objects but does not delete the target object itself) (4, ID) link to existing record with id = ID (adds a relationship) (5) unlink all (like using (3,ID) for all linked records) (6, 0, [IDs]) replace the list of linked IDs (like using (5) then (4,ID) for each ID in the list of IDs) Regards, Mayank Gosai
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يناير 25
1917
2
سبتمبر 22
9668
2
أبريل 22
4716
0
يوليو 21
7336
1
مارس 21
5072