Renamed module and homogenized with other farm modules
This commit is contained in:
parent
78cfb62038
commit
2c6ada2ecc
2
README
2
README
|
@ -14,7 +14,7 @@ questions on the NaN·tic bug tracker, mailing list,
|
|||
wiki or IRC channel:
|
||||
|
||||
* http://doc.tryton-erp.es/
|
||||
* http://bitbucket.org/nantic/nutrition_program
|
||||
* http://bitbucket.org/nantic/trytond-farm_nutrition_program
|
||||
* http://groups.tryton.org/
|
||||
* http://wiki.tryton.org/
|
||||
* irc://irc.freenode.net/tryton
|
||||
|
|
12
__init__.py
12
__init__.py
|
@ -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 .nutrition_program import *
|
||||
|
@ -7,9 +7,11 @@ from .nutrition_program import *
|
|||
|
||||
def register():
|
||||
Pool.register(
|
||||
Animal,
|
||||
AnimalGroup,
|
||||
NutritionProgram,
|
||||
StockLot,
|
||||
module='nutrition_program', type_='model')
|
||||
Specie,
|
||||
module='farm_nutrition_program', type_='model')
|
||||
Pool.register(
|
||||
OpenBOM,
|
||||
module='nutrition_program', type_='wizard')
|
||||
module='farm_nutrition_program', type_='wizard')
|
||||
|
|
|
@ -2,66 +2,102 @@
|
|||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:nutrition.program,bom:"
|
||||
msgctxt "field:farm.animal,nutrition_program:"
|
||||
msgid "Nutrition Program"
|
||||
msgstr "Programa de alimentación"
|
||||
|
||||
msgctxt "field:farm.animal.group,nutrition_program:"
|
||||
msgid "Nutrition Program"
|
||||
msgstr "Programa de alimentación"
|
||||
|
||||
msgctxt "field:farm.nutrition.program,animal_type:"
|
||||
msgid "Animal Type"
|
||||
msgstr "Tipo animal"
|
||||
|
||||
msgctxt "field:farm.nutrition.program,bom:"
|
||||
msgid "BOM"
|
||||
msgstr "Lista de material"
|
||||
|
||||
msgctxt "field:nutrition.program,create_date:"
|
||||
msgctxt "field:farm.nutrition.program,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Fecha de creación"
|
||||
|
||||
msgctxt "field:nutrition.program,create_uid:"
|
||||
msgctxt "field:farm.nutrition.program,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuario de creación"
|
||||
|
||||
msgctxt "field:nutrition.program,end_weight:"
|
||||
msgctxt "field:farm.nutrition.program,end_weight:"
|
||||
msgid "End Weight"
|
||||
msgstr "Peso final"
|
||||
|
||||
msgctxt "field:nutrition.program,id:"
|
||||
msgctxt "field:farm.nutrition.program,id:"
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:nutrition.program,product:"
|
||||
msgctxt "field:farm.nutrition.program,product:"
|
||||
msgid "Product"
|
||||
msgstr "Producto"
|
||||
|
||||
msgctxt "field:nutrition.program,rec_name:"
|
||||
msgctxt "field:farm.nutrition.program,rec_name:"
|
||||
msgid "Name"
|
||||
msgstr "Nombre"
|
||||
|
||||
msgctxt "field:nutrition.program,start_weight:"
|
||||
msgctxt "field:farm.nutrition.program,specie:"
|
||||
msgid "Specie"
|
||||
msgstr "Especie"
|
||||
|
||||
msgctxt "field:farm.nutrition.program,start_weight:"
|
||||
msgid "Start Weight"
|
||||
msgstr "Peso inicial"
|
||||
|
||||
msgctxt "field:nutrition.program,write_date:"
|
||||
msgctxt "field:farm.nutrition.program,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Fecha modificación"
|
||||
|
||||
msgctxt "field:nutrition.program,write_uid:"
|
||||
msgctxt "field:farm.nutrition.program,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuario modificación"
|
||||
|
||||
msgctxt "model:farm.nutrition.program,name:"
|
||||
msgid "Nutrition Program"
|
||||
msgstr "Programa de alimentación"
|
||||
|
||||
msgctxt "model:ir.action,name:act_nutrition_program"
|
||||
msgid "Nutrition Programs"
|
||||
msgstr "Programas de Alimentación"
|
||||
msgstr "Programas de alimentación"
|
||||
|
||||
msgctxt "model:ir.action,name:wizard_bom_open"
|
||||
msgid "BOMs"
|
||||
msgstr "Listas de material"
|
||||
|
||||
msgctxt "model:ir.action.act_window,name:act_nutrition_program"
|
||||
msgid "Nutrition Programs"
|
||||
msgstr "Programa de Alimentación"
|
||||
msgstr "Programas de alimentación"
|
||||
|
||||
msgctxt "model:ir.ui.menu,name:menu_nutrition_program"
|
||||
msgctxt "model:res.group,name:group_nutrition_program"
|
||||
msgid "Farm / Nutriton Program"
|
||||
msgstr "Granja / Programa de alimentación"
|
||||
|
||||
msgctxt "selection:farm.nutrition.program,animal_type:"
|
||||
msgid "Female"
|
||||
msgstr "Hembra"
|
||||
|
||||
msgctxt "selection:farm.nutrition.program,animal_type:"
|
||||
msgid "Group"
|
||||
msgstr "Grupo"
|
||||
|
||||
msgctxt "selection:farm.nutrition.program,animal_type:"
|
||||
msgid "Individual"
|
||||
msgstr "Individual"
|
||||
|
||||
msgctxt "selection:farm.nutrition.program,animal_type:"
|
||||
msgid "Male"
|
||||
msgstr "Macho"
|
||||
|
||||
msgctxt "view:farm.nutrition.program:"
|
||||
msgid "Nutrition Program"
|
||||
msgstr "Programa de Alimentación"
|
||||
msgstr "Programa de alimentación"
|
||||
|
||||
msgctxt "model:ir.ui.menu,name:menu_nutrition_program_tree"
|
||||
msgctxt "view:farm.nutrition.program:"
|
||||
msgid "Nutrition Programs"
|
||||
msgstr "Programas de Alimentación"
|
||||
|
||||
msgctxt "model:nutrition.program,name:"
|
||||
msgid "Nutrition Program"
|
||||
msgstr "Programa de Alimentación"
|
||||
|
||||
msgctxt "model:res.group,name:group_nutrition_program_admin"
|
||||
msgid "Nutrition Program Administration"
|
||||
msgstr "Administrador de programas de alimentación"
|
||||
msgstr "Programas de alimentación"
|
||||
|
|
|
@ -1,28 +1,38 @@
|
|||
#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 ModelView, ModelSQL, fields
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval, PYSONEncoder
|
||||
from trytond.wizard import Wizard, StateAction
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import Wizard, StateAction
|
||||
|
||||
__all__ = ['NutritionProgram', 'StockLot', 'OpenBOM']
|
||||
__all__ = ['NutritionProgram', 'Animal', 'AnimalGroup', 'OpenBOM', 'Specie']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class NutritionProgram(ModelSQL, ModelView):
|
||||
'Nutrition Program'
|
||||
__name__ = 'nutrition.program'
|
||||
__name__ = 'farm.nutrition.program'
|
||||
|
||||
specie = fields.Many2One('farm.specie', 'Specie', required=True,
|
||||
readonly=True, select=True)
|
||||
animal_type = fields.Selection([
|
||||
('male', 'Male'),
|
||||
('female', 'Female'),
|
||||
('individual', 'Individual'),
|
||||
('group', 'Group'),
|
||||
], "Animal Type", required=True, select=True)
|
||||
start_weight = fields.Float('Start Weight')
|
||||
end_weight = fields.Float('End Weight')
|
||||
product = fields.Many2One('product.product', 'Product', required=True)
|
||||
animal_product = fields.Many2One('product.product', 'Animal Product')
|
||||
bom = fields.Function(fields.Many2One('production.bom', 'BOM',
|
||||
domain=[
|
||||
('output_products', '=', Eval('product', 0)),
|
||||
],
|
||||
depends=['product']), 'get_bom')
|
||||
bom = fields.Function(fields.Many2One('production.bom', 'BOM', domain=[
|
||||
('output_products', '=', Eval('product', 0)),
|
||||
], depends=['product']),
|
||||
'get_bom')
|
||||
|
||||
@staticmethod
|
||||
def default_specie():
|
||||
return Transaction().context.get('specie')
|
||||
|
||||
def get_bom(self, name):
|
||||
if self.product and self.product.boms:
|
||||
|
@ -33,48 +43,61 @@ class NutritionProgram(ModelSQL, ModelView):
|
|||
self.start_weight or '', self.end_weight or '')
|
||||
|
||||
|
||||
class StockLot:
|
||||
__name__ = 'stock.lot'
|
||||
def _get_nutrition_program(animal):
|
||||
pool = Pool()
|
||||
Program = pool.get('farm.nutrition.program')
|
||||
|
||||
nutrition_program = fields.Function(fields.Many2One('nutrition.program',
|
||||
'Nutrition Program', domain=[
|
||||
('product', '=', Eval('product')),
|
||||
], depends=['product']), 'get_nutrition_program')
|
||||
domain = [
|
||||
('specie', '=', animal.specie),
|
||||
('animal_type', '=', animal.lot.animal_type),
|
||||
]
|
||||
order = [('end_weight', 'DESC')]
|
||||
weight_domain = []
|
||||
if animal.current_weight:
|
||||
weight = animal.current_weight.weight
|
||||
weight_domain = [
|
||||
('start_weight', '<=', weight),
|
||||
('end_weight', '>=', weight),
|
||||
]
|
||||
programs = Program.search(domain + weight_domain, order=order, limit=1)
|
||||
if len(programs) > 0:
|
||||
return programs[0].id
|
||||
programs = Program.search(weight_domain, order=order, limit=1)
|
||||
if len(programs) > 0:
|
||||
return programs[0].id
|
||||
|
||||
|
||||
class Animal:
|
||||
__name__ = 'farm.animal'
|
||||
|
||||
nutrition_program = fields.Function(
|
||||
fields.Many2One('farm.nutrition.program', 'Nutrition Program'),
|
||||
'get_nutrition_program')
|
||||
|
||||
def get_nutrition_program(self, name):
|
||||
pool = Pool()
|
||||
Program = pool.get('nutrition.program')
|
||||
return _get_nutrition_program(self)
|
||||
|
||||
animal = self.animal_group if self.animal_group else self.animal
|
||||
if not animal:
|
||||
return
|
||||
|
||||
domain = [('animal_product', '=', self.product)]
|
||||
order = [('end_weight', 'DESC')]
|
||||
weight_domain = []
|
||||
if animal.current_weight:
|
||||
weight = animal.current_weight.weight
|
||||
weight_domain = [
|
||||
('start_weight', '<=', weight),
|
||||
('end_weight', '>=', weight),
|
||||
]
|
||||
programs = Program.search(domain + weight_domain, order=order, limit=1)
|
||||
if len(programs) > 0:
|
||||
return programs[0].id
|
||||
programs = Program.search(weight_domain, order=order, limit=1)
|
||||
if len(programs) > 0:
|
||||
return programs[0].id
|
||||
class AnimalGroup:
|
||||
__name__ = 'farm.animal.group'
|
||||
|
||||
nutrition_program = fields.Function(
|
||||
fields.Many2One('farm.nutrition.program', 'Nutrition Program'),
|
||||
'get_nutrition_program')
|
||||
|
||||
def get_nutrition_program(self, name):
|
||||
return _get_nutrition_program(self)
|
||||
|
||||
|
||||
class OpenBOM(Wizard):
|
||||
'Open BOM'
|
||||
__name__ = 'nutrition.program.open.bom'
|
||||
__name__ = 'farm.nutrition.program.open_bom'
|
||||
start_state = 'open_'
|
||||
open_ = StateAction('production.act_bom_list')
|
||||
|
||||
def do_open_(self, action):
|
||||
pool = Pool()
|
||||
NutritionProgram = pool.get('nutrition.program')
|
||||
NutritionProgram = pool.get('farm.nutrition.program')
|
||||
|
||||
program = NutritionProgram(Transaction().context.get('active_id'))
|
||||
|
||||
|
@ -88,3 +111,33 @@ class OpenBOM(Wizard):
|
|||
|
||||
def transition_open_(self):
|
||||
return 'end'
|
||||
|
||||
|
||||
class Specie:
|
||||
__name__ = 'farm.specie'
|
||||
|
||||
@classmethod
|
||||
def _create_additional_menus(cls, specie, specie_menu, specie_submenu_seq,
|
||||
current_menus, current_actions):
|
||||
pool = Pool()
|
||||
ActWindow = pool.get('ir.action.act_window')
|
||||
Group = pool.get('res.group')
|
||||
ModelData = pool.get('ir.model.data')
|
||||
|
||||
super(Specie, cls)._create_additional_menus(specie, specie_menu,
|
||||
specie_submenu_seq, current_menus, current_actions)
|
||||
|
||||
act_window_program = ActWindow(ModelData.get_id(
|
||||
'farm_nutrition_program', 'act_nutrition_program'))
|
||||
program_group = Group(ModelData.get_id('farm_nutrition_program',
|
||||
'group_nutrition_program'))
|
||||
|
||||
cls._create_menu_w_action(specie, [
|
||||
('specie', '=', specie.id),
|
||||
], {
|
||||
'specie': specie.id,
|
||||
},
|
||||
'Nutrition Programs', specie_menu, specie_submenu_seq,
|
||||
'tryton-list', program_group, act_window_program, False,
|
||||
current_menus, current_actions)
|
||||
specie_submenu_seq += 1
|
||||
|
|
|
@ -3,30 +3,44 @@
|
|||
copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<!-- groups -->
|
||||
<record model="res.group" id="group_nutrition_program">
|
||||
<field name="name">Farm / Nutriton Program</field>
|
||||
</record>
|
||||
<record model="res.user-res.group"
|
||||
id="user_admin_group_nutrition_programs">
|
||||
<field name="user" ref="res.user_admin"/>
|
||||
<field name="group" ref="group_nutrition_program"/>
|
||||
</record>
|
||||
<record model="res.user-res.group"
|
||||
id="user_trigger_group_nutrition_programs">
|
||||
<field name="user" ref="res.user_trigger"/>
|
||||
<field name="group" ref="group_nutrition_program"/>
|
||||
</record>
|
||||
|
||||
<!-- farm.nutrition.program -->
|
||||
<record model="ir.ui.view" id="nutrition_program_view_form">
|
||||
<field name="model">nutrition.program</field>
|
||||
<field name="model">farm.nutrition.program</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">nutrition_program_form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="nutrition_program_view_tree">
|
||||
<field name="model">nutrition.program</field>
|
||||
<field name="model">farm.nutrition.program</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="name">nutrition_program_tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.action.act_window" id="act_nutrition_program">
|
||||
<field name="name">Nutrition Programs</field>
|
||||
<field name="res_model">nutrition.program</field>
|
||||
<field name="res_model">farm.nutrition.program</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.act_window.view"
|
||||
id="act_nutrition_program_view1">
|
||||
<field name="sequence" eval="10"/>
|
||||
<field name="view" ref="nutrition_program_view_tree"/>
|
||||
<field name="act_window" ref="act_nutrition_program"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.act_window.view"
|
||||
id="act_nutrition_program_view2">
|
||||
<field name="sequence" eval="20"/>
|
||||
|
@ -34,55 +48,37 @@
|
|||
<field name="act_window" ref="act_nutrition_program"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Nutrition Program" id="menu_nutrition_program"
|
||||
sequence="8"/>
|
||||
<menuitem parent="menu_nutrition_program" action="act_nutrition_program"
|
||||
id="menu_nutrition_program_tree" sequence="10"/>
|
||||
|
||||
<!-- Permissions -->
|
||||
<record model="res.group" id="group_nutrition_program_admin">
|
||||
<field name="name">Nutrition Program Administration</field>
|
||||
</record>
|
||||
|
||||
<record model="res.user-res.group"
|
||||
id="user_admin_group_nutrition_program_admin">
|
||||
<field name="user" ref="res.user_admin"/>
|
||||
<field name="group" ref="group_nutrition_program_admin"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.menu-res.group" id="menugroup_nutrition_program">
|
||||
<field name="menu" ref="menu_nutrition_program"/>
|
||||
<field name="group" ref="group_nutrition_program_admin"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.model.access" id="access_nutrition_program">
|
||||
<field name="model" search="[('model', '=', 'nutrition.program')]"/>
|
||||
<field name="model"
|
||||
search="[('model', '=', 'farm.nutrition.program')]"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="False"/>
|
||||
<field name="perm_create" eval="False"/>
|
||||
<field name="perm_delete" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.model.access" id="access_nutrition_program_admin">
|
||||
<field name="model" search="[('model', '=', 'nutrition.program')]"/>
|
||||
<field name="group" ref="group_nutrition_program_admin"/>
|
||||
<record model="ir.model.access"
|
||||
id="access_nutrition_program_group_nutrition_program">
|
||||
<field name="model"
|
||||
search="[('model', '=', 'farm.nutrition.program')]"/>
|
||||
<field name="group" ref="group_nutrition_program"/>
|
||||
<field name="perm_read" eval="True"/>
|
||||
<field name="perm_write" eval="True"/>
|
||||
<field name="perm_create" eval="True"/>
|
||||
<field name="perm_delete" eval="True"/>
|
||||
</record>
|
||||
|
||||
<!-- farm.nutrition.program.open_bom -->
|
||||
<record model="ir.action.wizard" id="wizard_bom_open">
|
||||
<field name="name">BOMs</field>
|
||||
<field name="wiz_name">nutrition.program.open.bom</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
id="act_nutrition_program_open_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">nutrition.program,-1</field>
|
||||
<field name="action" ref="wizard_bom_open"/>
|
||||
<field name="wiz_name">farm.nutrition.program.open_bom</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.keyword"
|
||||
id="act_nutrition_program_open_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">farm.nutrition.program,-1</field>
|
||||
<field name="action" ref="wizard_bom_open"/>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
2
setup.py
2
setup.py
|
@ -6,7 +6,7 @@ import re
|
|||
import os
|
||||
import ConfigParser
|
||||
|
||||
MODULE = 'nutrition_program'
|
||||
MODULE = 'farm_nutrition_program'
|
||||
PREFIX = 'nantic'
|
||||
MODULE2PREFIX = {}
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# The COPYRIGHT file at the top level of this repository contains the full
|
||||
# copyright notices and license terms.
|
||||
|
||||
from .test import suite
|
||||
from .test_nutrition_program import suite
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
====================
|
||||
Move Events Scenario
|
||||
====================
|
||||
==========================
|
||||
Nutrition Program Scenario
|
||||
==========================
|
||||
|
||||
=============
|
||||
General Setup
|
||||
|
@ -13,7 +13,7 @@ Imports::
|
|||
>>> from decimal import Decimal
|
||||
>>> from proteus import config, Model, Wizard
|
||||
>>> now = datetime.datetime.now()
|
||||
>>> yesterday = datetime.datetime.now() - relativedelta(month=1)
|
||||
>>> yesterday = datetime.datetime.now() - relativedelta(days=1)
|
||||
>>> today = datetime.date.today()
|
||||
|
||||
Create database::
|
||||
|
@ -25,7 +25,7 @@ Install farm::
|
|||
|
||||
>>> Module = Model.get('ir.module.module')
|
||||
>>> modules = Module.find([
|
||||
... ('name', '=', 'nutrition_program'),
|
||||
... ('name', '=', 'farm_nutrition_program'),
|
||||
... ])
|
||||
>>> Module.install([x.id for x in modules], config.context)
|
||||
>>> Wizard('ir.module.module.install_upgrade').execute('upgrade')
|
||||
|
@ -177,19 +177,20 @@ Create individual::
|
|||
u'L1'
|
||||
>>> individual.farm.code
|
||||
u'WH'
|
||||
>>> individual.lot.nutrition_program == None
|
||||
>>> individual.nutrition_program == None
|
||||
True
|
||||
|
||||
Create nutrition program::
|
||||
|
||||
>>> NutritionProgram = Model.get('nutrition.program')
|
||||
>>> NutritionProgram = Model.get('farm.nutrition.program')
|
||||
>>> nutrition_program = NutritionProgram(
|
||||
... specie=pigs_specie,
|
||||
... animal_type='individual',
|
||||
... start_weight=10.0,
|
||||
... end_weight=30.0,
|
||||
... product=grain_product)
|
||||
... animal_product=individual_product)
|
||||
>>> nutrition_program.save()
|
||||
>>> individual.lot.nutrition_program == None
|
||||
>>> individual.nutrition_program == None
|
||||
True
|
||||
|
||||
Add weight on animal::
|
||||
|
@ -204,16 +205,17 @@ Add weight on animal::
|
|||
>>> individual.reload()
|
||||
>>> individual.current_weight.weight == Decimal('15.0')
|
||||
True
|
||||
>>> individual.lot.nutrition_program == nutrition_program
|
||||
>>> individual.nutrition_program == nutrition_program
|
||||
True
|
||||
|
||||
Create another nutrition program::
|
||||
|
||||
>>> nutrition_program2 = NutritionProgram(
|
||||
... specie=pigs_specie,
|
||||
... animal_type='individual',
|
||||
... start_weight=50.0,
|
||||
... end_weight=70.0,
|
||||
... product=grain_product)
|
||||
... animal_product=individual_product)
|
||||
>>> nutrition_program2.save()
|
||||
>>> AnimalWeight = Model.get('farm.animal.weight')
|
||||
>>> kg, = ProductUom.find([('name', '=', 'Kilogram')])
|
||||
|
@ -225,5 +227,5 @@ Create another nutrition program::
|
|||
>>> individual.reload()
|
||||
>>> individual.current_weight.weight == Decimal('60.0')
|
||||
True
|
||||
>>> individual.lot.nutrition_program == nutrition_program2
|
||||
>>> individual.nutrition_program == nutrition_program2
|
||||
True
|
||||
|
|
|
@ -22,13 +22,13 @@ class TestCase(unittest.TestCase):
|
|||
'''
|
||||
|
||||
def setUp(self):
|
||||
trytond.tests.test_tryton.install_module('nutrition_program')
|
||||
trytond.tests.test_tryton.install_module('farm_nutrition_program')
|
||||
|
||||
def test0005views(self):
|
||||
'''
|
||||
Test views.
|
||||
'''
|
||||
test_view('nutrition_program')
|
||||
test_view('farm_nutrition_program')
|
||||
|
||||
def test0006depends(self):
|
||||
'''
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=3.0.0
|
||||
version=3.0.1
|
||||
depends:
|
||||
farm
|
||||
xml:
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<form string="Nutrition Program" col="4">
|
||||
<label name="animal_type"/>
|
||||
<field name="animal_type"/>
|
||||
<newline/>
|
||||
<label name="start_weight"/>
|
||||
<field name="start_weight"/>
|
||||
<label name="end_weight"/>
|
||||
|
@ -10,6 +13,4 @@
|
|||
<field name="product"/>
|
||||
<label name="bom"/>
|
||||
<field name="bom"/>
|
||||
<label name="animal_product"/>
|
||||
<field name="animal_product"/>
|
||||
</form>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- The COPYRIGHT file at the top level of this repository contains the full
|
||||
copyright notices and license terms. -->
|
||||
<tree string="Nutrition program">
|
||||
<tree string="Nutrition Programs">
|
||||
<field name="product"/>
|
||||
<field name="animal_type"/>
|
||||
<field name="start_weight"/>
|
||||
<field name="end_weight"/>
|
||||
<field name="bom"/>
|
||||
|
|
Loading…
Reference in New Issue