[FIX] rma: rma_custmer_user has no write permissions in partner, so compute method fails.

[IMP] rma: use rma user in tests
[FIX] rma_account: move_line_id field string
[IMP] rma, rma_account, rma_sale, rma_purchase: tests for stock valuation
[FIX] account_move_line_rma_order_line: minor lint, make auto-install
[IMP] rma_account_unreconciled: use manager user in test
This commit is contained in:
AaronHForgeFlow
2022-03-04 10:56:07 +01:00
committed by Aaron ForgeFlow
parent b7c0205607
commit c65856d717
16 changed files with 527 additions and 71 deletions

View File

@@ -35,6 +35,9 @@ class StockRule(models.Model):
res["partner_id"] = line.delivery_address_id.id
else:
res["partner_id"] = line.rma_id.partner_id.id
# We are not checking the reference move here because if stock account
# is not installed, there is no way to know the cost of the stock move
# so better use the standard cost in this case.
company_id = res["company_id"]
company = self.env["res.company"].browse(company_id)
cost = product_id.with_company(company).standard_price