How to pass Note from Sale Order Line to Transfer (Detailed Operation Line)? - odoo

In Sale Order Line, there is an option to write down some notes in the lines as "note". When the Sale Order is confirmed, the data is sent to stock.picking (Transfers) and the lines from Sale Order Line appear in Detailed Operations in the Transfers page, but without the note.
Where should I look for in order to customize and/or configure it to achieve such goal?

There is no differanciation of line types for stock.picking lines as for sales order lines. In sales order lines it's made by the field display_type.
Trying to imitate this feature for pickings could end in a mess. Personally i would try to get all notes and either copy them to a new notes one2many field or just in one new note text field on the created picking. Or maybe even "easier" is to compute all notes, because every picking line (stock.move) has a connection to the original sales line (sale_line_id) and so indirectly to the sales order or even directly by field stock.picking.sale_id.

Related

Add a subtotal line in a Sales Quote

I need to allow Sales staff to add options in Quotes, and display a subtotal line under each option.
I'm thinking of using a couple of comment lines:
OPTHEAD (Sales will detail the option here, e.g., "Option 1: Full product line"
Sales Quote lines
SUBTOTAL
I'd like to replace the SUBTOTAL comment line when it is printed, with the total of lines between that and the Option Header. Along the lines of "Subtotal Option 1, $1000"
Could someone please provide me a pointer to achieve this? I'm having trouble finding guidance/documentation for this, but it must be a fairly common requirement.
The method you mention is one possibility, however might be difficult to manage.
I suggest you add a new field to the Sales Line table e.g. Sales Option of type Integer. The field would also need to be added to the Sales Quote subform page.
The salesperson then needs to assign a value to the Sales Option field in order to group the lines into options.
The Sales Option should be added to the report dataset for each line which will enable you to group on it on the RDLC layout.
You can then add a sum per group.

Error in Updating Square Order after creating invoice

I am using Square SDK for dotnet and I am creating an order and then creating invoice and then updating the same order. I am using same api key, same customer and same location for all these operations but it is breaking at update call giving following error.
Category: "AUTHENTICATION_ERROR"
Code: "FORBIDDEN"
Detail: "LineItems cannot be modified for orders owned by another application."
Field: "order.line_items"
The error should be better, but essentially once you actually create the invoice, you can't edit the line items that would affect the amount. Per the documentation:
Updating an order. You cannot update order fields (such as line items, taxes, and discounts) that change the order amount. To update these order fields, you must cancel the invoice, which also cancels the order (sets the order status to CANCELED). You then create a new order and a new invoice. You can update order fields that do not change the order amount.

Linking quotation and order data in way that lets order data to be flexible

I have developed a data model as per screenshot. The purpose of this is to have all the relevant quotation data "mapped" out for further analysis.
The data between orders/quotations/invoices etc is linked by generating link tables, which comes out directly from SAP document flow (the document flow table only holds main document number, like quotation number and a line number of the material).
The links serve their purpose and are correct, if the quotations weren't so "flexible".
Orders to invoices are linked on a material level, so there cannot be any difference between them.
But Quotations are not hard linked to orders, I'll explain below.
For example if a quotation is created for 2 lines, which then later is converted in to an order, the user is not forced to keep the order in the same structure as the quotation, he/she can add more items in the order/change quantities etc. so they can really only be linked on the header level, aka Document number to document number.
So this is where I need some help.
I have tried to link the quotations to order in 2 ways, but they both have their issues.
Doc to Doc. - The lines are duplicated when trying to create a report at an item level.
Doc + line number to Doc + line number - If the order has extra lines added on to compared to quotation, this data is not captured in the flow.
I am hoping someone had a similar task/issue in the past and would be kind enough to share their experience/approach.
Regards

Bigcommerce: edit an existing order shipment address

I imported 10k legacy orders with the wrong state. How do I fix it? When I use the order shipment update endpoint PUT /orders/{order_id}/shipments/{id} I get an error that the shipping_address field is not writable. What do I do?
I'm using the API docs here: https://developer.bigcommerce.com/api-reference/orders/orders-api/order-shipments/putordersorderidshipmentsid
It isn't possible to directly write to the order shipment address state field, but for context, that mirrors the behavior you'd see when working with order shipments in the control panel. The best solution would be to delete the shipments with the incorrect state and re-create the shipments.
Edit:
There are 2 options to re-create the shipment with the correct address: The first is to update the order by adding a new shipping address containing the correct state and use that shipping address when you re-make the shipment. Although existing order shipping addresses can't be edited, the order shipping address array is additive. So you can update the order by adding a new shipping address and use that order_address_id to create the new shipment. The second option would be to delete the entire order with the incorrect shipping address and re-import it with the correct data, then re-create the shipment.
On the orders resource, we are scoping a feature request to make shipping addresses editable. (This would align with what you're able to do when editing an order through the control panel). I'll keep you posted in this thread when there's an update on that, although the best solution in the meantime would be to use one of the options outlined above.

Xrm.Page.ui.getFormType() returns 2 when create order from quote

When i am creating an order from quote, in onload Xrm.Page.ui.getFormType() returns me the value 2.
but the form is in create mode, so should return 1.
When you "win" a quote and a Sales Order is generated, there is no Create state presented by the UI - the system creates the new record in the background and then displays it. When you are presented with the new Sales Order through this process, it already has a record ID so Xrm.Page.ui.getFormType() will return 2, which is the Update state.
The only way to get the Create state (1) from Xrm.Page.ui.getFormType() would be to manually create a Sales Order. However, if you do this you will lose much of the convenience the system does automatically for you, such as copying over all fields with the same name (essentially duplicating the Quote data into the the new Sales Order).