summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-09-12 10:48:13 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-09-12 10:48:13 +0700
commit7d07a282c134cb5e2a784b73cc477e3f398df57c (patch)
treed0e1515e1947985c06f5046b24042720a2574b49
parentef8a6f39e6967c592b14f5ebc1d4ebcdb6fd2f7b (diff)
<hafid> add rc in journal
-rw-r--r--indoteknik_api/controllers/api_v1/user.py4
-rw-r--r--indoteknik_custom/models/refund_sale_order.py8
-rw-r--r--indoteknik_custom/models/stock_move.py1
-rw-r--r--indoteknik_custom/views/account_move.xml1
4 files changed, 11 insertions, 3 deletions
diff --git a/indoteknik_api/controllers/api_v1/user.py b/indoteknik_api/controllers/api_v1/user.py
index dde30fec..3511bc52 100644
--- a/indoteknik_api/controllers/api_v1/user.py
+++ b/indoteknik_api/controllers/api_v1/user.py
@@ -89,7 +89,9 @@ class User(controller.Controller):
'name': name,
'login': email,
'oauth_provider_id': request.env.ref('auth_oauth.provider_google').id,
- 'sel_groups_1_9_10': 9
+ 'sel_groups_1_9_10': 9,
+ 'active': True,
+
}
user = request.env['res.users'].create(user_data)
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py
index 731d8e41..e981abb5 100644
--- a/indoteknik_custom/models/refund_sale_order.py
+++ b/indoteknik_custom/models/refund_sale_order.py
@@ -462,7 +462,7 @@ class RefundSaleOrder(models.Model):
total_invoice = 0.0
so_ids = self.sale_order_ids.ids
-
+ amount_refund_before = 0.0
for so in self.sale_order_ids:
self.ongkir += so.delivery_amt or 0.0
valid_invoices = so.invoice_ids.filtered(
@@ -470,6 +470,10 @@ class RefundSaleOrder(models.Model):
)
all_invoices |= valid_invoices
total_invoice += sum(valid_invoices.mapped('amount_total_signed'))
+ refunds = self.env['refund.sale.order'].search([
+ ('sale_order_ids', 'in', so_ids)
+ ])
+ amount_refund_before += sum(refunds.mapped('amount_refund')) if refunds else 0.0
moves = self.env['account.move'].search([
('sale_id', 'in', so_ids),
@@ -478,7 +482,7 @@ class RefundSaleOrder(models.Model):
])
total_uang_muka = sum(moves.mapped('amount_total_signed')) if moves else 0.0
total_midtrans = sum(self.env['sale.order'].browse(so_ids).mapped('gross_amount')) if so_ids else 0.0
- self.uang_masuk = total_uang_muka + total_midtrans
+ self.uang_masuk = (total_uang_muka + total_midtrans) - amount_refund_before
self.invoice_ids = all_invoices
diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py
index 90ab30a4..64cb6ba6 100644
--- a/indoteknik_custom/models/stock_move.py
+++ b/indoteknik_custom/models/stock_move.py
@@ -15,6 +15,7 @@ class StockMove(models.Model):
barcode = fields.Char(string='Barcode', related='product_id.barcode')
vendor_id = fields.Many2one('res.partner' ,string='Vendor')
hold_outgoingg = fields.Boolean('Hold Outgoing', default=False)
+ product_image = fields.Binary(related="product_id.image_128", string="Product Image", readonly=True)
# @api.model_create_multi
# def create(self, vals_list):
diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml
index 1b477c6d..c88effd5 100644
--- a/indoteknik_custom/views/account_move.xml
+++ b/indoteknik_custom/views/account_move.xml
@@ -39,6 +39,7 @@
</field>
<field name="ref" position="after">
<field name="sale_id" readonly="1" attrs="{'invisible': ['|', ('move_type', '!=', 'entry'), ('has_refund_so', '=', True)]}"/>
+ <field name="refund_id" readonly="1" attrs="{'invisible': ['|', ('move_type', '!=', 'entry'), ('has_refund_so', '=', False)]}"/>
<field name="refund_so_links" readonly="1" widget="html" attrs="{'invisible': ['|', ('move_type', '!=', 'entry'), ('has_refund_so', '=', False)]}"/>
<field name="has_refund_so" invisible="1"/>
</field>