diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-07-18 03:49:50 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-07-18 03:49:50 +0000 |
| commit | 999725ea036840d74c7fdeebbd3aefac772bd8d3 (patch) | |
| tree | 287639ccb8e05af2597f23694c7d1325bbdc6d63 /indoteknik_custom | |
| parent | 5b1c2054e3ca176a3705c6d0a84e33867ad1c945 (diff) | |
| parent | d5319d565a4b40cc6fe5b7fa8f9abc507f09e752 (diff) | |
Merged in feature/voucher (pull request #57)
Add amount voucher on sale order and update api
Diffstat (limited to 'indoteknik_custom')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 3d0dfc17..e151bf22 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -88,6 +88,7 @@ class SaleOrder(models.Model): npwp = fields.Char(string="NPWP") purchase_total = fields.Monetary(string='Purchase Total', compute='_compute_purchase_total') voucher_id = fields.Many2one(comodel_name='voucher', string='Voucher') + amount_voucher_disc = fields.Float(string='Voucher Discount') def _compute_purchase_total(self): for order in self: @@ -589,6 +590,7 @@ class SaleOrderLine(models.Model): line_no = fields.Integer('No', default=0, copy=False) note_procurement = fields.Char(string='Note', help="Harap diisi jika ada keterangan tambahan dari Procurement, agar dapat dimonitoring") vendor_subtotal = fields.Float(string='Vendor Subtotal', compute="_compute_vendor_subtotal") + amount_voucher_disc = fields.Float(string='Voucher Discount') def _compute_vendor_subtotal(self): for line in self: diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index b55fefff..7679f92d 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -71,12 +71,18 @@ <field name="item_percent_margin"/> <field name="note_procurement" optional="hide"/> <field name="vendor_subtotal" optional="hide"/> + <field name="amount_voucher_disc" string="Voucher" optional="hide"/> </xpath> <xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='product_id']" position="before"> <field name="line_no" readonly="1" optional="hide"/> </xpath> <field name="amount_total" position="after"> <field name="grand_total"/> + <label for="amount_voucher_disc" string="Voucher" /> + <div> + <field class="mb-0" name="amount_voucher_disc" string="Voucher"/> + <div class="text-right mb-2"><small>*Hanya informasi</small></div> + </div> <field name="total_margin"/> <field name="total_percent_margin"/> </field> |
