Merge lp:~openerp-dev/openobject-addons/trunk-bug-902440-jap into lp:openobject-addons

Proposed by Jagdish Panchal (Open ERP)
Status: Merged
Merged at revision: 6048
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-902440-jap
Merge into: lp:openobject-addons
Diff against target: 34 lines (+12/-1)
2 files modified
analytic/analytic.py (+11/-0)
stock/product_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-902440-jap
Reviewer Review Type Date Requested Status
Meera Trambadia (OpenERP) (community) Approve
Jagdish Panchal (Open ERP) (community) Needs Resubmitting
OpenERP Core Team Pending
Review via email: mp+86013@code.launchpad.net

Description of the change

Hello,

 Add constraint for view type account in account_analytic_line.py and Put the domain on stock valuation account in product category form. --fixes=lp:902440

Thanks
JAP

To post a comment you must log in.
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) wrote :

Hello jagdish,

Also add the domain ('type','<>','consolidation') for stock valuation account.

Thanks,
Meera

review: Needs Fixing
Revision history for this message
Jagdish Panchal (Open ERP) (jap-openerp) wrote :

Hello,

Improve code as per your suggestion.

Thanks
JAP

review: Needs Resubmitting
Revision history for this message
Meera Trambadia (OpenERP) (mtr-openerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'analytic/analytic.py'
2--- analytic/analytic.py 2011-12-08 15:26:58 +0000
3+++ analytic/analytic.py 2011-12-19 08:43:29 +0000
4@@ -301,6 +301,17 @@
5 }
6
7 _order = 'date desc'
8+
9+ def _check_no_view(self, cr, uid, ids, context=None):
10+ analytic_lines = self.browse(cr, uid, ids, context=context)
11+ for line in analytic_lines:
12+ if line.account_id.type == 'view':
13+ return False
14+ return True
15+
16+ _constraints = [
17+ (_check_no_view, 'You can not create analytic line on view account.', ['account_id']),
18+ ]
19
20 account_analytic_line()
21
22
23=== modified file 'stock/product_view.xml'
24--- stock/product_view.xml 2011-12-11 09:14:42 +0000
25+++ stock/product_view.xml 2011-12-19 08:43:29 +0000
26@@ -27,7 +27,7 @@
27 <separator string="Accounting Stock Properties" colspan="2"/>
28 <field name="property_stock_account_input_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
29 <field name="property_stock_account_output_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
30- <field name="property_stock_valuation_account_id"/>
31+ <field name="property_stock_valuation_account_id" domain="[('type','&lt;&gt;','view'), ('type','&lt;&gt;','consolidation')]"/>
32 <field name="property_stock_journal"/>
33 </group>
34 </form>

Subscribers

People subscribed via source and target branches

to all changes: