[IMP] stock_delivery: don't require partner_id if not integration_level == 'rate_and_ship'

The requirement of partner_id was put long ago because send_to_shipper() method requires it. But if you look into the python code, you see in _send_confirmation_email() method that the requirement to enter into send_to_shipper() is `integration_level == 'rate_and_ship'` instead of `delivery_type not in ['fixed', 'base_on_rule']`. It means that, with this change, if we have a `delivery_type not in ['fixed', 'base_on_rule']`, we should be able to validate the picking without partner if we have `integration_level == 'rate'`.

closes odoo/odoo#136149

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
Miquel Raïch
2023-10-04 19:40:13 +00:00
parent a57b3e9872
commit 2129dcb288
@@ -50,7 +50,7 @@
<button name="print_return_label" string="Print Return Label" type="object" invisible="not is_return_picking or state == 'done' or picking_type_code != 'incoming'" data-hotkey="shift+o"/>
</xpath>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="required">delivery_type and delivery_type not in ['fixed', 'base_on_rule']</attribute>
<attribute name="required">carrier_id and carrier_id.integration_level == 'rate_and_ship'</attribute>
</xpath>
</data>
</field>