Skip to content

Commit

Permalink
Merge PR #129 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by etobella
  • Loading branch information
OCA-git-bot committed Nov 23, 2023
2 parents e864bce + fb5d297 commit 066d659
Show file tree
Hide file tree
Showing 14 changed files with 148 additions and 98 deletions.
11 changes: 6 additions & 5 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.14.2
_commit: v1.19.2
_src_path: gh:oca/oca-addons-repo-template
ci: Travis
dependency_installation_mode: PIP
ci: GitHub
convert_readme_fragments_to_markdown: false
generate_requirements_txt: true
github_check_license: true
github_ci_extra_env: {}
Expand All @@ -11,6 +11,7 @@ github_enable_makepot: true
github_enable_stale_action: true
github_enforce_dev_status_compatibility: true
include_wkhtmltopdf: false
odoo_test_flavor: Both
odoo_version: 14.0
org_name: Odoo Community Association (OCA)
org_slug: OCA
Expand All @@ -19,6 +20,6 @@ repo_description: Addons for Fleet management
repo_name: Fleet
repo_slug: fleet
repo_website: https://github.com/OCA/fleet
travis_apt_packages: []
travis_apt_sources: []
use_pyproject_toml: false
use_ruff: false

1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ globals:
odoo: readonly
openerp: readonly
owl: readonly
luxon: readonly

# Styling is handled by Prettier, so we only need to enable AST rules;
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Get python version
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
Expand All @@ -25,6 +27,15 @@ jobs:
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always
env:
# Consider valid a PR that changes README fragments but doesn't
# change the README.rst file itself. It's not really a problem
# because the bot will update it anyway after merge. This way, we
# lower the barrier for functional contributors that want to fix the
# readme fragments, while still letting developers get README
# auto-generated (which also helps functionals when using runboat).
# DOCS https://pre-commit.com/#temporarily-disabling-hooks
SKIP: oca-gen-addon-readme
- name: Check that all files generated by pre-commit are in git
run: |
newfiles="$(git ls-files --others --exclude-from=.gitignore)"
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: tests

on:
pull_request:
branches:
- "14.0*"
push:
branches:
- "14.0"
- "14.0-ocabot-*"

jobs:
unreleased-deps:
runs-on: ubuntu-latest
name: Detect unreleased dependencies
steps:
- uses: actions/checkout@v3
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
result=0
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
grep "^[^#].*/" ${reqfile} || result=$?
if [ $result -eq 0 ] ; then
echo "Unreleased dependencies found in ${reqfile}."
exit 1
fi
fi
done
test:
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest
name: test with OCB
makepot: "true"
services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install addons and dependencies
run: oca_install_addons
- name: Check licenses
run: manifestoo -d . check-licenses
- name: Check development status
run: manifestoo -d . check-dev-status --default-dev-status=Beta
- name: Initialize test db
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v1
- name: Update .pot files
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__/
*.py[cod]
/.venv
/.pytest_cache
/.ruff_cache

