odoo widget HTML content cleared when click save button - odoo

I'm using odoo 9.0 community version:
<record model="ir.ui.view" id="jjbbs.list_form">
<field name="name">BBS</field>
<field name="model">jjbbs.jjbbs</field>
<field name="arch" type="xml">
<sheet string="BBS">
<form>
<h2><field name="name" string="title" placeholder="title" /></h2>
<field name="catagory" placeholder="catagory" String="catagory"/>
<field String="Content" name="content" widget="html"/>
</form>
</sheet>
<sheet string="replies">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</sheet>
</field>
</record>
This is my odoo view for form,
but every time I click the save button to save the content I have changed, the content will be cleared.

This is not a form view. You're using search tags. I don't know if there are errors on the backend side, but this view should be
<record model="ir.ui.view" id="jjbbs.searchview">
<field name="name">workreport.search</field>
<field name="model">workreport.workreport</field>
<field name="arch" type="xml">
<form>
<field name="content" String="Content"/>
<field name="create_uid" String="User"/>
</form>
</field>
</record>

upgraded to the latest version ,this issue is resolved.

Related

How to make the Schedule visible in Employee module without deverloper mode in Odoo 13?

Currently, I just see the Schedule working hours and timezone with developer mode.
So, how to make the Schedule visible without developer mode?
You need to inherit form view and replace group section. It will be easy.
Something like:
<record id="view_employee_form" model="ir.ui.view">
<field name="name">hr.employee.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook/page/div/div/group[4]" position="replace">
<group string="Schedule">
<field name="resource_calendar_id" required="1"/>
<field name="tz"/>
</group>
</xpath>
</field>
</record>
The origin form view you're inheriting resp. extending is in short:
<notebook>
<page name="public" string="Work Information">
<div id="o_work_employee_container"> <!-- These two div are used to position org_chart -->
<div id="o_work_employee_main">
<!-- ... -->
<group string="Schedule" groups="base.group_no_one">
<field name="resource_calendar_id" required="1"/>
<field name="tz"/>
</group>
</div>
</div>
</page>
<!-- ... --->
</notebook>
You could as one option just remove the groups attribute, which is in combination with the group base.group_no_one used for showing things in debug mode only:
<record id="view_employee_form" model="ir.ui.view">
<field name="name">hr.employee.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//field[#name='tz']/.." position="attributes">
<attribute name="groups" />
</xpath>
</field>
</record>

Odoo: Where to edit the overview of customer invoices?

I'm new to Odoo and I'm looking for a way to add/edit columns in the overview of customer invoices.
Does anyone know which files to edit? Or how this "overview screen" is called so I can look it up better?
Link to screenshot of overview screen: http://oi58.tinypic.com/2prtyk0.jpg
Thanks in advance!
The VIEW of this "TREE" is defined in
addons/account/views/account_invoice_view.xml
Which has the code like this:
<record id="invoice_tree" model="ir.ui.view">
<field name="name">account.invoice.tree</field>
<field name="model">account.invoice</field>
<field name="arch" type="xml">
<tree decoration-info="state == 'draft'" decoration-muted="state == 'cancel'" string="Invoice">
<field name="partner_id" groups="base.group_user" string="Customer"/>
<field name="date_invoice"/>
<field name="number"/>
<field name="commercial_partner_id" invisible="1"/>
<field name="reference" invisible="1"/>
<field name="name" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<field name="user_id"/>
<field name="date_due"/>
<field name="origin"/>
<field name="amount_total_signed" sum="Total Amount"/>
<field name="residual_signed" sum="Residual Amount"/>
<field name="currency_id" invisible="1"/>
<field name="company_currency_id" invisible="1"/>
<field name="state"/>
<field name="type" invisible="context.get('type',True)"/>
</tree>
</field>
</record>
I recommend you use developer mode to know the name of the view what you want change/edit/inherit/..etc,
Go to Administrator => About Odoo => Activate Developer Mode then return to the view and you will see near to the name of the current view a Drop-down list with name Debug View#xx click there and choice Edit TreeView/FormView/...etc after that you are going to see the definition of the current view, in this way you will know what view you need to inherit/edit/..etc
I hope this will help you!

OpenERP version 6, My Timesheet form crashed after inherited

