-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12.0][FIX] Improved code of stage create method. #643
base: 12.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rutul-serpentcs
This fixes the original error you presented.
However there is still an issue creating the stage from Kanban view
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)
stage_type field needs to be set
@brian10048 Done, Can you please review it again? |
@rutul-serpentcs - It allows to create the stage, but a new bug is introduced when we create a stage that has an undefined stage type. When you go back to the orders kanban view, the stage recently created will not be displayed. Can you revert the recent change and keep the stage_type required in python? Then, instead can you use the context to set the correct |
12648da
to
b21997b
Compare
@@ -45,8 +45,7 @@ def _default_team_ids(self): | |||
stage_type = fields.Selection([('order', 'Order'), | |||
('equipment', 'Equipment'), | |||
('location', 'Location'), | |||
('worker', 'Worker')], 'Type', | |||
required=True) | |||
('worker', 'Worker')], 'Type', require=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid this is incorrect, required
is the correct field attribute.
Is the goal to remove the required attribute?
@@ -13,7 +13,8 @@ | |||
<field name="name">Orders</field> | |||
<field name="res_model">fsm.order</field> | |||
<field name="view_mode">kanban,timeline,tree,form,calendar</field> | |||
<field name="context">{'default_team_id': active_id}</field> | |||
<field name="context">{'default_team_id': active_id, | |||
'default_stage_type':'order'}</field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'default_stage_type':'order'}</field> | |
'default_stage_type': 'order'}</field> |
if stage.stage_type == vals['stage_type'] and \ | ||
stage.sequence == vals['sequence']: | ||
if stage.stage_type == vals.get('stage_type') and \ | ||
stage.sequence == vals.get('sequence'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please attend the comments
When I create stage from Field Service >> Dashboard >> Team >> Orders kanban view I got an error.