summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-01-30 13:48:19 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-01-30 13:48:19 +0700
commitb0152e913e55d4061abe1a0e96c558f62a99a830 (patch)
treeb3b4c39f6435d05b4c016b869109699fc7f4eefd
parent2ceef7e7e73a91ee513787071ba4537c7c263349 (diff)
cr on account move line and add tracking on shipping paid by and shipping covered by on sale order
-rw-r--r--indoteknik_custom/models/account_move_line.py6
-rwxr-xr-xindoteknik_custom/models/sale_order.py4
-rw-r--r--indoteknik_custom/views/account_move.xml3
3 files changed, 11 insertions, 2 deletions
diff --git a/indoteknik_custom/models/account_move_line.py b/indoteknik_custom/models/account_move_line.py
index a4b25109..c4a65209 100644
--- a/indoteknik_custom/models/account_move_line.py
+++ b/indoteknik_custom/models/account_move_line.py
@@ -7,6 +7,12 @@ class AccountMoveLine(models.Model):
cost_centre_id = fields.Many2one('cost.centre', string='Cost Centre')
is_required = fields.Boolean(string='Is Required', compute='_compute_is_required')
analytic_account_ids = fields.Many2many('account.analytic.account', string='Analytic Account')
+ line_no = fields.Integer('No', default=0, compute='_compute_line_no')
+
+ def _compute_line_no(self):
+ if self.move_id:
+ for index, line in enumerate(self.move_id.invoice_line_ids, start=1):
+ line.line_no = index
@api.onchange('account_id')
def _onchange_account_id(self):
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 98468c4b..132aa397 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -28,11 +28,11 @@ class SaleOrder(models.Model):
shipping_cost_covered = fields.Selection([
('indoteknik', 'Indoteknik'),
('customer', 'Customer')
- ], string='Shipping Covered by', help='Siapa yang menanggung biaya ekspedisi?', copy=False)
+ ], string='Shipping Covered by', help='Siapa yang menanggung biaya ekspedisi?', copy=False, tracking=3)
shipping_paid_by = fields.Selection([
('indoteknik', 'Indoteknik'),
('customer', 'Customer')
- ], string='Shipping Paid by', help='Siapa yang talangin dulu Biaya ekspedisi-nya?', copy=False)
+ ], string='Shipping Paid by', help='Siapa yang talangin dulu Biaya ekspedisi-nya?', copy=False, tracking=3)
sales_tax_id = fields.Many2one('account.tax', string='Tax', domain=['|', ('active', '=', False), ('active', '=', True)])
have_outstanding_invoice = fields.Boolean('Have Outstanding Invoice', compute='_have_outstanding_invoice')
have_outstanding_picking = fields.Boolean('Have Outstanding Picking', compute='_have_outstanding_picking')
diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml
index 36b292e8..50a34e11 100644
--- a/indoteknik_custom/views/account_move.xml
+++ b/indoteknik_custom/views/account_move.xml
@@ -137,6 +137,9 @@
{'column_invisible': [('parent.move_type', '!=', 'in_invoice')]}
</attribute>
</field>
+ <field name="product_id" position="before">
+ <field name="line_no" optional="hide"/>
+ </field>
<field name="invoice_incoterm_id" position="after">
<field name="date_terima_tukar_faktur"/>
</field>