Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
seda
Commits
40a0ca66bc1a
Commit
a765df70
authored
Mar 17, 2017
by
Sylvain Thénault
Browse files
[views] Attempt to display inherited rule if there is no rule defined at some level
Closes extranet #14593198
parent
bfe6130e62b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
cubicweb_seda/i18n/en.po
View file @
40a0ca66
...
...
@@ -4756,6 +4756,9 @@ msgstr ""
msgid "import_unit"
msgstr ""
msgid "inherited value"
msgstr ""
msgid "juridictional"
msgstr ""
...
...
cubicweb_seda/i18n/fr.po
View file @
40a0ca66
...
...
@@ -4775,6 +4775,9 @@ msgstr ""
msgid "import_unit"
msgstr "unité d'archive du référentiel"
msgid "inherited value"
msgstr "valeur héritée"
msgid "juridictional"
msgstr "juridication administrative"
...
...
cubicweb_seda/views/mgmt_rules.py
View file @
40a0ca66
...
...
@@ -23,7 +23,7 @@ from logilab.mtconverter import xml_escape
from
cubicweb.predicates
import
is_instance
from
cubicweb.web
import
INTERNAL_FIELD_VALUE
from
cubicweb.web.views
import
uicfg
from
cubicweb.web.views
import
reledit
,
uicfg
from
..entities
import
parent_and_container
,
rule_type_from_etype
from
.
import
viewlib
...
...
@@ -180,3 +180,18 @@ class ClassificationRuleComplexLinkEntityAttributeView(RuleComplexLinkEntityAttr
need_human
=
_
(
'without human intervention'
)
self
.
w
(
u
'<div>{0}</div>'
.
format
(
xml_escape
(
need_human
)))
super
(
ClassificationRuleComplexLinkEntityAttributeView
,
self
).
entity_call
(
entity
)
class
MgmtRuleAutoClickAndEditFormView
(
reledit
.
AutoClickAndEditFormView
):
__select__
=
(
reledit
.
AutoClickAndEditFormView
.
__select__
&
is_instance
(
'SEDASeqAltArchiveUnitArchiveUnitRefIdManagement'
))
def
_compute_default_value
(
self
,
rschema
,
role
):
if
rschema
.
type
.
endswith
(
'_rule'
):
rule_type
=
rschema
.
type
[
len
(
'seda_'
):
-
len
(
'_rule'
)]
rule
=
self
.
entity
.
inherited_rule
(
rule_type
)
if
rule
:
return
rule
.
view
(
'seda.reledit.text'
)
+
u
'<p><mark>{}</mark></p>'
.
format
(
self
.
_cw
.
_
(
u
'inherited value'
))
return
super
(
MgmtRuleAutoClickAndEditFormView
,
self
).
_compute_default_value
(
rschema
,
role
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment