You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
621 B
22 lines
621 B
# Copyright 2020 Coop IT Easy SCRL fs
|
|
# Robin Keunen <robin@coopiteasy.be>
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
|
|
|
from odoo import api, fields, models
|
|
|
|
|
|
class AccountInvoice(models.Model):
|
|
_inherit = "account.invoice"
|
|
|
|
external_id = fields.Integer(
|
|
string="External ID", index=True, required=False
|
|
)
|
|
|
|
@api.multi
|
|
def get_external_id(self):
|
|
self.ensure_one()
|
|
if not self.external_id:
|
|
self.external_id = self.env["ir.sequence"].next_by_code(
|
|
"account.invoice.external.id"
|
|
)
|
|
return self.external_id
|