|
1 | | -# Contributing guidelines |
| 1 | +# Contributing to go-odoo |
2 | 2 |
|
3 | | -We’d love you to help us improve this project. To help us keep this collection |
4 | | -high quality, we request that contributions adhere to the following guidelines. |
| 3 | +Thank you for your interest in contributing to `go-odoo`, a Golang wrapper for the Odoo API! We welcome contributions from the community to help improve this library and make it more robust for interacting with Odoo instances. Whether you're fixing bugs, adding features, improving documentation, or suggesting enhancements, your efforts are appreciated. |
5 | 4 |
|
6 | | -* TODO |
| 5 | +This document outlines the process and guidelines for contributing to the project. Please read it carefully to ensure a smooth collaboration experience. |
| 6 | + |
| 7 | +## How to Contribute |
| 8 | + |
| 9 | +### Getting Started |
| 10 | + |
| 11 | +* **Fork the Repository:** Click the "Fork" button on the [GitHub repository](https://github.com/Helvethink/go-odoo) to create your own copy of the project. |
| 12 | +* **Clone Your Fork:** Clone your forked repository to your local machine: |
| 13 | + |
| 14 | +```bash |
| 15 | +git clone https://github.com/<your-username>/go-odoo.git |
| 16 | +cd go-odoo |
| 17 | +``` |
| 18 | + |
| 19 | +* **Set Upstream Remote:** Add the main repository as an upstream remote to keep your fork in sync: |
| 20 | + |
| 21 | +```bash |
| 22 | +git remote add upstream https://github.com/Helvethink/go-odoo.git |
| 23 | +``` |
| 24 | + |
| 25 | + ### Development Environment |
| 26 | + |
| 27 | +* **Requirements:** Ensure you have Go installed (version 1.x or later, as specified in the project’s `go.mod` file if available). |
| 28 | +* **Dependencies:** Install project dependencies: |
| 29 | + |
| 30 | +```bash |
| 31 | +go mod tidy |
| 32 | +``` |
| 33 | + |
| 34 | +* **Testing Setup:** If you plan to test against an Odoo instance, have access to an Odoo server (e.g., version 11 as mentioned in the original repo, or your target version). Update the `ClientConfig` in your test code with appropriate credentials (`Admin`, `Password`, `Database`, `URL`). |
| 35 | + |
| 36 | +### Finding Issues to Work On |
| 37 | + |
| 38 | +* Check the [Issues tab](https://github.com/Helvethink/go-odoo/issues) for open issues labeled `help wanted` or `good first issue`. |
| 39 | +* If you have an idea for a new feature or improvement, open an issue to discuss it with the maintainers before starting work. |
| 40 | + |
| 41 | +### Making Changes |
| 42 | + |
| 43 | +* **Create a Branch:** Work on a new branch for each contribution: |
| 44 | + |
| 45 | +```bash |
| 46 | +git checkout -b feature/<your-feature-name> |
| 47 | +``` |
| 48 | + |
| 49 | +* **Code Style:** Follow Go conventions (e.g., use gofmt for formatting and go vet for static analysis). |
| 50 | +* **Commit Messages:** Write clear, concise commit messages: |
| 51 | + * Use the present tense (e.g., "Add support for Odoo 14 API" instead of "Added support"). |
| 52 | + * Reference related issues (e.g., "Fixes #42"). |
| 53 | + |
| 54 | +Testing: Add or update tests in the *_test.go files to cover your changes. Run tests locally: |
| 55 | + |
| 56 | +```bash |
| 57 | +go test ./... |
| 58 | +``` |
| 59 | + |
| 60 | +### Submitting Your Contribution |
| 61 | + |
| 62 | +* **Push Your Changes:** Push your branch to your fork: |
| 63 | + |
| 64 | +```bash |
| 65 | +git push origin feature/<your-feature-name> |
| 66 | +``` |
| 67 | + |
| 68 | +* Open a Pull Request (PR): |
| 69 | + * Go to the [Pull Requests](https://github.com/Helvethink/go-odoo/pulls) tab in the original repository. |
| 70 | + * Click "New Pull Request" and select your branch. |
| 71 | + * Provide a detailed description of your changes, including: |
| 72 | + * What you changed and why. |
| 73 | + * How to test your changes. |
| 74 | + * Any related issue numbers (e.g., "Closes #42"). |
| 75 | +* **Code Review:** Be responsive to feedback from maintainers. Make requested changes by pushing additional commits to your branch. |
| 76 | + |
| 77 | +### Syncing with Upstream |
| 78 | + |
| 79 | +* Keep your fork up to date with the main repository: |
| 80 | + |
| 81 | +```bash |
| 82 | +git fetch upstream |
| 83 | +git rebase upstream/master |
| 84 | +git push --force |
| 85 | +``` |
| 86 | + |
| 87 | +## Guidelines |
| 88 | + |
| 89 | +* **Scope:** This project focuses on providing a Golang wrapper for Odoo’s API. Contributions should align with this goal (e.g., improving model generation, adding support for newer Odoo versions, enhancing usability). |
| 90 | +* **Model Generation:** If adding new models, follow the existing pattern in `ir_model.go` and `ir_model_fields.go`. Regenerate models if necessary, as outlined in the README. |
| 91 | +* **Compatibility:** Note that model structures may differ across Odoo versions. Specify the Odoo version your changes target in your PR. |
| 92 | +* **Documentation:** Update the README or add inline comments for significant changes, especially if they affect usage. |
| 93 | +* **License:** Contributions are assumed to be under the same license as the project (check the repository for the specific license, likely MIT or similar, unless specified otherwise). |
| 94 | + |
| 95 | +## Reporting Bugs |
| 96 | + |
| 97 | +* Use the [Issues tab](https://github.com/Helvethink/go-odoo/issues) to report bugs. |
| 98 | +* Include: |
| 99 | + * Odoo version tested against. |
| 100 | + * Steps to reproduce the issue. |
| 101 | + * Expected vs. actual behavior. |
| 102 | + * Any error messages or logs. |
| 103 | + |
| 104 | +## Questions or Support |
| 105 | + |
| 106 | +* For general questions, open an issue with the `question` label. |
| 107 | +* Reach out to the maintainers via GitHub for clarification on contribution processes. |
| 108 | + |
| 109 | +## Code of Conduct |
| 110 | + |
| 111 | +We aim to foster an inclusive and respectful community. Please be kind and considerate in all interactions. |
0 commit comments