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

Hi. I am trying to autosave a record after saving a previous record. Here is my scenario:

I have a tournament with an integer value of rounds. (e.g. I input a value of 4 in the rounds_field). Now after saving/creating the tournament, I should save data in my 'rounds' table/model depending on the value of rounds from the 'tournament'. In this case, I want to save values in my rounds class:

round_1 tour_id (FK)

round_2 tour_id (FK)

round_3 tour_id (FK)

round_4 tour_id (FK)

Basically I have 2 classes - 'tournament', 'rounds'. Due to the syntax of odoo, I don't know how to achieve this so any help would be much appreciated. Thanks!     

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

To achieve your scenario use should override create method, hope this will resolve your issue. https://goo.gl/4BkizH

أفضل إجابة

I suggest you use the base_automation module.  Create base.action.rule with "When to Run" set as "On Update". 


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 16
5017
4
يوليو 20
8376
1
ديسمبر 19
6442
1
فبراير 18
5345
3
يناير 18
6371