summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2025-12-12 08:55:41 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2025-12-12 08:55:41 +0700
commitb0037dfee3eb9c9a03de185dde9e46df95ea3cb9 (patch)
tree4c1825759952f420030cf89adec04f41382d361c
parentda5617f49ec011c80d4ce6b04ce025f18151e575 (diff)
parentfcdb961c42b32887b51c349242ba47312b7110e3 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
merge
-rw-r--r--indoteknik_custom/models/refund_sale_order.py73
-rwxr-xr-xindoteknik_custom/models/sale_order.py24
-rw-r--r--indoteknik_custom/report/report_sale_order.xml22
3 files changed, 75 insertions, 44 deletions
diff --git a/indoteknik_custom/models/refund_sale_order.py b/indoteknik_custom/models/refund_sale_order.py
index fe0002bd..0ff0a2f0 100644
--- a/indoteknik_custom/models/refund_sale_order.py
+++ b/indoteknik_custom/models/refund_sale_order.py
@@ -294,16 +294,20 @@ class RefundSaleOrder(models.Model):
('state', '=', 'posted'),
('ref', 'not ilike', 'dp'),
])
- piutangbca = self.env['account.move'].search([
- ('ref', 'in', invoices.mapped('name')),
- ('journal_id', '=', 4),
- ('state', '=', 'posted'),
- ])
- piutangmdr = self.env['account.move'].search([
- ('ref', 'in', invoices.mapped('name')),
- ('journal_id', '=', 7),
- ('state', '=', 'posted'),
- ])
+ piutangbca = self.env['account.move']
+ piutangmdr = self.env['account.move']
+
+ for inv_name in invoices.mapped('name'):
+ piutangbca |= self.env['account.move'].search([
+ ('ref', 'ilike', inv_name),
+ ('journal_id', '=', 4),
+ ('state', '=', 'posted'),
+ ])
+ piutangmdr |= self.env['account.move'].search([
+ ('ref', 'ilike', inv_name),
+ ('journal_id', '=', 7),
+ ('state', '=', 'posted'),
+ ])
misc = self.env['account.move']
if invoices:
@@ -568,17 +572,20 @@ class RefundSaleOrder(models.Model):
('state', '=', 'posted'),
])
- piutangbca = self.env['account.move'].search([
- ('ref', 'in', invoice_ids.mapped('name')),
- ('journal_id', '=', 4),
- ('state', '=', 'posted'),
- ])
+ piutangbca = self.env['account.move']
+ piutangmdr = self.env['account.move']
- piutangmdr = self.env['account.move'].search([
- ('ref', 'in', invoice_ids.mapped('name')),
- ('journal_id', '=', 7),
- ('state', '=', 'posted'),
- ])
+ for inv_name in invoice_ids.mapped('name'):
+ piutangbca |= self.env['account.move'].search([
+ ('ref', 'ilike', inv_name),
+ ('journal_id', '=', 4),
+ ('state', '=', 'posted'),
+ ])
+ piutangmdr |= self.env['account.move'].search([
+ ('ref', 'ilike', inv_name),
+ ('journal_id', '=', 7),
+ ('state', '=', 'posted'),
+ ])
moves2 = self.env['account.move']
if rec.sale_order_ids:
@@ -651,16 +658,22 @@ class RefundSaleOrder(models.Model):
('state', '=', 'posted'),
('ref', 'not ilike', 'dp'),
])
- piutangbca = self.env['account.move'].search([
- ('ref', 'in', all_invoices.mapped('name')),
- ('journal_id', '=', 4),
- ('state', '=', 'posted'),
- ])
- piutangmdr = self.env['account.move'].search([
- ('ref', 'in', all_invoices.mapped('name')),
- ('journal_id', '=', 7),
- ('state', '=', 'posted'),
- ])
+
+ piutangbca = self.env['account.move']
+ piutangmdr = self.env['account.move']
+
+ for inv_name in all_invoices.mapped('name'):
+ piutangbca |= self.env['account.move'].search([
+ ('ref', 'ilike', inv_name),
+ ('journal_id', '=', 4),
+ ('state', '=', 'posted'),
+ ])
+ piutangmdr |= self.env['account.move'].search([
+ ('ref', 'ilike', inv_name),
+ ('journal_id', '=', 7),
+ ('state', '=', 'posted'),
+ ])
+
misc = self.env['account.move']
if all_invoices:
misc = self.env['account.move'].search([
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 9ef9ce9a..17691798 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -3445,16 +3445,20 @@ class SaleOrder(models.Model):
('journal_id', '=', 11),
('state', '=', 'posted'),
])
- piutangbca = self.env['account.move'].search([
- ('ref', 'in', invoice_ids.mapped('name')),
- ('journal_id', '=', 4),
- ('state', '=', 'posted'),
- ])
- piutangmdr = self.env['account.move'].search([
- ('ref', 'in', invoice_ids.mapped('name')),
- ('journal_id', '=', 7),
- ('state', '=', 'posted'),
- ])
+ piutangbca = self.env['account.move']
+ piutangmdr = self.env['account.move']
+
+ for inv_name in invoice_ids.mapped('name'):
+ piutangbca |= self.env['account.move'].search([
+ ('ref', 'ilike', inv_name),
+ ('journal_id', '=', 4),
+ ('state', '=', 'posted'),
+ ])
+ piutangmdr |= self.env['account.move'].search([
+ ('ref', 'ilike', inv_name),
+ ('journal_id', '=', 7),
+ ('state', '=', 'posted'),
+ ])
moves2 = self.env['account.move'].search([
('ref', 'ilike', self.name),
diff --git a/indoteknik_custom/report/report_sale_order.xml b/indoteknik_custom/report/report_sale_order.xml
index d1a6de28..608d909c 100644
--- a/indoteknik_custom/report/report_sale_order.xml
+++ b/indoteknik_custom/report/report_sale_order.xml
@@ -1,6 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
+ <record id="paperformat_saleorder_custom_indoteknik" model="report.paperformat">
+ <field name="name">A4 Sale Order Indoteknik (Custom)</field>
+ <field name="default" eval="True" />
+ <field name="format">A4</field>
+ <field name="page_height">0</field>
+ <field name="page_width">0</field>
+ <field name="orientation">Portrait</field>
+ <field name="margin_top">45</field> <field name="margin_bottom">28</field>
+ <field name="margin_left">7</field>
+ <field name="margin_right">7</field>
+ <field name="header_line" eval="False" />
+ <field name="header_spacing">35</field>
+ <field name="dpi">90</field>
+ </record>
+
<record id="action_report_saleorder_website" model="ir.actions.report">
<field name="name">Quotation / Order (Website)</field>
<field name="model">sale.order</field>
@@ -12,9 +27,10 @@
('Quotation - %s - %s - %s' % (object.partner_id.name, object.name, object.create_date.strftime('%d/%m/%Y')))
or 'Order - %s - %s - %s' % (object.partner_id.name, object.name, object.create_date.strftime('%d/%m/%Y')))
</field>
-
<field name="binding_model_id" ref="model_sale_order"/>
<field name="binding_type">report</field>
+
+ <field name="paperformat_id" ref="paperformat_saleorder_custom_indoteknik"/>
</record>
</data>
@@ -86,12 +102,10 @@
</div>
</div>
- <!-- Is there a discount on at least one line? -->
<t t-set="display_discount" t-value="any(l.discount for l in doc.order_line)"/>
<table class="table table-sm o_main_table">
- <!-- In case we want to repeat the header, remove "display: table-row-group" -->
- <thead style="display: table-row-group">
+ <thead style="display: table-header-group">
<tr>
<th name="th_description" class="text-left">Description</th>
<th name="th_quantity" class="text-right">Quantity</th>