Browse Source

[FIX] journal selection

Gogs 7 years ago
parent
commit
69948effa8
1 changed files with 3 additions and 2 deletions
  1. 3 2
      controllers/main.py

+ 3 - 2
controllers/main.py

@@ -385,7 +385,8 @@ class Purchases(http.Controller):
                 'quantity': float(line.get('quantity')),
                 'price_unit': float(line.get('price'))
             }] for line in cart_items],
-            'account_id': journal.id,
+            'account_id': partner.property_account_payable.id,
+            'journal_id': journal.id,
             'currency_id': currency_id,
             'payment_term': payment_term_id,
             'type': 'in_invoice'
@@ -474,7 +475,7 @@ class Purchases(http.Controller):
                     'date_maturity': payment_line[0],
                     'amount_currency': invoice.company_id.currency_id.compute(payment_line[1], invoice.currency_id) if invoice.currency_id != invoice.company_id.currency_id else False,
                     'currency_id': invoice.currency_id != invoice.company_id.currency_id and invoice.currency_id.id,
-                    'ref': invoice.type in ('in_invoice', 'in_refund') and invoice.reference or invoice.number
+                    'ref': invoice.type in ('in_invoice', 'in_refund') and invoice.reference or invoice.number 
                 })
                 
             payment_lines = []