Skip to content
Snippets Groups Projects
Unverified Commit 5de5953a authored by Andrea Stirpe's avatar Andrea Stirpe Committed by Martin Trigaux
Browse files

[FIX] account_asset: domain in multicompany

In a multicompany environment, an user who has access to multiple companies is
able to select accounts and analytic accounts of multiple companies. This can
easily lead to mistakes in the definition of the asset category.

With this commit the user can only read/select accounts and analytic accounts
belonging to the company already set in the asset category.

This is what is already done in most invoice or other accounting views

Closes #26578
parent 9c7043d2
Branches
Tags
No related merge requests found
......@@ -28,18 +28,18 @@
<label for="account_asset_id" attrs="{'invisible': [('type','!=','purchase')]}"/>
<label for="account_asset_id" string="Deferred Revenue Account" attrs="{'invisible': [('type','!=','sale')]}"/>
</div>
<field name="account_asset_id" nolabel="1" attrs="{'invisible': [('type','=', False)]}"/>
<field name="account_asset_id" nolabel="1" attrs="{'invisible': [('type','=', False)]}" domain="[('company_id', '=', company_id)]"/>
<div>
<label for="account_depreciation_id" attrs="{'invisible': [('type','!=','purchase')]}"/>
<label for="account_depreciation_id" string="Recognition Income Account" attrs="{'invisible': [('type','!=','sale')]}"/>
</div>
<field name="account_depreciation_id" nolabel="1"/>
<field name="account_depreciation_id" nolabel="1" domain="[('company_id', '=', company_id)]"/>
<div>
<label for="account_depreciation_expense_id" attrs="{'invisible': [('type','!=','purchase')]}"/>
<label for="account_depreciation_expense_id" string="Recognition Account" attrs="{'invisible': [('type','!=','sale')]}"/>
</div>
<field name="account_depreciation_expense_id" nolabel="1"/>
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<field name="account_depreciation_expense_id" nolabel="1" domain="[('company_id', '=', company_id)]"/>
<field name="account_analytic_id" domain="[('company_id', '=', company_id)]" groups="analytic.group_analytic_accounting"/>
</group>
<group string="Periodicity">
<field name="method_time" string="Time Method Based On" widget="radio" attrs="{'invisible': [('type','!=','purchase')]}"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment