Problem with adding a new field to an existing model - field

I have created a new module in order to add a field to a view but i have this error: "the field 'cin' does not exist
my client.xml code:
<record id="view_partner_form_inherit" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<!-- Leave the 'arch' field open -->
<field name="arch" type="xml">
<!-- Put your custom field and its position inside the 'arch' field.
Use 'xpath' tag to create a more precise positioning -->
<xpath expr="//group/group/field[#name='name']" position="after">
<field name="cin"/>
</xpath>
<!-- Now, close the 'arch' field -->
</field>
</record>
I hope you can help me.

Please follow the following steps:
There are two ways you can add new fields to res.partner model.
Uninstall the module. Then add new fields in python and xml file and then restart the server. After server restart install the module again.
But if you don't want to uninstall the module then First remove the new fields from xml and python files. Restart the server. Goto odoo apps page and open the module to upgrade. Don't click the upgrade button. Just keep it open. Then add the new fields in python and xml files and restart odoo services. After server restart click on upgrade button. In this way new fields will be added.
Hope this works for you.

Related

TFS Process Template XML - Set default System.History value

I would like to add a custom rule to set a default History when changing the status.
<FIELD name="History" refname="System.History" type="History">
<HELPTEXT>Discussion thread plus automatic record of changes</HELPTEXT>
<WHENCHANGED field="System.State">
<DEFAULT from="value" value="State changed" />
</WHENCHANGED>
</FIELD>
getting below error.
**Error importing work item type definition:
TF26062: Rule '<DEFAULT from="value" value="State changed" />' is not supported for the field 'System.History'.**
any help would be appreciated.
Checking the Process xml file, you would like to add a value for the Discussion field when the status of this work item changes.
Discussion field of the work item is not supported to use custom rule to set a value when changing status.
You could consider create a new custom field to apply your rule.

Can you add validation for swimlanes in TFS 2018?

I have a "Blocked" swimlane that I would like to add validation to. Specifically, I'd like to make a field required to be filled in when a backlog item is moved into this swimlane. Is this possible in TFS 2018? I've looked in the "TFS Process Template Editor" extension but I can't see how to do this. Thanks
Yes, it's possible, I prefer to do it with exportwitd and importwitd.
Export the work item XML with exportwitd.
Add a transition with your Blocked state and make a field required.
<TRANSITION from="In Progress" to="Blocked">
<REASONS>
<DEFAULTREASON value="Fixed"/>
</REASONS>
<FIELDS>
<FIELD refname="MyCorp.SomeField" >
<REQUIRED />
</FIELD>
</FIELDS>
</TRANSITION>`
Import the XML again to TFS with importwitd.
Now when a user moves the work item from "In Progress" to "Blocked" the field "MyCorp.SomeField" will be required.
You can find good documenation regarding above here, here and here.

TFS 2013 Add and reffer to new link type

I would like to add proper management for Duplicated bugs.
My plans were to Add new link type "Duplicating" and to prevent move to "Duplicated" in case the new linktype ==0.
Steps Taken:
Add new link type: https://msdn.microsoft.com/en-us/library/dd273716.aspx
preventing:
<FIELD refname="My.DuplicatingBug">
<WHEN field="My.LinkType.Duplicating" value="0">
<COPY from="value" value="0" />
</WHEN>
<COPY from="value" value="Valid Completed Work time" />
<PROHIBITEDVALUES expanditems="true">
<LISTITEM value="0" />
</PROHIBITEDVALUES>
</FIELD>
Yet, when trying to import the new WIT, The following prompts:
Error importing work item type definition:
TF201000: Field reference name My.LinkType.Duplicating conflicts with an existing link type. The name is already in use.
I assume that on your bug work item definition you have defined 2 fields: My.DuplicatingBug and My.LinkType.Duplicating
When you created your custom link you probably defined it as
When you're uploading the new bug definition, the field reference is clashing with the link type reference.
I'm not 100% certain but I don't think there is a way to add a conditional value to a field based on a link type.
Could you perhaps add a new field on the Bug work item called "Duplicate Bug ID" and even a new closed state of "Duplicate" and you can only move into the Duplicate state if you have populated the "Duplicate Bug ID"

Failed to update the following work item error while tfs check-in

I have modified the tfs bug work item template as below so that while resolving a bug from active to resolved state root cause field is not empty.
AS Microsoft.VSTS.Actions.Checkin action is defined user can checkin in team explorer marking the work item as resolved.This cause error
Failed to update the following work item:
ID 39169. Reason: TF237124: Work Item is not ready to save
How can i allow user to update the root cause field while check-in from team explorer pend changes window
<TRANSITION from="Active" to="Resolved">
<REASONS>
....
</REASONS>
<FIELDS>
....
<FIELD refname="RootCause">
<REQUIRED />
</FIELD>
</FIELDS>
<ACTIONS>
<ACTION value="Microsoft.VSTS.Actions.Checkin" />
</ACTIONS>
</TRANSITION>
You are not able to update additional fields when you are associating work items with a checkin. I would recommend that you head over to http://visualstudio.uservoice.com and suggest that.
With your template above your developers would need to open and update the work item before the association to make it valid.
note: Your are also disabling Gated Checkin with this configuration.

TFS 2012: Add the "effort" field to the "backlog" page

The default "Backlog" page on TFS 2012 looks like the screenshot below.
I'd like to add the "Effort" field to the "quick add" panel on the top (see arrow).
I know it involves changing xml templates, but I can't figure out the specifics.
How would I go about accomplishing that? :)
You need to change the AgileProcessConfig of the project:
Export the config file:
witadmin exportagileprocessconfig /collection:http://tfsserver:8080/tfs/DefaultCollection /p:ProjectName /f:d:\temp\test\agileprocessconfig.xml
Edit the agileprocessconfig.xml by adding the Effort field:
<ProductBacklog>
<AddPanel>
<Fields>
<Field refname="System.Title" />
<Field refname="Microsoft.VSTS.Scheduling.Effort" />
</Fields>
</AddPanel>
Import the file back to your project
witadmin importagileprocessconfig /collection:http://tfsserver:8080/tfs/DefaultCollection /p:ProjectName /f:d:\temp\test\agileprocessconfig.xml

Resources