All Projects → hexya-erp → Hexya

hexya-erp / Hexya

Licence: apache-2.0
Hexya business application development framework

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Hexya

Metasfresh
We do Open Source ERP - Fast, Flexible & Free Software to scale your Business.
Stars: ✭ 807 (+175.43%)
Mutual labels:  erp, business
Docker
Stars: ✭ 551 (+88.05%)
Mutual labels:  erp, business
uzerp
uzERP - Open Source Business Management
Stars: ✭ 41 (-86.01%)
Mutual labels:  business, erp
Xtuple
This repository contains the source code for the database schema for the PostBooks edition of xTuple ERP and xTuple's REST API server. The REST API server is written in JavaScript running on Node.js. The database schema for PostBooks runs on a PostgreSQL database server.
Stars: ✭ 247 (-15.7%)
Mutual labels:  erp, business
Trytond
Mirror of trytond
Stars: ✭ 145 (-50.51%)
Mutual labels:  erp, business
Qt Client
This repository contains the source code for the Desktop client. The Desktop client is built using the Qt framework for C++. The client can be extended or customized using JavaScript. This client is used by all editions of xTuple ERP.
Stars: ✭ 93 (-68.26%)
Mutual labels:  erp, business
Odoo
Odoo. Open Source Apps To Grow Your Business.
Stars: ✭ 23,596 (+7953.24%)
Mutual labels:  erp, business
Idempiere
iDempiere. Community Powered Enterprise. Full Open Source Business Suite ERP/CRM/MFG/SCM/POS
Stars: ✭ 137 (-53.24%)
Mutual labels:  erp, business
Openpapyrus
Sophisticated ERP, CRM, Point-Of-Sale, etc. Open source now. This system is developed since 1996.
Stars: ✭ 158 (-46.08%)
Mutual labels:  erp, business
corebos
core Business Operating System. An OPEN SOURCE business application that helps small and medium business handle all the day to day tasks.
Stars: ✭ 128 (-56.31%)
Mutual labels:  business, erp
phive
Generic business document validation engine
Stars: ✭ 17 (-94.2%)
Mutual labels:  business
is-biz-mail-php
isBizMail tells you whether a given email address belongs to a free email account provider (gmail.com, yahoo.es, yandex.ru etc) or not.
Stars: ✭ 19 (-93.52%)
Mutual labels:  business
ecclesiacrm
A CRM Software for church management.
Stars: ✭ 15 (-94.88%)
Mutual labels:  erp
erp-crm
IDURAR is Open Source ERP/CRM Based on Mern Stack (Node.js / Express.js / MongoDb / React.js ) with Ant Design (AntD) and Redux
Stars: ✭ 18 (-93.86%)
Mutual labels:  erp
odoo-docker-tutorial
利用 docker 快速建立 odoo 環境
Stars: ✭ 46 (-84.3%)
Mutual labels:  erp
apparelo
Frappe application to manage the manufacturing workflows in the garment industry. Reach us out at [email protected]
Stars: ✭ 26 (-91.13%)
Mutual labels:  erp
Nimrod
Nimrod is a lead generation bot that helps you find the emails of people you want to reach out to.
Stars: ✭ 20 (-93.17%)
Mutual labels:  business
pytest-odoo
pytest plugin to run Odoo tests
Stars: ✭ 46 (-84.3%)
Mutual labels:  business
Stoq
Stoq Retail Management System
Stars: ✭ 269 (-8.19%)
Mutual labels:  erp
pyiiko
Pyiiko is the easy-to-use library for iiko API
Stars: ✭ 14 (-95.22%)
Mutual labels:  erp

Build Status Go Report Card codecov godoc reference Gitter License

Hexya

Hexya is an open source ERP and a business application development framework written in Go.

This repository houses the business application development framework. The ERP is built by integrating modules of the Hexya Addons Project

Features of the framework

The Hexya framework is designed to develop business applications quickly and safely. It includes all needed components in a very opinionated way.

The examples below are here to give you a first idea of Hexya.

Head to the /doc directory and especially our Tutorial if you want to start developing your business application with Hexya.

ORM

Hexya includes a full-featured type safe ORM, including a type safe query builder.

Declare a model and add some fields

var fields_User = map[string]models.FieldDefinition{
    "Name": fields.Char{String: "Name", Help: "The user's username", Unique: true,
        NoCopy: true, OnChange: h.User().Methods().OnChangeName()},
    "Email":    fields.Char{Help: "The user's email address", Size: 100, Index: true},
    "Password": fields.Char{},
    "IsStaff":  fields.Boolean{String: "Is a Staff Member", 
        Help: "Set to true if this user is a member of staff"},
}

func init() {
	models.NewModel("User")
	h.User().AddFields(fields_User)
}

Use the ORM to create a record in the database with type-safe data

newUser := h.User().Create(env, h.User().NewData().
	SetName("John").
	SetEmail("[email protected]").
	SetIsStaff(true))

Search the database using the type-safe query builder and update records directly

myUsers := h.User().Search(env,
	q.User().Name().Contains("John").
		And().Email().NotEquals("[email protected]"))
