| 1 | import { fields, models } from "@web/../tests/web_test_helpers"; |
| 2 | import { mailDataHelpers } from "@mail/../tests/mock_server/mail_mock_server"; |
| 3 | |
| 4 | export class HrEmployee extends models.ServerModel { |
| 5 | _name = "hr.employee"; |
| 6 | |
| 7 | department_id = fields.Many2one({ relation: "hr.department" }); |
| 8 | work_email = fields.Char(); |
| 9 | work_phone = fields.Char(); |
| 10 | work_location_type = fields.Char(); |
| 11 | work_location_id = fields.Many2one({ relation: "hr.work.location" }); |
| 12 | job_title = fields.Char(); |
| 13 | |
| 14 | _get_store_avatar_card_fields() { |
| 15 | return [ |
| 16 | "company_id", |
| 17 | mailDataHelpers.Store.one("department_id", ["name"]), |
| 18 | "work_email", |
| 19 | mailDataHelpers.Store.one("work_location_id", ["location_type", "name"]), |
| 20 | "work_phone", |
| 21 | "job_title", |
| 22 | ]; |
| 23 | } |
| 24 | |
| 25 | _views = { |
| 26 | search: `<search><field name="display_name" string="Name" /></search>`, |
| 27 | list: `<list><field name="display_name"/></list>`, |
| 28 | }; |
| 29 | } |