# -*- encoding: utf-8 -*-
###############################################################################
#                                                                             #
# Copyright (C) 2009  Renato Lima - Akretion                                  #
# Copyright (C) 2012  Raphaël Valyi - Akretion                                #
#                                                                             #
#This program is free software: you can redistribute it and/or modify         #
#it under the terms of the GNU Affero General Public License as published by  #
#the Free Software Foundation, either version 3 of the License, or            #
#(at your option) any later version.                                          #
#                                                                             #
#This program is distributed in the hope that it will be useful,              #
#but WITHOUT ANY WARRANTY; without even the implied warranty of               #
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
#GNU Affero General Public License for more details.                          #
#                                                                             #
#You should have received a copy of the GNU Affero General Public License     #
#along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
###############################################################################

from openerp.osv import orm


class sale_order(orm.Model):
    _inherit = 'sale.order'

    def _prepare_order_picking(self, cr, uid, order, context=None):
        result = super(sale_order, self)._prepare_order_picking(
            cr, uid, order, context)
        result['fiscal_category_id'] = order.fiscal_category_id and \
        order.fiscal_category_id.id
        result['fiscal_position'] = order.fiscal_position and \
        order.fiscal_position.id
        return result

@@ -1476,20 +1476,16 @@
 nerp
-.osv
  import 
 orm%0A
@@ -1480,19 +1480,22 @@
  import 
-orm
+models
 %0A%0A%0Aclass
@@ -1499,22 +1499,24 @@
 ass 
-sale_o
+SaleO
 rder(
-orm
+models
 .Mod
@@ -1549,16 +1549,46 @@
 order'%0A%0A
+    # TODO migrate to new API%0A
     def 
@@ -1674,14 +1674,13 @@
 per(
-sale_o
+SaleO
 rder
@@ -1685,16 +1685,23 @@
 er, self
+._model
 )._prepa
@@ -1797,47 +1797,8 @@
 '%5D =
- order.fiscal_category_id and %5C%0A       
  ord
@@ -1861,44 +1861,8 @@
 '%5D =
- order.fiscal_position and %5C%0A       
  ord

migrate stock objects and view to new API