first import

This commit is contained in:
Valentin Lab
2015-01-28 11:59:35 +07:00
commit 36902ec12b
23 changed files with 489 additions and 0 deletions

23
{{name}}/LICENSE Normal file
View File

@@ -0,0 +1,23 @@
Copyright (c) {{license_years}}, {{author}}
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

7
{{name}}/README.rst Normal file
View File

@@ -0,0 +1,7 @@
=====================
{{name}}
=====================
{{description}}
This is an OpenERP/Odoo addons.

6
{{name}}/__init__.py Normal file
View File

@@ -0,0 +1,6 @@
## package holder
import models
import wizard
import test

31
{{name}}/__openerp__.py Normal file
View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
{
'name': '{{name}}',
'version': '{{version}}',
'author': '{{author}}',
'category': '{{category}}',
'complexity': 'normal',
{%- if website %}
'website': '{{ website }}',
{%- endif %}
'data': [
'data/templates.xml',
'security/security.xml',
'security/ir.model.access.csv',
'views/view.xml',
'actions/act_window.xml',
'menu.xml',
'data/data.xml',
],
'depends': [
'base',
],
'qweb': [
"static/src/xml/*.xml",
],
'test': [
],
'installable': True,
'auto_install': False,
}

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<!-- This file should contain only records from model ir.actions.act_window -->
<!-- Example:
<record id="action_orders" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="search_view_id" ref="view_sales_order_filter"/>
<field name="context">{
'search_default_my_sale_orders_filter': 1
}
</field>
<field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a quotation that can be converted into a sales
order.
</p><p>
Odoo will help you efficiently handle the complete sales flow:
quotation, sales order, delivery, invoicing and payment.
</p>
</field>
</record>
-->
</data>
</openerp>

View File

@@ -0,0 +1,4 @@
## package holder
import main

View File

@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
import logging
import openerp
import openerp.modules.registry
from openerp.modules import get_module_resource
from openerp.tools.translate import _
from openerp import http
from openerp.http import request, serialize_exception as _serialize_exception
_logger = logging.getLogger(__name__)
##
## Web Controllers
##
# class Main(http.Controller):
#
# @http.route('/{{name}}', type='http', auth="none")
# def index(self, s_action=None, db=None, **kw):
# return http.local_redirect('/web', query=request.params, keep_hash=True)
#
# @http.route([
# '/{{name}}/<xmlid>',
# '/{{name}}/<xmlid>/<version>',
# ], type='json', auth="user")
# def load_needaction(self, menu_ids):
# """ Loads needaction counters for specific menu ids.
#
# :return: needaction data
# :rtype: dict(menu_id: {'needaction_enabled': boolean, 'needaction_counter': int})
# """
# return request.session.model('ir.ui.menu').get_needaction_data(menu_ids, request.context)
#

6
{{name}}/data/data.xml Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
</data>
</openerp>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- vim:fdn=3:
-->
<openerp>
<data>
<template id="assets_backend" name="{{name}} assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/{{name}}/static/src/css/main.css"/>
<script type="text/javascript" src="/{{name}}/static/src/js/main.js"></script>
</xpath>
</template>
</data>
</openerp>

1
{{name}}/i18n/README Normal file
View File

@@ -0,0 +1 @@
This directory should contain the *.po for OpenERP/Odoo translation.

18
{{name}}/menu.xml Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<!-- This file should contain only menuitem elements -->
<!-- Example:
<menuitem action="action_order_report_all"
id="menu_report_product_all"
parent="base.next_id_64"
sequence="10"/>
-->
</data>
</openerp>

28
{{name}}/models.py Normal file
View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
import logging
from openerp.osv import orm, fields
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
##
## Models
##
# class mymodel(orm.Model):
#
# _name = '{{name}}.mymodel'
# _inherit = "res.company"
#
# _columns = {
# 'res_model': fields.char('Model'),
# 'file': fields.binary(i
# 'File', help="File to check"),
# 'partner_id': fields.many2one(
# 'res.partner',
# string="Attached Partner",
# domain="[('type', '=', 'other')]",),
# }
#

View File

@@ -0,0 +1 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
1 id name model_id/id group_id/id perm_read perm_write perm_create perm_unlink

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data noupdate="1">
<!-- This file should contain only security objects
<record model="res.groups" id="base.group_{{name}}_user">
<field name="name">{{name}} / User</field>
</record>
<record model="res.groups" id="base.group_{{toto}}_manager">
<field name="name">{{toto}} / Manager</field>
<field name="implied_ids" eval="[(4, ref('base.group_{{name}}_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
<record id="{{name}}_users_access" model="ir.rule">
<field name="name">Access to {{name}} for regular users</field>
<field name="model_id" ref="{{name}}.model_{{name}}_{{name}}"/>
<field name="domain_force">[('stage_id.closed', '=', False)]</field>
<field name="groups" eval="[(4, ref('base.group_{{name}}_user'))]"/>
<field eval="0" name="perm_unlink"/>
<field eval="0" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_create"/>
</record>
-->
</data>
</openerp>

View File

@@ -0,0 +1,11 @@
/**
* Main css of {{name}} addon.
*/
/*
.oe-{{name}} {
color: black
}
*/

View File

@@ -0,0 +1,22 @@
openerp.{{name}} = function (instance) {
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb;
// instance.web.views.add('kanban', 'instance.{{name}}.MyView');
// instance.{{name}}.MyView = instance.web.View.extend({
// template: "MyView",
// display_name: _lt('MyView'),
// default_nr_columns: 1,
// view_type: "myview",
// quick_create_class: "instance.{{name}}.QuickCreate",
// number_of_color_schemes: 10,
// init: function (parent, dataset, view_id, options) {
// this._super(parent, dataset, view_id, options);
// }
// });
};

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<!-- QWEB Templates for UI Widgets and views -->
<!--
<t t-name="{{name}}View">
<div class="oe_{{name}}_view">
<div class="oe_{{name}}_buttons"/>>
<table class="oe_{{name}}_groups">
<tr class="oe_{{name}}_groups_headers">
<td class="oe_{{name}}_dummy_cell"><div/></td>
</tr>
<tr class="oe_{{name}}_dummy_row">
</tr>
</table>
</div>
</t>
-->
</templates>

24
{{name}}/views/view.xml Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<!-- This file should contain only records from model ir.ui.view -->
<!-- Example:
<record id="view_sale_order_calendar" model="ir.ui.view">
<field name="name">sale.order.calendar</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<calendar string="Sales Orders" color="state" date_start="date_order">
<field name="partner_id"/>
<field name="amount_total"/>
</calendar>
</field>
</record>
-->
</data>
</openerp>

View File