Skip to content

Commit

Permalink
[FIX] fieldservice: allow to quick create a fsm.stage
Browse files Browse the repository at this point in the history
Steps to reproduce the behavior:

1. open dashboard Field Service Orders
2. click "Add a Column" in the kanban view
3. type a new stage name

Current behavior:

```
2023-08-29 10:48:02,995 73200 ERROR test-fieldservice odoo.sql_db: bad query: INSERT INTO "fsm_stage" ("id", "create_uid", "create_date", "write_uid", "write_date", "active", "custom_color", "name", "sequence") VALUES (nextval('fsm_stage_id_seq'), 2, (now() at time zone 'UTC'), 2, (now() at time zone 'UTC'), true, '#FFFFFF', 'test', 1) RETURNING id
ERROR: null value in column "stage_type" violates not-null constraint
DETAIL:  Failing row contains (13, t, test, 1, null, null, null, null, #FFFFFF, null, null, null, 2, 2023-08-29 10:48:02.988337, 2, 2023-08-29 10:48:02.988337).

2023-08-29 10:48:03,000 73200 WARNING test-fieldservice odoo.http: The operation cannot be completed:
- Create/update: a mandatory field is not set.
- Delete: another model requires the record being deleted. If possible, archive it instead.

Model: Field Service Stage (fsm.stage), Field: Type (stage_type)
```

Expected behavior:

the fsm.stage is created with type 'order' by default.
  • Loading branch information
tafaRU committed Aug 30, 2023
1 parent 95fdb3b commit 8a78e91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions fieldservice/models/fsm_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def _default_team_ids(self):
],
"Type",
required=True,
default="order",
)
company_id = fields.Many2one(
"res.company",
Expand Down
1 change: 1 addition & 0 deletions fieldservice/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@

* Víctor Martínez
* Nils Coenen <nils.coenen@nico-solutions.de>
* Alex Comba <alex.comba@agilebg.com>

0 comments on commit 8a78e91

Please sign in to comment.