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

[ADD] account_debt_report: make method more heritable #414

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions account_debt_report/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
class ResPartner(models.Model):
_inherit = 'res.partner'

def _get_debt_report_line_name(self, record):
name = record.move_id.name
# similar to _format_aml_name
if record.ref and record.ref != '/':
name += ' - ' + record.ref
return name

def _get_debt_report_lines(self):
# TODO ver si borramos este metodo que no tiene mucho sentido (get_line_vals)
def get_line_vals(
Expand Down Expand Up @@ -104,10 +111,8 @@ def get_line_vals(
'\n', ' ').replace('\r', ''),
inv_line.quantity,
inv_line_product_uom_id_name)))
name = record.move_id.name
# similar to _format_aml_name
if record.ref and record.ref != '/':
name += ' - ' + record.ref

name = self._get_debt_report_line_name(record)

date_maturity = record.date_maturity
date = record.date
Expand Down