carrier_id not readonly on done picking (add tracking on it)

fix for formatLang inherit in base_usability
This commit is contained in:
Alexis de Lattre
2018-07-18 14:27:21 +02:00
parent cfebb6c99c
commit 1957018a14
4 changed files with 37 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
# -*- coding: utf-8 -*-
from . import stock

View File

@@ -24,6 +24,7 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
'data': [
'delivery_view.xml',
'sale_view.xml',
'stock_view.xml',
],
'installable': True,
}

View File

@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class StockPicking(models.Model):
_inherit = 'stock.picking'
carrier_id = fields.Many2one(track_visibility='onchange')

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_picking_withcarrier_out_form" model="ir.ui.view">
<field name="name">delivery_usability.stock.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form"/>
<field name="arch" type="xml">
<field name="carrier_id" position="attributes">
<!-- Sometimes we have to modify carrier_id when state is done
so remove readonly when state = done from view and add tracking on_change in
field definition -->
<attribute name="attrs">{}</attribute>
</field>
</field>
</record>
</odoo>