bzr revid: christophe@tinyerp.com-20080902082306-nwcjhie922rjsmjv
This commit is contained in:
Christophe Simonis 2008-09-02 10:23:06 +02:00
commit c326e2317f
15 changed files with 72 additions and 65 deletions

View File

@ -1276,7 +1276,7 @@
<field name="type">default</field>
<field model="res.country" name="country_id" ref="be"/>
</record>
<!-- Currencies -->
<record id="EUR" model="res.currency">
<field name="name">EUR</field>
@ -1314,7 +1314,6 @@
<field eval="time.strftime('%Y-01-01')" name="name"/>
</record>
<record id="CAD" model="res.currency">
<field name="name">CAD</field>
<field name="code">CAD</field>
@ -1485,7 +1484,7 @@
<field eval="False" name="active"/>
</record>
<!-- Basic Company -->
<record id="main_company" model="res.company">
<field name="name">Tiny sprl</field>
<field name="partner_id" ref="main_partner"/>

View File

@ -38,17 +38,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Groups">
<notebook>
<page string="Group">
<field colspan="4" name="name" select="1"/>
<field colspan="4" name="users"/>
<field colspan="4" name="comment"/>
<field colspan="4" name="name" select="1"/>
<notebook colspan="4">
<page string="Users">
<field colspan="4" name="users" nolabel="1"/>
</page>
<page string="Menus">
<field colspan="4" name="menu_access"/>
<field colspan="4" name="menu_access" nolabel="1"/>
</page>
<page string="Security">
<field colspan="4" name="model_access">
<page string="Access Rights">
<field colspan="4" name="model_access" nolabel="1">
<form string="Access Controls">
<field colspan="4" name="name" select="1"/>
<field name="model_id" select="1"/>
@ -59,7 +58,11 @@
<field name="perm_unlink"/>
</form>
</field>
<field colspan="4" name="rule_groups"/>
</page>
<page string="Rules">
<field colspan="4" name="rule_groups" nolabel="1"/>
</page><page string="Notes">
<field colspan="4" name="comment" nolabel="1"/>
</page>
</notebook>
</form>
@ -94,12 +97,12 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Users">
<notebook>
<field name="name" select="1"/>
<field name="active" select="1"/>
<field name="login" select="1"/>
<field name="password"/>
<notebook colspan="4">
<page string="User">
<field name="name" select="1"/>
<field name="active" select="1"/>
<field name="login" select="1"/>
<field name="password"/>
<field name="address_id"/>
<field name="company_id" required="1"/>
<field name="action_id" required="True"/>
@ -108,9 +111,11 @@
<field name="context_tz"/>
<field colspan="4" name="signature"/>
</page>
<page string="Security">
<field colspan="4" name="groups_id"/>
<field colspan="4" name="roles_id"/>
<page string="Groups">
<field colspan="4" nolabel="1" name="groups_id"/>
</page>
<page string="Roles">
<field colspan="4" nolabel="1" name="roles_id"/>
</page>
</notebook>
</form>
@ -139,11 +144,11 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Company">
<notebook>
<field colspan="4" name="name" select="1"/>
<field name="partner_id" select="1"/>
<field name="parent_id" select="1"/>
<notebook colspan="4">
<page string="General Information">
<field colspan="4" name="name" select="1"/>
<field name="partner_id" select="1"/>
<field name="parent_id" select="1"/>
<field name="rml_header1"/>
<field name="rml_footer1"/>
<field name="rml_footer2"/>
@ -151,9 +156,6 @@
<separator colspan="4" string="Your Logo - Use a size of about 450x150 pixels."/>
<field colspan="4" name="logo" widget="image"/>
</page>
<page string="Currency">
<field colspan="4" name="currency_ids" nolabel="1"/>
</page>
<page string="Header/Footer">
<field colspan="4" name="rml_header" nolabel="1"/>
</page>

View File

@ -1066,15 +1066,15 @@
<page string="Create / Write" attrs="{'invisible':[('state','=','python'),('state','=','dummy'),('state','=','trigger'), ('state','=','sms'), ('state','=','email'), ('state','=','client_action'), ('state','=','other')]}">
<separator colspan="4" string="Fields Mapping"/>
<field name="otype"/>
<field name="srcmodel_id" select="2" attrs="{'readonly':[('type','!=','new'),('type','!=','object_create')]}"/>
<field name="srcmodel_id" select="2" attrs="{'readonly':[('type','=','copy'),('state','=','write_create')]}"/>
<field name="fields_lines" nolabel="1" select="2" colspan="4">
<tree string="Field Mappings" editable="top">
<field name="col1" domain="[('model_id','=',parent.srcmodel_id)]"/>
<field name="col1" domain="[('model_id','=',parent.srcmodel_id or parent.model_id)]"/>
<field name="type"/>
<field name="value"/>
<field name="value" colsapan="4"/>
</tree>
<form string="Field Mapping">
<field name="col1" domain="[('model_id','=',parent.srcmodel_id)]"/>
<field name="col1" domain="[('model_id','=',parent.srcmodel_id or parent.model_id)]"/>
<field name="type"/>
<field name="value" colsapan="4"/>
</form>

