[7030][ADD] product_weighing: append-only weighing lines with product Weighing tab - #172
Merged
Conversation
nobuQuartile
force-pushed
the
7030-add-product_weighing
branch
2 times, most recently
from
July 31, 2026 08:19
4a86afd to
b7cb6a1
Compare
nobuQuartile
marked this pull request as ready for review
July 31, 2026 08:19
nobuQuartile
force-pushed
the
7030-add-product_weighing
branch
from
July 31, 2026 08:34
b7cb6a1 to
2c33380
Compare
nobuQuartile
force-pushed
the
7030-add-product_weighing
branch
from
July 31, 2026 08:39
2c33380 to
b7ecf36
Compare
nobuQuartile
marked this pull request as draft
July 31, 2026 08:41
nobuQuartile
force-pushed
the
7030-add-product_weighing
branch
from
July 31, 2026 08:46
b7ecf36 to
8aa0a3c
Compare
nobuQuartile
force-pushed
the
7030-add-product_weighing
branch
7 times, most recently
from
August 3, 2026 05:04
13eb33f to
3755f9e
Compare
… Weighing tab Store weighing results (gross/dust/net weight) sent from the external odoo-upload-system against a product, as an append-only model to back the "no tampering of weighing data" claim. Creation is limited to a dedicated integration group via ACL, and the model overrides write/unlink to always raise AccessError, so a line can never be modified or deleted after creation through any ORM path - UI, RPC, sudo or the developer-mode superuser included; there is no context flag to bypass it. Direct SQL is out of scope by design. The parent product cannot be deleted while lines exist (product_tmpl_id ondelete="restrict"), so the trail is preserved. product.template gets three computed+stored aggregate fields (weighing count, total net weight, weighing confirmed at) plus the one2many; the integration only creates lines and never writes to product.template. The line model does not inherit mail.thread and uses no field tracking: there is no chatter view for the line and, being append-only, it never changes, so tracking would add cost with no auditable effect. A searchable audit trail (create/write/unlink of the line, plus permission changes) is intended to be provided by the OCA auditlog module as a follow-up. The product form gets a read-only Weighing tab matching the requested mockup (no add/delete, row click opens a read-only detail with the image hash). task-7030
nobuQuartile
force-pushed
the
7030-add-product_weighing
branch
from
August 3, 2026 05:28
3755f9e to
564b4b6
Compare
nobuQuartile
marked this pull request as ready for review
August 3, 2026 05:28
smorita7749
reviewed
Aug 3, 2026
Contributor
Author
|
Add ja.po Translation notesTranslations are referenced from existing Odoo translations where available (odoo/product). The following terms have no reference and are translated independently:
|
smorita7749
approved these changes
Aug 6, 2026
smorita7749
left a comment
There was a problem hiding this comment.
Code and functional review: LGTM
yostashiro
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QT7030
What
Add a new module
product_weighingthat stores weighing results sent from the externalodoo-upload-systemagainst a product.Why
The weighing data is used to back a "no tampering of weighing data" claim, so the detail model must be append-only.
How
product.weighing.line(gross/dust/net weight, weighing id, measured at, image hash),weighing_idSQL unique.group_weighing_integrationvia ACL (no write/unlink granted to anyone), and the model overrideswrite/unlinkto always raiseAccessError. So a line can never be modified or deleted after creation through any ORM path — UI, RPC,sudoor the developer-mode superuser included; there is no context flag to bypass it. Direct SQL is out of scope by design.product_tmpl_idisondelete="restrict", so a product with weighing lines cannot be deleted (no cascade erasure of the evidence).product.templategets three computed+stored aggregate fields (weighing count, total net weight, weighing confirmed at) plus the one2many. The integration only creates lines — it never writes toproduct.template.mail.thread/ no field tracking on the line: there is no chatter view for the line and, being append-only, it never changes, so tracking would add cost with no auditable effect. A searchable audit trail (create/write/unlink of the line, plus permission changes) is intended to be provided by the OCA auditlog module as a follow-up (module to be vendored intormm-oca).i18n/ja.po) and tests.Test
-u product_weighing --test-enable→ 3/3 pass. Covered: integration user create OK; create denied for regular/admin; write and unlink raise for everyone incl. sudo; product with lines cannot be deleted (restrict); duplicateweighing_idrejected; aggregates computed.