In OpenERP version 6, in my custom module, I changed the Timesheet form view by inheriting as my custom view below:
<record id="oit_hr_timesheet_sheet_form" model="ir.ui.view">
<field name="name">oit.hr.timesheet.sheet.form</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form" />
<field name="type">form</field>
<field name="arch" type="xml">
<data>
<button name="sign_in" position="replace"/>
<button name="sign_out" position="replace"/>
<field name="state_attendance" position="after">
<field name="day_attendance"/>
</field>
<field name="total_attendance_day" position="replace"/>
<field name="total_difference_day" position="replace"/>
<field name="total_timesheet_day" position="replace"/>
<field name="timesheet_ids" position="after">
<field name="day_difference"/>
<field name="day_timesheet"/>
</field>
<page string="By Day" position="replace" />
<notebook position="inside">
<page string="Time balance">
<group colspan="4" col="2" width="600">
<field name="time_account_balance"/>
<field name="working_hour"/>
<field name="attendance_hour"/>
<separator string="Timesheet numbers until the viewed working period." colspan="4" />
<field name="total_time_account_balance"/>
<field name="total_working_hour"/>
<field name="total_attendance_hour"/>
</group>
</page>
</notebook>
</data>
</field>
</record>
Then the Human Resources / Time Tracking / My Timesheet form totaly crash. But when I go to Administration / Customization / User Interface / Menu Items, and I choose "My Timesheet" menu item to fix its action from "ir.actions.server" to "ir.actions.act_window" and select object "hr_timesheet_sheet.sheet", then choose my view "oit.hr.timesheet.sheet.form" for object's form view, choose my view "oit.hr.timesheet.sheet.tree.simplified" for object's tree view.
Then I have "My Timesheet" form shown correctly.
Why is that? I think there is somethings in my view code not work with "My Timesheet" menu and "ir.actions.server" defined in file hr_timesheet_sheet/hr_timesheet_sheet_data.xml, Here I paste the openerp6 code in hr_timesheet_sheet_data.xml:
<record id="ir_actions_server_timsheet_sheet" model="ir.actions.server">
<field eval="5" name="sequence"/>
<field eval=""""code"""" name="state"/>
<field eval=""""ir.actions.server"""" name="type"/>
<field name="model_id" ref="model_hr_timesheet_current_open"/>
<field eval="[(6,0,[])]" name="child_ids"/>
<field eval=""""action = self.pool.get('hr.timesheet.current.open').open_timesheet(cr, uid, object.id, context)"""" name="code"/>
<field eval=""""True"""" name="condition"/>
<field eval=""""My Timesheet"""" name="name"/>
</record>
<record id="menu_act_hr_timesheet_sheet_form_my_current" model="ir.ui.menu">
<field name="name">My Timesheet</field>
<field eval="1" name="sequence"/>
<field name="parent_id" ref="hr_attendance.menu_hr_time_tracking"/>
<field name="icon">STOCK_JUSTIFY_FILL</field>
<field name="action" ref="ir_actions_server_timsheet_sheet"/>
</record>
Kindly please help me to have correct view code or a solution so that I will not need to change information for menu "My Timesheet" after I upgrade my custom module! thanks a lot!

OpenERP - Passing domain from button -> action -> search view

I have a button as follows:
<button string="View Cancelled Applications" name="%(action_recruit_application)d" type="action" domain="[('state','=','cancel')]"/>
The action is as follows:
<record model="ir.actions.act_window" id="action_recruit_application">
<field name="name">Applications</field>
<field name="res_model">recruit.application</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_recruit_application_search"/>
</record>
Finally the search view is as follows:
<record model="ir.ui.view" id="view_recruit_application_search">
<field name="name">recruit.application.search</field>
<field name="model">recruit.application</field>
<field name="arch" type="xml">
<search string="Applications">
<field name="application_id"/>
<field name="name"/>
<field name="application_date"/>
<field name="state"/>
</search>
</field>
</record>
I can't seem to pass the 'state' = 'cancel' to the search view.
Could anyone please help me out?
Thanks in advance.
Try by adding context in the button.For example
<button string="View Cancelled Applications" name="%(action_recruit_application)d" type="action" domain="[('state','=','cancel')]" context="{'search_default_state':'cancel'}"/>

Path for Custom Module in Openerp 7.0

my OpenERP 7.0 is install in d:\openERP 7.0 on windows 7. I have copied a custom module to D:\OpenERP 7.0\Server\server\openerp\addons, but when I update module list I am unable to see my custom module.
I have tried advanced search options with filters 'extra' and 'not installed' but still no success.
<data>
<record model="ir.ui.view" id="notebook_tree_view">
<field name="name">notebook.tree</field>
<field name="model">notebook</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Notebook">
<field name="title"/>
<field name="note"/>
<field name="note_date"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="notebook_form_view">
<field name="name">notebook.form</field>
<field name="model">notebook</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Notebook">
<field name="title"/>
<field name="note"/>
<field name="note_date"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_notebook_form">
<field name="name">notebook</field>
<field name="res_model">notebook</field>
</record>
<menuitem id="notebook_menu"
name="Notebook"
icon="terp-project"
/>
<menuitem id="notebook_menu_mainform"
name="Notes"
action="action_notebook_form"
parent="notebook_menu"
/>
</data>
try debugging this way :
1) Install another addons module and see if you can do
that. If you cannot do that then you are probably putting it
in the wrong directory.
You should have 3 directors one for the server , addons and web
2) If the above goes well then its your module which has
the problem. Double check your openerp.py file
For the form views you need to add an attribute version='7.0'
For example
<record model="ir.ui.view" id="notebook_form_view">
<field name="name">notebook.form</field>
<field name="model">notebook</field>
<field name="arch" type="xml">
<form string="Notebook" version="7.0">
<field name="title"/>
<field name="note"/>
<field name="note_date"/>
</form>
</field>
</record>
Also dont test the module in the old gtk client. openerp 7 doesnt have a gtk client