Error receiving Purchase Order

macmediamacmedia Member Posts: 6

Im getting an error when trying to receive a newly created purchase order with serialized line item. 


  • The purchase order is created without error
  • The line item is added to the new purchase order
  • When sending a POST payload to :  `/api/purchase_orders/(d+)/receive/` I get an error.


<error class="lscore.rest.request_handling.ValidationUnexpectedDataError" type="resource.validation_unexpected_data_error">
    <localizable_message type="resource.validation_unexpected_data_error">
        <fields>
            <field name="errors">
                <string>:0:0:ERROR:RELAXNGV:RELAXNG_ERR_INTEREXTRA: Extra element supplier_product_code in interleave
                <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_INTERSEQ: Invalid sequence in interleave
                <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_CONTENTVALID: Element inventory failed to validate content
            </field>
            <field name="element">supplier_product_code</field>
        </fields>
        <plain_message>There was unexpected data with the <supplier_product_code> element which caused the validation to fail: 
            <string>:0:0:ERROR:RELAXNGV:RELAXNG_ERR_INTEREXTRA: Extra element supplier_product_code in interleave
            <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_INTERSEQ: Invalid sequence in interleave
            <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_CONTENTVALID: Element inventory failed to validate content
        </plain_message>
    </localizable_message>
    <traceback>Traceback (most recent call last):
        File "lscore/rest/request_handling.pyc", line 743, in new_f
        File "lscore/rest/request_handling.pyc", line 677, in new_f
        File "lscore/rest/framework.pyc", line 450, in post
        File "lscore/rest/framework.pyc", line 431, in action
        File "lsserver/rest/standard_impl.pyc", line 370, in validate_action
        File "lscore/rest/request_handling.pyc", line 168, in request_as_xml
        File "lscore/rest/request_handling.pyc", line 88, in validate
        File "lscore/rest/request_handling.pyc", line 111, in raise_rng_error
        ValidationUnexpectedDataError: There was unexpected data with the <supplier_product_code> element which caused the validation to fail: 
        <string>:0:0:ERROR:RELAXNGV:RELAXNG_ERR_INTEREXTRA: Extra element supplier_product_code in interleave
        <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_INTERSEQ: Invalid sequence in interleave
        <string>:2:0:ERROR:RELAXNGV:RELAXNG_ERR_CONTENTVALID: Element inventory failed to validate content
    </traceback>
</error>


Here is the data payload Im sending.

<receive>
    <inventory>
        <product id="13764"/>
        <supplier_product_code>MPXQ2AA</supplier_product_code>
        <quantity>1</quantity>
        <serial_numbers>
            <serial_number>TEST00000000</serial_number>
        </serial_numbers>
    </inventory>
</receive>


Best Answer

Answers

Sign In or Register to comment.