Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
b94c6bb
Create the OpenStack Odoo Client library for Python
Jun 10, 2024
8fb4920
Remove old README parts
Jun 10, 2024
68da1fc
Add to docs, fix bugs in account move record type defs
Jun 11, 2024
1ff5a85
Remove custom heading IDs (not supported by GitHub)
Jun 11, 2024
fd7b86c
Add code-formatting to attribute headings, add Company attributes
Jun 11, 2024
7bd1641
Fix product_uom_id <-> product_uom mapping, add credit fields to README
Jun 11, 2024
d2be83e
Add Credit Type docs
Jun 11, 2024
b5a72fe
Add missing docstrings to README
Jun 11, 2024
e9a21b6
Encode list fields, and fields/values in create_multi
Jun 11, 2024
be61219
Move manager/record docs into separate files
Jun 12, 2024
cd18f72
Write more manager/record docs
Jun 12, 2024
0195abc
Add TODOs, remove CRMTeam from library, add more docs
Jun 12, 2024
7e5731f
Add "OpenStack" to page titles
Jun 12, 2024
25aa02b
Start converting to the new style of defining aliases and model refs
Jun 13, 2024
f1ec46b
Fix annotation parsing
Jun 13, 2024
b2aa897
Convert more managers to type hinted model refs
Jun 13, 2024
6b8f1a7
FInish switching to type hint-based model refs, add type hint model r…
Jun 14, 2024
4ae22bf
Comment
Jun 14, 2024
98fbb7d
Resolve aliases before the local and remote fields
Jun 14, 2024
2b0d2ca
Fix encoding model ref lists and creating new sub-models, improve enc…
Jun 14, 2024
52026c3
Parse list value type to pass to record manager mapping
Jun 14, 2024
0938bee
Pass correct value
Jun 14, 2024
e2e87e5
Organise code, add TODOs
Jun 14, 2024
732bea4
Add error handler for unexpected number of annotations
Jun 14, 2024
4ae947f
Implement recursive filter field and value encoding
Jun 16, 2024
cd14ec7
Replace get_type_tree with get_type_origin/get_type_args
Jun 16, 2024
e599d3c
Import type hints during runtime as well
Jun 16, 2024
133f573
Start defining record class in model refs
Jun 17, 2024
888820c
Finish defining record class in model refs
Jun 17, 2024
1059ec2
Fix unset record classes
Jun 17, 2024
c4583d3
Fix field alias definitionb
Jun 17, 2024
1321ab7
Fix more unset record classes
Jun 17, 2024
457fe99
Handle multi-value search domains
Jun 17, 2024
e2409be
Start cleaning up imports
Jun 17, 2024
f6cee63
Clean up imports, switch client to use type hints
Jun 17, 2024
11e9b93
Fix circular imports
Jun 17, 2024
bceb747
Set type hint if get_type_origin returns None
Jun 17, 2024
63953c1
Move decode_value into the RecordBase class
Jun 17, 2024
41909e6
Add docs for support subscriptions
Jun 18, 2024
8b679d8
Add docs for support subscription types and taxes
Jun 18, 2024
adccfb3
Add more docs for more managers
Jun 18, 2024
d2a6610
Finish record/manager docs
Jun 19, 2024
6e82c3b
Additions and fixes to docs
Jun 19, 2024
ff14066
Finish documentation
Jun 19, 2024
4d7d8cd
Add and improve more docs, make returning all IDs required by default…
Jun 19, 2024
fc1c2a8
Fix list docs section, set optional to True on list method call in get
Jun 19, 2024
107d12e
Add "Performance Considerations" page
Jun 19, 2024
1736163
function -> method
Jun 19, 2024
b0f9988
Add more links
Jun 19, 2024
30d061a
Resolve model refs in _(decode|encode)_field
Jun 19, 2024
2ab43e1
Fix mapping record class to manager
Jun 19, 2024
ee7b4bd
Fix search->list race condition, add docs about querying record IDs
Jun 19, 2024
c1c8f5f
Remove creating new records for Many2one relations (not possible)
Jun 20, 2024
9329a17
Comments
Jun 20, 2024
463d539
Add shields, URLs to package metadata
Jun 20, 2024
2260123
Turn Record._manager into a read-only property, make other Record and…
Jun 21, 2024
1d4d06e
Fix variable ref in example docs
Jun 21, 2024
38e8105
Add more details for what needs to be set in `record_class`
Jun 21, 2024
7575106
Correct type for default_fields
Jun 21, 2024
d53010e
RecordManager -> RecordManagerBase
Jun 21, 2024
682beb8
README.md: Change relative links to full URLs (for PyPI)
Jun 21, 2024
6ee4245
Consistent branding
Jun 21, 2024
3b8869e
Address review comments
Jun 27, 2024
551cec1
Remove `time` type handling (doesn't exist in Odoo), add docs for cus…
Jun 27, 2024
233590d
Remove the docs for the `time` type
Jun 27, 2024
3f5a72e
Fix docstrings
Jun 27, 2024
4929675
Add missing detail
Jun 27, 2024
e0bf02a
Add automatic changelog generating using `towncrier`, upgrade PDM
Jun 27, 2024
2cfe9f0
Add mike for docs versioning, make sure changelog loosely conforms to…
Jun 27, 2024
f1c0d6e
Change release workflow to tag workflow, add publishing to GitHub Pages
Jun 27, 2024
04a970d
Run mike in pdm
Jun 27, 2024
61d86e8
Simplify workflow job names
Jun 27, 2024
8703abb
Simplify Literal heading
Jun 27, 2024
c4a7d44
Grammar fix
Jun 27, 2024
862b098
Fix filtering by record ID fields using the record object value, add …
Jun 30, 2024
60c0f9a
Move _resolve_alias into RecordManagerBase (the only place it is used…
Jun 30, 2024
6f8b6ef
Change Client type hints in base classes to ClientBase, add proper ty…
Jun 30, 2024
95783d1
Last batch of fixes
Jun 30, 2024
aedae39
Add missing docs, add tips about when not to use _manager
Jul 1, 2024
7be869b
Improve model ref handling in search filters, make create_uid/write_u…
Jul 1, 2024
ddcdc3b
write_date is still required
Jul 1, 2024
c3f8a0a
Fix incorrect comma
Jul 1, 2024
e8d9332
Update release date
Jul 1, 2024
890184b
Move missing changes over to README.md
Jul 1, 2024
d27d77c
Change README links to point to GitHub Pages
Jul 1, 2024
1318642
Make sure optional/empty model refs are encoded to the expected values
Jul 1, 2024
e5b4107
Simplify is_model_ref var
Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

name: main

on:
push:
branches:
- main

jobs:
publish-github-pages:
runs-on: ubuntu-22.04
steps:
- name: Clone full tree, and checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python and PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.12"
version: "2.16.1"
- name: Create virtual environment
run: pdm install
- name: Publish the docs to GitHub Pages
run: pdm run mike deploy --push develop
96 changes: 96 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: tag

on:
push:
tags:
- "*.*.*"

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Clone full tree, and checkout tag
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python and PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.12"
version: "2.16.1"
- name: Build source dist and wheels
run: pdm build --verbose
- name: Upload source dist and wheels to artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 5
if-no-files-found: error

publish-pypi:
needs: build
runs-on: ubuntu-22.04
environment: pypi
permissions:
id-token: write
steps:
- name: Clone full tree, and checkout tag
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download source dist and wheels from artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Setup Python and PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.12"
version: "2.16.1"
- name: Publish source dist and wheels to PyPI
run: pdm publish --no-build --verbose

publish-github-release:
needs: build
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Clone and checkout tag
uses: actions/checkout@v4
- name: Download source dist and wheels from artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Extract changelog
id: extract-changelog
uses: sean0x42/markdown-extract@v2
with:
file: docs/changelog.md
pattern: ${{ github.ref_name }}
- name: Publish the GitHub Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.extract-changelog.outputs.markdown }}
files: dist/*
fail_on_unmatched_files: true

publish-github-pages:
runs-on: ubuntu-22.04
steps:
- name: Clone full tree, and checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python and PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.12"
version: "2.16.1"
- name: Create virtual environment
run: pdm install
- name: Publish the docs to GitHub Pages
run: pdm run mike deploy --push --update-aliases ${{ github.ref_name }} latest
114 changes: 114 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: test

on:
pull_request:
push:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- name: Clone and checkout branch
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1

build:
needs: pre-commit
runs-on: ubuntu-22.04
steps:
- name: Clone full tree, and checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python and PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.12"
version: "2.16.1"
- name: Build source dist and wheels
run: pdm build --verbose
- name: Upload source dist and wheels to artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 5
if-no-files-found: error

# test:
# needs: pre-commit
# permissions:
# checks: write
# strategy:
# fail-fast: false
# matrix:
# operating_system:
# - ubuntu-22.04
# - windows-2022
# python_version:
# - "3.8"
# - "3.9"
# - "3.10"
# - "3.11"
# - "3.12"
# runs-on: ${{ matrix.operating_system }}
# steps:
# - name: Clone full tree, and checkout branch
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Setup Python and PDM
# uses: pdm-project/setup-pdm@v4
# with:
# python-version: ${{ matrix.python_version }}
# version: "2.16.1"
# - name: Create virtual environment
# run: pdm install
# - name: Run tests
# run: pdm run test
# - name: Publish test results
# uses: mikepenz/action-junit-report@v4
# # Always run, even if the tests fail.
# if: success() || failure()
# with:
# report_paths: rspec.xml
# - name: Upload coverage report to artifacts
# uses: actions/upload-artifact@v4
# # Always run, even if the tests fail.
# if: success() || failure()
# with:
# name: coverage-${{ matrix.operating_system}}-${{ matrix.python_version }}
# path: coverage.xml
# retention-days: 5
# if-no-files-found: warn

# coverage:
# needs: test
# # Always run, even if the test job failed.
# if: success() || failure()
# runs-on: ubuntu-22.04
# steps:
# - name: Download coverage reports from artifacts
# uses: actions/download-artifact@v4
# with:
# pattern: coverage-*
# merge-multiple: false
# - name: Generate code coverage summary report
# uses: irongut/CodeCoverageSummary@v1.3.0
# with:
# filename: coverage-*/coverage.xml
# format: markdown
# hide_branch_rate: false
# hide_complexity: false
# indicators: false
# output: both
# - name: Write to job summary
# run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# VS Code
.vscode
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# .pre-commit-config.yml
# Pre-commit hook tasks.
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
- id: end-of-file-fixer
- id: detect-private-key
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/crate-ci/typos
rev: "v1.22.9"
hooks:
- id: typos
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.8"
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.0"
hooks:
- id: mypy
additional_dependencies:
- OdooRPC>=0.9.0
- packaging
- typing-extensions>=4.0.0
- repo: https://github.com/pdm-project/pdm
rev: "2.16.1"
hooks:
- id: pdm-lock-check
Loading