public class AttendanceReport extends OModel { public static final String TAG = AttendanceReport.class.getSimpleName(); public static final String AUTHORITY = "com.odoo.addons.hremployee.att_report"; OColumn employee_present_ids = new OColumn("Employees present", HrEmployee.class, OColumn.RelationType.ManyToMany); OColumn lat = new OColumn("Latitude", OFloat.class); OColumn lng = new OColumn("Longitude", OFloat.class); OColumn employee_id = new OColumn("Name", HrEmployee.class, OColumn.RelationType.ManyToOne); OColumn date_reported = new OColumn("Date Reported", ODate.class); OColumn date_reporting = new OColumn("Date Reporting", ODate.class); OColumn employee_absent_ids = new OColumn("Employees absent", HrEmployee.class, OColumn.RelationType.ManyToMany); public AttendanceReport(Context context, OUser user) { super(context, "attendance.report", user); } }
I have created a model named 'attendance.report'. Inside it, I have created two many2many (employee_present_ids & employee_absent_ids).
Both Many2many belong to HrEmployee.class.
Now when i execute this code(app), only one table named 'attendance_report_hr_empoyee_rel' is created in local database.
In python we can give many2many table name while field declaration.
Please guide me, How to create two manymany fields of same class in one Omodel?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
3392
Widoki
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
Syntax of domains - operators
Rozwiązane
|
|
2
sty 23
|
26781 | |
|
4
cze 21
|
39701 | ||
|
1
gru 20
|
2835 | ||
|
1
kwi 18
|
7963 | ||
|
1
mar 16
|
4727 |