Xero API: Delete the last ContactPerson in a Contact - xero-api

I need to delete the last ContactPerson from a contact in Xero.
Given this Contact:
<Contact>
<ContactID>4c7370e7-6f83-43b7-b943-a0b77e5dc348</ContactID>
<ContactStatus>ACTIVE</ContactStatus>
<!-- snip -->
<ContactPersons>
<ContactPerson>
<FirstName>Some</FirstName>
<LastName>Person</LastName>
<EmailAddress>p1#example.com</EmailAddress>
<IncludeInEmails>false</IncludeInEmails>
</ContactPerson>
<ContactPerson>
<FirstName>Another</FirstName>
<LastName>Person</LastName>
<EmailAddress>p2#example.com</EmailAddress>
<IncludeInEmails>false</IncludeInEmails>
</ContactPerson>
</ContactPersons>
</Contact>
I can delete one of them by issuing a POST to Contacts with the following payload:
<Contact>
<ContactID>4c7370e7-6f83-43b7-b943-a0b77e5dc348</ContactID>
<ContactPersons>
<ContactPerson>
<FirstName>Some</FirstName>
<LastName>Person</LastName>
<EmailAddress>p1#example.com</EmailAddress>
<IncludeInEmails>false</IncludeInEmails>
</ContactPerson>
</ContactPersons>
</Contact>
This will delete Another Person from the list of contact persons from this contact. By this logic, if I want to delete Some Person, I'd POST a request with an empty <ContactPersons /> tag. However that doesn't work - I get back a contact with the contact person intact.
Is there a way to actually delete the last contact person?

Related

Access other address country code in Odoo

I need to access the country code (country_id) from another address on the contact form as marked in the screenshot. There is a possibility to add more than one 'other' address I guess this is gonna be some kind of list, I need to list all those states.
This is the code I tried to get the country_id on res_partner
<field name="child_ids" domain="[('active','=',True)]" context="{'default_country_id':1}" string="CHILD ID"/>
How can I get that information and show it on a field?

Amadeus Error Code - Where can I find error code 25864 and resolve email format error response?

When selling a Amadeus hotel segment, I am consistently getting an error response regarding incorrect or missing email address. This is only happening for a specific Amadeus office ID. The same hotel and email address combination sells as expected in other OID.
Is there a setting on the Amadeus side that needs to be set at the OID level to support hotel sell and properly map email address?
Hotel Sell Request with email address in correct format:
<Hotel_Sell>
<systemIdentifier>
<deliveringSystem>
<companyId>WEBS</companyId>
</deliveringSystem>
</systemIdentifier>
<extraIndentification />
<groupIndicator>
<statusDetails>
<indicator>GR</indicator>
<action>2</action>
</statusDetails>
</groupIndicator>
<travelAgentRef>
<status>APE</status>
<reference>
<type>OT</type>
<value>0</value>
</reference>
</travelAgentRef>
<roomStayData>
<markerRoomStayData />
<globalBookingInfo>
<markerGlobalBookingInfo>
<hotelReference>
<chainCode>HI</chainCode>
<cityCode>OAK</cityCode>
<hotelCode>A15</hotelCode>
</hotelReference>
<hotelName>Holiday Inn Express Hotel & Suites Oakla</hotelName>
</markerGlobalBookingInfo>
<representativeParties>
<occupantList>
<passengerReference>
<type>BHO</type>
<value>2</value>
</passengerReference>
</occupantList>
<guestContactInfo>
<phoneOrEmailType>EML</phoneOrEmailType>
<emailAddress>GSWANN#DEEM.COM</emailAddress>
</guestContactInfo>
</representativeParties>
</globalBookingInfo>
<roomList>
<markerRoomstayQuery />
<roomRateDetails>
<marker />
<hotelProductReference>
<referenceDetails>
<type>BC</type>
<value>KNGP08F</value>
</referenceDetails>
</hotelProductReference>
<markerOfExtra />
</roomRateDetails>
<guaranteeOrDeposit>
<paymentInfo>
<paymentDetails>
<formOfPaymentCode>1</formOfPaymentCode>
<paymentType>2</paymentType>
<serviceToPay>3</serviceToPay>
</paymentDetails>
</paymentInfo>
<groupCreditCardInfo>
<creditCardInfo>
<ccInfo>
<vendorCode>VI</vendorCode>
<cardNumber[obfuscated]XXXX-XXXX-XXXX-XXXX/ns95:cardNumber>
<expiryDate>0535</expiryDate>
<ccHolderName>garner swann</ccHolderName>
</ccInfo>
</creditCardInfo>
</groupCreditCardInfo>
</guaranteeOrDeposit>
<guestList>
<occupantList>
<passengerReference>
<type>RMO</type>
<value>2</value>
</passengerReference>
</occupantList>
</guestList>
</roomList>
</roomStayData>
</Hotel_Sell>
Hotel Sell Response that email address is incorrect or missing:
<Hotel_SellReply>
<errorGroup>
<messageErrorInformation>
<errorDetails>
<errorCode>25864</errorCode>
<errorCategory>EC</errorCategory>
<errorCodeOwner>1A</errorCodeOwner>
</errorDetails>
</messageErrorInformation>
<errorDescription>
<freeTextDetails>
<textSubjectQualifier>3</textSubjectQualifier>
<informationType>HERR</informationType>
<language>EN</language>
<source>M</source>
<encoding>1</encoding>
</freeTextDetails>
<freeText>EMAIL ADDRESS MISSING OR INVALID</freeText>
</errorDescription>
</errorGroup>
<bookingTypeIndicator>
<numberOfRooms>
<quantity>0</quantity>
<statusCode>HK</statusCode>
</numberOfRooms>
</bookingTypeIndicator>
</Hotel_SellReply>

