From dd1e7158f3c5a24c4cfd67fdeedd9011f6c0655b Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 24 Jul 2023 16:54:07 +0700 Subject: Feature account move multi update payment schedule --- indoteknik_custom/__manifest__.py | 2 +- indoteknik_custom/models/__init__.py | 3 +- indoteknik_custom/models/account_move.py | 9 +++++- .../models/account_move_multi_update.py | 26 +++++++++++++++++ indoteknik_custom/security/ir.model.access.csv | 1 + indoteknik_custom/views/account_move.xml | 8 ++++++ .../views/account_move_multi_update.xml | 33 ++++++++++++++++++++++ 7 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 indoteknik_custom/models/account_move_multi_update.py create mode 100644 indoteknik_custom/views/account_move_multi_update.xml (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index ead47bd3..dfe22fd2 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -84,7 +84,7 @@ 'views/product_sla.xml', 'views/voucher.xml', 'views/bill_receipt.xml', - # 'views/account_bills.xml', + 'views/account_move_multi_update.xml', 'report/report.xml', 'report/report_banner_banner.xml', 'report/report_banner_banner2.xml', diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index 929fc8ba..5b8fcc54 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -71,4 +71,5 @@ from . import token_storage from . import product_sla from . import account_move_due_extension from . import voucher -from . import bill_receipt \ No newline at end of file +from . import bill_receipt +from . import account_move_multi_update \ No newline at end of file diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 33fb73b5..4db97706 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -115,4 +115,11 @@ class AccountMove(models.Model): add_days += line.days due_date = tukar_date + timedelta(days=add_days) invoice.invoice_date_due = due_date - \ No newline at end of file + + def open_form_multi_update(self): + action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_account_move_multi_update') + action['context'] = { + 'move_ids': [x.id for x in self] + } + return action + \ No newline at end of file diff --git a/indoteknik_custom/models/account_move_multi_update.py b/indoteknik_custom/models/account_move_multi_update.py new file mode 100644 index 00000000..4b650868 --- /dev/null +++ b/indoteknik_custom/models/account_move_multi_update.py @@ -0,0 +1,26 @@ +from odoo import models, fields +import logging + +_logger = logging.getLogger(__name__) + + +class AccountMoveMultiUpdate(models.TransientModel): + _name = 'account.move.multi_update' + + payment_schedule = fields.Date(string="Jadwal Pembayaran") + + def save_multi_update(self): + move_ids = self._context['move_ids'] + moves = self.env['account.move'].browse(move_ids) + moves.update({ + 'payment_schedule': self.payment_schedule + }) + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': 'Notification', + 'message': 'Account Move berhasil diubah', + 'next': {'type': 'ir.actions.act_window_close'}, + } + } \ No newline at end of file diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index f115da56..6e11bc5b 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -63,3 +63,4 @@ access_product_sla,access.product_sla,model_product_sla,,1,1,1,1 access_voucher,access.voucher,model_voucher,,1,1,1,1 access_bill_receipt,access.bill.receipt,model_bill_receipt,,1,1,1,1 access_bill_receipt_line,access.bill.receipt.line,model_bill_receipt_line,,1,1,1,1 +access_account_move_multi_update,access.account.move.multi_update,model_account_move_multi_update,,1,1,1,1 \ No newline at end of file diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 0fd6b5b5..26168561 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -73,5 +73,13 @@ + + + Multi Update + + + code + action = records.open_form_multi_update() + \ No newline at end of file diff --git a/indoteknik_custom/views/account_move_multi_update.xml b/indoteknik_custom/views/account_move_multi_update.xml new file mode 100644 index 00000000..dbd90340 --- /dev/null +++ b/indoteknik_custom/views/account_move_multi_update.xml @@ -0,0 +1,33 @@ + + + + + Account Move Multi Update + account.move.multi_update + +
+ + + + + + + +
+
+
+
+
+ + + Account Move Multi Update + account.move.multi_update + ir.actions.act_window + form + + new + +
+
\ No newline at end of file -- cgit v1.2.3 From 4656fedaac694b5e6fe72311a49dd34bce1e50e5 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 25 Jul 2023 11:09:14 +0700 Subject: add receipt date on report purchase order --- indoteknik_custom/report/purchase_order.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/report/purchase_order.xml b/indoteknik_custom/report/purchase_order.xml index 09ded9dc..0f392630 100644 --- a/indoteknik_custom/report/purchase_order.xml +++ b/indoteknik_custom/report/purchase_order.xml @@ -5,5 +5,11 @@ NPWP
74.226.022.7-086.000
PT. INDOTEKNIK DOTCOM GEMILANG
JALAN BANDENGAN UTARA BLOK 85A NO 8-9
PENJARINGAN, PENJARINGAN
KOTA ADM, JAKARTA UTARA DKI JAKARTA 14440 + +
+ Receipt Date: +

+

+
-- cgit v1.2.3 From e24789e8df500f47e6d1df28e3c656874709eb70 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 25 Jul 2023 11:22:19 +0700 Subject: Bug fix calculate discount function on voucher --- indoteknik_custom/models/voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/models/voucher.py b/indoteknik_custom/models/voucher.py index b3a55499..a7151398 100644 --- a/indoteknik_custom/models/voucher.py +++ b/indoteknik_custom/models/voucher.py @@ -107,7 +107,7 @@ class Voucher(models.Model): if self.discount_type == 'percentage': discount = price * self.discount_amount / 100 max_disc = self.max_discount_amount - return max_disc if discount > max_disc else discount + return discount if max_disc == 0 else min(discount, max_disc) return 0 -- cgit v1.2.3 From d454b715e7c7c31836cd525d9470b0eb3b1e7376 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 25 Jul 2023 11:23:23 +0700 Subject: Add domain excl_pricelists on voucher menu --- indoteknik_custom/views/voucher.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indoteknik_custom') diff --git a/indoteknik_custom/views/voucher.xml b/indoteknik_custom/views/voucher.xml index c6741a8d..0bafcd55 100755 --- a/indoteknik_custom/views/voucher.xml +++ b/indoteknik_custom/views/voucher.xml @@ -59,7 +59,7 @@ - + -- cgit v1.2.3