Skip to content
Snippets Groups Projects
Commit 7d1e483a authored by Maxime Richez's avatar Maxime Richez
Browse files

Add field access on referential document

issue10269
review332861003
parent 520c5e98
No related branches found
No related tags found
1 merge request!114Return an empty list when the treeview has no selection
* Add group to edit accounting of products
Version 6.0.0 - 2021-05-03
* Bug fixes (see mercurial logs for details)
* Add deductible rate for supplier taxes
......
......@@ -3,6 +3,15 @@
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="res.group" id="group_account_product_admin">
<field name="name">Account Product Administration</field>
<field name="parent" ref="product.group_product_admin"/>
</record>
<record model="res.user-res.group" id="user_admin_group_account_product_admin">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_account_product_admin"/>
</record>
<record model="ir.ui.view" id="create_chart_properties_view_form">
<field name="model">account.create_chart.properties</field>
<field name="inherit"
......
......@@ -399,6 +399,18 @@
def supplier_taxes_deductible_rate_used(self):
return self.get_taxes('supplier_taxes_deductible_rate_used')
@classmethod
def copy(cls, templates, default=None):
context = Transaction().context
default = default.copy() if default else {}
if context.get('_check_access'):
default.setdefault(
'account_category',
cls.default_get(
['account_category'],
with_rec_name=False).get('account_category'))
return super().copy(templates, default=default)
class Product(metaclass=PoolMeta):
__name__ = 'product.product'
......
......@@ -28,5 +28,5 @@
<field name="global_p" eval="False"/>
<field name="perm_read" eval="False"/>
</record>
<record model="ir.rule.group-res.group" id="rule_group_category_accounting-account_admin">
<record model="ir.rule.group-res.group" id="rule_group_category_account-account_product_admin">
<field name="rule_group" ref="rule_group_category_accounting"/>
......@@ -32,5 +32,5 @@
<field name="rule_group" ref="rule_group_category_accounting"/>
<field name="group" ref="account.group_account_admin"/>
<field name="group" ref="group_account_product_admin"/>
</record>
<record model="ir.rule" id="rule_category_accounting_accounting">
<field name="domain" eval="[('accounting', '=', True)]" pyson="1"/>
......@@ -49,5 +49,16 @@
<field name="name">template_tree</field>
</record>
<record model="ir.model.field.access" id="access_template_account_category">
<field name="field" search="[('model.model', '=', 'product.template'), ('name', '=', 'account_category')]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
</record>
<record model="ir.model.field.access" id="access_template_account_category_account_product_admin">
<field name="field" search="[('model.model', '=', 'product.template'), ('name', '=', 'account_category')]"/>
<field name="group" ref="group_account_product_admin"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
</record>
</data>
</tryton>
......@@ -8,5 +8,6 @@
extras_depend:
analytic_account
xml:
account.xml
product.xml
configuration.xml
......@@ -11,5 +12,4 @@
product.xml
configuration.xml
account.xml
message.xml
analytic_account.xml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment