Skip to content

Commit 663c35f

Browse files
committed
[FIX] argocd.application.get_value
1 parent 9f26dbd commit 663c35f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

argocd_deployer/models/application.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import jinja2
55
from git import Repo
66

7-
from odoo import _, api, fields, models
7+
from odoo import Command, _, api, fields, models
88
from odoo.exceptions import ValidationError
99
from odoo.tools.safe_eval import safe_eval
1010

@@ -61,7 +61,10 @@ class Application(models.Model):
6161
def get_value(self, key, default=""):
6262
self.ensure_one()
6363
kv_pair = self.value_ids.filtered(lambda v: v.key == key)
64-
return kv_pair and kv_pair.value or default
64+
if kv_pair:
65+
return kv_pair.value
66+
self.value_ids = [Command.create({"key": key, "value": default})]
67+
return default
6568

6669
def has_tag(self, key):
6770
self.ensure_one()

0 commit comments

Comments
 (0)