Skip to content

[ADD] account_move_tier_validation_purchase + _stock_landed_costs#26

Open
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-add-account_move_tier_validation_purchase_landed_costs
Open

[ADD] account_move_tier_validation_purchase + _stock_landed_costs#26
bosd wants to merge 1 commit into
OCA:19.0from
bosd:19.0-add-account_move_tier_validation_purchase_landed_costs

Conversation

@bosd
Copy link
Copy Markdown
Contributor

@bosd bosd commented May 13, 2026

What

Two new auto-installed bridge modules so vendor bills can still be matched to a Purchase Order and turned into a Landed Cost after reaching validation_status='validated' on account_move_tier_validation.

account_move_tier_validation_purchase

Depends on account_move_tier_validation + purchase. Adds the following fields to the tier-validation exception list:

  • purchase_vendor_bill_id
  • purchase_id
  • invoice_vendor_bill_id
  • invoice_origin
  • invoice_line_ids
  • line_ids

Use case: a purchasing user validates a draft bill; a finance user then attaches the matching PO via the Auto-complete from a past purchase order picker. Without this bridge, the picker is greyed out by base_tier_validation's view post-processing and the onchange-driven write of invoice_line_ids / invoice_origin would be refused by the post-validation write guard.

account_move_tier_validation_stock_landed_costs

Depends on account_move_tier_validation + stock_landed_costs. Adds:

  • invoice_line_ids
  • line_ids
  • landed_costs_ids

Use case: a draft bill is validated; stock operations then mark one of the lines as a landed-cost line (which feeds _compute_landed_costs_visible and re-enables the Create Landed Costs button) and push the amount into stock valuation. Without this bridge the line is locked the moment validation lands and the user cannot reach the button.

Why two bridges instead of extending account_move_tier_validation

Adding the exceptions in account_move_tier_validation directly would force the base module to hard-depend on purchase and stock_landed_costs. The bridge pattern keeps the dependency edges clean: each bridge auto-installs only when both halves are present.

Tests

Each bridge ships a focused module-level test asserting the new fields are present in _get_validation_exceptions() -- the integration suite for the end-to-end flow (auto-complete a validated bill from a PO; mark a line as landed-cost on a validated bill and create the landed cost) lives in the customer project that requested this.

Notes

  • Both modules are auto_install: True, so they activate transparently whenever their dependencies are met.
  • No view or data changes -- only Python.

CC @LoisRForgeFlow

Two new auto-installed bridge modules so vendor bills can still be
matched to a Purchase Order and turned into a Landed Cost after
reaching ``validation_status='validated'`` on
``account_move_tier_validation``:

- ``account_move_tier_validation_purchase``: depends on
  ``account_move_tier_validation`` + ``purchase``. Adds
  ``purchase_vendor_bill_id``, ``purchase_id``,
  ``invoice_vendor_bill_id``, ``invoice_origin``,
  ``invoice_line_ids``, ``line_ids`` to the tier-validation
  exception list. Use case: purchasing user validates a draft
  bill; finance user attaches the matching PO via the
  *Auto-complete from a past purchase order* picker -- without
  this bridge the picker is greyed out and the onchange write
  is refused.

- ``account_move_tier_validation_stock_landed_costs``: depends
  on ``account_move_tier_validation`` + ``stock_landed_costs``.
  Adds ``invoice_line_ids``, ``line_ids``, ``landed_costs_ids``
  to the exception list. Use case: a draft bill is validated;
  stock operations then mark one of the lines as a landed-cost
  line and click *Create Landed Costs* to push the amount into
  stock valuation. Without this bridge the line is locked at
  the moment validation lands.

Both modules ``auto_install: True`` so they activate transparently
whenever the relevant pair is present. Each ships a focused unit
test that asserts the new fields are present in
``_get_validation_exceptions()``.
@OCA-git-bot OCA-git-bot added series:19.0 mod:account_move_tier_validation_purchase Module account_move_tier_validation_purchase mod:account_move_tier_validation_stock_lande 35025 Module account_move_tier_validation_stock_landed_costs labels May 13, 2026
@bosd bosd marked this pull request as draft May 13, 2026 21:01
@bosd bosd marked this pull request as ready for review May 14, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:account_move_tier_validation_purchase Module account_move_tier_validation_purchase mod:account_move_tier_validation_stock_lande 35025 Module account_move_tier_validation_stock_landed_costs series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants