diff --git a/invoice_stock_move/__manifest__.py b/invoice_stock_move/__manifest__.py index ae38627fe..9fe9967f0 100644 --- a/invoice_stock_move/__manifest__.py +++ b/invoice_stock_move/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': "Stock Picking From Invoice", - 'version': '13.0.1.1.2', + 'version': '13.0.1.2.3', 'summary': """Stock Picking From Customer/Supplier Invoice""", 'description': """This Module Enables To Create Stocks Picking From Customer/Supplier Invoice""", 'author': "Cybrosys Techno Solutions", diff --git a/invoice_stock_move/doc/RELEASE_NOTES.md b/invoice_stock_move/doc/RELEASE_NOTES.md index 94ae2fcce..3a893dbb3 100644 --- a/invoice_stock_move/doc/RELEASE_NOTES.md +++ b/invoice_stock_move/doc/RELEASE_NOTES.md @@ -17,3 +17,9 @@ Delivery and Receipts Bug fixed. #### FIX Bug fixed. + +#### 20.02.2020 +#### Version 13.0.1.2.3 +#### FIX + +Invoice Post Bug fixed. diff --git a/invoice_stock_move/models/invoice_stock.py b/invoice_stock_move/models/invoice_stock.py index a6a74fd1f..5c9d67f5f 100644 --- a/invoice_stock_move/models/invoice_stock.py +++ b/invoice_stock_move/models/invoice_stock.py @@ -57,25 +57,29 @@ class InvoiceStockMove(models.Model): track_visibility='onchange', copy=False) def action_stock_move(self): + if not self.picking_type_id: + raise UserError(_( + " Please select a picking type")) for order in self: if not self.invoice_picking_id: - if self.picking_type_id.code =='outgoing': - pick = { - 'picking_type_id': self.picking_type_id.id, - 'partner_id': self.partner_id.id, - 'origin': self.name, - 'location_dest_id': self.partner_id.property_stock_customer.id, - 'location_id': self.picking_type_id.default_location_src_id.id - } - - if self.picking_type_id.code =='incoming': - pick = { - 'picking_type_id': self.picking_type_id.id, - 'partner_id': self.partner_id.id, - 'origin': self.name, - 'location_dest_id': self.picking_type_id.default_location_dest_id.id, - 'location_id': self.partner_id.property_stock_supplier.id - } + pick = {} + if self.picking_type_id.code == 'outgoing': + pick = { + 'picking_type_id': self.picking_type_id.id, + 'partner_id': self.partner_id.id, + 'origin': self.name, + 'location_dest_id': self.partner_id.property_stock_customer.id, + 'location_id': self.picking_type_id.default_location_src_id.id + } + + if self.picking_type_id.code == 'incoming': + pick = { + 'picking_type_id': self.picking_type_id.id, + 'partner_id': self.partner_id.id, + 'origin': self.name, + 'location_dest_id': self.picking_type_id.default_location_dest_id.id, + 'location_id': self.partner_id.property_stock_supplier.id + } picking = self.env['stock.picking'].create(pick) self.invoice_picking_id = picking.id self.picking_count = len(picking) @@ -97,13 +101,6 @@ class InvoiceStockMove(models.Model): result['res_id'] = pick_ids or False return result - def action_post(self): - if not self.picking_type_id : - raise UserError(_( - " Please select a picking type")) - res = super(InvoiceStockMove, self).action_post() - return res - def _reverse_moves(self, default_values_list=None, cancel=False): ''' Reverse a recordset of account.move. If cancel parameter is true, the reconcilable or liquidity lines diff --git a/invoice_stock_move/views/invoice_stock_move_view.xml b/invoice_stock_move/views/invoice_stock_move_view.xml index 5dcb03cec..214d9a5e2 100644 --- a/invoice_stock_move/views/invoice_stock_move_view.xml +++ b/invoice_stock_move/views/invoice_stock_move_view.xml @@ -15,16 +15,14 @@ - -
- -
+ +