[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:
parent
88dfee7df4
commit
50f3280aa0
|
@ -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()
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<separator string="Accounting Stock Properties" colspan="2"/>
|
||||
<field name="property_stock_account_input_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="property_stock_account_output_categ" domain="[('type','<>','view'),('type','<>','consolidation')]"/>
|
||||
<field name="property_stock_valuation_account_id"/>
|
||||
<field name="property_stock_valuation_account_id" domain="[('type','<>','view')]"/>
|
||||
<field name="property_stock_journal"/>
|
||||
</group>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue