mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-18 16:12:08 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
from odoo import api, models
|
||||
|
||||
from ... import upgrade_log
|
||||
from ..odoo_patch import OdooPatch
|
||||
|
||||
|
||||
class BaseModelPatch(OdooPatch):
|
||||
target = models.BaseModel
|
||||
method_names = ["_convert_records"]
|
||||
|
||||
@api.model
|
||||
def _convert_records(self, records, log=lambda a: None):
|
||||
"""Log data ids that are imported with `load`"""
|
||||
current_module = self.env.context["module"]
|
||||
for res in BaseModelPatch._convert_records._original_method(
|
||||
self, records, log=log
|
||||
):
|
||||
_id, xid, _record, _info = res
|
||||
if xid:
|
||||
xid = xid if "." in xid else "{}.{}".format(current_module, xid)
|
||||
upgrade_log.log_xml_id(self.env.cr, current_module, xid)
|
||||
|
||||
yield res
|
||||
Loading…
Add table
Add a link
Reference in a new issue