summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/voucher_line.py
blob: 890471dc85473029c5edca2627cec797b43a6e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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.Float(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')