fix: buttons editable logic for all scenarios & hide code badge

**Buttons logic:**
- New record: editable
- Draft + edit mode: editable
- Draft + readonly: readonly
- Non-draft + any mode: readonly

**Code badge:**
- Hidden (commented out)

Synced with dev_odex25_ensan on Wed Nov 12 05:32:47 +03 2025
This commit is contained in:
Mohamed Eltayar 2025-11-12 05:32:47 +03:00
parent 7f9dd8e140
commit 53adaf8c96
2 changed files with 6 additions and 3 deletions

View File

@ -207,8 +207,10 @@
var self = this;
var currentData = self.model.localData[self.handle].data;
var isNewRecord = !currentData.id;
var isDraftState = currentData.state === 'draft';
var isEditable = isDraftState;
var isEditMode = self.mode === 'edit';
var isEditable = isNewRecord || (isDraftState && isEditMode);
// Remove old event handlers to prevent duplicates
this.$('.record_option').off('click');

View File

@ -84,11 +84,12 @@
<!-- </button>-->
</div>
<div style="position: absolute; top: 70px; right: 15px; z-index: 100;" attrs="{'invisible': [('code', '=', False)]}">
<!-- Code badge hidden for now -->
<!-- <div style="position: absolute; top: 70px; right: 15px; z-index: 100;" attrs="{'invisible': [('code', '=', False)]}">
<span class="badge badge-info" style="font-size: 14px; padding: 6px 12px;">
<i class="fa fa-barcode"/> <field name="code" nolabel="1" readonly="1"/>
</span>
</div>
</div> -->
<!-- Record Type Selection - Simple & Clean Design -->
<div class="o_record_type_simple">