mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[12.0][FIX] contract & contract_sale - security fix
The lowest model access for contract.contract model is group_account_invoice group. However the addon adds two smart buttons to res.partner view without any security restrictions and without compute_sudo attribute on computed fields. This causes the view to crash when a user without the proper permissions tries to access the res.partner form view. The solution adds groups_id to the partner form views in which the buttons are added, so the only loads when the user has proper permissions. Other way to solve it would be to add compute_sudo attribute to the relevant fields, but this causes an access error when the user clicks on the smart buttons.
This commit is contained in:
committed by
Francisco Ivan Anton Prieto
parent
6dfd9656d4
commit
caa5cae7d7
@@ -9,7 +9,7 @@
|
||||
|
||||
{
|
||||
'name': 'Recurring - Contracts Management',
|
||||
'version': '12.0.4.0.0',
|
||||
'version': '12.0.4.1.0',
|
||||
'category': 'Contract Management',
|
||||
'license': 'AGPL-3',
|
||||
'author': "OpenERP SA, "
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<record id="view_partner_form" model="ir.ui.view">
|
||||
<field name="inherit_id" ref="base.view_partner_form" />
|
||||
<field name="model">res.partner</field>
|
||||
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
|
||||
<field type="xml" name="arch">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="act_show_contract" type="object" class="oe_stat_button"
|
||||
|
||||
Reference in New Issue
Block a user