Mule-SAP Connector Error Message "Please enter sold-to party or ship-to party" - mule

Am using Mule-Sap Connector(v)3.5.0 to Create Sales-Order.
I see following error message in RETURN
Row 0
Type: E
ID: VP
Message: Please enter sold-to party or ship-to party
Row 1
Type: E
ID: V4
Message: Sales document was not changed
Mapping Details
Code Snippet:
<sap:outbound-endpoint exchange-pattern="request-response"
type="function" functionName="BAPI_SALESORDER_CREATEFROMDAT2"
xmlVersion="2" outputXml="true" responseTimeout="10000"
connector-ref="sap-connector" doc:name="create-sales-order">
<sap:definition><![CDATA[
<jco>
<import>
<structure name="ORDER_HEADER_IN">
<field name="DOC_TYPE">ZBV1</field>
<field name="SALES_ORG">1000</field>
<field name="DISTR_CHAN">6</field>
<field name="DIVISION">1</field>
<field name="SALES_OFF">MCT</field>
<field name="SALES_GRP">2</field>
</structure>
</import>
<tables>
<table name="ORDER_PARTNERS">
<row id="0">
<field name="PARTN_ROLE">PE</field>//Customer sold to party
<field name="PARTN_NUMB">4275</field>
</row>
<row id="1">
<field name="PARTN_ROLE">SP</field> //Employee sold to party
<field name="PARTN_NUMB">60001039</field>
</row>
</table>
<table name="ORDER_SCHEDULES_IN">
<row id="0">
<field name="REQ_QTY">1</field>
</row>
</table>
<table name="ORDER_ITEMS_IN">
<row id="0">
<field name="MATERIAL">11753</field>
<field name="SALES_UNIT">EA</field>
<field name="PLANT">D006</field>
<field name="BATCH">384</field>
</row>
</table>
</tables>
</jco>]]></sap:definition>
</sap:outbound-endpoint>
By the error message i insist that sold-to party is not correctly mapped.
So can any one please help me, how do i map sold-to party and where am going wrong.
Many Thanks..

Try with 'AG' instead of 'SP'. I faced the same problem which resolved by putting AG as PARTN_ROLE.

Related

How to add a new button inside the action menu Odoo 12?

Im trying to add a button inside the action in the model named 'consultation', After clicking the button i need to open up the wizard i created follow,But im stuck in some errors
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="specialist_no_show" model="ir.ui.view">
<field name="name">specialist no show</field>
<field name="model">specialist.no.show</field>
<field name="arch" type="xml">
<form string="No Show">
<group>
<group>
<field name="partner_id" readonly="1"/>
</group>
</group>
<footer>
<button name="update_no_show" string="Confirm" type="object" class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<act_window name="No Show"
id="specialist_no_show"
res_model="specialist_no_show" #model created for the wizard
binding_model="consultation" #model where i want to show the button in the action
binding_views="form"
view_mode="list"
target="new"
/>
</odoo>
I can spot some problems that you can try:
The XML ID for the form and the act_window must be different. In your example it is both specialist_no_show
The res_model must be specialist.no.show
The structure for the act_window is different depending on your Odoo Version (see below).
For Odoo Version 12.0
<act_window name="No Show"
id="action_specialist_no_show"
res_model="specialist.no.show"
src_model="consultation"
view_mode="form"
target="new"
/>
For Odoo Version 13.0
<act_window name="No Show"
id="action_specialist_no_show"
res_model="specialist.no.show"
binding_model="consultation"
view_mode="form"
target="new"
/>
Also, the error logs would be helpful as #Kenly suggested. Always post those.

Odoo 13 error in xml file while adding fields in custom module