# C extensions
*.so
Expand Down
19 changes: 18 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ exclude: |
/static/(src/)?lib/|
# Repos using Sphinx to generate docs don't need prettying
^docs/_templates/.*\.html$|
# Don't bother non-technical authors with formatting issues in docs
readme/.*\.(rst|md)$|
# Ignore build and dist directories in addons
/build/|/dist/|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
default_language_version:
Expand All @@ -33,12 +37,25 @@ repos:
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
rev: ab1d7f6
rev: f71041f22b8cd68cf7c77b73a14ca8d8cd190a60
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
- id: oca-fix-manifest-website
args: ["https://github.com/OCA/fleet"]
- id: oca-gen-addon-readme
args:
- --addons-dir=.
- --branch=14.0
- --org-name=OCA
- --repo-name=fleet
- --if-source-changed
- --keep-source-digest
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: v0.0.25
hooks:
- id: oca-checks-odoo-module
- id: oca-checks-po
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
Expand Down
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/fleet&target_branch=14.0)
[![Build Status](https://travis-ci.com/OCA/fleet.svg?branch=14.0)](https://travis-ci.com/OCA/fleet)
[![Pre-commit Status](https://github.com/OCA/fleet/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/OCA/fleet/actions/workflows/pre-commit.yml?query=branch%3A14.0)
[![Build Status](https://github.com/OCA/fleet/actions/workflows/test.yml/badge.svg?branch=14.0)](https://github.com/OCA/fleet/actions/workflows/test.yml?query=branch%3A14.0)
[![codecov](https://codecov.io/gh/OCA/fleet/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/fleet)
[![Translation Status](https://translation.odoo-community.org/widgets/fleet-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/fleet-14-0/?utm_source=widget)

Expand Down
2 changes: 1 addition & 1 deletion fleet_vehicle_category/views/fleet_vehicle_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<field name="name">fleet.vehicle.category.tree</field>
<field name="model">fleet.vehicle.category</field>
<field name="arch" type="xml">
<tree string="Category">
<tree>
<field name="name" />
</tree>
</field>
Expand Down
36 changes: 17 additions & 19 deletions fleet_vehicle_inspection/data/fleet_vehicle_inspection.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<!-- Sequences for fleet vehicle inspection out -->
<record id="seq_fleet_vehicle_inspection_our" model="ir.sequence">
<field name="name">Fleet Vehicle Inspection Out</field>
<field name="code">fleet.vehicle.inspection.out</field>
<field name="prefix">FVI/OUT/</field>
<field name="padding">5</field>
<field name="company_id" eval="False" />
</record>
<!-- Sequences for fleet vehicle inspection in -->
<record id="seq_fleet_vehicle_inspection_in" model="ir.sequence">
<field name="name">Fleet Vehicle Inspection In</field>
<field name="code">fleet.vehicle.inspection.in</field>
<field name="prefix">FVI/IN/</field>
<field name="padding">5</field>
<field name="company_id" eval="False" />
</record>
</data>
<odoo noupdate="1">
<!-- Sequences for fleet vehicle inspection out -->
<record id="seq_fleet_vehicle_inspection_our" model="ir.sequence">
<field name="name">Fleet Vehicle Inspection Out</field>
<field name="code">fleet.vehicle.inspection.out</field>
<field name="prefix">FVI/OUT/</field>
<field name="padding">5</field>
<field name="company_id" eval="False" />
</record>
<!-- Sequences for fleet vehicle inspection in -->
<record id="seq_fleet_vehicle_inspection_in" model="ir.sequence">
<field name="name">Fleet Vehicle Inspection In</field>
<field name="code">fleet.vehicle.inspection.in</field>
<field name="prefix">FVI/IN/</field>
<field name="padding">5</field>
<field name="company_id" eval="False" />
</record>
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
mode="tree,kanban"
context="{'default_inspection_id': active_id}"
>
<tree string="Inspection Line">
<tree>
<field name="state" invisible="1" />
<field name="inspection_item_id" />
<field name="inspection_item_instruction" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
name="inspection_template_lines"
>
<field name="inspection_template_line_ids">
<tree
string="Inspection Template Line"
editable="bottom"
>
<tree editable="bottom">
<field name="inspection_template_item_id" />
</tree>
</field>
Expand Down
40 changes: 18 additions & 22 deletions fleet_vehicle_log_fuel/security/fleet_security.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<record id="fleet_rule_fuel_log_visibility_user" model="ir.rule">
<field name="name">User can only see his/her vehicle's fuel log</field>
<field name="model_id" ref="model_fleet_vehicle_log_fuel" />
<field name="groups" eval="[(4, ref('fleet.fleet_group_user'))]" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_unlink" eval="True" />
<field
name="domain_force"
>[('vehicle_id.driver_id','=',user.partner_id.id)]</field>
</record>
<record id="fleet_rule_fuel_log_visibility_manager" model="ir.rule">
<field
name="name"
>Administrator has all rights on vehicle's fuel log</field>
<field name="model_id" ref="model_fleet_vehicle_log_fuel" />
<field name="groups" eval="[(4, ref('fleet.fleet_group_manager'))]" />
</record>
</data>
<odoo noupdate="1">
<record id="fleet_rule_fuel_log_visibility_user" model="ir.rule">
<field name="name">User can only see his/her vehicle's fuel log</field>
<field name="model_id" ref="model_fleet_vehicle_log_fuel" />
<field name="groups" eval="[(4, ref('fleet.fleet_group_user'))]" />
<field name="perm_read" eval="True" />
<field name="perm_write" eval="True" />
<field name="perm_create" eval="True" />
<field name="perm_unlink" eval="True" />
<field
name="domain_force"
>[('vehicle_id.driver_id','=',user.partner_id.id)]</field>
</record>
<record id="fleet_rule_fuel_log_visibility_manager" model="ir.rule">
<field name="name">Administrator has all rights on vehicle's fuel log</field>
<field name="model_id" ref="model_fleet_vehicle_log_fuel" />
<field name="groups" eval="[(4, ref('fleet.fleet_group_manager'))]" />
</record>
</odoo>
2 changes: 1 addition & 1 deletion fleet_vehicle_log_fuel/views/fleet_vehicle_cost_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<field name="name">fleet.vehicle.log.fuel.tree</field>
<field name="model">fleet.vehicle.log.fuel</field>
<field name="arch" type="xml">
<tree string="Fuel Logs" multi_edit="1">
<tree multi_edit="1">
<field name="date" readonly="1" />
<field name="description" />
<field name="service_type_id" />
Expand Down

0 comments on commit 066d659

Please sign in to comment.