diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-15 15:11:30 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2025-12-15 15:11:30 +0700 |
| commit | 274a067754ae67bc0f7f77c4c079aa2634b8000c (patch) | |
| tree | acbe717ab773ac3f79576b565565934093118e33 | |
| parent | 6ebf59cda9356890dfa3fe181ab4efc1194103e9 (diff) | |
<Miqdad> add clear button
| -rw-r--r-- | indoteknik_custom/models/keywords.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/views/keywords.xml | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/keywords.py b/indoteknik_custom/models/keywords.py index 495a42cc..3602be15 100644 --- a/indoteknik_custom/models/keywords.py +++ b/indoteknik_custom/models/keywords.py @@ -65,6 +65,10 @@ class Keywords(models.Model): # raise UserError("Tidak bisa create/write/duplicate karena keywords sudah dipakai") + def clear_products(self): + for record in self: + record.product_ids = [(5, 0, 0)] + def generate_products(self): for record in self: if not record.keywords: diff --git a/indoteknik_custom/views/keywords.xml b/indoteknik_custom/views/keywords.xml index 878952f8..6f1a675f 100644 --- a/indoteknik_custom/views/keywords.xml +++ b/indoteknik_custom/views/keywords.xml @@ -21,6 +21,7 @@ <form> <header> <button name="generate_products" string="Generate Product Manual" type="object" class="oe_highlight"/> + <button name="clear_products" string="Clear Generated Products" type="object" /> </header> <sheet> <div class="oe_title"> |
