Skip to content
Permalink
Browse files

[FIX] account, sale_timesheet: access rights when validating invoice

When validate an invoice, if the user is member of the timesheet user
group and the billing user group, it is forbidden to create an analytic
line without a project set. The previous commit (81218a8) allow the user
to create an analytic account line by adding a record rule in the
sale_timesheet module.

If only the account and timesheet modules' are installed, before this
commit, an error was raised when trying to validate an invoice in the
account module. This issue occurs because the record rule to allow the
user to create an analytic account line is found in sale_timesheet
module, and this one is not installed.
As an invoice can be validated without the need of the sales module's,
from the purchase module, or directly in the account module.
In this commit, the record rule was move to the account module.

opw-1948132

closes #31661

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
  • Loading branch information...
alt-odoo authored and jpp-odoo committed Mar 7, 2019
1 parent f1d0f2a commit 49eb24a46771792bec454f6c4693c19d2b5b05b6
@@ -59,6 +59,17 @@
<field name="category_id" ref="base.module_category_hidden"/>
</record>

<record id="account_analytic_line_rule_billing_user" model="ir.rule">
<field name="name">account.analytic.line.billing.user</field>
<field name="model_id" ref="analytic.model_account_analytic_line"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('account.group_account_invoice'))]"/>
<field name="perm_create" eval="1"/>
<field name="perm_write" eval="1"/>
<field name="perm_unlink" eval="1"/>
<field name="perm_read" eval="0"/>
</record>

</data>


@@ -3,17 +3,6 @@

<data noupdate="1">

<record id="account_analytic_line_rule_billing_user" model="ir.rule">
<field name="name">account.analytic.line.billing.user</field>
<field name="model_id" ref="analytic.model_account_analytic_line"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('account.group_account_invoice'))]"/>
<field name="perm_create" eval="1"/>
<field name="perm_write" eval="1"/>
<field name="perm_unlink" eval="1"/>
<field name="perm_read" eval="0"/>
</record>

<record id="sale_order_line_rule_project_manager" model="ir.rule">
<field name="name">Project Manager Sales Orders Line</field>
<field name="model_id" ref="sale.model_sale_order_line"/>

0 comments on commit 49eb24a

Please sign in to comment.
You can’t perform that action at this time.