Wrong values in Interim Accounts when returning stock - odoo-12

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>

Related

quickfix: How to know whether a fid is in a group or not?

Let's assume there is such part in quickfix's data dictionary
<message name="Name" msgtype="type">
<field name="field1" required="Y"/>
<field name="field2" required="Y"/>
<field name="field3" required="N"/>
<group name="group1" required="Y">
<field name="field4" required="Y"/>
</group>
<group name="group2" required="Y">
<field name="field5" required="Y"/>
<field name="field6" required="N"/>
</group>
</message>
While sending request, I need to construct message correctly - set field5 in group2, field4 in group1, and field1 outside of any group. Is there a way in quickfix library to know, for example, if field4 is in a group or not? And in which group?
If not, how is it possible to use quickfix library, if you are depending on data dictionary client will use? I should force clients to configure data dictionary as I configured it?
I should force clients to configure data dictionary as I configured it?
Yes. A server ("acceptor") and its clients ("initiators") should all be using the same DataDictionary.
If you are providing a server, you should provide documentation that defines exactly what messages/fields you support, and how use use those messages and fields. If you don't provide a QuickFIX data dictionary file, you should provide sufficient information so that client firms can create one.
Is there a way in quickfix library to know, for example, if field4 is in a group or not? And in which group?
I think you are asking this question because you don't really know what you're doing yet. :)
I think there might be DD methods for this, but I can't really remember because they're not something people usually need. I don't think this is the right approach for whatever your problem is.

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.

Set test parameter in test instance using HP QC REST API

Is there any way to create test instance with parameter using the REST API on QC 11 ?
I have a test in my test plan with some parameters, or just one for the exercise :
I want to create using the rest API :
A test set in my test lab
A test instance in this test set
A test run of my test (the one in the plan) in this test instance
And be able to set the value of my parameters
I have manage to do the first 3 points. But I can not find how to set the parameter value for my instance. If I create the tests manually it is asked during the add of the test in the instance. And I can find the parameters in the Execution Settings in the Test Instance detail :
I have search in the documentation, but didn't find anything about how to set/use theses parameters. I have made GET on every objects, but didn't find them. I also try some urls like :
/test-instances/25378/test-parameters
/test-instances/25378/execution-settings
/test-instances/25378/exec-settings
But they always return 404.
Is there any way to set these parameters values ?
I had same troubles and here is my solution.
You can query your test parameters as:
/tests/{id}/test-parameters
And your test instance parameters, which are effectively actual values for those in your test instance, with:
/test-instances/{id}/step-parameters
For parameter values created via UI it returns like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Entities TotalResults="1">
<Entity Type="step-parameter">
<ChildrenCount>
<Value>0</Value>
</ChildrenCount>
<Fields>
<Field Name="origin-test">
<Value>-1</Value>
</Field>
<Field Name="vc-user-name">
<Value></Value>
</Field>
<Field Name="id">
<Value>21</Value>
</Field>
<Field Name="parent-id">
<Value>46</Value>
</Field>
<Field Name="used-by-owner-type">
<Value>test-instance</Value>
</Field>
<Field Name="actual-value">
<Value><html><body>
<div align="left">
<font face="Arial"><span style="font-size:8pt">AAA</span></font>
</div>
</body></html></Value>
</Field>
<Field Name="key">
<Value></Value>
</Field>
<Field Name="used-by-owner-id">
<Value>34</Value>
</Field>
</Fields>
<RelatedEntities/>
</Entity>
</Entities>
Where used-by-owner-id is id of the test-instance and parent-id is id of test parameter of the test.
Actual value for this case is AAA wrapped up with html tags.
You can create step parameters like this using normal POST to url:
/step-parameters
Note: Don't use same nested url for creation as you use for retrieval. You'll not be able to create parameters with such a combination of parameters you need.
API documentation really sucks, but you can get ideas how to retrieve or create things you need by requesting entity schema with
/customization/entities

Change the content of a record field from an XML file

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

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.