Skip to content
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

fsm_location.partner_id field in form view prevents creation when debug is active #1166

Open
are-agilebg opened this issue Mar 12, 2024 · 8 comments
Labels

Comments

@are-agilebg
Copy link

Hi,

I have found this strage behavior in the module fieldservice, which affects 15.0 and 16.0 branches (probably even 17.0 but I haven't checked).

Steps to reproduce on Runboat:

  • activate the debug mode (put the debug=1 parameter in the URL, use the browser extension, whatever)
  • go to 'Field Service > Master Data > Locations'
  • click on 'Create'
  • fill 'Name', 'Related Owner' and 'Billed Customer'
  • click on 'Save'

An error will prevent saving the record showing: 'Invalid fields: Related Partner'.

The problem is that the field is readonly=True, required=True and False since it hasn't been created.

This is particularly nasty in instances that uses base_technical_features to always show technical fields even to users without administration privileges.

The same problem cannot exist in version 14.0 which declares the field required=False in the view.

I'm not opening a PR now since I'm afraid I could be missing something: let me know If I'm right at seeing it as a bug or not.

@pcastelovigo
Copy link

confirmed in 15.0
It difficults set up and usage, should we PR remove the read only?

@qupro
Copy link

qupro commented Jun 12, 2024

Same happens with Workers

  • activate the debug mode (put the debug=1 parameter in the URL, use the browser extension, whatever)
  • go to 'Field Service > Master Data > Workers'
  • click on 'Create'
  • fill field 'Name'
  • click on 'Save'

Error 'Invalid fields: Related Partner'.

as @pcastelovigo saids make sense make 'Related Partner' field editable,

if not, how can I link a field service worker with their user (res.user), so that the worker can login and see their work orders, or with the hr_employee?

@houzefa-abba
Copy link
Member

Hi this seems identical to #1163 which was a fix for 16.0; you could backport it to 15.0

Indeed same problem in the worker form; I did not see it in that initial 16.0 PR (which was only for locations) as I already have a worker form rework in the project I was working on

@houzefa-abba
Copy link
Member

#1164 & #1165 came right after on 16.0 location partners; could also make sense to backport them to 15.0

@pcserviceshn
Copy link

I can confirm it is still present in 16.0.1.7, there are some others fields that are in readonly state, like fsm_location and fsm_person in the res.partner model, those are required to set the customer or employee as worker.

@pleirb
Copy link

pleirb commented Jul 26, 2024

Same behavior, I can't assign contact to the worker configuration

@pleirb
Copy link

pleirb commented Jul 26, 2024

El mismo comportamiento, no puedo asignar contacto a la configuración del trabajador.

It's a problem in the fsm.person.form view
Just change readonly from 1 to 0 on this line:
<field name="partner_id" groups="base.group_no_one" readonly="0"/>

pcastelovigo added a commit to pcastelovigo/field-service that referenced this issue Jul 27, 2024
pcastelovigo added a commit to pcastelovigo/field-service that referenced this issue Jul 27, 2024
pcastelovigo added a commit to pcastelovigo/field-service that referenced this issue Jul 30, 2024
[15.0][FIX] fieldservice: Fix manual location creation issue OCA#1166
@qupro
Copy link

qupro commented Jul 30, 2024

I have tested @pcastelovigo commits and are ok, but...

Why do these related contact fields only have to be visible in debug mode?

If a non-developer user wants to associate a newly created worker with an existing contact (for example, a company employee), he cannot.

I think it would be better if it worked like the employee app, where there is a field where you can associate an employee with a user without developer mode active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants