[FIX] account_analytic_line: add constraint for view type account and Put the domain on stock valuation account in product category form.

lp bug: https://launchpad.net/bugs/902440 fixed

bzr revid: jap@tinyerp.com-20111216055455-ewzx2kjhazojlzv4
This commit is contained in:
Jagdish Panchal (Open ERP) 2011-12-16 11:24:55 +05:30
parent 88dfee7df4
commit 50f3280aa0
2 changed files with 12 additions and 1 deletions

View File

@ -301,6 +301,17 @@ class account_analytic_line(osv.osv):
}
_order = 'date desc'
def _check_no_view(self, cr, uid, ids, context=None):
analytic_lines = self.browse(cr, uid, ids, context=context)
for line in analytic_lines:
if line.account_id.type == 'view':
return False
return True
_constraints = [
(_check_no_view, 'You can not create analytic line on view account.', ['account_id']),
]
account_analytic_line()

View File

@ -27,7 +27,7 @@
<separator string="Accounting Stock Properties" colspan="2"/>
<field name="property_stock_account_input_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="property_stock_account_output_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="property_stock_valuation_account_id"/>
<field name="property_stock_valuation_account_id" domain="[('type','&lt;&gt;','view')]"/>
<field name="property_stock_journal"/>
</group>
</form>