-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
[16.0][IMP] spreadsheet_dashboard_oca: Dashboard editability #31
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,21 +15,42 @@ | |
<field name="arch" type="xml"> | ||
<tree position="attributes"> | ||
<attribute name="create">1</attribute> | ||
<attribute name="decoration-muted">not active</attribute> | ||
</tree> | ||
<tree position="inside"> | ||
<field name="can_edit" invisible="1" /> | ||
<field | ||
name="data" | ||
groups="base.group_no_one" | ||
widget="binary" | ||
filename="name" | ||
/> | ||
<!-- Put the button 2 times for having the edit button explicitly disabled for discoverability --> | ||
<button | ||
name="open_spreadsheet" | ||
type="object" | ||
string="Edit" | ||
icon="fa-pencil" | ||
disabled="1" | ||
groups="base.group_system" | ||
attrs="{'invisible': [('can_edit', '=', True)]}" | ||
/> | ||
<button | ||
name="open_spreadsheet" | ||
type="object" | ||
string="Edit" | ||
icon="fa-pencil" | ||
groups="base.group_system" | ||
attrs="{'invisible': [('can_edit', '=', False)]}" | ||
/> | ||
<button | ||
name="copy" | ||
type="object" | ||
string="Copy" | ||
icon="fa-copy" | ||
groups="base.group_system" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only setting users?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't changed this. Only being consistent with the other buttons. But yes, it seems a bit restricted. What do you think, @etobella ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was done this way in order to set some groups, but we can create a new set if we think that it is the best option. |
||
/> | ||
<field name="active" widget="boolean_toggle" /> | ||
</tree> | ||
</field> | ||
</record> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2024 Tecnativa - Pedro M. Baeza | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
<record | ||
model="ir.actions.act_window" | ||
id="spreadsheet_dashboard.spreadsheet_dashboard_action_configuration_dashboards" | ||
> | ||
<field name="context">{'active_test': False}</field> | ||
</record> | ||
</odoo> |
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.
If we export a record (compatible for import) an xml id is generated.
With the current algorithm, if we export a record, it will become not editable. Don't you think ?
Quite theoritical use case though.
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.
Not really, as the XML-ID entry
__export__.<whatever>
will be noupdate=1.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 just tested in a 16.0 CE database.
If I understand correctly, noupdate = False, so can_edit = False
did I missed something ? Sorry if my comment is not relevant.
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.
Ouch, I didn't expect that one... Anyway, fixed 😉