do not erase barcode on 'no barcode present' checkbox

This commit is contained in:
leca 2024-11-11 17:06:40 +03:00
parent c6def13eb4
commit ec7062602d
1 changed files with 2 additions and 4 deletions

View File

@ -98,9 +98,7 @@ class AddAbstractProductActivity : AppCompatActivity() {
fillupUnitsSpinner()
noBarcodeCheckBox.setOnClickListener {
if (noBarcodeCheckBox.isChecked) {
barcodeText.setText("")
}
barcodeText.isEnabled = !noBarcodeCheckBox.isChecked
}
barcodeText.addTextChangedListener {
@ -165,7 +163,7 @@ class AddAbstractProductActivity : AppCompatActivity() {
abstractProduct = AbstractProduct(
if(abstractProduct == null) 0 else abstractProduct!!.id,
barcode,
if (noBarcodeCheckBox.isChecked) "" else barcode,
productName,
netWeight.toString().toDouble(),
pictureFile.nameWithoutExtension,