add new field to have company wise seprate currency

change view for server action : create_object

bzr revid: mga@tinyerp.com-20080826101305-5yzu2c80edh6u7bo
This commit is contained in:
mga@tinyerp.com 2008-08-26 15:43:05 +05:30
parent 570f34b49f
commit 8dfc4cef42
6 changed files with 13 additions and 2 deletions

View File

@ -151,6 +151,9 @@
<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

@ -1065,7 +1065,8 @@
<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="srcmodel_id" select="2" attrs="{'invisible':[('state','!=','object_create')]}"/>
<field name="otype"/>
<field name="srcmodel_id" select="2" attrs="{'readonly':[('type','!=','new'),('type','!=','object_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)]"/>

View File

@ -382,6 +382,10 @@ class actions_server(osv.osv):
'type': fields.char('Report Type', size=32, required=True),
'srcmodel_id': fields.many2one('ir.model', 'Model'),
'fields_lines': fields.one2many('ir.server.object.lines', 'server_id', 'Fields Mapping'),
'otype': fields.selection([
('copy','Create in Same Model'),
('new','Create in Other Model')
], 'Create Model', required=True, size=32, change_default=True),
}
_defaults = {
'state': lambda *a: 'dummy',

View File

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