[MERGE] MErged with main server of trunk

bzr revid: jvo@tinyerp.com-20100512122913-0xy3ntmkqvgp3paf
This commit is contained in:
Jay (Open ERP) 2010-05-12 17:59:13 +05:30
commit 5a028fa5ed
13 changed files with 150 additions and 65 deletions

View File

@ -280,18 +280,24 @@
<field name="arch" type="xml">
<data>
<form position="attributes">
<attribute name="string">Select your Interface</attribute>
<attribute name="string">Choose Your Interface</attribute>
</form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="Choose between the simplified interface and the extended one."/>
<newline/>
<label colspan="4" align="0.0" string="If you are testing OpenERP or using it for the first time, we suggest you use the simplified interface. It has less options and fields but is easier to understand."/>
<newline/>
<label colspan="4" align="0.0" string="You will be able to switch to the extended interface later."/>
<separator string="Choose Your Interface" colspan="4"/>
<field colspan="2" name="view" nolabel="1"/>
</group>
<xpath expr="//label[@string='description']"
position="attributes">
<attribute name="string">Choose between the simplified interface and the extended one. If you are testing OpenERP or using it for the first time, We suggest you use the simplified interface. It has less options and fields but is easier to understand. You will be able to switch to the extended interface later.</attribute>
</xpath>
<xpath expr='//separator[@string="title"]' position='attributes'>
<attribute name='string'>Choose Your Interface</attribute>
</xpath>
<xpath expr='//separator[@string="vsep"]' position='attributes'>
<attribute name='string'></attribute>
<attribute name='rowspan'>14</attribute>
</xpath>
<group string="res_config_contents" position="replace">
<group colspan="4">
<field colspan="4" name="view" nolabel="1"/>
</group>
</group>
<xpath expr='//button[@name="action_skip"]' position='replace'/>
<xpath expr='//button[@name="action_next"]' position='attributes'>
<attribute name='string'>Set</attribute>
@ -320,6 +326,5 @@
<field name="action_id" ref="action_config_simple_view_form"/>
<field name="sequence">1</field>
</record>
</data>
</openerp>

View File

@ -1352,6 +1352,7 @@
<field name="sequence"/>
<field name="action_id" select="1"/>
<field name="state"/>
<button name="action_id" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
</tree>
</field>
</record>
@ -1365,6 +1366,11 @@
<field name="action_id" select="1"/>
<field name="restart"/>
<field name="state"/>
<notebook colspan="4">
<page string="Groups">
<field name="groups_id" nolabel="1" colspan="4"/>
</page>
</notebook>
</form>
</field>
</record>

View File

