Tryton vs OpenERP

Author: Cédric Krier
Date: 2011-11-11

Project Organisation

Licenses

Maintenance

Release Cycle

Release Policy

Packaging

Code Quality

Code Quality Example

Which one do you want to read every day?

comparison_sale.png

OpenERP Unittest

13 tests

openerp_unittest.png

54% coverage

openerp_coverage.png

Tryton Unittest

310 tests

tryton_unittest.png

69% coverage

tryton_coverage.png

Usability

Business Design

Sale

Shipment

Account

Purchase

Coding

Models

Fields

OpenERP - Function fields

def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
    res = {}
    for order in self.browse(cr, uid, ids, context=context):
        ...
    return res

OpenERP - Function fields

'amount_total': fields.function(_amount_all, digits_compute= dp.get_precision('Sale Price'), string='Total',
    store = {
        'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
        'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
    },
    multi='sums', help="The total amount."),

Tryton - Function fields

total_amount = fields.Function(fields.Numeric('Total',
        digits=(16, Eval('currency_digits', 2)),
        depends=['currency_digits']), 'get_total_amount')

def get_total_amount(self, ids, name):
    result = {}
    for sale in self.browse(ids):
        ...
    return result

OpenERP on_change - Definition

<field name="partner_id"
    on_change="onchange_partner_id(partner_id)"
    domain="[('customer','=',True)]"
    context="{'search_default_customer':1}"
    required="1"/>

OpenERP on_change - Method

def onchange_partner_id(self, cr, uid, ids, part):
    if not part:
        return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'partner_order_id': False, 'payment_term': False, 'fiscal_position': False}}

    addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['delivery', 'invoice', 'contact'])
    part = self.pool.get('res.partner').browse(cr, uid, part)
    ...
    return {'value': val}

Tryton on_change - Definition

party = fields.Many2One('party.party', 'Party',
    required=True, select=1, states={
        'readonly': Eval('state') != 'draft',
        }, on_change=['party', 'payment_term'],
    depends=['state'])

Tryton on_change - Method

def on_change_party(self, values):
    party_obj = Pool().get('party.party')
    res = {}
    if values.get('party'):
        party = party_obj.browse(values['party'])
    ...
    return res

OpenERP Digits

'amount_total': fields.function(_amount_all,
    digits_compute= dp.get_precision('Sale Price'), string='Total',
    store = {
        'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10),
        'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10),
    },
    multi='sums', help="The total amount."),

Tryton Digits

currency_digits = fields.Function(fields.Integer('Currency Digits',
    on_change_with=['currency']), 'get_function_fields')
total_amount = fields.Function(fields.Numeric('Total',
        digits=(16, Eval('currency_digits', 2)),
        depends=['currency_digits']), 'get_total_amount')

Security

Data Loading

Report Engine

Wizard

Not for Tryton

Thanks