diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-11-03 10:46:02 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-11-03 10:46:02 +0700 |
| commit | a4cd5ce9cd8d5ef38062732a16a61d6d5c094e30 (patch) | |
| tree | 324faf41d77339169cb95df7efe8275915c00fc2 /indoteknik_custom/models | |
| parent | 6b49797aca36574497f93a06f8e1c0622e5ad009 (diff) | |
initial commit for new window of customer commision
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/__init__.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/commision.py | 41 |
2 files changed, 42 insertions, 0 deletions
diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index 6a5eac00..e842b511 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -91,3 +91,4 @@ from . import sale_orders_multi_update from . import quotation_so_multi_update from . import product_monitoring from . import stock_warehouse_orderpoint +from . import commision diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py new file mode 100644 index 00000000..e39deb63 --- /dev/null +++ b/indoteknik_custom/models/commision.py @@ -0,0 +1,41 @@ +from odoo import models, api, fields +from odoo.exceptions import UserError +from datetime import datetime +import logging + +_logger = logging.getLogger(__name__) + + +class CustomerCommision(models.Model): + _name = 'customer.commision' + _order = 'id desc' + + number = fields.Char(string='Document No', index=True, copy=False, readonly=True) + date_from = fields.Date(string='Date From', required=True) + date_to = fields.Date(string='Date To', required=True) + partner_id = fields.Many2one('res.partner', String='Customer', required=True) + description = fields.Char(string='Description') + notification = fields.Char(string='Notification') + commision_lines = fields.One2many('customer.commision.line', 'customer_commision_id', string='Lines', auto_join=True) + + @api.model + def create(self, vals): + vals['number'] = self.env['ir.sequence'].next_by_code('customer.commision') or '0' + result = super(CustomerCommision, self).create(vals) + return result + + def generate_customer_commision(self): + print("masuk") + return + +class CustomerCommisionLine(models.Model): + _name = 'customer.commision.line' + _order = 'id' + + customer_commision_id = fields.Many2one('customer.commision', string='Ref', required=True, ondelete='cascade', copy=False) + invoice_id = fields.Many2one('account.move', string='Invoice') + partner_id = fields.Many2one('res.partner', string='Customer') + state = fields.Char(string='InvStatus') + dpp = fields.Float(string='DPP') + tax = fields.Float(string='TaxAmt') + total = fields.Float(string='Total') |
