Skip to content
Extraits de code Groupes Projets
Valider 6bb78abb rédigé par Juliana's avatar Juliana
Parcourir les fichiers

modif le type de methode de livraison

parent caada995
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# © 2019 Le Filament (<http://www.le-filament.com>) # © 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # 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): class VracoopDeliveryCarrier(models.Model):
_inherit = 'delivery.carrier' _inherit = 'delivery.carrier'
type_carrier = fields.Selection([
('retrait', 'Point retrait')], string="Type")
point_retrait = fields.Boolean(string='Point retrait') 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
\ No newline at end of file
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<field name="inherit_id" ref="delivery.view_delivery_carrier_form"/> <field name="inherit_id" ref="delivery.view_delivery_carrier_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//group//group" position="inside"> <xpath expr="//group//group" position="inside">
<field name="point_retrait"/> <field name="type_carrier"/>
<field name="point_retrait" invisible="1"/>
</xpath> </xpath>
</field> </field>
</record> </record>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter