Browse Source

[FIX] Bug Fixed 'invoice_stock_move'

pull/145/head
Ajmal JK 5 years ago
parent
commit
0bc479142c
  1. 2
      invoice_stock_move/__manifest__.py
  2. 6
      invoice_stock_move/doc/RELEASE_NOTES.md
  3. 45
      invoice_stock_move/models/invoice_stock.py
  4. 18
      invoice_stock_move/views/invoice_stock_move_view.xml

2
invoice_stock_move/__manifest__.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
{ {
'name': "Stock Picking From Invoice", 'name': "Stock Picking From Invoice",
'version': '13.0.1.1.2', 'version': '13.0.1.2.3',
'summary': """Stock Picking From Customer/Supplier Invoice""", 'summary': """Stock Picking From Customer/Supplier Invoice""",
'description': """This Module Enables To Create Stocks Picking From Customer/Supplier Invoice""", 'description': """This Module Enables To Create Stocks Picking From Customer/Supplier Invoice""",
'author': "Cybrosys Techno Solutions", 'author': "Cybrosys Techno Solutions",

6
invoice_stock_move/doc/RELEASE_NOTES.md

@ -17,3 +17,9 @@ Delivery and Receipts Bug fixed.
#### FIX #### FIX
Bug fixed. Bug fixed.
#### 20.02.2020
#### Version 13.0.1.2.3
#### FIX
Invoice Post Bug fixed.

45
invoice_stock_move/models/invoice_stock.py

@ -57,25 +57,29 @@ class InvoiceStockMove(models.Model):
track_visibility='onchange', copy=False) track_visibility='onchange', copy=False)
def action_stock_move(self): def action_stock_move(self):
if not self.picking_type_id:
raise UserError(_(
" Please select a picking type"))
for order in self: for order in self:
if not self.invoice_picking_id: if not self.invoice_picking_id:
if self.picking_type_id.code =='outgoing': pick = {}
pick = { if self.picking_type_id.code == 'outgoing':
'picking_type_id': self.picking_type_id.id, pick = {
'partner_id': self.partner_id.id, 'picking_type_id': self.picking_type_id.id,
'origin': self.name, 'partner_id': self.partner_id.id,
'location_dest_id': self.partner_id.property_stock_customer.id, 'origin': self.name,
'location_id': self.picking_type_id.default_location_src_id.id '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 = { if self.picking_type_id.code == 'incoming':
'picking_type_id': self.picking_type_id.id, pick = {
'partner_id': self.partner_id.id, 'picking_type_id': self.picking_type_id.id,
'origin': self.name, 'partner_id': self.partner_id.id,
'location_dest_id': self.picking_type_id.default_location_dest_id.id, 'origin': self.name,
'location_id': self.partner_id.property_stock_supplier.id '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) picking = self.env['stock.picking'].create(pick)
self.invoice_picking_id = picking.id self.invoice_picking_id = picking.id
self.picking_count = len(picking) self.picking_count = len(picking)
@ -97,13 +101,6 @@ class InvoiceStockMove(models.Model):
result['res_id'] = pick_ids or False result['res_id'] = pick_ids or False
return result 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): def _reverse_moves(self, default_values_list=None, cancel=False):
''' Reverse a recordset of account.move. ''' Reverse a recordset of account.move.
If cancel parameter is true, the reconcilable or liquidity lines If cancel parameter is true, the reconcilable or liquidity lines

18
invoice_stock_move/views/invoice_stock_move_view.xml

@ -15,16 +15,14 @@
<field name="picking_type_id"/> <field name="picking_type_id"/>
<field name="invoice_picking_id" invisible="1"/> <field name="invoice_picking_id" invisible="1"/>
</xpath> </xpath>
<xpath expr="//field[@name='name']" position="before"> <xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<div class="oe_button_box" name="button_box"> <button type="object"
<button type="object" name="action_view_picking" states="open,paid"
name="action_view_picking" states="open,paid" class="oe_stat_button"
class="oe_stat_button" attrs="{'invisible':['|',('state','=','draft'),('picking_count', '&lt;', 1)]}"
attrs="{'invisible':['|',('state','=','draft'),('picking_count', '&lt;', 1)]}" icon="fa-truck">
icon="fa-truck"> <field name="picking_count" string="Shipment" widget="statinfo"/>
<field name="picking_count" string="Shipment" widget="statinfo"/> </button>
</button>
</div>
</xpath> </xpath>
</field> </field>
</record> </record>

Loading…
Cancel
Save