[IMP] Make sure we can do dropship where the purchase is invoiced on incoming shipments
authorJosse Colpaert <jco@odoo.com>
Fri, 22 Aug 2014 12:20:34 +0000 (14:20 +0200)
committerJosse Colpaert <jco@odoo.com>
Wed, 3 Sep 2014 17:18:16 +0000 (19:18 +0200)
addons/purchase/purchase.py
addons/stock_dropshipping/__init__.py
addons/stock_dropshipping/wizard/stock_invoice_onshipping.py

index 99efd15..fb2a40d 100644 (file)
@@ -740,7 +740,7 @@ class purchase_order(osv.osv):
                 'move_dest_id': procurement.move_dest_id.id,  #move destination is same as procurement destination
                 'group_id': procurement.group_id.id or group_id,  #move group is same as group of procurements if it exists, otherwise take another group
                 'procurement_id': procurement.id,
-                'invoice_state': procurement.rule_id.invoice_state or (procurement.location_id and procurement.location_id.usage == 'customer' and procurement.invoice_state) or (order.invoice_method == 'picking' and '2binvoiced') or 'none', #dropship case takes from sale
+                'invoice_state': procurement.rule_id.invoice_state or (procurement.location_id and procurement.location_id.usage == 'customer' and procurement.invoice_state=='picking' and '2binvoiced') or (order.invoice_method == 'picking' and '2binvoiced') or 'none', #dropship case takes from sale
             })
             diff_quantity -= min(procurement_qty, diff_quantity)
             res.append(tmp)
index 1529644..0da169d 100644 (file)
@@ -18,6 +18,6 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
+import wizard
 
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index f377463..6d0a7fc 100644 (file)
@@ -38,4 +38,9 @@ class stock_invoice_onshipping(osv.osv_memory):
         if pick.picking_type_id.code == 'outgoing' and src_usage == 'supplier' and dest_usage == 'customer' and pick_purchase:
             return 'purchase'
         else:
-            return super(stock_invoice_onshipping, self)._get_journal_type(cr, uid, context=context)
\ No newline at end of file
+            return super(stock_invoice_onshipping, self)._get_journal_type(cr, uid, context=context)
+        
+        
+    _defaults = {
+        'journal_type': _get_journal_type,
+        }
\ No newline at end of file