summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-12-14 15:16:55 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-12-14 15:16:55 +0700
commitce2b8502ab85419096dda2bffaffbec4a096a99f (patch)
tree852dfc2e6a7a89c8a4a42daf8d89d662fe8d1b03
parenteabbbadc5114f6c1edb9ec6bb74a296477f02b5a (diff)
bug fix window multi update
-rw-r--r--indoteknik_custom/models/purchasing_job.py6
-rw-r--r--indoteknik_custom/models/purchasing_job_multi_update.py4
-rw-r--r--indoteknik_custom/views/purchasing_job.xml4
-rw-r--r--indoteknik_custom/views/purchasing_job_multi_update.xml4
4 files changed, 9 insertions, 9 deletions
diff --git a/indoteknik_custom/models/purchasing_job.py b/indoteknik_custom/models/purchasing_job.py
index c660b937..18235d47 100644
--- a/indoteknik_custom/models/purchasing_job.py
+++ b/indoteknik_custom/models/purchasing_job.py
@@ -30,7 +30,7 @@ class PurchasingJob(models.Model):
""" % self._table)
def open_form_multi_generate_request_po(self):
- action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_generate_request_po')
+ action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_purchasing_job_multi_update')
action['context'] = {
'product_ids': [x.id for x in self]
}
@@ -38,5 +38,5 @@ class PurchasingJob(models.Model):
def generate_request_po(self):
# print(1)
- for product in self:
- print(product)
+ for job in self:
+ print(job.product_id.name)
diff --git a/indoteknik_custom/models/purchasing_job_multi_update.py b/indoteknik_custom/models/purchasing_job_multi_update.py
index e455c5a4..c880980a 100644
--- a/indoteknik_custom/models/purchasing_job_multi_update.py
+++ b/indoteknik_custom/models/purchasing_job_multi_update.py
@@ -9,8 +9,8 @@ class PurchasingJobMultiUpdate(models.TransientModel):
def save_multi_update_purchasing_job(self):
product_ids = self._context['product_ids']
- product = self.env['product.product'].browse(product_ids)
- product.action_multi_update_invoice_status()
+ product = self.env['v.purchasing.job'].browse(product_ids)
+ product.generate_request_po()
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
diff --git a/indoteknik_custom/views/purchasing_job.xml b/indoteknik_custom/views/purchasing_job.xml
index 0af4455d..42dfd359 100644
--- a/indoteknik_custom/views/purchasing_job.xml
+++ b/indoteknik_custom/views/purchasing_job.xml
@@ -65,8 +65,8 @@
<record id="purchasing_job_multi_update_ir_actions_server" model="ir.actions.server">
<field name="name">Generate Automatic PO</field>
- <field name="model_id" ref="indoteknik_custom.v_purchasing_job_tree"/>
- <field name="binding_model_id" ref="indoteknik_custom.v_purchasing_job_tree"/>
+ <field name="model_id" ref="model_v_purchasing_job"/>
+ <field name="binding_model_id" ref="model_v_purchasing_job"/>
<field name="binding_view_types">form,list</field>
<field name="state">code</field>
<field name="code">action = records.open_form_multi_generate_request_po()</field>
diff --git a/indoteknik_custom/views/purchasing_job_multi_update.xml b/indoteknik_custom/views/purchasing_job_multi_update.xml
index 422d9e3c..79b935c7 100644
--- a/indoteknik_custom/views/purchasing_job_multi_update.xml
+++ b/indoteknik_custom/views/purchasing_job_multi_update.xml
@@ -8,11 +8,11 @@
<form>
<sheet>
<group>
- <span>Apakah Anda Yakin Ingin Mengubah Invoice Status?</span>
+ <span>Apakah Anda Yakin Ingin Create Automatic PO?</span>
</group>
</sheet>
<footer>
- <button name="save_multi_update_purchasing_job" string="Multi Update" type="object" default_focus="1" class="oe_highlight"/>
+ <button name="save_multi_update_purchasing_job" string="Create" type="object" default_focus="1" class="oe_highlight"/>
<button string="Cancel" class="btn btn-secondary" special="cancel" />
</footer>
</form>