[FIX] survey : random question count not editable
We can't edit the random question count field from the survey form (in list widget). Change the function which compute the colspan of a field (during edition). TASK_ID : 2075216 closes odoo/odoo#39549 X-original-commit: 61d61348d3e5abf852edb692bb412f177ae5e167 Signed-off-by: ryv-odoo <ryv-odoo@users.noreply.github.com> Co-authored-by: Michaël Mattiello <mcm@odoo.com>
This commit is contained in:
committed by
fw-bot
co-authored by
Michaël Mattiello
parent
5074430bfb
commit
4ed2bd4abf
@@ -37,7 +37,7 @@ var SectionListRenderer = ListRenderer.extend({
|
||||
var isSection = record.data[this.sectionFieldName];
|
||||
|
||||
if (isSection){
|
||||
if (node.attrs.widget === "handle"){
|
||||
if (node.attrs.widget === "handle" || node.attrs.name === "random_questions_count"){
|
||||
return $cell;
|
||||
} else if (node.attrs.name === "title"){
|
||||
var nbrColumns = this._getNumberOfCols();
|
||||
@@ -47,6 +47,9 @@ var SectionListRenderer = ListRenderer.extend({
|
||||
if (this.addTrashIcon){
|
||||
nbrColumns--;
|
||||
}
|
||||
if (record.data.questions_selection === "random"){
|
||||
nbrColumns--;
|
||||
}
|
||||
$cell.attr('colspan', nbrColumns);
|
||||
} else {
|
||||
$cell.removeClass('o_invisible_modifier');
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<separator />
|
||||
<field name="questions_selection" invisible="1"/>
|
||||
</div>
|
||||
<group attrs="{'invisible': ['|', ('is_page', '=', False), ('questions_selection', '=', 'all')]}">
|
||||
<group class="o_label_nowrap" attrs="{'invisible': ['|', ('is_page', '=', False), ('questions_selection', '=', 'all')]}">
|
||||
<field name="random_questions_count"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('is_page', '=', True)]}">
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<tree decoration-bf="is_page" editable="bottom">
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="title"/>
|
||||
<field name="question_type" attrs="{'invisible': [('is_page', '=', True)]}"/>
|
||||
<field name="question_type" />
|
||||
<field name="is_page" invisible="1"/>
|
||||
<field name="questions_selection" invisible="1"/>
|
||||
<field name="random_questions_count" attrs="{'column_invisible': [('parent.questions_selection', '=', 'all')], 'invisible': [('is_page', '=', False)]}" />
|
||||
|
||||
Reference in New Issue
Block a user