adapt farm to new quality_control version

This commit is contained in:
Àngel Àlvarez 2020-12-20 09:23:43 +01:00
parent 30526f5ca9
commit dfe64c5062
3 changed files with 23 additions and 7 deletions

View File

@ -1,5 +1,5 @@
#The COPYRIGHT file at the top level of this repository contains the full
#copyright notices and license terms.
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.pool import Pool
from . import animal
from . import animal_group
@ -72,6 +72,7 @@ def register():
stock.Move,
production.BOM,
quality.QualityTest,
quality.QualityTemplate,
module='farm', type_='model')
Pool.register(
animal.CreateFemale,

View File

@ -1,14 +1,29 @@
#The COPYRIGHT file at the top level of this repository contains the full
#copyright notices and license terms.
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.model import fields
from trytond.pyson import Bool, Eval, Not
from trytond.pool import PoolMeta
from trytond.pool import PoolMeta, Pool
from trytond.exceptions import UserError
from trytond.i18n import gettext
__all__ = ['QualityTest']
__all__ = ['QualityTest', 'QualityTemplate']
class QualityTemplate(metaclass=PoolMeta):
__name__ = 'quality.template'
document = fields.Reference('Document', selection='get_model')
@classmethod
def get_model(cls):
pool = Pool()
ConfigLine = pool.get('quality.configuration.line')
lines = ConfigLine.search([])
res = [('', '')]
for line in lines:
res.append((line.document.model, line.document.name))
return res
class QualityTest(metaclass=PoolMeta):
__name__ = 'quality.test'

View File

@ -4,7 +4,7 @@ depends:
ir
res
stock
stock_lot
stock_lot_deactivatable
stock_lot_cost
stock_lot_sled
production