View File

@ -385,7 +385,7 @@ class actions_server(osv.osv):
'otype': fields.selection([
('copy','Create in Same Model'),
('new','Create in Other Model')
], 'Create Model', required=True, size=32, change_default=True),
], 'Create Model', size=32, change_default=True),
}
_defaults = {
'state': lambda *a: 'dummy',
@ -399,7 +399,8 @@ class actions_server(osv.osv):
# - uid
# - ids
# If you plan to return an action, assign: action = {...}
"""
""",
'otype': lambda *a: 'copy',
}
def get_field_value(self, cr, uid, action, context):
@ -496,7 +497,6 @@ class actions_server(osv.osv):
logger.notifyChannel('sms', netsvc.LOG_INFO, 'SMS successfully send to : %s' % (action.address))
else:
logger.notifyChannel('sms', netsvc.LOG_ERROR, 'Failed to send SMS to : %s' % (action.address))
if action.state == 'other':
localdict = {
'self': self.pool.get(action.model_id.model),
@ -535,9 +535,15 @@ class actions_server(osv.osv):
else:
expr = exp.value
res[exp.col1.name] = expr
obj_pool = self.pool.get(action.model_id.model)
id = context.get('active_id')
obj_pool.copy(cr, uid, id, res)
obj_pool = None
if action.state == 'object_create' and action.otype == 'new':
obj_pool = self.pool.get(action.srcmodel_id.model)
obj_pool.create(cr, uid, res)
else:
obj_pool = self.pool.get(action.model_id.model)
id = context.get('active_id')
obj_pool.copy(cr, uid, id, res)
return False
actions_server()

View File

@ -275,7 +275,7 @@ class module(osv.osv):
mdemo = True
for dep in module.dependencies_id:
if dep.state == 'unknown':
raise orm.except_orm(_('Error'), _('Unmet dependency: %s') % (dep.name,))
raise orm.except_orm(_('Error'), _('You try to install a module that depends on the module: %s.\nBut this module is not available in your system.') % (dep.name,))
if dep.state != newstate:
ids2 = self.search(cr, uid, [('name','=',dep.name)])
mdemo = self.state_update(cr, uid, ids2, newstate, states_to_update, context, level-1,) and mdemo

View File

@ -104,7 +104,7 @@
<field name="model">ir.module.module</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state=='to upgrade' or state=='to install';grey:state=='uninstalled' or state=='uninstallable'" string="Modules">
<tree colors="blue:state=='to upgrade' or state=='to install';red:state=='uninstalled';grey:state=='uninstallable'" string="Modules">
<field name="name"/>
<field name="shortdesc"/>
<field name="author"/>

View File

@ -31,8 +31,8 @@
<image name="gtk-dialog-info"/>
<group col="2" states="choose" fill="0" height="500">
<separator string="Export translation file" colspan="2"/>
<field name="lang" width="300"/>
<field name="format"/>
<field name="lang" width="300" required="1"/>
<field name="format" required="1"/>
<field name="modules" width="500" height="200"/>
<field name="state" invisible="1"/>
<newline/><label/>

View File

@ -203,11 +203,11 @@
<form string="Partners">
<group colspan="4" col="6">
<field name="name" select="1"/>
<field name="customer" select="1"/>
<field name="supplier" select="2"/>
<field domain="[('domain', '=', 'partner')]" name="title"/>
<field name="ref" select="1"/>
<field name="customer" select="1"/>
<field domain="[('domain', '=', 'partner')]" name="title"/>
<field name="lang" select="2"/>
<field name="supplier" select="2"/>
</group>
<notebook colspan="4">
<page string="General">
@ -249,6 +249,7 @@
<field name="website" widget="url"/>
<field name="date" select="2"/>
<field name="parent_id"/>
<newline/>
</page>
<page string="History">
<field colspan="4" name="events" nolabel="1" widget="one2many_list"/>
@ -279,7 +280,11 @@
<field name="view_id" ref="view_partner_form"/>
<field name="act_window_id" ref="action_partner_form"/>
</record>
<menuitem action="action_partner_form" id="menu_partner_form" parent="base.menu_base_partner"/>
<menuitem
action="action_partner_form"
id="menu_partner_form"
parent="base.menu_base_partner"
sequence="2"/>
<record id="action_partner_customer_form" model="ir.actions.act_window">
<field name="name">Customers Partners</field>
@ -469,8 +474,8 @@
<field name="view_id" ref="view_partner_category_tree"/>
<field name="domain">[('parent_id','=',False)]</field>
</record>
<menuitem id="next_id_13" name="Categories" parent="base.menu_base_config"/><menuitem action="action_partner_category" id="menu_partner_category" parent="next_id_13"/>
<menuitem action="action_partner_category" id="menu_partner_category_main" parent="base.menu_base_partner" sequence="1"/>
<record id="action_partner_by_category" model="ir.actions.act_window">
<field name="name" eval="False"/>
<field name="res_model">res.partner</field>
@ -486,19 +491,14 @@
<field eval="'ir.actions.act_window,%d'%action_partner_by_category" name="value"/>
<field eval="True" name="object"/>
</record>
<menuitem action="action_partner_category" id="menu_partner_category_main" parent="base.menu_base_partner" sequence="1"/>
<record id="action_partner_category_form" model="ir.actions.act_window">
<field name="name">Partner categories</field>
<field name="name">Partner Categories</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner.category</field>
<field name="view_type">form</field>
</record>
<menuitem action="action_partner_category_form" id="menu_partner_category_form" parent="base.next_id_13"/>
<menuitem action="action_partner_category_form" id="menu_partner_category_form" parent="base.menu_base_config"/>
</data>
</terp>

View File

@ -46,7 +46,6 @@ class res_company(osv.osv):
'rml_header2' : fields.text('RML Internal Header'),
'logo' : fields.binary('Logo'),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
'currency_ids': fields.one2many('res.currency', 'company_id', 'Currency Rates'),
}
def _get_child_ids(self, cr, uid, uid2, context={}):

