This commit is contained in:
Adrián Bernardi 2021-09-23 21:45:53 -03:00
parent 0db8cd0228
commit 8bc0384d6a
11 changed files with 28 additions and 23 deletions

View File

@ -1226,7 +1226,7 @@ class ControlChartReport(Report):
if 'id' in data:
tendency = ControlTendency(data['id'])
else:
tendency = ControlTendency(reports[0].id)
tendency = ControlTendency(records[0].id)
company = Company(Transaction().context.get('company'))
report_context['company'] = company

View File

@ -5163,6 +5163,10 @@ msgctxt "field:lims.results_report.version.detail.line,start_date:"
msgid "Start date"
msgstr "Fecha de inicio"
msgctxt "field:lims.results_report.version.detail.line,uncertainty:"
msgid "Uncertainty"
msgstr "Incertidumbre"
msgctxt "field:lims.results_report.version.detail.line,urgent:"
msgid "Urgent"
msgstr "Urgente"
@ -11170,7 +11174,7 @@ msgid "Urgent"
msgstr "Urgente"
msgctxt "report:lims.pending_services_unplanned.spreadsheet:"
msgid "for each=\"line in objects\""
msgid "for each=\"line in records\""
msgstr ""
msgctxt "report:lims.pending_services_unplanned.spreadsheet:"

View File

@ -1405,8 +1405,8 @@ class NotebookLine(ModelSQL, ModelView):
not self.literal_result and
(not self.converted_result_modifier or
not self.converted_result) and
self.converted_result_modifier not in
('nd', 'pos', 'neg')):
self.converted_result_modifier not in (
'nd', 'pos', 'neg')):
self.accepted = False
self.not_accepted_message = gettext(
'lims.msg_not_accepted_7')

View File

@ -4,8 +4,7 @@
from dateutil import relativedelta
from trytond.model import Workflow, ModelView, ModelSQL, fields
from trytond.wizard import Wizard, StateTransition, StateView, StateAction, \
Button
from trytond.wizard import Wizard, StateAction
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
from trytond.pyson import PYSONEncoder, Eval

View File

@ -6,7 +6,6 @@ from datetime import datetime
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
from PyPDF2 import PdfFileMerger
from string import Template
from trytond.model import ModelSQL, ModelView, fields

View File

@ -54,7 +54,6 @@ class Plant(ModelSQL, ModelView):
table.column_rename('zip', 'postal_code')
super().__register__(module_name)
@staticmethod
def default_country():
Company = Pool().get('company.company')

View File

@ -3,7 +3,6 @@
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
import formulas
import sql
from trytond import backend
from trytond.model import ModelSQL, ModelView, fields

View File

@ -34,6 +34,7 @@ class AddSampleService(metaclass=PoolMeta):
Planification.automatic_plan(entries=[new_service.entry])
return new_service
class EditSampleService(metaclass=PoolMeta):
__name__ = 'lims.sample.edit_service'

View File

@ -169,9 +169,10 @@ class Template(Workflow, ModelSQL, ModelView):
@Workflow.transition('not_active')
def not_active(cls, templates):
pass
@classmethod
@ModelView.button_action('lims_quality_control.wiz_quality_template_copy_line')
@ModelView.button_action(
'lims_quality_control.wiz_quality_template_copy_line')
def copy_lines(cls, typifications):
pass
@ -724,24 +725,23 @@ class TestAttachmentReport(Report):
class CopyQualityTemplateLineStart(ModelView):
'Copy Quality Template Line'
__name__ = 'lims.quality.template.copy_line.start'
origin_quality_template = fields.Many2One('lims.quality.template', 'Origin Template',
required=True,
)
origin_quality_template = fields.Many2One('lims.quality.template',
'Origin Template', required=True)
class CopyQualityTemplateLine(Wizard):
'Copy Quality Template Line'
__name__ = 'lims.quality.template.copy_line'
start = StateTransition()
ask = StateView('lims.quality.template.copy_line.start',
'lims_quality_control.quality_template_copy_line_start_view_form', [
Button('Cancel', 'end', 'tryton-cancel'),
Button('Copy', 'copy', 'tryton-ok', default=True),
Button('Copy', 'copy', 'tryton-ok', default=True),
])
copy = StateTransition()
def transition_start(self):
QualityTemplate = Pool().get('lims.quality.template')
quality_template_id = Transaction().context.get('active_id', None)
@ -756,7 +756,9 @@ class CopyQualityTemplateLine(Wizard):
Line = Pool().get('lims.typification')
quality_template_id = Transaction().context.get('active_id', None)
count = Line.search_count([('quality_template', '=', quality_template_id)])
count = Line.search_count([
('quality_template', '=', quality_template_id),
])
new_lines = []
origin_lines = Line.search([
@ -807,7 +809,8 @@ class CopyQualityTemplateLine(Wizard):
'valid_value': origin.valid_value,
'quality_test_report': origin.quality_test_report,
'quality_order': origin.quality_order,
#problemas al copiar algunos registros que no tienen valor en quality_min
# problemas al copiar algunos registros que no tienen valor
# en quality_min
'quality_min': origin.quality_min,
'quality_max': origin.quality_max,
}

View File

@ -60,8 +60,8 @@ class ReportTemplate(ModelSQL, ModelView):
], 'Charts per Row')
page_orientation = fields.Selection([
('portrait', 'Portrait'),
('landscape','Landscape'),
],'Page orientation',sort=False)
('landscape', 'Landscape'),
], 'Page orientation', sort=False)
resultrange_origin = fields.Many2One('lims.range.type', 'Comparison range',
domain=[('use', '=', 'result_range')])

View File

@ -532,7 +532,8 @@ class ResultReport(metaclass=PoolMeta):
if tfooter:
stylesheets += cls.parse_stylesheets(tfooter)
page_orientation = record.template and record.template.page_orientation or 'portrait'
page_orientation = (record.template and
record.template.page_orientation or 'portrait')
document = PdfGenerator(content,
header_html=header, footer_html=footer,