mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-17 18:29:08 +02:00
22 lines
742 B
Python
22 lines
742 B
Python
from odoo import api, fields, models, _
|
|
|
|
class SaleOrder(models.Model):
|
|
_inherit = 'sale.order'
|
|
_description = 'Sale Order'
|
|
|
|
intercompany_transfer_id = fields.Many2one('inter.company.transfer.ept', string="ICT", copy=False)
|
|
|
|
|
|
"""
|
|
This Method is used to invoice journal issue when it is creating time(as breadcrumb)
|
|
"""
|
|
|
|
def _prepare_invoice(self):
|
|
if self.intercompany_transfer_id:
|
|
journal_id = self.env['account.move'].default_get(['journal_id'])['journal_id']
|
|
vals = super(SaleOrder, self.with_context({'journal_id':journal_id}))._prepare_invoice()
|
|
return vals
|
|
else:
|
|
vals = super(SaleOrder, self)._prepare_invoice()
|
|
return vals
|