# Imports, for base primitives from tryton_builder import Module, Model, Field, Relation # We create a new module module = Module('HelloWorld') # Add a module dependence module.add_dependence('party') # Two models hello = Model('Hello', 'hello.hello') bye = Model('Bye', 'bye.bye') # Add models to module module.add_model(hello) module.add_model(bye) # Add Fields hello.add_field(Field('Char', 'Name')) hello.add_field(Field('Char', 'Greeting')) hello.add_field(Field('Boolean', 'Is Happy')) hello.add_field(Field('Date', 'Birthdate')) hello.add_field(Field('Time', 'Wake Up Time')) hello.add_field(Field('Binary', 'Some File')) # Add Relation with party module hello.add_field(Relation('Many2One', 'Party', 'party.party')) # Fields for Bye module bye.add_field(Field('Char', 'Name')) bye.add_field(Field('Selection', 'Season', options=[
# Imports, for base primitives from tryton_builder import Module, Model, Field, Relation # ---------- Partner -------------- # socio = Model('Partner', 'cooperative.partner') socio.add_field(Field('Integer', 'File')) #Legajo socio.add_field(Relation('Many2One', 'Party', 'party.party')) socio.add_field(Relation('Many2One', 'Company', 'company.company')) socio.add_field(Field('Char', 'First Name')) socio.add_field(Field('Char', 'Last Name')) socio.add_field(Field('Char', 'DNI')) socio.add_field(Relation('Many2One', 'Nationality', 'country.country')) socio.add_field( Field('Selection', 'Marital Status', options=['Soltero/a', 'Casado/a', 'Divorciado/a', 'Viudo/a', 'Otra'])) socio.add_field(Field('Date', 'Incorporation Date')) socio.add_field(Field('Numeric', 'Payed Quotes')) socio.add_field(Field('Integer', 'Vacation Days')) socio.add_field( Relation('One2Many', 'Vacation', 'cooperative.partner.vacation', field='partner')) #Relacion con vacaciones # ---------- Vacations ------------- # #Relacion con Socios vacations = Model('Vacation', 'cooperative.partner.vacation') vacations.add_field(Field('Date', 'Start Date'))
# Imports, for base primitives from tryton_builder import Module, Model, Field, Relation # ---------- Partner -------------- # socio = Model("Partner", "cooperative.partner") socio.add_field(Field("Integer", "File")) # Legajo socio.add_field(Relation("Many2One", "Party", "party.party")) socio.add_field(Relation("Many2One", "Company", "company.company")) socio.add_field(Field("Char", "First Name")) socio.add_field(Field("Char", "Last Name")) socio.add_field(Field("Char", "DNI")) socio.add_field(Relation("Many2One", "Nationality", "country.country")) socio.add_field( Field("Selection", "Marital Status", options=["Soltero/a", "Casado/a", "Divorciado/a", "Viudo/a", "Otra"]) ) socio.add_field(Field("Date", "Incorporation Date")) socio.add_field(Field("Numeric", "Payed Quotes")) socio.add_field(Field("Integer", "Vacation Days")) socio.add_field(Relation("One2Many", "Vacation", "cooperative.partner.vacation", field="partner")) # Relacion con vacaciones # ---------- Vacations ------------- # # Relacion con Socios vacations = Model("Vacation", "cooperative.partner.vacation") vacations.add_field(Field("Date", "Start Date")) vacations.add_field(Field("Date", "End Date")) vacations.add_field(Field("Integer", "Days")) vacations.add_field(Relation("Many2One", "Partner", "cooperative.partner")) # relacion many to many con Meetings