Allow only lines with maturity date to be paid
issue11364 review403191002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Allow only lines with maturity date to be paid
|
||||
* Allow processing receivable payment without approval
|
||||
* Add submitted state to payment
|
||||
* Permit to edit amount for manual payment in processing
|
||||
|
||||
+1
-4
@@ -419,10 +419,7 @@ class PayLine(Wizard):
|
||||
amount=line.payment_amount,
|
||||
line=line,
|
||||
)
|
||||
date = self.start.date or line.maturity_date
|
||||
# Use default value when empty
|
||||
if date:
|
||||
payment.date = date
|
||||
payment.date = self.start.date or line.maturity_date
|
||||
return payment
|
||||
|
||||
def do_pay(self, action):
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="name">Lines to Pay</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="domain"
|
||||
eval="[['OR', ('account.type.receivable', '=', True), ('account.type.payable', '=', True)], ('party', '!=', None), ('reconciliation', '=', None), ('payment_amount', '!=', 0), ('move_state', '=', 'posted')]"
|
||||
eval="[['OR', ('account.type.receivable', '=', True), ('account.type.payable', '=', True)], ('party', '!=', None), ('reconciliation', '=', None), ('payment_amount', '!=', 0), ('move_state', '=', 'posted'), ('maturity_date', '!=', None)]"
|
||||
pyson="1"/>
|
||||
<field name="search_value"
|
||||
eval="[('payment_blocked', '=', False)]" pyson="1"/>
|
||||
|
||||
@@ -322,6 +322,7 @@ class Payment(Workflow, ModelSQL, ModelView):
|
||||
If(Eval('state') == 'draft',
|
||||
[
|
||||
('reconciliation', '=', None),
|
||||
('maturity_date', '!=', None),
|
||||
],
|
||||
[]),
|
||||
['OR',
|
||||
|
||||
@@ -70,7 +70,8 @@ Create payable move::
|
||||
>>> Move = Model.get('account.move')
|
||||
>>> move = Move()
|
||||
>>> move.journal = expense_journal
|
||||
>>> line = move.lines.new(account=payable, party=supplier,
|
||||
>>> line = move.lines.new(
|
||||
... account=payable, party=supplier, maturity_date=tomorrow,
|
||||
... credit=Decimal('50.00'))
|
||||
>>> line = move.lines.new(account=expense, debit=Decimal('50.00'))
|
||||
>>> move.click('post')
|
||||
|
||||
@@ -84,15 +84,3 @@ The date on the payment wizard is used for payment date::
|
||||
>>> payment, = Payment.find()
|
||||
>>> payment.date == tomorrow
|
||||
True
|
||||
|
||||
If the line does not have any maturity date it is scheduled for today::
|
||||
|
||||
>>> payment.delete()
|
||||
>>> line.maturity_date = None
|
||||
>>> line.save()
|
||||
>>> pay_line = Wizard('account.move.line.pay', [line])
|
||||
>>> pay_line.execute('next_')
|
||||
>>> pay_line.execute('next_')
|
||||
>>> payment, = line.payments
|
||||
>>> payment.date == today
|
||||
True
|
||||
|
||||
Reference in New Issue
Block a user