Saturday, November 2, 2024
1 change
Resolved issues and error corrections
Vendor bill imports now keep the unit price and tax values read from the document even when product prediction fills in a missing product. This prevents imported bills from being incorrectly recalculated to zero or using product defaults, improving accounting accuracy when automation is enabled.
Original PR description
Consider the case that "Predict vendor bill product" is activated in the settings and we upload / import a vendor bill with a single line. In case the product on the line could not be determined by…
Consider the case that "Predict vendor bill product" is activated in the settings and we upload / import a vendor bill with a single line. In case the product on the line could not be determined by the import function it is predicted afterwards (since the setting is enabled). But changing the product triggers i.e. a recompute of the unit price (`price_unit`) and taxes (`tax_ids`) based on the new product information. This is not what we want since the aforementioned values should be determined by the import even in case the product is not found. After this commit we explicitly mark the imported lines as imported before the prediction happens. Due to odoo/odoo@238b6af685eeba20e4f8f1a9c3969bbd1d1de890 (community, 18.0+) a product change on these lines will not trigger a recompute of the unit price or taxes. Reproduce 1. Activate "Predict vendor bill product" in the settings 2. Create Customer OpsWay * country = Poland * VAT = PL8992922295 3. Create 3 Vendor Bills manually * date in the past * customer = OpsWay * single invoice line: with product "Commissions" * Confirm 4. Import the PDF attached on the task in Vendor Bills. * It has a single line with quantity 1 and unit price 1,322.40 5. A bill with a single line is created: product = "Commissions" unit price = 0.0 total = 0 task-4279931 PR in 17: https://github.com/odoo/enterprise/pull/72625