diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-08-05 15:21:56 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-08-05 15:21:56 +0700 |
| commit | c42bdba2996d85d328897e42e7a1d86001b3a14d (patch) | |
| tree | 710efdc71f124f8509f053159bed5506d38f5ef4 | |
| parent | 2d7aaf7fe387dd778731a2058dbe3210407ad803 (diff) | |
multi update receipt date
| -rwxr-xr-x | indoteknik_custom/__manifest__.py | 1 | ||||
| -rwxr-xr-x | indoteknik_custom/models/__init__.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/update_date_planned_po_wizard.py | 14 | ||||
| -rwxr-xr-x | indoteknik_custom/security/ir.model.access.csv | 3 | ||||
| -rwxr-xr-x | indoteknik_custom/views/purchase_order.xml | 20 | ||||
| -rw-r--r-- | indoteknik_custom/views/update_date_planned_po_wizard_view.xml | 25 |
6 files changed, 63 insertions, 1 deletions
diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index 2a4db273..d1ae681a 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -174,6 +174,7 @@ # 'views/tukar_guling_return_views.xml' 'views/tukar_guling_po.xml', # 'views/refund_sale_order.xml', + 'views/update_date_planned_po_wizard_view.xml', ], 'demo': [], 'css': [], diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index 51d25c1f..3a9f9312 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -156,3 +156,4 @@ from . import refund_sale_order # from . import patch from . import tukar_guling from . import tukar_guling_po +from . import update_date_planned_po_wizard
\ No newline at end of file diff --git a/indoteknik_custom/models/update_date_planned_po_wizard.py b/indoteknik_custom/models/update_date_planned_po_wizard.py new file mode 100644 index 00000000..a0d241c8 --- /dev/null +++ b/indoteknik_custom/models/update_date_planned_po_wizard.py @@ -0,0 +1,14 @@ +from odoo import models, fields, api + +class PurchaseOrderUpdateDateWizard(models.TransientModel): + _name = 'purchase.order.update.date.wizard' + _description = 'Wizard to Update Receipt Date on Purchase Order Lines' + + date_planned = fields.Datetime(string="New Receipt Date", required=True) + + def action_update_date(self): + active_ids = self.env.context.get('active_ids', []) + orders = self.env['purchase.order'].browse(active_ids) + for order in orders: + order.write({'date_planned': self.date_planned}) + return {'type': 'ir.actions.act_window_close'} diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index 9b43bf2a..d6e44f9d 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -191,4 +191,5 @@ access_tukar_guling_all_users,tukar.guling.all.users,model_tukar_guling,base.gro access_tukar_guling_line_all_users,tukar.guling.line.all.users,model_tukar_guling_line,base.group_user,1,1,1,1 access_tukar_guling_po_all_users,tukar.guling.po.all.users,model_tukar_guling_po,base.group_user,1,1,1,1 access_tukar_guling_line_po_all_users,tukar.guling.line.po.all.users,model_tukar_guling_line_po,base.group_user,1,1,1,1 -access_tukar_guling_mapping_koli_all_users,tukar.guling.mapping.koli.all.users,model_tukar_guling_mapping_koli,base.group_user,1,1,1,1
\ No newline at end of file +access_tukar_guling_mapping_koli_all_users,tukar.guling.mapping.koli.all.users,model_tukar_guling_mapping_koli,base.group_user,1,1,1,1 +access_purchase_order_update_date_wizard,access.purchase.order.update.date.wizard,model_purchase_order_update_date_wizard,base.group_user,1,1,1,1
\ No newline at end of file diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index fedcb4f9..15cdc788 100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml @@ -428,4 +428,24 @@ <field name="code">action = records.open_form_multi_cancel()</field> </record> </data> + <data> + <record id="action_update_receipt_date_po" model="ir.actions.server"> + <field name="name">Update Receipt Date</field> + <field name="model_id" ref="purchase.model_purchase_order"/> + <field name="binding_model_id" ref="purchase.model_purchase_order"/> + <field name="state">code</field> + <field name="binding_view_types">list</field> + <field name="code"> + action = { + 'type': 'ir.actions.act_window', + 'res_model': 'purchase.order.update.date.wizard', + 'view_mode': 'form', + 'target': 'new', + 'context': { + 'active_ids': env.context.get('active_ids', []), + }, + } + </field> + </record> + </data> </odoo>
\ No newline at end of file diff --git a/indoteknik_custom/views/update_date_planned_po_wizard_view.xml b/indoteknik_custom/views/update_date_planned_po_wizard_view.xml new file mode 100644 index 00000000..6b3ab991 --- /dev/null +++ b/indoteknik_custom/views/update_date_planned_po_wizard_view.xml @@ -0,0 +1,25 @@ +<odoo> + <record id="view_update_date_planned_po_wizard_form" model="ir.ui.view"> + <field name="name">purchase.order.update.date.wizard.form</field> + <field name="model">purchase.order.update.date.wizard</field> + <field name="arch" type="xml"> + <form string="Update Receipt Date"> + <group> + <field name="date_planned"/> + </group> + <footer> + <button string="Apply" type="object" name="action_update_date" class="btn-primary"/> + <button string="Cancel" special="cancel"/> + </footer> + </form> + </field> + </record> + + <record id="action_update_date_planned_po_wizard" model="ir.actions.act_window"> + <field name="name">Update Receipt Date</field> + <field name="res_model">purchase.order.update.date.wizard</field> + <field name="view_mode">form</field> + <field name="target">new</field> + </record> + </odoo> +
\ No newline at end of file |
