Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4419][IMP] account_invoice_report_hls #222

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

kanda999
Copy link
Contributor

@kanda999 kanda999 commented May 30, 2024

@kanda999 kanda999 changed the title [IMP] account_invoice_report_hls [4419][IMP] account_invoice_report_hls May 30, 2024
@kanda999 kanda999 force-pushed the 12.0-2-imp-account_invoice_report_hls branch from de48c8a to 75153e9 Compare May 30, 2024 08:48
@kanda999 kanda999 force-pushed the 12.0-2-imp-account_invoice_report_hls branch from 75153e9 to 9f94a16 Compare May 30, 2024 08:49
@kanda999 kanda999 marked this pull request as ready for review May 30, 2024 10:19
Comment on lines 11 to 15
def render_qweb_pdf(self, res_id=None, data=None):
if self.report_name == "account_invoice_report_hls.invoice_delivery":
invoices = self.env["account.invoice"].browse(res_id)
invoices._create_invoice_delivery_report()
return super(IrActionsReport, self).render_qweb_pdf(res_id, data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be a bit safer.

Suggested change
def render_qweb_pdf(self, res_id=None, data=None):
if self.report_name == "account_invoice_report_hls.invoice_delivery":
invoices = self.env["account.invoice"].browse(res_id)
invoices._create_invoice_delivery_report()
return super(IrActionsReport, self).render_qweb_pdf(res_id, data)
def render_qweb_pdf(self, res_ids=None, data=None):
if self.report_name == "account_invoice_report_hls.invoice_delivery":
if not res_ids:
res_ids = self.env.context.get("active_ids")
invoices = self.env["account.invoice"].browse(res_ids)
invoices._create_invoice_delivery_report()
return super(IrActionsReport, self).render_qweb_pdf(res_ids, data)

line_ids = fields.One2many("invoice.delivery.report.line", inverse_name="report_id")
report_line_ids = fields.One2many(
"invoice.delivery.report.line", inverse_name="report_id"
)

@api.model
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@api.model
@api.multi



class InvoiceDeliveryReportLine(models.TransientModel):
_name = "invoice.delivery.report.line"
_order = "date_delivered"

report_id = fields.Many2one("invoice.delivery.report")
report_id = fields.Many2one("account.invoice")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would make more sense to change the field name.

Suggested change
report_id = fields.Many2one("account.invoice")
invoice_id = fields.Many2one("account.invoice")

Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review.

@kanda999 kanda999 merged commit a41b81f into 12.0 Jun 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants