[ADD] account_move_tier_validation_purchase + _stock_landed_costs#26
Open
bosd wants to merge 1 commit into
Open
[ADD] account_move_tier_validation_purchase + _stock_landed_costs#26bosd wants to merge 1 commit into
bosd wants to merge 1 commit into
Conversation
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()``.
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.
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'onaccount_move_tier_validation.account_move_tier_validation_purchaseDepends on
account_move_tier_validation+purchase. Adds the following fields to the tier-validation exception list:purchase_vendor_bill_idpurchase_idinvoice_vendor_bill_idinvoice_origininvoice_line_idsline_idsUse 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 ofinvoice_line_ids/invoice_originwould be refused by the post-validation write guard.account_move_tier_validation_stock_landed_costsDepends on
account_move_tier_validation+stock_landed_costs. Adds:invoice_line_idsline_idslanded_costs_idsUse case: a draft bill is validated; stock operations then mark one of the lines as a landed-cost line (which feeds
_compute_landed_costs_visibleand 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_validationAdding the exceptions in
account_move_tier_validationdirectly would force the base module to hard-depend onpurchaseandstock_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
auto_install: True, so they activate transparently whenever their dependencies are met.CC @LoisRForgeFlow