View File

@ -64,7 +64,6 @@ class res_currency(osv.osv):
'accuracy': fields.integer('Computational Accuracy'),
'rounding': fields.float('Rounding factor', digits=(12,6)),
'active': fields.boolean('Active'),
'company_id' : fields.many2one('res.company', 'Company'),
}
_defaults = {
'active': lambda *a: 1,

View File

@ -23,8 +23,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Currency">
<field name="name" select="1"/>
<field name="company_id" select="2"/>
<field name="name" select="1" colspan="4"/>
<field name="code" select="1"/>
<field name="rate"/>
<field name="rounding"/>

View File

@ -203,6 +203,8 @@ class expression(object):
return self
def __leaf_to_sql(self, leaf, table):
if leaf == self.__DUMMY_LEAF:
return ('(1=1)',[])
left, operator, right = leaf
if operator == 'inselect':

View File

@ -295,15 +295,14 @@ class orm_template(object):
_table = None
def _field_create(self, cr, context={}):
cr.execute("SELECT id FROM ir_model WHERE model='%s'" % self._name)
cr.execute("SELECT id FROM ir_model_data WHERE name='%s'" % ('model_'+self._name.replace('.','_'),))
if not cr.rowcount:
# reference model in order to have a description of its fonctionnality in custom_report
cr.execute('SELECT nextval(%s)', ('ir_model_id_seq',))
id = cr.fetchone()[0]
cr.execute("INSERT INTO ir_model (id,model, name, info) VALUES (%s, %s, %s, %s)", (id, self._name, self._description, self.__doc__))
if 'module' in context:
cr.execute("INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (%s, now(), now(), %s, %s, %s)", \
('model_'+self._table, context['module'], 'ir.model', id)
('model_'+self._name.replace('.','_'), context['module'], 'ir.model', id)
)
cr.commit()

View File

@ -32,8 +32,8 @@ import re
# First a little helper, since I don't like to repeat things. (Tismer speaking)
import string
def replace(where, what, with):
return string.join(string.split(where, what), with)
def replace(where, what, with_whom):
return string.join(string.split(where, what), with_whom)
# This list of keywords is taken from ref/node13.html of the
# Python 1.3 HTML documentation. ("access" is intentionally omitted.)

View File

@ -368,6 +368,8 @@ def trans_generate(lang, modules, dbname=None):
elif model=='ir.model.fields':
field_name = obj.name
if not field_name in pool.get(obj.model)._columns:
continue
field_def = pool.get(obj.model)._columns[field_name]
name = obj.model + "," + field_name