Skip to content

Commit

Permalink
run pre-commit, upd
Browse files Browse the repository at this point in the history
  • Loading branch information
AungKoKoLin1997 committed Sep 13, 2024
1 parent 955b2df commit 6136335
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion stock_report_deliveryslip_adj/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import models
from . import models
9 changes: 5 additions & 4 deletions stock_report_deliveryslip_adj/models/ir_actions_report.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields
from odoo import fields, models


class Report(models.Model):
_inherit = 'ir.actions.report'
_inherit = "ir.actions.report"

commercial_partner = fields.Boolean()

def _get_partner_id(self, doc):
def _get_partner_id(self, xmlid, doc):
doc.ensure_one()
# report = self._get_report_from_name("stock.report_deliveryslip")
report = self._get_report_from_name(xmlid)
if report.commercial_partner:
return doc.partner_id.commercial_partner_id
else:
Expand Down
4 changes: 2 additions & 2 deletions stock_report_deliveryslip_adj/report/report_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="article o_report_layout_standard" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<div class="row" name="address_layout">
<div class="col-7" name="partner_address">
<div t-set="partner" t-value="o.env['ir.actions.report']._get_partner_id(o)"/>
<div t-set="partner" t-value="o.env['ir.actions.report']._get_partner_id(xmlid, o)"/>
<div t-esc="partner" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
</div>
<div class="col-5" name="company_address">
Expand Down Expand Up @@ -59,7 +59,7 @@
</t>
</t>
</xpath>
<xpath expr="//t[@t-if='company.external_report_layout_id']" position="replace">
<xpath expr="//t[@t-if='company.external_report_layout_id']" position="replace">
</xpath>
</template> -->
</odoo>

0 comments on commit 6136335

Please sign in to comment.