Jagdish Panchal (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-902440-jap into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #902440 in OpenERP Addons: "product & product category - accounts must 
not be views"
  https://bugs.launchpad.net/openobject-addons/+bug/902440

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-902440-jap/+merge/86013

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
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-902440-jap/+merge/86013
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-902440-jap.
=== modified file 'analytic/analytic.py'
--- analytic/analytic.py	2011-12-08 15:26:58 +0000
+++ analytic/analytic.py	2011-12-16 09:34:31 +0000
@@ -301,6 +301,17 @@
     }
 
     _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()
 

=== modified file 'stock/product_view.xml'
--- stock/product_view.xml	2011-12-11 09:14:42 +0000
+++ stock/product_view.xml	2011-12-16 09:34:31 +0000
@@ -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>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to