I am getting this error while upgrading my custom module in odoo13 while upgrading it , the error is within this xml file.i have added somoe fields in xml file then it showing me this erro
error :
Odoo Server Error
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 392, in _check_xml
self.postprocess_and_fields(view.model, view_doc, view.id)
File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 964, in postprocess_and_fields
self.raise_view_error(message, view_id)
File "/odoo/odoo-server/odoo/addons/base/models/ir_ui_view.py", line 592, in raise_view_error
raise ValueError(message)
ValueError: Field state does not exist
Error context:
View view.demo.form
[view_id: 1710, xml_id: gunalan_demo.request_form, model: car.request, parent_id: n/a]
models.py:
# -*- coding: utf-8 -*-
from odoo import models, fields, api , _
class gunalan_demo(models.Model):
_name = 'car.request' #Tables in DB =>car_request
_description = 'demo module'
name = fields.Char(string="Request_demo",required = True ,)
date_from = fields.Datetime(string='starting date',default=fields.Datetime.now(),)
date_to = fields.Datetime(string='Ending date',required=False,)
emplyoee_id= fields.Many2one(comodel_name="hr.employee", string="Emplyoee ", required=True,)
car_id = fields.Many2one(comodel_name="fleet.vehicle", string="Car ", required=True,)
state = fields.Selection(string="Status", selection=[('draft', 'Draft'), ('confirm', 'Confirm'),('validate','Validate'),('refuse','Refuse')('approved','Approved'),], default="draft", )
views.xml:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id ="request_form" model ="ir.ui.view">
<field name="name">view.demo.form</field>
<field name="model">car.request</field>
<field name="arch" type="xml">
<form string ="Car Request Form">
<header>
<!--<button name="" string="" class="oe_highlight" states="" type=""/>-->
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate,refuse,approved"/>
</header>
<sheet>
<div class="oe_title">
<label for="name" class="oe_title_only"/>
<h1>
<field name="name" placeholder="Request Demo"/>
</h1>
</div>
<group>
<group>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group>
<field name="emplyoee_id"/>
<field name="car_id"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id='request_tree' model='ir.ui.view' >
<field name='name'>view.demo.tree</field>
<field name='model'>car.request</field>
<field name='arch' type='xml'>
<tree string='Car Request Tree'>
<field name="name"/>
<field name="emplyoee_id"/>
<field name="car_id"/>
<field name="date_from"/>
<field name="date_to"/>
</tree>
</field>
</record>
<record id="action_request_views" model="ir.actions.act_window">
<field name="name">Car Request</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">car.request</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Car Request
</p><p>
Click here to add
</p>
</field>
</record>
<!-- This Menu Item will appear in the Upper bar, That's why It needs NO parent or action -->
<menuitem id="menu_car_request_root" name="Car Request" sequence="10"/>
<menuitem id="menu_car_request_categ" name="Car Request" parent="menu_car_request_root" sequence="1"/>
<menuitem id="menu_car_request" name="Car Request" parent="menu_car_request_categ" action="action_request_views" sequence="1"/>
Make sure you have added your model.py file in init.py file. If you have added model.py inside model folder, then make sure model is given in init.py file.

How can i change address/ street format in customer form view (odoo 11)?

please, i want to change the address format in customer form view odoo? how can i do that?.
I tried to change the code to XML but nothing changes!
<xpath expr="//div[#class='o_address_format']" position="replace">
<div class="o_address_format">
<field name="street" placeholder="Street..." class="o_address_street"/>
<field name="city" placeholder="City" class="o_address_city"/>
<field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}'/>
<field name="zip" placeholder="Code postal"/>
<field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
</div>
</xpath>
Finally there was another module that inherited the street field, so my code doesn't work; so the solution is to make the changes I wanted in the first module.
So my problem is solved

Show list of available product fields for Inventory Adjustments (to find the barcode field)

I would like to add the barcode of my products to the product list in the inventory list in the inventory adjustments. The view list is:
<?xml version="1.0"?>
<tree editable="top" string="Inventory Details" 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', inventory_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="1"/>
<field name="inventory_id" invisible="1"/>
<field name="inventory_location_id" invisible="1"/>
</tree>
If I try to add the field <field name="product_id.barcode" /> I am told that:
Field product_id.barcode does not exist
How to see all the fields that are possible to add in this list?
Seems like you can't go throughout models in XML views.
You can add a related field to the model you're displaying in this view basically like that : barcode = fields.Char(related='product_id.barcode') then you can show it in your view like this : <field name="barcode"/>.

Default filter with partial number

In tree view i have field "code" and i want to filter only records when code starts with 910 and it should be default filter.
I trying to play with context but not much. i can filter by code but how can i add this 910 in there.
<field name="context">{"search_default_code":1}</field>
Update.
<record id="project_proposal_view_search" model="ir.ui.view">
<field name="name">project.part.search</field>
<field name="model">project.proposal</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="project_id"/>
<field name="code"/>
<filter name="code" string="Starts with 910" domain="[('code','ilike', '910')]"/>
</search>
</field>
</record>
class ProjectProposal(models.Model):
_name = 'project.proposal'
_inherit = ['mail.thread']
code = fields.Char(compute='_compute_code')
#api.multi
#api.onchange('project_id', 'object', 'stage_id', 'part_template_id')
def _compute_code(self):
for r in self:
code = []
if r.project_id:
code.append(r.project_id.code or '')
if r.object:
code.append(r.object or '')
if r.stage_id:
code.append(r.stage_id.code or '')
if r.part_template_id:
code.append(r.part_template_id.code or '')
r.code = '-'.join(code)
you have to inform us about the code field type. it seems to be of type char.also it seems you are using an action with context.
so you have to define filter code which you are trying to use {"search_default_code":1}
<filter name="code" string="starts with 910" domain="[('code','ilike', '910')]" />
so you will end up defining something like that
<!-- FILTERS FOR YOUR MODEL -->
<record id="filter_model_name" model="ir.ui.view">
<field name="name">FILTER NAME</field>
<field name="model">MODEL.NAME</field>
<field name="arch" type="xml">
<search string="MODEL NAME">
<filter name="code" string="starts with 910" domain="[('code','ilike', '910')]" />
</search>
</field>
</record>
<!-- FILTERS FOR YOUR MODEL -->
please make sure your field definition to be like
code = fields.Char(compute='_compute_code', store=True)