Change the content of a record field from an XML file - xml-serialization

In OpenERP XML fields are used to load module data.
The <record> tag is used for this.
When reinstalling the module, the records are rewritten with the current data in the XML file.
But is there a way to change just one of the record fields without rewriting all the others?
For instance, in addons/project_issue/project_issue_view.xml we have this action definition:
<record id="project_issue_categ_action" model="ir.actions.act_window">
<field name="name">Issue Categories</field>
<field name="res_model">crm.case.categ</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm.crm_case_categ_tree-view"/>
<field name="domain">[('object_id.model', '=', 'project.issue')]</field>
<field name="context" eval="{'object_id': ref('model_project_issue')}"/>
</record>
Is it possible to change just the name field in an XML file of a custom module?
I already tried :
<record id="project_issue.project_issue_categ_action" model="ir.actions.act_window">
<field name="name">Issue Categorization</field>
</record>
and
<update id="project_issue.project_issue_categ_action" model="ir.actions.act_window">
<field name="name">Issue Categorization</field>
</update>

<record id="project_issue.project_issue_categ_action" model="ir.actions.act_window">
<field name="name">Issue Categorization</field>
</record>
Your given code will change the name but won't affect menu name. You can see your given action name in form and tree view.
To change menu name, you have to override menu only not action.
For example:
<record id="project_issue.menu_project_issue_category_act" model="ir.ui.menu">
<field name="name">Issue Categorization</field>
</record>
You can even refer Apply groups on already created menus

Related

Wrong values in Interim Accounts when returning stock

I am using anglo saxon accounting ​method in my accounting and I use average pricing as my costing method in inventory. But I am struggling with the vendor stock returning process because after validating the return, stock interim account values are not as I expected. I want to return the stock to the vendor to the price of what bought but it returned to the current price.
https://www.odoo.com/documentation/user/12.0/accounting/others/inventory/avg_price_valuation.html
As the above link says, Odoo can cater stock returns to their purchase price (see section: “Further thoughts on anglo saxon mode”). But I run the same test case on my server (Odoo 12) as well as the Odoo demo server, but it returns to the current price.
Is there any specific configuration for enabling this process or am I doing something wrong?
all you need to do is inherit view_company_form view and add anglo_saxon_accounting field
<record id="view_company_form_inherit" model="ir.ui.view">
<field name="name">res.company.form.inherit</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//field[#name='rml_header1']" position="after">
<separator string=""/>
<group >
<field name="anglo_saxon_accounting" />
</group>
</xpath>
</field>
</record>

QuickFix - Tag not defined for this message - Celer tech

I've seen this questioned asked before here
and have applied the suggested solution but am still coming up with
Tag not defined for this message
I'm sending this message :
toapp : 8=FIX.4.4|9=151|35=V|34=2|49=Test|52=20180731-14:35:54.947|56=UAT-Test|55=EUR/USD|63=SP|115=Username|167=FOR|207=XCEL|262=1|263=1|264=0|265=0|461=SPOT|10=074|
and getting this back
toadmin : 8=FIX.4.4|9=134|35=3|34=3|49=Test|52=20180731-14:35:54.982|56=UAT-Test|45=2|58=Tag not defined for this message type|371=264|372=W|373=2|10=090|
The entry in the data dictionary for marketdatarequest is :
<message name="MarketDataRequest" msgtype="V" msgcat="app">
<field name="MDReqID" required="Y"/>
<field name="SubscriptionRequestType" required="Y"/>
<field name="MarketDepth" required="Y"/>
<field name="Symbol" required="Y"/>
<field name="SecurityType" required="Y"/>
<field name="MDUpdateType" required="Y"/>
<field name="CFICode" required="Y"/>
<field name="SettlType" required="Y"/>
<field name="OnBehalfOfCompID" required="N"/>
<field name="SecurityExchange" required="Y"/>
</message>
...
<field number="264" name="MarketDepth" type="INT"/>
All the other FIX implementations I've come across also have NoMDEntryTypes and NoRelatedSym groups which this does not which is strange but this is what the spec requires.
Also am I correct in saying that if I send an toapp message and get the toadmin message back with no fromapp/fromadmin message, does that mean quickfix intercepted the message as incorrectly formed and never sent it?
The rejection is not for your market data request. I can tell this from tag 372=W in the rejection:
FIX 4.4 : RefMsgType <372> field
The MsgType <35> (35) of the FIX message being referenced.
Source
MsgType W refers to a market data snapshot.
From the information you've given, I can infer that you send a MarketDataRequest (35=V) which presumably works successfully. The server you're connecting to replies with a snapshot (35=W) and your FIX engine then automatically responds to them with a rejection, because their snapshot includes tag 264 which are you not expecting.

