Replace api.model by api.multi and avoid title from warning in document template
This commit is contained in:
parent
e12d21c549
commit
994a3246e1
@ -37,7 +37,7 @@ class AccountDocumentTemplate(models.Model):
|
|||||||
count += 1
|
count += 1
|
||||||
return count
|
return count
|
||||||
|
|
||||||
@api.model
|
@api.multi
|
||||||
def _get_template_line(self, template_id, line_number):
|
def _get_template_line(self, template_id, line_number):
|
||||||
template = self.browse(template_id)
|
template = self.browse(template_id)
|
||||||
for line in template.template_line_ids:
|
for line in template.template_line_ids:
|
||||||
@ -45,7 +45,7 @@ class AccountDocumentTemplate(models.Model):
|
|||||||
return line
|
return line
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@api.model
|
@api.multi
|
||||||
def _generate_empty_lines(self, template_id):
|
def _generate_empty_lines(self, template_id):
|
||||||
lines = {}
|
lines = {}
|
||||||
template = self.browse(template_id)
|
template = self.browse(template_id)
|
||||||
@ -60,7 +60,6 @@ class AccountDocumentTemplate(models.Model):
|
|||||||
line = self._get_template_line(self._current_template_id, line_number)
|
line = self._get_template_line(self._current_template_id, line_number)
|
||||||
if re.match(r'L\( *' + str(line_number) + r' *\)', line.python_code):
|
if re.match(r'L\( *' + str(line_number) + r' *\)', line.python_code):
|
||||||
raise exceptions.Warning(
|
raise exceptions.Warning(
|
||||||
_('Error'),
|
|
||||||
_('Line %s can\'t refer to itself') % str(line_number)
|
_('Line %s can\'t refer to itself') % str(line_number)
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user