[IMP] reverting back useability on company header/footer from al
bzr revid: fp@tinyerp.com-20110930080425-wuyaef8fd2k1fuwy
This commit is contained in:
parent
8507f7cc4a
commit
d32f04bb3c
|
@ -225,18 +225,17 @@
|
|||
<field name="city"/>
|
||||
<field name="country_id"/>
|
||||
<field name="state_id"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
<field name="fax"/>
|
||||
<field name="website"/>
|
||||
<field name="vat"/>
|
||||
<field name="company_registry"/>
|
||||
<field name="phone" on_change="on_change_header(phone, email, fax, website, vat, company_registry)"/>
|
||||
<field name="email" on_change="on_change_header(phone, email, fax, website, vat, company_registry)"/>
|
||||
<field name="fax" on_change="on_change_header(phone, email, fax, website, vat, company_registry)"/>
|
||||
<field name="website" on_change="on_change_header(phone, email, fax, website, vat, company_registry)"/>
|
||||
<field name="vat" on_change="on_change_header(phone, email, fax, website, vat, company_registry)"/>
|
||||
<field name="company_registry" on_change="on_change_header(phone, email, fax, website, vat, company_registry)"/>
|
||||
<separator string="Header/Footer of Reports" colspan="4"/>
|
||||
<group colspan="4" col="3">
|
||||
<field name="rml_header1" colspan="3"/>
|
||||
<newline/>
|
||||
<field name="rml_footer1" colspan="2"/>
|
||||
<button name="generate_header" string="Generate" type="object" icon="gtk-go-forward"/>
|
||||
<field name="rml_footer1" colspan="3" groups="base.group_extended"/>
|
||||
<newline/>
|
||||
<field name="rml_footer2" colspan="2"/>
|
||||
<button name="%(bank_account_update)d" string="Set Bank Accounts" type="action" icon="gtk-go-forward"/>
|
||||
|
@ -245,10 +244,10 @@
|
|||
<button name="%(preview_report)d" string="Preview Header" type="action" icon="gtk-print"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="External Template" groups="base.group_extended">
|
||||
<page string="Header/Footer" groups="base.group_extended">
|
||||
<field colspan="4" name="rml_header" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Internal Template" groups="base.group_extended">
|
||||
<page string="Internal Header/Footer" groups="base.group_extended">
|
||||
<separator string="Portrait" colspan="2"/>
|
||||
<separator string="Landscape" colspan="2"/>
|
||||
<field colspan="2" name="rml_header2" nolabel="1"/>
|
||||
|
|
|
@ -88,6 +88,18 @@ class res_company(osv.osv):
|
|||
result[company.id][field] = address[field] or False
|
||||
return result
|
||||
|
||||
|
||||
def _get_bank_data(self, cr, uid, ids, field_names, arg, context=None):
|
||||
""" Read the 'address' functional fields. """
|
||||
result = {}
|
||||
for company in self.browse(cr, uid, ids, context=context):
|
||||
r = []
|
||||
for bank in company.bank_ids:
|
||||
if bank.footer:
|
||||
r.append(bank.name_get(context=context)[0][1])
|
||||
result[company.id] = ' | '.join(r)
|
||||
return result
|
||||
|
||||
def _set_address_data(self, cr, uid, company_id, name, value, arg, context=None):
|
||||
""" Write the 'address' functional fields. """
|
||||
company = self.browse(cr, uid, company_id, context=context)
|
||||
|
@ -102,16 +114,6 @@ class res_company(osv.osv):
|
|||
address_obj.create(cr, uid, {name: value or False, 'partner_id': company.partner_id.id}, context=context)
|
||||
return True
|
||||
|
||||
def _get_bank_data(self, cr, uid, ids, field_names, arg, context=None):
|
||||
""" Read the 'address' functional fields. """
|
||||
result = {}
|
||||
for company in self.browse(cr, uid, ids, context=context):
|
||||
r = []
|
||||
for bank in company.bank_ids:
|
||||
if bank.footer:
|
||||
r.append(bank.name_get(context=context)[0][1])
|
||||
result[company.id] = ' | '.join(r)
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Company Name', size=64, required=True),
|
||||
|
@ -146,6 +148,15 @@ class res_company(osv.osv):
|
|||
_sql_constraints = [
|
||||
('name_uniq', 'unique (name)', 'The company name must be unique !')
|
||||
]
|
||||
def on_change_header(self, cr, uid, ids, phone, email, fax, website, vat, reg=False, context={}):
|
||||
val = []
|
||||
if phone: val.append(_('Phone: ')+phone)
|
||||
if fax: val.append(_('Fax: ')+fax)
|
||||
if website: val.append(_('Website: ')+website)
|
||||
if vat: val.append(_('VAT: ')+vat)
|
||||
if reg: val.append(_('Reg: ')+reg)
|
||||
return {'value': {'rml_footer1':' | '.join(val)}}
|
||||
|
||||
|
||||
def _search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
context=None, count=False, access_rights_uid=None):
|
||||
|
@ -228,16 +239,6 @@ class res_company(osv.osv):
|
|||
self.cache_restart(cr)
|
||||
return super(res_company, self).write(cr, *args, **argv)
|
||||
|
||||
def generate_header(self, cr, uid, ids, context=None):
|
||||
for c in self.browse(cr, uid, ids, context=context):
|
||||
val = []
|
||||
if c.phone: val.append(_('Phone: ')+c.phone)
|
||||
if c.fax: val.append(_('Fax: ')+c.fax)
|
||||
if c.website: val.append(_('Website: ')+c.website)
|
||||
if c.vat: val.append(_('VAT: ')+c.vat)
|
||||
if c.company_registry: val.append(_('Reg: ')+c.company_registry)
|
||||
self.write(cr,uid, [c.id], {'rml_footer1':' | '.join(val)}, context)
|
||||
|
||||
def _get_euro(self, cr, uid, context={}):
|
||||
try:
|
||||
return self.pool.get('res.currency').search(cr, uid, [])[0]
|
||||
|
|
Loading…
Reference in New Issue