for _, myUser := range myUsers.Records() {
    if myUser.IsStaff() {
        myUser.SetEmail("[email protected]")
    }	
}

Add methods to the models

// GetEmail returns the Email of the user with the given name
func user_GetEmail(rs m.UserSet, name string) string {
    user := h.User().Search(env, q.User().Name().Equals("John")).Limit(1)
    user.Sanitize()     // Call other methods of the model
    return user.Email() // If user is empty, then Email() will return the empty string
}

func init() {
    h.User().NewMethod("GetEmail", user_GetEmail)
}

Views

Define views of different types using a simple XML view definition and let the framework do the rendering:

<view id="base_view_users_form_simple_modif" model="User" priority="18">
    <form string="Users">
        <field name="image" readonly="0" widget='image'
               options='{"preview_image": "image_small"}'/>
        <h1>
            <field name="name" readonly="1"/>
        </h1>
        <button name="preference_change_password" type="object" string="Change password"/>
        <group name="preferences" col="4">
            <field name="lang" readonly="0"/>
            <field name="tz" widget="timezone_mismatch" options="{'tz_offset_field': 'tz_offset'}"
                   readonly="0"/>
            <field name="tz_offset" invisible="1"/>
            <field name="company_id" options="{'no_create': True}" readonly="0"
                   groups="base_group_multi_company"/>
        </group>
        <group string="Email Preferences">
            <field name="email" widget="email" readonly="0"/>
            <field name="signature" readonly="0"/>
        </group>
        <footer>
            <button name="preference_save" type="object" string="Save" class="btn-primary"/>
            <button name="preference_cancel" string="Cancel" special="cancel" class="btn-default"/>
        </footer>
    </form>
</view>

Controllers

Most of the time, you do not need to declare controllers in Hexya. Instead, declare an "Action" with the views you want and a menu to access it. The framework will take care of the UI including rendering views, navigation, CRUD, etc.

<action id="base_action_res_users" 
        type="ir.actions.act_window" 
        name="Users" 
        model="User"
        view_id="base_view_users_tree" 
        search_view_id="base_view_users_search" 
        view_mode="tree,form,calendar"/>

<menuitem id="base_menu_action_users" 
          name="Users" 
          sequence="1" 
          action="base_action_res_users"
          parent="base_menu_users"/>

Iterative Definition and Modularity

Each part of the Hexya Framework is modular and follow the Iterative Definition concept.

This means that an object (for example a model class) can be defined in a module and then extended in place by dependent modules. So any subsequent modification will be made on the original model and will be available for the whole application.

This makes it possible to customize the application by creating a new module with the new features without forking and still benefiting from upstream updates.

Example on models:

package A

var fields_User = map[string]models.FieldDefinition{
    "Name": fields.Char{String: "Name", Help: "The user's username", Unique: true,
        NoCopy: true, OnChange: h.User().Methods().OnChangeName()},
    "Email":    fields.Char{Help: "The user's email address", Size: 100, Index: true},
    "Password": fields.Char{},
    "IsStaff":  fields.Boolean{String: "Is a Staff Member", 
        Help: "Set to true if this user is a member of staff"},
}

func init() {
    models.NewModel("User")
    h.User().AddFields(fields_User)
}
package B

var fields_User = map[string]models.FieldDefinition{
    "Size": models.Float{},
}

func init() {
    h.User().AddFields(fields_User)
}
// Anywhere else
newUser := h.User().Create(env, h.User().NewData().
	SetName("John").
	SetEmail("[email protected]").
	SetSize(185.7))
fmt.Println(newUser.Name())
// output : John
fmt.Println(newUser.Size())
// output : 185.7

Model methods can be extended too:

package A

// GetEmail returns the Email of the user with the given name
func user_GetEmail(rs m.UserSet, name string) string {
    user := h.User().Search(rs.Env(), q.User().Name().Equals(name)).Limit(1)
    user.Sanitize()     
    return user.Email() 
}

func init() {
    h.User().NewMethod("GetEmail", user_GetEmail)
}
package B

func init() {
    h.User().Methods().GetEmail().Extend(
    	func(rs m.UserSet, name string) string {
    	    res := rs.Super().GetEmail(name)
    	    return fmt.Sprintf("<%s>", res)
    	})
}
// Anywhere else
email := h.User().NewSet(env).GetEmail("John")
fmt.Println(email)
// output: <[email protected]>

And it works also with views:

<!-- Package A -->
<view id="base_view_users_tree" model="User">
    <tree string="Users">
        <field name="Name"/>
        <field name="Login"/>
        <field name="Lang"/>
        <field name="LoginDate"/>
    </tree>
</view>
<!-- Package B -->
<view inherit_id="base_view_users_tree">
    <field name="Login" position="after">
        <field name="IsStaff"/>
    </field>
</view>

And the rendered view will be :

<tree string="Users">
    <field name="Name"/>
    <field name="Login"/>
    <field name="IsStaff"/>
    <field name="Lang"/>
    <field name="LoginDate"/>
</tree>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].