-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
de48c8a
to
75153e9
Compare
75153e9
to
9f94a16
Compare
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) |
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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") |
There was a problem hiding this comment.
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.
report_id = fields.Many2one("account.invoice") | |
invoice_id = fields.Many2one("account.invoice") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review.
4332