Debian Codegraph @

addons/l10n_sg_ubl_pint/models/account_move.py

raw symbols SCIP
1 import uuid
2
3 from odoo import models
4
5
6 class AccountMove(models.Model):
7 _inherit = 'account.move'
8
9 def _l10n_sg_get_uuid(self):
10 """ SG Pint requires us to generate a uuid, to avoid storing a new field on the move,
11 we derive it from the dbuuid and the move id. """
12 self.ensure_one()
13 dbuuid = self.env['ir.config_parameter'].sudo().get_param('database.uuid')
14 guid = uuid.uuid5(namespace=uuid.UUID(dbuuid), name=str(self.id))
15 return str(guid)