From 697bb1ffeaee2374ac39aa1c838958b6dfae40fd Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 31 Aug 2023 16:07:43 +0700 Subject: Update voucher model - Add voucher line model - Add voucher line on voucher view - Add voucher relation to voucher line --- indoteknik_custom/models/voucher_line.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 indoteknik_custom/models/voucher_line.py (limited to 'indoteknik_custom/models/voucher_line.py') diff --git a/indoteknik_custom/models/voucher_line.py b/indoteknik_custom/models/voucher_line.py new file mode 100644 index 00000000..8b449d1f --- /dev/null +++ b/indoteknik_custom/models/voucher_line.py @@ -0,0 +1,20 @@ +from odoo import models, fields + + +class Voucher(models.Model): + _name = 'voucher.line' + + voucher_id = fields.Many2one('voucher', string='Voucher') + manufacture_id = fields.Many2one('x_manufactures', string='Brand') + min_purchase_amount = fields.Integer(string='Min. Purchase Amount', help='Nominal minimum untuk dapat menggunakan voucher. Isi 0 jika tidak ada minimum purchase amount') + discount_amount = fields.Integer(string='Discount Amount') + discount_type = fields.Selection(string='Discount Type', + selection=[ + ('percentage', 'Percentage'), + ('fixed_price', 'Fixed Price'), + ], + help='Select the type of discount:\n' + '- Percentage: Persentase dari total harga.\n' + '- Fixed Price: Jumlah tetap yang dikurangi dari harga total.' + ) + max_discount_amount = fields.Integer(string='Max. Discount Amount', help='Max nominal terhadap persentase diskon') \ No newline at end of file -- cgit v1.2.3