Skip to Content
Menu
This question has been flagged
3 Replies
3306 Views

Hi, can anyone tell me how can I align a float or number on Odoo 10? Thanks.

Avatar
Discard

Try widget='char'

Author Best Answer

I get an error now (I don't think it's due to that): The error is as follow: Element odoo has extra content: record, line 4

 Xml file

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--Daily Transaction List View -->
<record id="daily_transaction_tree_view" model="ir.ui.view">
<field name="name">daily.transaction.tree</field>
<field name="model">daily.transaction</field>
<field name="arch" type="xml">
<!-- this will be our title of list/tree view -->
<tree string="Daily Transaction">
<!-- these will automatically map table headers for our list view, so we’ll select out column names of our model here -->
<field name="name"/>
<field name="date"/>
<field name="type"/>
<field name="amount" widget="char"/>
</tree>
</field>
</record>
<!--Daily Transaction Form View-->
<record id="daily_transaction_form_view" model="ir.ui.view">
<field name="name">daily.transaction.form</field>
<field name="model">daily.transaction</field>
<field name="arch" type="xml">
<!-- this will be our title of list/tree view -->
<form string="Daily Transaction" version="8.0">
<group>
<field name="name"/>
<field name="subject"/>
<field name="date"/>
<field name="type"/>
<field name="amount"/>
<field name="note"/>
</group>
</form>
</field>
</record>
<record id="action_daily_transaction" model="ir.actions.act_window">
<field name="name">Daily Transaction</field>
<!-- name of action -->
<field name="res_model">daily.transaction</field>
<!-- this action will be mapped to model specified -->
<field name="view_type">form</field>
<field name="view_mode">tree, form</field>
<!-- these are type of view our module will show for our daily transaction mode -->
<field name="search_view_id" eval="False"/>
<!-- here we specify id of our search view -->
<field name="context">{}</field>
<field name="help" type="html">Create new daily transaction.</field>
<!-- help text for our model -->
</record>
<!-- Main Menu Related Info -->
<menuitem name="Daily Transaction" id="base.daily_transaction_root" sequence="60"/>
<!-- Sub Menu Related Info -->
<menuitem id="menu_daily_transaction_root" name="Daily Transaction"
parent="base.daily_transaction_root" sequence="1"/>
<!-- Action Menu Related Info -->
<menuitem action="action_daily_transaction" id="menu_action_daily_transaction"
parent="menu_daily_transaction_root" sequence="20"/>

</odoo>
EDIT: Fixed...
<field name="amount" widget="float" type="char"/>

Avatar
Discard
Best Answer

What do you mean by align Float/number ?

Avatar
Discard