parent
379133b17f
commit
d16ca8293d
|
@ -54,77 +54,6 @@
|
|||
!python {model: account.invoice}: |
|
||||
acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
|
||||
assert acc_id.move_id, "Move not created for open invoice"
|
||||
-
|
||||
I create a record for partial payment of 1000 EUR.
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_first0}:
|
||||
amount: 1000.0
|
||||
date: '2010-05-26'
|
||||
journal_id: account.sales_journal
|
||||
name: First payment for [PC3] Medium PC to Distrib PC
|
||||
period_id: account.period_5
|
||||
-
|
||||
I make partial payment by clicking on Partial Payment button
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_first0")], {"lang":
|
||||
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
||||
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
||||
})
|
||||
-
|
||||
I check that the invoice state is still open
|
||||
-
|
||||
!assert {model: account.invoice, id: account_invoice_customer0}:
|
||||
- state == 'open'
|
||||
-
|
||||
I make second partial payment of 6000 EUR.
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_second0}:
|
||||
amount: 6000.0
|
||||
date: '2010-05-28'
|
||||
journal_id: account.sales_journal
|
||||
name: Second payment for [PC3] Medium PC to Distrib PC
|
||||
period_id: account.period_5
|
||||
-
|
||||
I make partial payment by clicking on Partial Payment button
|
||||
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_second0")], {"lang":
|
||||
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
||||
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
||||
})
|
||||
-
|
||||
I make final partial payment of 2000 EUR
|
||||
-
|
||||
!record {model: account.invoice.pay, id: account_invoice_pay_final0}:
|
||||
amount: 2000.0
|
||||
date: '2010-05-30'
|
||||
journal_id: account.sales_journal
|
||||
name: Final payment for [PC3] Medium PC to Distrib PC
|
||||
period_id: account.period_5
|
||||
|
||||
-
|
||||
I make partial payment by clicking on Partial Payment button
|
||||
|
||||
-
|
||||
!python {model: account.invoice.pay}: |
|
||||
self.pay_and_reconcile(cr, uid, [ref("account_invoice_pay_final0")], {"lang":
|
||||
'en_US', "active_model": "account.invoice", "tz": False, "record_id": 3, "active_ids":
|
||||
[ref("account_invoice_customer0")], "type": "out_invoice", "active_id": ref("account_invoice_customer0"),
|
||||
})
|
||||
|
||||
-
|
||||
I check that the invoice state is now Done
|
||||
-
|
||||
!assert {model: account.invoice, id: account_invoice_customer0}:
|
||||
- state == 'paid'
|
||||
-
|
||||
I check that an payment entry gets created in the account.move.line
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
acc_id=self.browse(cr, uid, ref("account_invoice_customer0"))
|
||||
assert(acc_id.move_id)
|
||||
-
|
||||
I refund the invoice Using Refund Button
|
||||
-
|
||||
|
|
|
@ -64,31 +64,6 @@
|
|||
!assert {model: res.partner, id: res_partner_markjohnson0}:
|
||||
- membership_state == 'invoiced', 'Member should be has "Current Membership State" in "Invoiced Member".'
|
||||
|
||||
- |
|
||||
I'm doing to paid that invoice which is opened for "Mark Johnson".
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
|
||||
from tools.translate import _
|
||||
invoice_pool = self.pool.get('account.invoice')
|
||||
partner_pool = self.pool.get('res.partner')
|
||||
membership_line_pool = self.pool.get('membership.membership_line')
|
||||
membership_pool = self.pool.get('product.product')
|
||||
invoice_pay_pool = self.pool.get('account.invoice.pay')
|
||||
|
||||
membership_line_ids = membership_line_pool.search(cr, uid, [('membership_id','=',ref('product_product_membershipproduct0')),('partner','=',ref('res_partner_markjohnson0'))])
|
||||
membership_lines = membership_line_pool.browse(cr, uid, membership_line_ids)
|
||||
assert membership_lines, _('Membership is not registrated.')
|
||||
membership_line = membership_lines[0]
|
||||
assert membership_line.account_invoice_id.state == 'open', _('Invoice should be Opened.')
|
||||
pay_id = invoice_pay_pool.create(cr, uid, {'amount': 80, 'name': 'Payment of Membership', 'journal_id': ref('account.bank_journal')}, {'active_id': membership_line.account_invoice_id.id})
|
||||
invoice_pay_pool.pay_and_reconcile(cr, uid, [pay_id], {'active_id': membership_line.account_invoice_id.id})
|
||||
- |
|
||||
I'm checking "Current membership state" of "Mark Johnson". It is an "Paid Member" or not.
|
||||
-
|
||||
!assert {model: res.partner, id: res_partner_markjohnson0}:
|
||||
- membership_state == 'paid', 'Member should be has "Current Membership State" in "Paid Member".'
|
||||
|
||||
- |
|
||||
I'm creating free member "Ms. Johnson" of "Golden Membership".
|
||||
-
|
||||
|
|
|
@ -18,30 +18,3 @@
|
|||
project_id: project_project_retroplanning0
|
||||
remaining_hours: 24.0
|
||||
state: draft
|
||||
-
|
||||
Check if task deadline_date and start_date changes upon changing its project's end_date
|
||||
-
|
||||
!python {model: project.project}: |
|
||||
from datetime import datetime, date, timedelta
|
||||
import time
|
||||
data_project = self.browse(cr,uid,[ref("project_project_retroplanning0")])
|
||||
prj = data_project[0]
|
||||
old_end_date=''
|
||||
if prj.date:
|
||||
old_end_date = date(*time.strptime(prj.date,'%Y-%m-%d')[:3])
|
||||
if old_end_date:
|
||||
new_end_date = date.today()+timedelta(1)
|
||||
res={}
|
||||
for task in prj.tasks:
|
||||
start_dt = (datetime(*time.strptime(task.date_start,'%Y-%m-%d %H:%M:%S')[:3])+(new_end_date-old_end_date)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
deadline_dt=''
|
||||
if task.date_deadline:
|
||||
deadline_dt = (datetime(*time.strptime(task.date_deadline,'%Y-%m-%d')[:3])+(new_end_date-old_end_date)).strftime('%Y-%m-%d')
|
||||
res[task.id]=[start_dt,deadline_dt]
|
||||
self.write(cr, uid, [ref("project_project_retroplanning0")], {'date' : (datetime.now()+timedelta(1)).strftime('%Y-%m-%d')})
|
||||
data_project = self.browse(cr,uid,[ref("project_project_retroplanning0")])
|
||||
prj = data_project[0]
|
||||
|
||||
for task in prj.tasks:
|
||||
assert task.date_start == res[task.id][0], "task start date differs, expected %s, got %s"%(res[task.id][0], task.date_start)
|
||||
assert task.date_deadline == res[task.id][1], "task deadline date differs, expected %s, got %s"%(res[task.id][1], task.date_deadline)
|
||||
|
|
Loading…
Reference in New Issue