summaryrefslogtreecommitdiff
path: root/vit_efaktur/wizard/assign.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
commit1ca3b3df3421961caec3b747a364071c80f5c7da (patch)
tree6778a1f0f3f9b4c6e26d6d87ccde16e24da6c9d6 /vit_efaktur/wizard/assign.py
parentb57188be371d36d96caac4b8d65a40745c0e972c (diff)
initial commit
Diffstat (limited to 'vit_efaktur/wizard/assign.py')
-rw-r--r--vit_efaktur/wizard/assign.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/vit_efaktur/wizard/assign.py b/vit_efaktur/wizard/assign.py
new file mode 100644
index 0000000..1fbd802
--- /dev/null
+++ b/vit_efaktur/wizard/assign.py
@@ -0,0 +1,35 @@
+from odoo import api, fields, models, _
+import time
+from odoo.exceptions import UserError
+import logging
+_logger = logging.getLogger(__name__)
+
+class AssignConfirm(models.TransientModel):
+ _name = 'vit.assign_wizard'
+ _description = 'Assign Confirmation'
+
+
+ def _get_active_invoices(self):
+ if self._context.get('active_model') == 'account.invoice':
+ return self._context.get('active_ids', False)
+ return False
+
+ invoice_ids = fields.Many2many(comodel_name="account.invoice", string="Invoices", required=True,
+ default=_get_active_invoices)
+
+ efaktur_id = fields.Many2one(comodel_name="vit.efaktur", string="Nomor E-Faktur", required=False, )
+
+ """
+ logika:
+ update invoice_ids.efaktur_id dengan yang dipilih
+ :return:
+ """
+
+ # @api.multi
+ def confirm_button(self):
+ self.ensure_one()
+
+ for inv in self.invoice_ids:
+ inv.efaktur_id = self.efaktur_id
+
+ return {'type': 'ir.actions.act_window_close'}