Why not showing custom module in odoo

I have developed new module but facing problem.
Installing custom module on server, without access rights on menus and views, my module works properly.
But when i install module with access rights , just blank page appear instead of list of installed module.
Actual screen:
Blank screen:
Access right:
Security:
One of the thing that i learned when i was learning security in odoo:
if you are getting a blank page that's mean that you did not give you user the needed groups is base.group_user Witch is employee group. because backend is for employee of the company you need to give the user this group in order to see the backend. here is a picture of my screen when i logged ing using the administrator but i removed manually the base.group_user :
so if you are creating a new groups for your new user you need to give it at least base.roup_user
in code example stock_security model :
<record id="group_stock_user" model="res.groups">
<field name="name">User</field>
<field name="category_id" ref="base.module_category_warehouse_management"/>
<field name="implied_ids" eval="[(4, ref('base.group_user')), (4, ref('stock.group_locations'))]"/>
</record>
Here they are defining a new group Named user that include base.group_user
so my question is are you connecting with administrator or a new user
now i have two question :
are you connecting using Administrator or a new user with new groups?
if you are using administrator is the screen i blank page like the one in the picture or you have the menu apps and setting but you don't have your costum menus?
EDITS :
if the menu is not shown to user then the user don't have acces
rights to the model you need to gave the read acces to the group
ir.model.access.csv
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
// in this example all user can read record of model : model.name because you didn't specify the group
"unic_xml_id_for_every_record","name what ever you want","model_model_name",,1,0,0,0
// in this example only user belong to group some_group_xmlid can read record of model.name
"unic_xml_id_for_every_record","name what ever you want","model_model_name","some_group_xmlid",1,0,0,0
// user belong to group some_group_xmlid can read and create records of model.name
"unic_xml_id_for_every_record","name what ever you want","model_model_name","some_group_xmlid",1,0,1,0
exmple
ir.model.access.csv
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"mode_name_id_1","model_name all","model_model_name",,1,0,0,0
"mode_name_id_2","model_name create_acces","model_model_name","some_group_xmlid",1,0,1,0
Could you just show our what you JS console showing?
if you want your user to see a menu that show view of model.test and let us suppose that your used_id is test_user
and your group xml group_xml_id:
add the group to your user :
<!--
this will add the group to the existing groups if you want
to replace them [(6,0,[ref('group_xml_id'),]]
-->
<record id="test_user" model="res.users">
...
...
<field name="groups" eval="[(4, ref('group_xml_id')]"/>
</record>
add access role to users of group_xml_id:
"user_test_full_acces","USER TEST FULL ACCES","model_model_test","group_xml_id",1,1,1,1
if you want the menu to be seen only by the user belong to group group_xml_id:
<menu ....... groups="module_name.group_xml_id"/>
thouse are the roles that you need to respect in order to see the menu.
this query will show if your user have the wanted groups if you don't find the group
then you are doing something wrong you should check __manifest__ may be you forget to
put the xml file.
select p.name, g.name from res_users u
INNER JOIN res_partner p on u.partner_id = p.id
inner join res_groups_users_rel r on u.id = r.uid
INNER JOIN res_groups g on r.gid = g.id
order by p.name

eBay API call AddItem using item's UPC code

I want to add products using AddItem API call in eBay with UPC code. I have searched about it, but did not get any specific answer. I want to ask what will be the UPC code for item that will be added in to the eBay list.
Please help me.
Thanks & Regards
This is an old question, and surely you have moved on. But surprisingly no other related examples here on stackoverflow or at developer.ebay.com were to be found when I ran into a similar need with the eBay API AddFixedPriceItem (almost exactly identical to AddItem but aimed at non-auction listings). Here is the XML request structure that worked for me in POSTing to this API for UPC or ISBN coded products illustrated using the Verify version of the API:
<?xml version="1.0" encoding="utf-8"?>
<VerifyAddFixedPriceItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>YOUR TOKEN STRING HERE</eBayAuthToken>
</RequesterCredentials>
<Item>
<AutoPay>false</AutoPay>
<Country>US</Country>
<Currency>USD</Currency>
<ListingType>FixedPriceItem</ListingType>
<ListingDuration>Days_30</ListingDuration>
<PaymentMethods>PayPal</PaymentMethods>
<PaymentMethods>VisaMC</PaymentMethods>
<PayPalEmailAddress>SELLER PAYPAL EMAIL ADDR HERE</PayPalEmailAddress>
<ProductListingDetails>
<UPC>BARCODE HERE</UPC>
<EAN>Does not apply</EAN>
<ListIfNoProduct>true</ListIfNoProduct>
<UseStockPhotoURLAsGallery>true</UseStockPhotoURLAsGallery>
</ProductListingDetails>
<ShippingDetails>
<ShippingServiceOptions>
<ShippingService>USPSFirstClass</ShippingService>
<ShippingServiceCost currencyID="USD">3.00</ShippingServiceCost>
<ShippingServiceAdditionalCost>1.00</ShippingServiceAdditionalCost>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>USPSPriority</ShippingService>
<ShippingServiceCost currencyID="USD">5.00</ShippingServiceCost>
<ShippingServiceAdditionalCost>2.00</ShippingServiceAdditionalCost>
<ShippingServicePriority>2</ShippingServicePriority>
</ShippingServiceOptions>
<ShippingType>Flat</ShippingType>
</ShippingDetails>
<ShipToLocations>US</ShipToLocations>
<Quantity>1</Quantity>
<Site>US</Site>
<StartPrice currencyID="USD">1.99</StartPrice>
<Title>YOUR GREAT ITEM TITLE</Title>
<Location>CITY,STATE HERE</Location>
<PictureDetails>
<GalleryType>Gallery</GalleryType>
</PictureDetails>
<DispatchTimeMax>3</DispatchTimeMax>
<ReturnPolicy>
<RefundOption>MoneyBack</RefundOption>
<Refund>Money Back</Refund>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<ReturnsWithin>30 Days</ReturnsWithin>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<ReturnsAccepted>Returns Accepted</ReturnsAccepted>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
<ShippingCostPaidBy>Buyer</ShippingCostPaidBy>
</ReturnPolicy>
<ConditionID>EBAY CONDITION CODE</ConditionID>
<ConditionDisplayName>EBAY CONDITION DISPLAY TEXT</ConditionDisplayName>
</Item>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>Low</WarningLevel>
</VerifyAddFixedPriceItemRequest>
This is the VerifyAddFixedPriceItem call, which again is very very similar to the VerifyAddItem API. You can use the Verify version of either to check out that the request will be OK once debugged (just don't trust the fees either of them report even in production). The AddFixedPriceItem API adds the item to eBay using the UPC code only, via the eBay product catalog content. You can replace <UPC> and </UPC> with <ISBN> and </ISBN> for books as well. You could use this as an XML template for the VerifyAddItem and AddItem APIs as well.
Text in CAPS needs to be customized, the shipping prices are just random for illustration. I ran this using eBay Trading API version 1001 (as of this posting date you can ignore the warnings about no seller profile being in place). Also you can find the eBay condition codes and name text here: eBay Condition ID Values and Names
Hope this helps you or someone else that comes along with a similar need.

Is it possible to send an invoice number with an authorize.net refund request?

Is it possible to send the invoiceNumber field in an AIM XML refund request with Authorize.Net? I try some variations on how to do it based on the documentation, and I get errors like:
The element 'transactionRequest' in namespace
'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element
'invoiceNumber' in namespace
'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements
expected: 'authCode, refTransId, splitTenderId, order, lineItems, tax,
duty, shipping, taxExempt, poNumber, customer, billTo, shipTo,
customerIP, cardholderAuthentication, retail, transactionSettings,
userFields' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'
The reason I ask is because I'd like to have my refunds tie back to their original transaction for reporting reasons. That way, I can search on an invoice number and find where the purchase record came in, along with each refund record, all of which would share the same invoice number. As is now, the Authorize.Net system shows me no way to match a given customer's original purchase with their refund.
Sorry for responding to an old post, but the above answer is not correct.
To have the invoice number associate with the transaction and appear in your Auth.net transaction logs, include the following bit of XML:
<order><invoiceNumber>123456</invoiceNumber></order>
See the schema https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd within <xs:complexType name="transactionRequestType"> to view the necessary order (because order does matter).
In the above example, it would go here:
<?xml version="1.0"?>
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>yourloginid</name>
<transactionKey>yourtransactionkey</transactionKey>
</merchantAuthentication>
<refId>15444549</refId>
<transactionRequest>
<transactionType>refundTransaction</transactionType>
<amount>5</amount>
<payment>
<creditCard>
<cardNumber>XXXX1111</cardNumber>
<expirationDate>122016</expirationDate>
</creditCard>
</payment>
<authCode>2165668159</authCode>
<order>
<invoiceNumber>123456</invoiceNumber>
</order>
</transactionRequest>
</createTransactionRequest>