[IMP] purchase: set scheduled date of lines
Commit a572b8115c removes the inverse function of the `date_planned`. This
is necessary to avoid unexpected changes of the scheduled dates.
However, this removes the ability to set the scheduled dates of all
lines at once.
This commit introduces back the functionality thanks to a new button.
This way, the functionality remains without unexpected behavior.
Backport of rev: https://github.com/odoo/odoo/commit/2cf80e00752c68e443b0cd442ee50f7d6daaa455
opw-692873
This commit is contained in:
committed by
Pierre Masereel
parent
a572b8115c
commit
401a3cfaf6
@@ -439,6 +439,11 @@ class PurchaseOrder(models.Model):
|
||||
result['res_id'] = self.invoice_ids.id
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
def action_set_date_planned(self):
|
||||
for order in self:
|
||||
order.order_line.update({'date_planned': order.date_planned})
|
||||
|
||||
|
||||
class PurchaseOrderLine(models.Model):
|
||||
_name = 'purchase.order.line'
|
||||
|
||||
@@ -249,7 +249,15 @@
|
||||
<page string="Deliveries & Invoices">
|
||||
<group>
|
||||
<group>
|
||||
<field name="date_planned"/>
|
||||
<label for="date_planned"/>
|
||||
<div>
|
||||
<field name="date_planned" required="1" attrs="{'readonly': [('state', 'not in', ('draft', 'sent'))]}"/>
|
||||
<button name="action_set_date_planned" type="object"
|
||||
states="draft,sent"
|
||||
string="Set date to all order lines"
|
||||
help="This changes the scheduled date of all order lines to the given date"
|
||||
class="fa fa-calendar o_icon_button oe_edit_only"/>
|
||||
</div>
|
||||
<field name="picking_type_id" domain="[('code','=','incoming')]" options="{'no_create': True}" groups="stock.group_locations"/>
|
||||
<field name="dest_address_id" groups="stock.group_locations" attrs="{'invisible': [('default_location_dest_id_usage', '!=', 'customer')], 'required': [('default_location_dest_id_usage', '=', 'customer')]}"/>
|
||||
<field name="default_location_dest_id_usage" invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user