diff --git a/l10n_br_delivery/__manifest__.py b/l10n_br_delivery/__manifest__.py index 0ecfacf71049..7ebee60b3a57 100644 --- a/l10n_br_delivery/__manifest__.py +++ b/l10n_br_delivery/__manifest__.py @@ -16,7 +16,11 @@ 'delivery', ], 'data': [ + # View 'views/carrier.xml', + 'views/l10n_br_delivery_view.xml', + # Security + 'security/ir.model.access.csv', ], 'demo': [ 'demo/sale_order_demo.xml', diff --git a/l10n_br_delivery/models/l10n_br_delivery.py b/l10n_br_delivery/models/l10n_br_delivery.py new file mode 100644 index 000000000000..416a6061d987 --- /dev/null +++ b/l10n_br_delivery/models/l10n_br_delivery.py @@ -0,0 +1,45 @@ +# Copyright (C) 2010 Renato Lima - Akretion +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import models, fields + + +class L10nBrDeliveryCarrierVehicle(models.Model): + _name = 'l10n_br_delivery.carrier.vehicle' + _description = 'Veiculos das transportadoras' + + name = fields.Char('Nome', required=True, size=32) + description = fields.Char(u'Descrição', size=132) + plate = fields.Char('Placa', size=7) + driver = fields.Char('Condudor', size=64) + rntc_code = fields.Char('Codigo ANTT', size=32) + country_id = fields.Many2one('res.country', 'País') + state_id = fields.Many2one( + 'res.country.state', 'Estado', + domain="[('country_id', '=', country_id)]") + l10n_br_city_id = fields.Many2one( + 'res.city', 'Municipio', + domain="[('state_id','=',state_id)]") + active = fields.Boolean('Ativo') + manufacture_year = fields.Char(u'Ano de Fabricação', size=4) + model_year = fields.Char('Ano do Modelo', size=4) + type = fields.Selection([('bau', u'Caminhão Baú')], 'Tipo do Modelo') + carrier_id = fields.Many2one( + 'delivery.carrier', 'Carrier', index=True, + required=True, ondelete='cascade') + + +class L10nBrDeliveryShipment(models.Model): + _name = 'l10n_br_delivery.shipment' + _description = 'Carga/Remessa/Transporte/?' + + code = fields.Char('Nome', size=32) + description = fields.Char('Descrição', size=132) + carrier_id = fields.Many2one( + 'delivery.carrier', 'Carrier', index=True, required=True) + vehicle_id = fields.Many2one( + 'l10n_br_delivery.carrier.vehicle', 'Vehicle', + index=True, required=True) + volume = fields.Float('Volume') + carrier_tracking_ref = fields.Char('Carrier Tracking Ref', size=32) + number_of_packages = fields.Integer('Number of Packages') diff --git a/l10n_br_delivery/security/ir.model.access.csv b/l10n_br_delivery/security/ir.model.access.csv new file mode 100644 index 000000000000..55751029f6c3 --- /dev/null +++ b/l10n_br_delivery/security/ir.model.access.csv @@ -0,0 +1,11 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_l10n_br_delivery_carrier_vehicle_sale","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","sales_team.group_sale_salesman",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_sale_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","sales_team.group_sale_manager",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_partner_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","base.group_partner_manager",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_stock_user","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_user",1,0,0,0 +"access_l10n_br_delivery_carrier_vehicle_stock_manager","l10n_br_delivery_carrier_vehicle","model_l10n_br_delivery_carrier_vehicle","stock.group_stock_manager",1,1,1,1 +"access_l10n_br_delivery_shipment_sale","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","sales_team.group_sale_salesman",1,0,0,0 +"access_l10n_br_delivery_shipment_sale_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","sales_team.group_sale_manager",1,0,0,0 +"access_l10n_br_delivery_shipment_partner_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","base.group_partner_manager",1,0,0,0 +"access_l10n_br_delivery_shipment_stock_user","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_user",1,0,0,0 +"access_l10n_br_delivery_shipment_stock_manager","l10n_br_delivery_shipment","model_l10n_br_delivery_shipment","stock.group_stock_manager",1,1,1,1 \ No newline at end of file diff --git a/l10n_br_delivery/views/l10n_br_delivery_view.xml b/l10n_br_delivery/views/l10n_br_delivery_view.xml new file mode 100644 index 000000000000..75c4a6756c59 --- /dev/null +++ b/l10n_br_delivery/views/l10n_br_delivery_view.xml @@ -0,0 +1,54 @@ + + + + + + l10n_br_delivery.carrier.vehicle.form + l10n_br_delivery.carrier.vehicle + form + +
+ + + + + + + + + + + + + + + + + +
+ + + l10n_br_delivery.carrier.vehicle.tree + l10n_br_delivery.carrier.vehicle + tree + + + + + + + + + + + Veículo + ir.actions.act_window + l10n_br_delivery.carrier.vehicle + tree,form + form + + + + + +