Skip to content

Commit

Permalink
[FIX] tms: pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EdgarRetes committed Oct 23, 2024
1 parent df323db commit dabf785
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 68 deletions.
10 changes: 5 additions & 5 deletions tms/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Transport
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--transport-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-transport/tree/17.0/tms
:target: https://github.com/OCA/stock-logistics-transport/tree/18.0/tms
:alt: OCA/stock-logistics-transport
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-transport-17-0/stock-logistics-transport-17-0-tms
:target: https://translation.odoo-community.org/projects/stock-logistics-transport-18-0/stock-logistics-transport-18-0-tms
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-transport&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-transport&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -161,7 +161,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-transport/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-transport/issues/new?body=module:%20tms%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-transport/issues/new?body=module:%20tms%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -222,6 +222,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-max3903| |maintainer-santiagordz| |maintainer-EdgarRetes|

This module is part of the `OCA/stock-logistics-transport <https://github.com/OCA/stock-logistics-transport/tree/17.0/tms>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-transport <https://github.com/OCA/stock-logistics-transport/tree/18.0/tms>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion tms/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Transport",
"summary": "Manage Vehicles, Drivers, Routes and Trips",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"category": "TMS",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
Expand Down
2 changes: 1 addition & 1 deletion tms/models/fleet_vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FleetVehicle(models.Model):

tms_team_id = fields.Many2one("tms.team")

tms_driver_id = fields.Many2one("tms.driver", string="Driver")
tms_driver_id = fields.Many2one("tms.driver", string="Driver Id")

# Operation
operation = fields.Selection([("cargo", "Cargo"), ("passenger", "Passenger")])
Expand Down
1 change: 1 addition & 0 deletions tms/models/tms_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class TmsDriver(models.Model):
_name = "tms.driver"
_inherit = ["mail.thread"]
_inherits = {"res.partner": "partner_id"}
_description = "Model for TMS drivers"

partner_id = fields.Many2one("res.partner", required=True, ondelete="cascade")

Expand Down
1 change: 1 addition & 0 deletions tms/models/tms_insurance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

class TMSInsurance(models.Model):
_name = "tms.insurance"
_description = "Model for TMS insurances"

active = fields.Boolean(default=True)
company_id = fields.Many2one(
Expand Down
14 changes: 9 additions & 5 deletions tms/models/tms_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ class TMSOrder(models.Model):
route_id = fields.Many2one(
"tms.route", compute="_compute_route_id", store=True, readonly=False
)
route_origin = fields.Char(related="route_id.origin_location_id.display_name")
route_origin = fields.Char(
related="route_id.origin_location_id.display_name", string="Route origin"
)
route_destination = fields.Char(
related="route_id.destination_location_id.display_name"
related="route_id.destination_location_id.display_name",
string="Route destination",
)

origin_id = fields.Many2one(
Expand All @@ -60,8 +63,8 @@ class TMSOrder(models.Model):
readonly=False,
)

origin_location = fields.Char(string="Origin")
destination_location = fields.Char(string="Destination")
origin_location = fields.Char()
destination_location = fields.Char()

driver_id = fields.Many2one(
"tms.driver",
Expand Down Expand Up @@ -270,7 +273,8 @@ def _compute_active_crew(self):
]

@api.model
def _read_group_stage_ids(self, stages, domain, order):
def _read_group_stage_ids(self, stages, domain, order=None):
order = order or "sequence, id"
return self.env["tms.stage"].search([("stage_type", "=", "order")], order=order)

def button_start_order(self):
Expand Down
5 changes: 5 additions & 0 deletions tms/security/res_groups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@
<field name="category_id" ref="base.module_category_hidden" />
</record>

<record id="group_tms_uom" model="res.groups">
<field name="name">Manage TMS Oum</field>
<field name="category_id" ref="base.module_category_hidden" />
</record>

</odoo>
6 changes: 3 additions & 3 deletions tms/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Transport</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b2144995fbc4816a0cf4cd0a224ae48f0ea6da9c795b3f9592dd407235dcf7f8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-transport/tree/17.0/tms"><img alt="OCA/stock-logistics-transport" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--transport-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-transport-17-0/stock-logistics-transport-17-0-tms"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-transport&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-transport/tree/18.0/tms"><img alt="OCA/stock-logistics-transport" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--transport-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-transport-18-0/stock-logistics-transport-18-0-tms"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-transport&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>The Transport Management Systems (TMS) module manages the workflow of
creating transport operations within Odoo. This module provides features
such as creating teams, stages, crews, routes, and vehicles, allowing
Expand Down Expand Up @@ -526,7 +526,7 @@ <h1><a class="toc-backref" href="#toc-entry-10">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-transport/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/stock-logistics-transport/issues/new?body=module:%20tms%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/stock-logistics-transport/issues/new?body=module:%20tms%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -572,7 +572,7 @@ <h2><a class="toc-backref" href="#toc-entry-15">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/santiagordz"><img alt="santiagordz" src="https://github.com/santiagordz.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/EdgarRetes"><img alt="EdgarRetes" src="https://github.com/EdgarRetes.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-transport/tree/17.0/tms">OCA/stock-logistics-transport</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-transport/tree/18.0/tms">OCA/stock-logistics-transport</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions tms/views/res_partner.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<odoo>

<!-- Locations -->
<record id="view_res_partner_tree_tms_location" model="ir.ui.view">
<field name="name">res.partner.tree.tms.location</field>
<record id="view_res_partner_list_tms_location" model="ir.ui.view">
<field name="name">res.partner.list.tms.location</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="display_name" string="Location" />
<field name="country_id" />
<field name="state_id" />
<field name="city" />
<field name="street" />
<field name="zip" />
</tree>
</list>
</field>
</record>

Expand All @@ -29,7 +29,7 @@
<attribute name="invisible">True</attribute>
</xpath>

<xpath expr="//span[@name='address_name']//b" position="attributes">
<xpath expr="//span[@name='address_name']" position="attributes">
<attribute name="invisible">False</attribute>
</xpath>

Expand Down Expand Up @@ -66,12 +66,12 @@
name="context"
>{"search_default_tms_location": True, "default_tms_location": True}
</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field
name="view_ids"
eval="[
(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('view_res_partner_tree_tms_location')}),
(0, 0, {'view_mode': 'list', 'view_id': ref('view_res_partner_list_tms_location')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('view_res_partner_form_inherit_tms_location')})
]"
/>
Expand Down
2 changes: 1 addition & 1 deletion tms/views/tms_crew.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@
<record id="action_tms_config_crew" model="ir.actions.act_window">
<field name="name">Crews</field>
<field name="res_model">tms.crew</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
</odoo>
18 changes: 9 additions & 9 deletions tms/views/tms_driver.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<odoo>
<!-- Drivers -->
<record id="view_tms_driver_tree" model="ir.ui.view">
<field name="name">tms.driver.tree</field>
<record id="view_tms_driver_list" model="ir.ui.view">
<field name="name">tms.driver.list</field>
<field name="model">tms.driver</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="display_name" string="Name" />
<field name="phone" />
<field name="stage_id" />
</tree>
</list>
</field>
</record>

Expand All @@ -24,7 +24,7 @@
name="stage_id"
widget="statusbar"
domain="[('stage_type', '=', 'driver')]"
options="{'clickable':True}, {'fold_field':'fold'}"
options="{'clickable':True, 'fold_field':'fold'}"
/>
</header>
</xpath>
Expand All @@ -36,7 +36,7 @@
<attribute name="invisible">True</attribute>
</xpath>

<xpath expr="//span[@name='address_name']//b" position="attributes">
<xpath expr="//span[@name='address_name']" position="attributes">
<attribute name="invisible">False</attribute>
</xpath>

Expand Down Expand Up @@ -197,13 +197,13 @@
<field name="name">Drivers</field>
<field name="res_model">tms.driver</field>
<field name="domain">[('is_company', '=', False)]</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_mode">kanban,list,form</field>
<field
name="view_ids"
eval="[
(5, 0, 0),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('view_tms_driver_kanban')}),
(0, 0, {'view_mode': 'tree', 'view_id': ref('view_tms_driver_tree')}),
(0, 0, {'view_mode': 'list', 'view_id': ref('view_tms_driver_list')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('view_tms_driver_form_inherit')}),
]"
/>
Expand All @@ -212,6 +212,6 @@
<record id="action_tms_config_stage_driver" model="ir.actions.act_window">
<field name="name">Drivers</field>
<field name="res_model">tms.driver</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
</odoo>
10 changes: 5 additions & 5 deletions tms/views/tms_insurance.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<odoo>

<record id="tms_insurance_view_tree" model="ir.ui.view">
<field name="name">tms.insurance.view.tree</field>
<record id="tms_insurance_view_list" model="ir.ui.view">
<field name="name">tms.insurance.view.list</field>
<field name="model">tms.insurance</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="policy_number" />
<field name="insurer_id" />
<field name="end_date" />
</tree>
</list>
</field>
</record>

Expand Down Expand Up @@ -55,7 +55,7 @@
<record id="action_tms_insurance" model="ir.actions.act_window">
<field name="name">Insurance Policies</field>
<field name="res_model">tms.insurance</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>

</odoo>
26 changes: 11 additions & 15 deletions tms/views/tms_order.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<odoo>


<!-- TMS Order Tree View -->
<record id="tms_order_view_tree" model="ir.ui.view">
<field name="name">tms.order.view.tree</field>
<!-- TMS Order list View -->
<record id="tms_order_view_list" model="ir.ui.view">
<field name="name">tms.order.view.list</field>
<field name="model">tms.order</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="start_trip" column_invisible="1" />
<field name="end_trip" column_invisible="1" />
<field name="date_end" column_invisible="1" />
Expand All @@ -28,7 +28,7 @@
class="btn btn-primary text-uppercase"
invisible="not start_trip or end_trip"
/>
</tree>
</list>
</field>
</record>

Expand Down Expand Up @@ -75,7 +75,7 @@
name="stage_id"
widget="statusbar"
domain="[('stage_type', '=', 'order')]"
options="{'clickable':True}, {'fold_field':'fold'}"
options="{'clickable':True, 'fold_field':'fold'}"
/>
</header>

Expand Down Expand Up @@ -176,11 +176,7 @@
</sheet>

<!-- Chatter -->
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
<chatter />
</form>
</field>
</record>
Expand Down Expand Up @@ -408,7 +404,7 @@
<record id="action_tms_operation_trip" model="ir.actions.act_window">
<field name="name">Trips</field>
<field name="res_model">tms.order</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>

<record id="action_tms_report_order" model="ir.actions.act_window">
Expand All @@ -420,19 +416,19 @@
<record id="action_tms_config_stage_travel" model="ir.actions.act_window">
<field name="name">Stages</field>
<field name="res_model">tms.order</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>

<record id="action_tms_dash_order" model="ir.actions.act_window">
<field name="name">Trips</field>
<field name="res_model">tms.order</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_mode">kanban,list,form</field>
</record>

<record id="action_tms_order_kanban" model="ir.actions.act_window">
<field name="name">Trips Kanban</field>
<field name="res_model">tms.order</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_mode">kanban,list,form</field>
<field name="domain">[('tms_team_id', '=', active_id)]</field>
</record>

Expand Down
Loading

0 comments on commit dabf785

Please sign in to comment.