[l10n_br_stock] onchange_fiscal_operation_category_id nao acha regra que tem estado em branco

Bug #792586 reported by Raphaël Valyi - http://www.akretion.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Brazilian Portuguese Localization (pt_BR)
Fix Released
Medium
Renato Lima - http://www.akretion.com

Bug Description

Isso tb vale para os outros lugares que temos regras de mudança de posiçao fiscais:
se um estado nao é informado na regra e que nehnuma regra com o estado bate, entao tem que aplicar a regra generica sem estado especificado.

No caso tem que trabalhar em cima de patch parecido desse:

=== modified file 'l10n_br_stock/stock.py'
--- l10n_br_stock/stock.py 2011-05-31 02:11:50 +0000
+++ l10n_br_stock/stock.py 2011-06-03 21:35:09 +0000
@@ -104,6 +104,10 @@
         fsc_pos_id = self.pool.get('account.fiscal.position.rule').search(cr, uid, [('company_id','=',company_id), ('from_country','=',from_country),('from_state','=',from_state),('to_country','=',to_country),('to_state','=',to_state),('use_picking','=',True),('partner_fiscal_type_id','=',partner_fiscal_type),('fiscal_operation_category_id','=',fiscal_operation_category_id)])
         if not fsc_pos_id:
             fsc_pos_id = self.pool.get('account.fiscal.position.rule').search(cr, uid, [('company_id','=',company_id), ('from_country','=',from_country),('from_state','=',from_state),('to_country','=',to_country),('to_state','=',to_state),('use_picking','=',True),('fiscal_operation_category_id','=',fiscal_operation_category_id)])
+ if not fsc_pos_id:
+ fsc_pos_id = self.pool.get('account.fiscal.position.rule').search(cr, uid, [('company_id','=',company_id), ('from_country','=',from_country),('from_state','=',from_state),('to_country','=',to_country),('to_state','=',False),('use_picking','=',True),('fiscal_operation_category_id','=',fiscal_operation_category_id)])
+
+

         if fsc_pos_id:
             obj_fpo_rule = self.pool.get('account.fiscal.position.rule').browse(cr, uid, fsc_pos_id)[0]
@@ -175,4 +179,4 @@

         return super(stock_picking, self)._invoice_hook(cr, uid, picking, invoice_id)

-stock_picking()
\ No newline at end of file
+stock_picking()

Revision history for this message
Renato Lima - http://www.akretion.com (renatonlima) wrote :

Corrigido na revisão 189

Changed in openerp.pt-br-localiz:
status: New → Fix Released
assignee: nobody → Renato Lima - http://www.akretion.com (renatonlima)
milestone: none → inicial-0.0
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.