Skip to content

Use stock_picking.origin as order_number for easier customization (instead of order.name) #13

@janbec

Description

@janbec

Hi, it's me again ;)

Currently the sale_order.name is used as a customer reference. For example, if our sale order S0010 is send via sendcloud, the reference S0010 will be passed to e.g. DHL. This will be the reference for parcel on the invoice.

order = self.sale_id
[...]

 if order.name:
            vals.update({"order_number": order.name})
        if self.sendcloud_shipment_uuid:
            vals.update({"shipment_uuid": self.sendcloud_shipment_uuid})
        if total_weight:
            vals.update({"weight": total_weight})
        vals.update({"is_return": is_return})

Github

I think it would be beneficial for many use cases to use stock_picking.origin as the value to pass. This is by default the sale order name but can easily be adjusted by the user in draft state of the picking or can be customized via code.

In our case, we would like to add the cost center to the reference for easier invoice control.

I would appreciate your feedback. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions