Browse Source

Jan 30 [UPDT] : Bug Fixed 'stock_move_invoice'

pull/259/head
AjmalCybro 2 years ago
parent
commit
93a7aafe46
  1. 2
      stock_move_invoice/__manifest__.py
  2. 104
      stock_move_invoice/models/stock_picking.py

2
stock_move_invoice/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': "Invoice From Stock Picking", 'name': "Invoice From Stock Picking",
'version': '13.0.1.0.0', 'version': '13.0.1.0.1',
'summary': """In this module creating customer invoice,vendor bill, customer 'summary': """In this module creating customer invoice,vendor bill, customer
credit note and refund from stock picking""", credit note and refund from stock picking""",
'description': """In this module creating customer invoice,vendor bill, customer 'description': """In this module creating customer invoice,vendor bill, customer

104
stock_move_invoice/models/stock_picking.py

@ -60,19 +60,19 @@ class StockPicking(models.Model):
'quantity': move_ids_without_package.quantity_done, 'quantity': move_ids_without_package.quantity_done,
}) })
invoice_line_list.append(vals) invoice_line_list.append(vals)
invoice = picking_id.env['account.move'].create({ invoice = picking_id.env['account.move'].create({
'type': 'out_invoice', 'type': 'out_invoice',
'invoice_origin': picking_id.name, 'invoice_origin': picking_id.name,
'invoice_user_id': current_user, 'invoice_user_id': current_user,
'narration': picking_id.name, 'narration': picking_id.name,
'partner_id': picking_id.partner_id.id, 'partner_id': picking_id.partner_id.id,
'currency_id': picking_id.env.user.company_id.currency_id.id, 'currency_id': picking_id.env.user.company_id.currency_id.id,
'journal_id': int(customer_journal_id), 'journal_id': int(customer_journal_id),
'invoice_payment_ref': picking_id.name, 'invoice_payment_ref': picking_id.name,
'picking_id': picking_id.id, 'picking_id': picking_id.id,
'invoice_line_ids': invoice_line_list 'invoice_line_ids': invoice_line_list
}) })
return invoice return invoice
def create_bill(self): def create_bill(self):
"""This is the function for creating vendor bill """This is the function for creating vendor bill
@ -96,19 +96,19 @@ class StockPicking(models.Model):
'quantity': move_ids_without_package.quantity_done, 'quantity': move_ids_without_package.quantity_done,
}) })
invoice_line_list.append(vals) invoice_line_list.append(vals)
invoice = picking_id.env['account.move'].create({ invoice = picking_id.env['account.move'].create({
'type': 'in_invoice', 'type': 'in_invoice',
'invoice_origin': picking_id.name, 'invoice_origin': picking_id.name,
'invoice_user_id': current_user, 'invoice_user_id': current_user,
'narration': picking_id.name, 'narration': picking_id.name,
'partner_id': picking_id.partner_id.id, 'partner_id': picking_id.partner_id.id,
'currency_id': picking_id.env.user.company_id.currency_id.id, 'currency_id': picking_id.env.user.company_id.currency_id.id,
'journal_id': int(vendor_journal_id), 'journal_id': int(vendor_journal_id),
'invoice_payment_ref': picking_id.name, 'invoice_payment_ref': picking_id.name,
'picking_id': picking_id.id, 'picking_id': picking_id.id,
'invoice_line_ids': invoice_line_list 'invoice_line_ids': invoice_line_list
}) })
return invoice return invoice
def create_customer_credit(self): def create_customer_credit(self):
"""This is the function for creating customer credit note """This is the function for creating customer credit note
@ -132,19 +132,19 @@ class StockPicking(models.Model):
'quantity': move_ids_without_package.quantity_done, 'quantity': move_ids_without_package.quantity_done,
}) })
invoice_line_list.append(vals) invoice_line_list.append(vals)
invoice = picking_id.env['account.move'].create({ invoice = picking_id.env['account.move'].create({
'type': 'out_refund', 'type': 'out_refund',
'invoice_origin': picking_id.name, 'invoice_origin': picking_id.name,
'invoice_user_id': current_user, 'invoice_user_id': current_user,
'narration': picking_id.name, 'narration': picking_id.name,
'partner_id': picking_id.partner_id.id, 'partner_id': picking_id.partner_id.id,
'currency_id': picking_id.env.user.company_id.currency_id.id, 'currency_id': picking_id.env.user.company_id.currency_id.id,
'journal_id': int(customer_journal_id), 'journal_id': int(customer_journal_id),
'invoice_payment_ref': picking_id.name, 'invoice_payment_ref': picking_id.name,
'picking_id': picking_id.id, 'picking_id': picking_id.id,
'invoice_line_ids': invoice_line_list 'invoice_line_ids': invoice_line_list
}) })
return invoice return invoice
def create_vendor_credit(self): def create_vendor_credit(self):
"""This is the function for creating refund """This is the function for creating refund
@ -168,19 +168,19 @@ class StockPicking(models.Model):
'quantity': move_ids_without_package.quantity_done, 'quantity': move_ids_without_package.quantity_done,
}) })
invoice_line_list.append(vals) invoice_line_list.append(vals)
invoice = picking_id.env['account.move'].create({ invoice = picking_id.env['account.move'].create({
'type': 'in_refund', 'type': 'in_refund',
'invoice_origin': picking_id.name, 'invoice_origin': picking_id.name,
'invoice_user_id': current_user, 'invoice_user_id': current_user,
'narration': picking_id.name, 'narration': picking_id.name,
'partner_id': picking_id.partner_id.id, 'partner_id': picking_id.partner_id.id,
'currency_id': picking_id.env.user.company_id.currency_id.id, 'currency_id': picking_id.env.user.company_id.currency_id.id,
'journal_id': int(vendor_journal_id), 'journal_id': int(vendor_journal_id),
'invoice_payment_ref': picking_id.name, 'invoice_payment_ref': picking_id.name,
'picking_id': picking_id.id, 'picking_id': picking_id.id,
'invoice_line_ids': invoice_line_list 'invoice_line_ids': invoice_line_list
}) })
return invoice return invoice
def action_open_picking_invoice(self): def action_open_picking_invoice(self):
"""This is the function of the smart button which redirect to the """This is the function of the smart button which redirect to the

Loading…
Cancel
Save