Skip to content

Commit

Permalink
[ADD] fieldservice_stock_account - on invoice, quantity from stock.re…
Browse files Browse the repository at this point in the history
…quest with direction inbound should be negative
  • Loading branch information
baimont committed May 21, 2021
1 parent 79def90 commit be486d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fieldservice_stock_account/models/fsm_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ class FSMOrder(models.Model):
def _prepare_inv_line_for_stock_request(self, stock_request, invoice=False):
accounts = stock_request.product_id.product_tmpl_id.get_product_accounts()
account = accounts["income"]
if stock_request.direction == "inbound":
quantity = -stock_request.qty_done
else:
quantity = stock_request.qty_done
vals = {
"product_id": stock_request.product_id.id,
"quantity": stock_request.qty_done,
"quantity": quantity,
"name": stock_request.product_id.name,
"price_unit": 0,
"show_in_report": False,
Expand Down

0 comments on commit be486d6

Please sign in to comment.