diff options
| author | Jagdish Panchal (Open ERP) <jap@tinyerp.com> | 2011-12-16 11:24:55 +0530 |
|---|---|---|
| committer | Jagdish Panchal (Open ERP) <jap@tinyerp.com> | 2011-12-16 11:24:55 +0530 |
| commit | 50f3280aa05cbc155cbb8a402e0cdbfaeceb7a4a (patch) | |
| tree | 8aa432c9227bbaf8a3428c45e37448fddeac8904 /addons/analytic | |
| parent | 88dfee7df4bb2a392fa97635a6e817e44c8277c6 (diff) | |
[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
Diffstat (limited to 'addons/analytic')
| -rw-r--r-- | addons/analytic/analytic.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 2ecaeee0f15..ee541e3cef1 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -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() |
