Browse Source

modif le type de methode de livraison

12.0
Juliana 5 years ago
parent
commit
6bb78abb2c
  1. 12
      models/delivery.py
  2. 3
      views/delivery_views.xml

12
models/delivery.py

@ -1,10 +1,20 @@
# © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
from odoo import fields, models, api
class VracoopDeliveryCarrier(models.Model):
_inherit = 'delivery.carrier'
type_carrier = fields.Selection([
('retrait', 'Point retrait')], string="Type")
point_retrait = fields.Boolean(string='Point retrait')
@api.onchange('type_carrier')
def onchange_type_carrier(self):
for delivery in self:
if delivery.type_carrier == 'retrait':
delivery.point_retrait = True
else:
delivery.point_retrait = False

3
views/delivery_views.xml

@ -7,7 +7,8 @@
<field name="inherit_id" ref="delivery.view_delivery_carrier_form"/>
<field name="arch" type="xml">
<xpath expr="//group//group" position="inside">
<field name="point_retrait"/>
<field name="type_carrier"/>
<field name="point_retrait" invisible="1"/>
</xpath>
</field>
</record>

Loading…
Cancel
Save