@ -737,6 +737,7 @@ class ir_actions_todo(osv.osv):
'state': fields.selection(TODO_STATES, string='State', required=True),
'name':fields.char('Name', size=64),
'restart': fields.selection([('onskip','On Skip'),('always','Always'),('never','Never')],'Restart',required=True),
'groups_id':fields.many2many('res.groups', 'res_groups_action_rel', 'uid', 'gid', 'Groups'),
'note':fields.text('Text', translate=True),
}
_defaults={

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -134,7 +134,7 @@ class res_partner(osv.osv):
'title': fields.selection(_partner_title_get, 'Title', size=32),
'parent_id': fields.many2one('res.partner','Parent Partner', select=2),
'child_ids': fields.one2many('res.partner', 'parent_id', 'Partner Ref.'),
'ref': fields.char('Code', size=64),
'ref': fields.char('Reference', size=64),
'lang': fields.selection(_lang_get, 'Language', size=5, help="If the selected language is loaded in the system, all documents related to this partner will be printed in this language. If not, it will be english."),
'user_id': fields.many2one('res.users', 'Salesman', help='The internal user that is in charge of communicating with this partner if any.'),
'vat': fields.char('VAT',size=32 ,help="Value Added Tax number. Check the box if the partner is subjected to the VAT. Used by the VAT legal statement."),
@ -151,7 +151,9 @@ class res_partner(osv.osv):
'supplier': fields.boolean('Supplier', help="Check this box if the partner is a supplier. If it's not checked, purchase people will not see it when encoding a purchase order."),
'city': fields.related('address', 'city', type='char', string='City'),
'phone': fields.related('address', 'phone', type='char', string='Phone'),
'country': fields.related('address', 'country_id', type='many2one', relation='res.country', string='Country'),
'country': fields.related('address', 'country_id', type='many2one', relation='res.country', string='Country'),
'employee': fields.boolean('Employee', help="Check this box if the partner is an Employee."),
'email': fields.related('address', 'email', type='char', size=240, string='E-mail'),
'company_id': fields.many2one('res.company', 'Company', select=1),
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report id="res_partner_address_report" model="res.partner" name="res.partner.address" string="Labels" xml="base/res/partner/report/partner_address.xml" xsl="base/res/partner/report/partner_address.xsl"/>
<!--
<report id="res_partner_address_report" model="res.partner" name="res.partner.address" string="Labels" xml="base/res/partner/report/partner_address.xml" xsl="base/res/partner/report/partner_address.xsl" groups="base.group_extended"/>
<!--
<report string="Business Cards" model="res.partner" name="res.partner.businesscard" xml="base/res/partner/report/business_card.xml" xsl="base/res/partner/report/business_card.xsl"/>
-->
</data>

View File

@ -6,7 +6,7 @@
<menuitem id="menu_base_config" name="Configuration" parent="menu_base_partner" sequence="9"
groups="group_system"/>
<menuitem id="menu_base_config_partner" name="Partners" parent="menu_base_config" sequence="10" />
<menuitem id="menu_base_config_partner" name="Partners" parent="menu_base_config" sequence="10" groups="base.group_extended"/>
<menuitem id="menu_base_config_contact" name="Contacts" parent="menu_base_config" sequence="20" />
<!--
@ -249,10 +249,11 @@
<field name="arch" type="xml">
<tree string="Partners">
<field name="name"/>
<field name="ref"/>
<field name="ref" groups="base.group_extended"/>
<field name="phone"/>
<field name="city"/>
<field name="country"/>
<field name="email"/>
<field name="lang"/>
<field name="user_id"/>
</tree>
@ -275,6 +276,7 @@
<group colspan="1" col="2">
<field name="customer" select="1"/>
<field name="supplier"/>
<field name="employee"/>
</group>
</group>
<notebook colspan="4">
@ -315,7 +317,7 @@
</tree>
</field>
<separator colspan="4" string="Categories"/>
<field colspan="4" name="category_id" nolabel="1" height="90"/>
<field colspan="4" name="category_id" nolabel="1" height="90" groups="base.group_extended"/>
</page>
<page string="Sales &amp; Purchases">
<separator string="General Information" colspan="4"/>
@ -349,6 +351,7 @@
<separator orientation="vertical"/>
<filter string="Customers" icon="terp-partner" domain="[('customer','=',1)]" help="Customer Partners"/>
<filter string="Suppliers" icon="terp-partner" domain="[('supplier','=',1)]" help="Supplier Partners"/>
<filter string="Employees" icon="terp-partner" domain="[('employee','=',1)]" help="Employee Partners"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="address" select="1"/>
@ -406,6 +409,16 @@
<field name="filter" eval="True"/>
</record>
<record id="action_partner_employee_form" model="ir.actions.act_window">
<field name="name">Employees</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_type">form</field>
<field name="domain">[('employee','=',1)]</field>
<field name="context">{'default_customer':0, 'default_supplier':0 , 'default_employee':1}</field>
<field name="filter" eval="True"/>
</record>
<record id="action_partner_other_form" model="ir.actions.act_window">
<field name="name">Other Partners</field>
<field name="type">ir.actions.act_window</field>
@ -621,7 +634,16 @@
<act_window domain="[('partner_id', '=', active_id)]"
id="act_res_partner_event" name="Events"
res_model="res.partner.event"
src_model="res.partner"/>
src_model="res.partner"
groups="base.group_extended"
/>
<record id="ir_ui_view_sc_partner0" model="ir.ui.view_sc">
<field name="name">Partner</field>
<field name="resource">ir.ui.menu</field>
<field name="user_id" ref="base.user_root"/>
<field name="res_id" ref="menu_partner_form"/>
</record>
</data>
</openerp>

View File

@ -19,13 +19,19 @@
#
##############################################################################
import os
import base64
import random
from operator import attrgetter
from osv import osv, fields
import tools
from tools.translate import _
import netsvc
import pooler
class res_config_configurable(osv.osv_memory):
''' Base classes for new-style configuration items
@ -45,11 +51,19 @@ class res_config_configurable(osv.osv_memory):
return round(open*100./total)
return 100.
def _get_image(self, cr, uid, context=None):
file_no = str(random.randint(1,3))
path = os.path.join('base','res','config_pixmaps/%s.png'%file_no)
file_data = tools.file_open(path,'rb').read()
return base64.encodestring(file_data)
_columns = dict(
progress=fields.float('Configuration Progress', readonly=True),
progress = fields.float('Configuration Progress', readonly=True),
config_logo = fields.binary('Image', readonly=True),
)
_defaults = dict(
progress=_progress
progress = _progress,
config_logo = _get_image
)
def _next_action(self, cr, uid):
@ -58,8 +72,18 @@ class res_config_configurable(osv.osv_memory):
'getting next %s' % todos)
active_todos = todos.search(cr, uid, [('state','=','open')],
limit=1)
dont_skip_todo = True
if active_todos:
return todos.browse(cr, uid, active_todos[0], context=None)
todo_obj = todos.browse(cr, uid, active_todos[0], context=None)
todo_groups = map(lambda x:x.id, todo_obj.groups_id)
if todo_groups:
cr.execute("select 1 from res_groups_users_rel where uid=%s and gid=ANY(%s)",(uid, todo_groups,))
dont_skip_todo = bool(cr.fetchone())
if dont_skip_todo:
return todos.browse(cr, uid, active_todos[0], context=None)
else:
todos.write(cr, uid, active_todos[0], {'state':'skip'}, context=None)
return self._next_action(cr, uid)
return None
def _set_previous_todo(self, cr, uid, state):

View File

@ -5,22 +5,29 @@
<field name="model">res.config</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<group string="res_config_contents">
</group>
<separator string="" colspan="4"/>
<group colspan="4" col="8">
<field name="progress" widget="progressbar"/>
<label string="" colspan="3"/>
<group colspan="1" col="2">
<button name="action_skip" icon="gtk-goto-last" special="cancel"
type="object" string="Skip"/>
</group>
<group colspan="1" col="2">
<button name="action_next" icon="gtk-go-forward"
type="object" string="Next"/>
</group>
</group>
<form>
<group colspan="4" col="8">
<group colspan="3" width="200" height="250">
<field name="config_logo" widget="image" width="150" height="100" nolabel="1" colspan="1"/>
<newline/>
<label align="0.0" string="description" width="200" colspan="2"/>
</group>
<separator string="vsep" position="vertical" colspan="1" rowspan="12"/>
<group colspan="4">
<separator string="title" colspan="4"/>
<group string="res_config_contents"/>
</group>
</group>
<group colspan="8" col="8">
<separator string="" colspan="8"/>
<group colspan="4" width="220">
<field name="progress" widget="progressbar" nolabel="1" colspan="2"/>
</group>
<button name="action_skip" icon="gtk-jump-to" special="cancel"
type="object" string="Skip" colspan="1"/>
<button name="action_next" icon="gtk-go-forward"
type="object" string="Next" colspan="1"/>
</group>
</form>
</field>
</record>
@ -52,32 +59,29 @@
<field name="model">res.config.installer</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<group colspan="4">
<separator string="title" colspan="4"/>
<group colspan="4" col="10">
<group colspan="2">
<image name="gtk-dialog-info"/>
<newline/>
<label align="0.0" string="description" width="200"/>
</group>
<group colspan="8"/>
</group>
</group>
<separator string="" colspan="4"/>
<group colspan="4" col="8">
<field name="progress" widget="progressbar"/>
<label string="" colspan="3"/>
<group colspan="1" col="2">
<button name="action_skip" icon="gtk-goto-last" special="cancel"
type="object" string="Skip"/>
</group>
<group colspan="1" col="2">
<button name="action_next" icon="gtk-go-forward"
type="object" string="Install Modules"/>
</group>
</group>
<group colspan="4" col="8">
<group colspan="3" width="200" height="250">
<field name="config_logo" widget="image" width="150" height="100" nolabel="1" colspan="1"/>
<newline/>
<label align="0.0" string="description" width="200" colspan="2"/>
</group>
<separator string="vsep" position="vertical" colspan="1" rowspan="12"/>
<group colspan="4">
<separator string="title" colspan="4"/>
<group colspan="8"/>
</group>
</group>
<group colspan="8" col="8">
<separator string="" colspan="8"/>
<group colspan="4" width="220">
<field name="progress" widget="progressbar" nolabel="1" colspan="2"/>
</group>
<button name="action_skip" icon="gtk-jump-to" special="cancel"
type="object" string="Skip" colspan="1"/>
<button name="action_next" icon="gtk-go-forward"
type="object" string="Install Modules" colspan="1"/>
</group>
</form>
</field>

View File

@ -280,6 +280,7 @@
<rng:define name="separator">
<rng:element name="separator">
<rng:optional><rng:attribute name="colspan"/></rng:optional>
<rng:optional><rng:attribute name="rowspan"/></rng:optional>
<rng:optional><rng:attribute name="string"/></rng:optional>
<rng:optional><rng:attribute name="col"/></rng:optional>
<rng:optional><rng:attribute name="select"/></rng:optional>
@ -435,6 +436,7 @@
<rng:optional><rng:attribute name="string"/></rng:optional>
<rng:optional><rng:attribute name="fill"/></rng:optional>
<rng:optional><rng:attribute name="height"/></rng:optional>
<rng:optional><rng:attribute name="width"/></rng:optional>
<rng:optional><rng:attribute name="name"/></rng:optional>
<rng:optional><rng:attribute name="color" /></rng:optional>
<rng:zeroOrMore>

View File

@ -33,6 +33,8 @@ import release
import socket
import re
from itertools import islice
import threading
if sys.version_info[:2] < (2, 4):
from threadinglocal import local
@ -472,7 +474,7 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non
for key, value in x_headers.iteritems():
msg['X-OpenERP-%s' % key] = str(value)
msg['%s' % key] = str(value)
if openobject_id:
msg['Message-Id'] = "<%s-openobject-%s@%s>" % (time.time(), openobject_id, socket.gethostname())
@ -1296,6 +1298,23 @@ if __name__ == '__main__':
import doctest
doctest.testmod()
class upload_data_thread(threading.Thread):
def __init__(self, email, data, type):
self.args = [('email',email),('type',type),('data',data)]
super(upload_data_thread,self).__init__()
def run(self):
try:
import urllib
args = urllib.urlencode(self.args)
fp = urllib.urlopen('http://www.openerp.com/scripts/survey.php', args)
fp.read()
fp.close()
except:
pass
def upload_data(email, data, type='SURVEY'):
a = upload_data_thread(email, data, type)
a.start()
return True
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: