[FIX] stock_account: account_id should be required only if valuation is real

Unable to get stock inventoy report for a product if inventory valuation is
manual. Because account_id was required on model. Changed it, now account_id
will be required only if valuation is real time.

Fixes-2279412

closes odoo/odoo#53704

X-original-commit: 6b8a85b25586358383e14ca2980cc69d6d5475a9
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Pratima Gupta
2020-06-26 00:55:45 +00:00
parent 8e5caea148
commit 5a30919826
2 changed files with 2 additions and 2 deletions
@@ -40,7 +40,7 @@ class StockValuationLayerRevaluation(models.TransientModel):
reason = fields.Char("Reason", help="Reason of the revaluation")
account_journal_id = fields.Many2one('account.journal', "Journal", required=True, check_company=True)
account_id = fields.Many2one('account.account', "Counterpart Account", domain=[('deprecated', '=', False)], required=True, check_company=True)
account_id = fields.Many2one('account.account', "Counterpart Account", domain=[('deprecated', '=', False)], check_company=True)
date = fields.Date("Accounting Date")
@api.depends('current_value_svl', 'current_quantity_svl', 'added_value')
@@ -28,7 +28,7 @@
<field name="account_journal_id" attrs="{'invisible':[('property_valuation', '!=', 'real_time')]}"/>
</group>
<group>
<field name="account_id" attrs="{'invisible':[('property_valuation', '!=', 'real_time')]}"/>
<field name="account_id" attrs="{'invisible':[('property_valuation', '!=', 'real_time')], 'required': [('property_valuation', '=', 'real_time')]}"/>
<field name="date" attrs="{'invisible':[('property_valuation', '!=', 'real_time')]}"/>
</group>
</group>