Does anyone have an xml block that will kick off a testset (curl example would be great)?
The REST documentation in HP-ALM does not show how to execute a testset from REST. There is a description of how to create a defect. The secondary problem is that the docs suggest that required fields include cycle_id and testcycl_id for which I can't find a way to get their values.
Specifically - I want to create a Run object via POST
thanks
ALM REST API Does not have the feature to kickoff Automated tests. We need to go with OTA API for the same.
By OTA try this code in VBS.
Set tdc = CreateObject("TDAPIOLE80.TDConnection")
tdc.InitConnectionEx "https://URLALM"
tdc.login "USer", "pass"
tdc.Connect "DOMAIN", "PROJECT"
Set objShell = CreateObject("WScript.Shell")
'Set TSetFact = tdc.TestSetFactory
Set tsTreeMgr = tdc.TestSetTreeManager
Set tsFolder = tsTreeMgr.NodeByPath("your tree")
Set tsList = tsFolder.FindTestSets("testSet")
Set theTestSet = tsList.Item(1) 'list of testSets
Set Scheduler = theTestSet.StartExecution("")
if err.number <> 0 then
'msgbox err.Description
Else
Scheduler.RunAllLocally = True
Scheduler.Run
Set execstatus = Scheduler.ExecutionStatus
Do While RunFinished = False
execstatus.RefreshExecStatusInfo "all", True
RunFinished = execstatus.Finished
Set EventsList = execstatus.EventsList
For Each ExecEventInfoObj In EventsList
strNowEvent = ExecEventInfoObj.EventType
Next
For i = 1 To execstatus.Count
Set TestExecStatusobj = execstatus.Item(i)
intTestid = TestExecStatusobj.TestInstance
Next
Loop
execstatus.RefreshExecStatusInfo "all", True
End if
Set tsTreeMgr = nothing
Set tsFolder = nothing
Set tsList = nothing
Set theTestSet =nothing
tdc.Disconnect
tdc.Logout
tdc.ReleaseConnection
Set tdc = Nothing
Through Rest Api,You can create run for each of the test instance in a test set and update each of the step through run-steps of that particular test case while execution.
While creating the run you have update following mandatory field:-
http://<server>/qcbin//rest/domains/<>/projects/<>/runs/
<Entity Type=\"run\"><Fields>
<Field Name=\"name\"><Value>Run_2015-04-15</Value></Field>
<Field Name=\"testcycl-id\"><Value>573269</Value></Field>
<Field Name=\"cycle-id\"><Value>4363</Value></Field>
<Field Name=\"test-id\"><Value>29201</Value></Field>
<Field Name=\"subtype-id\"><Value>hp.qc.run.MANUAL</Value></Field>
<Field Name=\"owner\"><Value>owner</Value></Field>
</Fields></Entity>
After creating run ,you need to fetch Run-ID{Run ID} from the generated Response Xml
/qcbin/rest/domains/{domain}/projects/{project}/runs/?query={name[Run_2015-04-15]}-use this url to get {Run ID}
will be used to update steps.Used in following Url
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/
For run-steps:-
To get the ID for the particular Step (like Step 1,2...).Use following query url.
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/run-steps/?query={name[Step 1]}-use this url to get Step ID {ID}.
To Update Step:-
1. Use following url:-
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/run-steps/{ID}
2.Generate the Xml and use post method to update status field.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <Entity Type="run-step">
+ <ChildrenCount>
<Value>0</Value>
</ChildrenCount>
- <Fields>
+ <Field Name="test-id">
<Value>6</Value>
</Field>
+ <Field Name="comp-status">
<Value />
</Field>
<Field Name="rel-obj-id" />
<Field Name="obj-id" />
+ <Field Name="has-linkage">
<Value>N</Value>
</Field>
+ <Field Name="execution-date">
<Value>2017-09-25</Value>
</Field>
+ <Field Name="path">
<Value />
</Field>
+ <Field Name="desstep-id">
<Value>1031</Value>
</Field>
+ <Field Name="attachment">
<Value>Y</Value>
</Field>
+ <Field Name="has-picture">
<Value>N</Value>
</Field>
<Field Name="tree-parent-id" />
+ <Field Name="id">
<Value>24820</Value>
</Field>
+ <Field Name="component-data">
<Value />
</Field>
+ <Field Name="bpt-path">
<Value />
</Field>
+ <Field Name="actual">
<Value><html><body> Results match expected </body></html></Value>
</Field>
+ <Field Name="step-order">
<Value>1</Value>
</Field>
<Field Name="level" />
+ <Field Name="expected">
<Value><html><body> <div align="left"> <font face="Arial"><span style="font-size:8pt">Successful launch of website</span></font> </div> </body></html></Value>
</Field>
<Field Name="line-no" />
+ <Field Name="comp-subtype-name">
<Value />
</Field>
- <Field Name="extended-reference">
<Value />
</Field>
- <Field Name="name">
<Value>Step 1</Value>
</Field>
+ <Field Name="execution-time">
<Value>03:56:29</Value>
</Field>
+ <Field Name="bpta-condition">
<Value />
</Field>
+ <Field Name="user-template-01">
<Value>Website Tester</Value>
</Field>
+ <Field Name="parent-id">
<Value>1522</Value>
</Field>
+ <Field Name="user-template-03">
<Value />
</Field>
+ <Field Name="bpt-facet-type">
<Value />
</Field>
+ <Field Name="user-template-04">
<Value>kama</Value>
</Field>
- <Field Name="status">
<Value>Passed</Value>
</Field>
</Fields>
Related
I would like to display a field in Form View of the product module, here is the python file (i use odoo 12.):
class ClassProductInherited:
_inherit = 'product.template'
file = fields.Char(string="Choose File")
Here is xml code (i use odoo 12.):
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[#name='inventory']/group" position="before">
<group col="2" colspan="2">
<field name="file"/>
</group>
</xpath>
</field>
</record>
When I restart the server, problem is that I have the following error:
File "/home/odoo/models.py", line 1112, in _validate_fields
raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.tools.convert.ParseError: "Error while validating constraint
Field `file` does not exist
Error context:
View `product.template.common.form.inherit`
[view_id: 2095, xml_id: module.view_product_form_inherit, model: product.template, parent_id: 402]
None" while parsing /home/omar/odoo/custom-addons/addons12/module/views/views.xml:403, near
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[#name='inventory']/group" position="before">
<group col="2" colspan="2">
<field name="file"/>
</group>
</xpath>
</field>
</record>
1- First, check if the manifest.py file contains:
"depends": [
'product'
],
2- check if the name of your file that contains the class ClassProductInherited: exists in the init.py file like this for example:
from . import my_file
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[#name='weight']" position="before">
<group>
<field name="file"/>
</group>
</xpath>
</field>
</record>
Try this piece of code and let me know if it works.
check in your .py file that you have to inherit only single module in one ... if you declare more than one module in single record so remove it. and make another record for another module. then after check it you declare or note the field file in your .py file
i am following the odoo 10 workflow documentation tutorial and i was unable to get any response form clicking on the workflow buttons, no error is showing.
*please note that in my code the name of the module i am developing is "testModule" which is written as "test_module" inside python instead of "openacademy" that is used in the docs tutorial. and the view file is views.xml instead of openacademy.xml , could any of that have an impact?
views.xml
...
<!-- this is the sessions views -->
<!-- session form view -->
<record model="ir.ui.view" id="session_form_view">
<field name="name">session.form</field>
<field name="model">test_module.session</field>
<field name="arch" type="xml">
<form string="Session Form">
<header>
<button name="draft" type="workflow"
string="Reset to draft"
states="confirmed,done"/>
<button name="confirm" type="workflow"
string="Confirm" states="draft"
class="oe_highlight"/>
<button name="done" type="workflow"
string="Mark as done" states="confirmed"
class="oe_highlight"/>
<field name="state" widget="statusbar"/>
</header>
...
session_workflow.xml
<odoo>
<data>
<record model="workflow" id="wkf_session">
<field name="name">OpenAcademy sessions workflow</field>
<field name="osv">test_module.session</field>
<field name="on_create">True</field>
</record>
<record model="ir.actions.server" id="set_session_to_draft">
<field name="name">Set session to Draft</field>
<field name="model_id" ref="model_test_module_session"/>
<field name="code">
model.search([('id', 'in', context['active_ids'])]).action_draft()
</field>
</record>
<record model="workflow.activity" id="draft">
<field name="name">Draft</field>
<field name="wkf_id" ref="wkf_session"/>
<field name="flow_start" eval="True"/>
<field name="kind">dummy</field>
<field name="action"></field>
<field name="action_id" ref="set_session_to_draft"/>
</record>
<record model="ir.actions.server" id="set_session_to_confirmed">
<field name="name">Set session to Confirmed</field>
<field name="model_id" ref="model_test_module_session"/>
<field name="code">
model.search([('id', 'in', context['active_ids'])]).action_confirm()
</field>
</record>
<record model="workflow.activity" id="confirmed">
<field name="name">Confirmed</field>
<field name="wkf_id" ref="wkf_session"/>
<field name="kind">dummy</field>
<field name="action"></field>
<field name="action_id" ref="set_session_to_confirmed"/>
</record>
<record model="ir.actions.server" id="set_session_to_done">
<field name="name">Set session to Done</field>
<field name="model_id" ref="model_test_module_session"/>
<field name="code">
model.search([('id', 'in', context['active_ids'])]).action_done()
</field>
</record>
<record model="workflow.activity" id="done">
<field name="name">Done</field>
<field name="wkf_id" ref="wkf_session"/>
<field name="kind">dummy</field>
<field name="action"></field>
<field name="action_id" ref="set_session_to_done"/>
</record>
<record model="workflow.transition" id="session_draft_to_confirmed">
<field name="act_from" ref="draft"/>
<field name="act_to" ref="confirmed"/>
<field name="signal">confirm</field>
</record>
<record model="workflow.transition" id="session_confirmed_to_draft">
<field name="act_from" ref="confirmed"/>
<field name="act_to" ref="draft"/>
<field name="signal">draft</field>
</record>
<record model="workflow.transition" id="session_done_to_draft">
<field name="act_from" ref="done"/>
<field name="act_to" ref="draft"/>
<field name="signal">draft</field>
</record>
<record model="workflow.transition" id="session_confirmed_to_done">
<field name="act_from" ref="confirmed"/>
<field name="act_to" ref="done"/>
<field name="signal">done</field>
</record>
<record model="workflow.transition" id="session_auto_confirm_half_filled">
<field name="act_from" ref="draft"/>
<field name="act_to" ref="confirmed"/>
<field name="condition">taken_seats > 50</field>
</record>
</data>
inculded the call in manafest.py
'data': [
# 'security/ir.model.access.csv',
'views/views.xml',
'views/templates.xml',
'views/partner.xml',
'views/session_workflow.xml',
],
created the fields and functions in my sessions model in models.py
state = fields.Selection([
('draft', "Draft"),
('confirmed', "Confirmed"),
('done', "Done"),
])
#api.multi
def action_draft(self):
self.state = 'draft'
#api.multi
def action_confirm(self):
self.state = 'confirmed'
#api.multi
def action_done(self):
self.state = 'done'
and at the end i upgraded the module
This happens with Sessions you created before implementing the session_workflow.xml
It should work fine for sessions you create after implementing the session_workflow.xml. They placed a warning for it somewhere in the middle of the example.
Warning
A workflow associated with a model is only created when the model's
records are created. Thus there is no workflow instance associated
with session instances created before the workflow's definition
I need to extend a form (stock.view_inventory_form) in Odoo 10. The form has a sub-tree populated with related records from another model. Here's the part of the original form that I want to change:
<field name="line_ids" string="Inventory Details" context="{'default_location_id': location_id, 'default_product_id': product_id, 'default_prod_lot_id': lot_id, 'default_package_id': package_id, 'default_partner_id': partner_id}" mode="tree,kanban">
<tree string="Inventory Details" editable="bottom" decoration-info="product_qty != theoretical_qty" decoration-danger="theoretical_qty < 0">
<field name="product_id" domain="[('type','=','product')]"/>
<field name="product_uom_id" string="UoM" groups="product.group_uom"/>
<field name="location_id" domain="[('id', 'child_of', parent.location_id)]" groups="stock.group_stock_multi_locations"/>
<field name="prod_lot_id" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}" groups="stock.group_production_lot"/>
<field name="package_id" domain="['|', ('location_id','=', False), ('location_id', '=', location_id)]" groups="stock.group_tracking_lot"/>
<field name="partner_id" groups="stock.group_tracking_owner"/>
<field name="theoretical_qty" readonly="1"/>
<field name="product_qty" string="Real Quantity"/>
<field name="state" invisible="True"/>
</tree>
</field>
Where line_ids is a field from a related model (stock.inventory.line). So I extended the model with the following:
class stock_inventory_line(models.Model):
_inherit = 'stock.inventory.line'
x_container_details = fields.Char('Container details')
x_wagon_no = fields.Char('Wagon No')
x_seal_no = fields.Char('Seal No')
x_invoice_no = fields.Integer('Invoice No')
x_net_weight = fields.Integer('Net weight')
x_gross_weight = fields.Integer('Gross Weight')
Then I tried to extend the form with the following code:
<record id="view_form_todo_task_inherited" model="ir.ui.view">
<field name="name">Test</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock.view_inventory_form"/>
<field name="arch" type="xml">
<field name="line_ids">
<field name="x_container_details"/>
<field name="x_wagon_no"/>
</field>
</field>
</record>
Odoo is not returning any error, but my fields are not showed in the (sub) tree of the form.. what am I doing wrong?
Thanks to anyone that can help with this!
This is not the right way to extend a view, you should take a look documentation.
You need to specify the position were you want to add or replace fields, this is an example to insert fields at the end of the list:
<record id="view_form_todo_task_inherited" model="ir.ui.view">
<field name="name">Test</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock.view_inventory_form"/>
<field name="arch" type="xml">
<!-- to insert your fields at the end of the list -->
<xpath expr="//tree/field[#name='state']" position="after" >
<field name="x_container_details"/>
<field name="x_wagon_no"/>
</xpath>
</field>
I hope this can be helpfull for you.
I am using quickfix 1.14.0 on a linux machine. I am sending a MarketDataRequest. The request I am sending is
<message>
<header>
<field number="8">
<![CDATA[FIX.4.4]]>
</field>
<field number="35">
<![CDATA[V]]>
</field>
<field number="49">
<![CDATA[FixServer]]>
</field>
<field number="56">
<![CDATA[INCA]]>
</field>
</header>
<body>
<field number="146">
<![CDATA[1]]>
</field>
<field number="262">
<![CDATA[MARKETDATAID]]>
</field>
<field number="263">
<![CDATA[0]]>
</field>
<field number="264">
<![CDATA[0]]>
</field>
<field number="267">
<![CDATA[1]]>
</field>
<group>
<field number="55">
<![CDATA[LNUX]]>
</field>
</group>
<group>
<field number="269">
<![CDATA[0]]>
</field>
</group>
</body>
<trailer>
</trailer>
</message>
On the receiving end, I see the request coming in as
<message>
<header>
<field number="8">
<![CDATA[FIX.4.4]]>
</field>
<field number="9">
<![CDATA[112]]>
</field>
<field number="35">
<![CDATA[V]]>
</field>
<field number="34">
<![CDATA[93]]>
</field>
<field number="49">
<![CDATA[FixServer]]>
</field>
<field number="52">
<![CDATA[20150714-19:19:54.844]]>
</field>
<field number="56">
<![CDATA[INCA]]>
</field>
</header>
<body>
<field number="55">
<![CDATA[LNUX]]>
</field>
<field number="146">
<![CDATA[1]]>
</field>
<field number="262">
<![CDATA[MARKETDATAID]]>
</field>
<field number="263">
<![CDATA[0]]>
</field>
<field number="264">
<![CDATA[0]]>
</field>
<field number="267">
<![CDATA[1]]>
</field>
<field number="269">
<![CDATA[0]]>
</field>
</body>
<trailer>
<field number="10">
<![CDATA[151]]>
</field>
</trailer>
</message>
I am parsing the request using
FIX::MDReqID mdReqID;
FIX::SubscriptionRequestType subscriptionRequestType;
FIX::MarketDepth marketDepth;
FIX::NoRelatedSym noRelatedSym;
FIX44::MarketDataRequest::NoRelatedSym noRelatedSymGroup;
message.get( mdReqID );
message.get( subscriptionRequestType );
if ( subscriptionRequestType != FIX::SubscriptionRequestType_SNAPSHOT )
throw( FIX::IncorrectTagValue( subscriptionRequestType.getField() ) );
message.get( marketDepth );
message.get( noRelatedSym );
for ( int i = 0; i < noRelatedSym; ++i )
{
FIX::Symbol symbol;
message.getGroup( i, noRelatedSymGroup );
noRelatedSymGroup.get( symbol );
}
I get an exception when I try to get the noRelatedSymbolGroup. I see the following error message sent back to the requestor,
358=Conditionally Required Field Missing (146)
The code I am using is from the examples. I do not understand why the tag 55 appears before tag 146, even though it appears correctly from the sender side.
Any help is appreciated.
This looks like a configuration problem.
Your config should have these two lines:
UseDataDictionary=Y
DataDictionary=path/to/your/dd.xml
I bet the first line is missing.
The 55 is appearing before 146 because QF will internally rearrange the top-level fields in your message (because FIX does not care about the order of top-level fields).
55 is not top-level in MarketDataReq messages, but your bad configuration is telling QF that there are no repeating groups (because repeating groups require a DD). Thus QF is treating everything as a top-level field.
I am beginner in OpenERP, I want to create a wizard to duplicate an object many time, which when i click on the button the wizard open a form the content if this form it's ( textbox + ok button) the textBox for to write how many time the wizard will call copy function to copy the object
This is my class
class immo_article(osv.osv):
_name = "immo.article"
_description = "immo article"
_columns = {
'name':fields.integer('N d inventaire',required=True , size=10),
}
_defaults = {
'date_creation': fields.date.context_today,
}
immo_article()
and this my view
<record id="immo_article_form" model="ir.ui.view">
<field name="name">immo.article.form</field>
<field name="model">immo.article</field>
<field name="arch" type="xml">
<form string="article" >
<button string="%(action_duplicate_object)d" type="action" name="duplicate.wiz"/>
<field name="name" />
</form>
</field>
</record>
<record id="immo_article_tree" model="ir.ui.view">
<record id="immo_article_tree" model="ir.ui.view">
<field name="name">immo.article.tree</field>
<field name="model">immo.article</field>
<field name="arch" type="xml">
<tree string="articles">
<field name="name" />
</tree>
</field>
</record>
<record id="immo_article_form_act" model="ir.actions.act_window">
<field name="name">Article</field>
<field name="res_model">immo.article</field>
<field name="view_mode">tree,form</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_id" ref="immo_article_tree"/>
<field name="help" type="html"></field>
</record>
and this my wizard .py
class duplicate_wiz(osv.osv_memory):
_name = 'duplicate.wiz'
_description = 'duplicate wizard'
_columns = {
'number_of_copies':fields.integer('Number of copies', size=2 , required=True),
}
_defaults = {
'number_of_copies': '0',
}
def duplicate_object(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids)[0]
article_id = context['active_id']
try:
number_of_copies = data['number_of_copies']
except:
raise osv.except_osv(_('Error'), _('Trouble!'))
return {'type': 'ir.actions.act_window_close'}
duplicate_wiz()
and this my wizard view
<record id="dup_view" model="ir.ui.view">
<field name="name">duplicate.wizard</field>
<field name="model">duplicate.wiz</field>
<field name="priority">1</field>
<field name="arch" type="xml">
<form string="Duplicate" version="7.0">
<group col="2">
<field name="number_of_copies"/>
</group>
<footer>
<button name="duplicate_object" string="_Import" type="action" class="oe_highlight"/>
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="action_duplicate_object" model="ir.actions.act_window">
<field name="name">duplicater action</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">duplicate.wiz</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="view_id" ref="dup_view"/>
</record>
</data>
I know I have many errors in wizard code, because I don't know how to it and how I can call the wizard from the button, anyone can help me with this ?
I don't have time now to read all your code, but the button on immo.article.form should have action reference in name attribute, not in string:
<button name="%(action_duplicate_object)d" type="action" string="A string"/>