Skip to content

Commit

Permalink
[FIX] Put back objects l10n_br_delivery.carrier.vehicle and l10n_br_d…
Browse files Browse the repository at this point in the history
…elivery.shipment missing during the migration.
  • Loading branch information
mbcosta committed Apr 19, 2021
1 parent e387abd commit 7026b78
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
4 changes: 4 additions & 0 deletions l10n_br_delivery/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
45 changes: 45 additions & 0 deletions l10n_br_delivery/models/l10n_br_delivery.py
Original file line number Diff line number Diff line change
@@ -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')
11 changes: 11 additions & 0 deletions l10n_br_delivery/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
54 changes: 54 additions & 0 deletions l10n_br_delivery/views/l10n_br_delivery_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<!-- Delivery Carriers Vehicle -->
<record id="l10n_br_delivery_carrier_vehicle_form" model="ir.ui.view">
<field name="name">l10n_br_delivery.carrier.vehicle.form</field>
<field name="model">l10n_br_delivery.carrier.vehicle</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Veículo">
<separator colspan="4" string="Transportadora" />
<field name="carrier_id" colspan="4"/>
<separator colspan="4" string="Dados do Veículo" />
<field name="name"/>
<field name="active"/>
<field name="description"/>
<field name="plate"/>
<field name="driver"/>
<field name="rntc_code"/>
<field name="country_id"/>
<field name="state_id"/>
<field name="l10n_br_city_id"/>
<field name="manufacture_year"/>
<field name="model_year"/>
<field name="type"/>
</form>
</field>
</record>

<record id="l10n_br_delivery_carrier_vehicle_tree" model="ir.ui.view">
<field name="name">l10n_br_delivery.carrier.vehicle.tree</field>
<field name="model">l10n_br_delivery.carrier.vehicle</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Veículo">
<field colspan="4" name="name"/>
<field name="plate" />
<field name="manufacture_year"/>
</tree>
</field>
</record>

<record model="ir.actions.act_window" id="action_l10n_br_delivery_carrier_vehicle_form">
<field name="name">Veículo</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">l10n_br_delivery.carrier.vehicle</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="l10n_br_delivery_carrier_vehicle_tree"/>
</record>

<menuitem name="Veículo" id="menu_l10n_br_delivery_carrier_vehicle_form" parent="delivery.menu_delivery" action="action_l10n_br_delivery_carrier_vehicle_form" sequence="10" />

</odoo>

0 comments on commit 7026b78

Please sign in to comment.