Odoo 10, Importing res partner with tags with an XML when installing a module

I need to import customers data with tags into res.partner with an XML when installing a custom module.
"Customers" data is stored in res.partner and "Tags" data is stored in res.partner.category, they have a relationship Many2many through res_partner_res_partner_category_rel.
I'm calling two XML files in the __manifest__.py:
The first one populates successfully res.partner.category:
<?xml version="1.0"?>
<odoo>
<record model="res.partner.category" id="res_partner_category_1">
<field name="name">Heavy metal</field>
<field name="active">1</field>
</record>
</odoo>
The second one inserts the partner data:
<?xml version="1.0"?>
<odoo>
<record model="res.partner" id="res_partner_predata_1">
<field name="name">Iron Maiden</field>
</record>
</odoo>
All I need is to insert this res.partner registry with the "Heavy metal" Tag with the installation of a custom module like this:
This is how it would look:
I will deeply appreciate any help.
I found the answer in the Odoo demo data:
When I created the category Heavy metal I assigned the id res_partner_predata_1, then I only have to add the next line (the one after the comment) to the res_partner registry like this:
<?xml version="1.0"?>
<odoo>
<record model="res.partner" id="res_partner_predata_1">
<field name="name">Iron Maiden</field>
<--! This line will add the category-->
<field eval="[(6, 0, [ref('module_name.res_partner_category_1')])]" name="category_id"/>
</record>
</odoo>
I faced the same question with odoo 14. In my case your solution did not work completely. Instead of:
<field eval="[(6, 0, [ref('module_name.res_partner_category_1')])]" name="category_id"/>
I had to set:
<field name="category_id" eval="[(6,0,[ref('res_partner_category_1')])]"/>

Make notes global?

I have a client who wants to use notes and have them global across all users. It would be easiest to just remove the user dependency to display to all users. The other option is to add message_follower_ids upon creation to add a "general" channel as a follower but I'm clueless as to what the values would be.
Any thoughts, ideas, advice is greatly appreciated.
You can achieve using two methods.
You can inactive record rule of note.
<record id="note.note_note_rule_global" model="ir.rule">
<field name="name">Only followers can access a sticky notes</field>
<field name="model_id" ref="note.model_note_note"/>
<field name="active" eval="False"/>
<field name="domain_force">['|', ('user_id', '=', user.id), ('message_partner_ids', '=', user.partner_id.id)]</field>
<field name="global" eval="True"/>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
</record>
If you inactive above record rule then odoo will visible notes to all users.
Add followers inside note.
If you hide some notes for some users then you must not inactive record rule and just add followers.
This may help you.

Add user defined fields in the FIX dictionary

I need to add/modify fields in the FIX4.4 dictionary. I haven't found any helpful documentation or tutorials on this.
I'm guessing I have to modify the FIX44.xml file, but I'm not sure how exactly to do that.
In the <message></message> tags I don't see any attributes that define the number or the type(format) of that field. I see just the name and required attributes.
I think I found attributes I', looking for in the <fields></fields> tags.
I'm not sure if I'm looking in the right place or if I'm doing the right thing, but according to this I should modify the dictionary if it is necessary.
Please help.
A link to a tutorial for beginners that can help me would also be greatly appreciated.
The FIX Data Dictionary in QuickFIX contains Messages and Fields (among other things).
To add Messages you must add the message between the <messages></messages> tags like this:
<message name="CoolMessage" msgcat="app" msgtype="xCM">
<field name="Currency" required="N"/>
<field name="Text" required="N"/>
<field name="Account" required="Y"/>
</message>
And then add the new msgtype to the MsgType field in the <fields></fields> section like this:
<field number='35' name='MsgType' type='STRING'>
...
<value enum='xCM' description='COOLMESSAGE'/>
</field>
If you want to add new fields, just add them between the <fields></fields> tags like this:
<fields>
<field number="1" name="Account" type="STRING"/>
<field number="2" name="AdvId" type="STRING"/>
<field number="3" name="AdvRefID" type="STRING"/>
...
<field number="9006" name="AwesomeField" type="STRING"/>
</fields>
This and more information can be found in this tutorial.