[MERGE] merge from dev3

bzr revid: ara@tinyerp.com-20110105131734-q2t76dn07o2hdszm
bzr revid: ara@tinyerp.com-20110106050207-0orb7sntw1e5ptrs
This commit is contained in:
ARA (OpenERP) 2011-01-06 10:32:07 +05:30
commit 74c0095279
37 changed files with 574 additions and 528 deletions

View File

@ -124,7 +124,6 @@ class account_analytic_line(osv.osv):
result = round(amount, prec)
if not flag:
result *= -1
return {'value': {
'amount': result,
'general_account_id': a,

View File

@ -100,6 +100,57 @@ class account_move_line(osv.osv):
return query
def _amount_residual(self, cr, uid, ids, field_names, args, context=None):
"""
This function returns the residual amount on a receivable or payable account.move.line.
By default, it returns an amount in the currency of this journal entry (maybe different
of the company currency), but if you pass 'residual_in_company_currency' = True in the
context then the returned amount will be in company currency.
"""
res = {}
if context is None:
context = {}
cur_obj = self.pool.get('res.currency')
for move_line in self.browse(cr, uid, ids, context=context):
res[move_line.id] = {
'amount_residual': 0.0,
'amount_residual_currency': 0.0,
}
if move_line.reconcile_id:
continue
if not move_line.account_id.type in ('payable', 'receivable'):
#this function does not suport to be used on move lines not related to payable or receivable accounts
continue
if move_line.currency_id:
move_line_total = move_line.amount_currency
sign = move_line.amount_currency < 0 and -1 or 1
else:
move_line_total = move_line.debit - move_line.credit
sign = (move_line.debit - move_line.credit) < 0 and -1 or 1
line_total_in_company_currency = move_line.debit - move_line.credit
context_unreconciled = context.copy()
if move_line.reconcile_partial_id:
for payment_line in move_line.reconcile_partial_id.line_partial_ids:
if payment_line.id == move_line.id:
continue
if payment_line.currency_id and move_line.currency_id and payment_line.currency_id.id == move_line.currency_id.id:
move_line_total += payment_line.amount_currency
else:
if move_line.currency_id:
context_unreconciled.update({'date': payment_line.date})
amount_in_foreign_currency = cur_obj.compute(cr, uid, move_line.company_id.currency_id.id, move_line.currency_id.id, (payment_line.debit - payment_line.credit), round=False, context=context_unreconciled)
move_line_total += amount_in_foreign_currency
else:
move_line_total += (payment_line.debit - payment_line.credit)
line_total_in_company_currency += (payment_line.debit - payment_line.credit)
result = move_line_total
res[move_line.id]['amount_residual_currency'] = sign * (move_line.currency_id and self.pool.get('res.currency').round(cr, uid, move_line.currency_id, result) or result)
res[move_line.id]['amount_residual'] = sign * line_total_in_company_currency
return res
def default_get(self, cr, uid, fields, context=None):
data = self._default_get(cr, uid, fields, context=context)
for f in data.keys():
@ -433,6 +484,8 @@ class account_move_line(osv.osv):
'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),
'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
'amount_residual_currency': fields.function(_amount_residual, method=True, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."),
'amount_residual': fields.function(_amount_residual, method=True, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."),
'currency_id': fields.many2one('res.currency', 'Currency', help="The optional other currency if it is a multi-currency entry."),
'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1),
@ -676,6 +729,7 @@ class account_move_line(osv.osv):
company_list.append(line.company_id.id)
for line in self.browse(cr, uid, ids, context=context):
company_currency_id = line.company_id.currency_id
if line.reconcile_id:
raise osv.except_osv(_('Warning'), _('Already Reconciled!'))
if line.reconcile_partial_id:
@ -688,8 +742,7 @@ class account_move_line(osv.osv):
else:
unmerge.append(line.id)
total += (line.debit or 0.0) - (line.credit or 0.0)
if not total:
if self.pool.get('res.currency').is_zero(cr, uid, company_currency_id, total):
res = self.reconcile(cr, uid, merges+unmerge, context=context)
return res
r_id = move_rec_obj.create(cr, uid, {
@ -771,6 +824,19 @@ class account_move_line(osv.osv):
libelle = context['comment']
else:
libelle = _('Write-Off')
cur_obj = self.pool.get('res.currency')
cur_id = False
amount_currency_writeoff = 0.0
if context.get('company_currency_id',False) != context.get('currency_id',False):
cur_id = context.get('currency_id',False)
for line in unrec_lines:
if line.currency_id and line.currency_id.id == context.get('currency_id',False):
amount_currency_writeoff += line.amount_currency
else:
tmp_amount = cur_obj.compute(cr, uid, line.account_id.company_id.currency_id.id, context.get('currency_id',False), abs(line.debit-line.credit), context={'date': line.date})
amount_currency_writeoff += (line.debit > 0) and tmp_amount or -tmp_amount
writeoff_lines = [
(0, 0, {
'name': libelle,
@ -779,8 +845,8 @@ class account_move_line(osv.osv):
'account_id': account_id,
'date': date,
'partner_id': partner_id,
'currency_id': account.currency_id.id or False,
'amount_currency': account.currency_id.id and -currency or 0.0
'currency_id': cur_id or (account.currency_id.id or False),
'amount_currency': amount_currency_writeoff and -1 * amount_currency_writeoff or (account.currency_id.id and -1 * currency or 0.0)
}),
(0, 0, {
'name': libelle,
@ -789,7 +855,9 @@ class account_move_line(osv.osv):
'account_id': writeoff_acc_id,
'analytic_account_id': context.get('analytic_id', False),
'date': date,
'partner_id': partner_id
'partner_id': partner_id,
'currency_id': cur_id or (account.currency_id.id or False),
'amount_currency': amount_currency_writeoff and amount_currency_writeoff or (account.currency_id.id and currency or 0.0)
})
]
@ -802,6 +870,8 @@ class account_move_line(osv.osv):
})
writeoff_line_ids = self.search(cr, uid, [('move_id', '=', writeoff_move_id), ('account_id', '=', account_id)])
if account_id == writeoff_acc_id:
writeoff_line_ids = [writeoff_line_ids[1]]
ids += writeoff_line_ids
r_id = move_rec_obj.create(cr, uid, {
@ -1283,4 +1353,4 @@ class account_move_line(osv.osv):
account_move_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -27,6 +27,7 @@
<field name="view_mode">tree,graph</field>
<field name="context">{'group_by':['user_type'], 'group_by_no_leaf':1}</field>
<field name="view_id" ref="account.view_account_entries_report_tree"/>
<field name="domain">[('year','=',time.strftime('%Y'))]</field>
</record>
<record id="action_treasory_graph" model="ir.actions.act_window">
<field name="name">Treasury</field>

View File

@ -88,32 +88,14 @@ class account_invoice(osv.osv):
return [('none', _('Free Reference'))]
def _amount_residual(self, cr, uid, ids, name, args, context=None):
res = {}
if context is None:
context = {}
cur_obj = self.pool.get('res.currency')
data_inv = self.browse(cr, uid, ids, context=context)
for inv in data_inv:
if inv.reconciled:
res[inv.id] = 0.0
continue
inv_total = inv.amount_total
context_unreconciled = context.copy()
for lines in inv.move_lines:
if lines.currency_id and lines.currency_id.id == inv.currency_id.id:
if inv.type in ('out_invoice','in_refund'):
inv_total += lines.amount_currency
else:
inv_total -= lines.amount_currency
else:
context_unreconciled.update({'date': lines.date})
amount_in_invoice_currency = cur_obj.compute(cr, uid, inv.company_id.currency_id.id, inv.currency_id.id,abs(lines.debit-lines.credit),round=False,context=context_unreconciled)
inv_total -= amount_in_invoice_currency
result = inv_total
res[inv.id] = self.pool.get('res.currency').round(cr, uid, inv.currency_id, result)
return res
result = {}
for invoice in self.browse(cr, uid, ids, context=context):
result[invoice.id] = 0.0
if invoice.move_id:
for m in invoice.move_id.line_id:
if m.account_id.type in ('receivable','payable'):
result[invoice.id] = m.amount_residual_currency
return result
# Give Journal Items related to the payment reconciled to this invoice
# Return ids of partial and total payments related to the selected invoices

View File

@ -94,25 +94,21 @@ class account_entries_report(osv.osv):
return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
context=context, count=count)
def read_group(self, cr, uid, domain, *args, **kwargs):
todel=[]
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
if context is None:
context = {}
fiscalyear_obj = self.pool.get('account.fiscalyear')
period_obj = self.pool.get('account.period')
for arg in domain:
if arg[0] == 'period_id' and arg[2] == 'current_period':
current_period = period_obj.find(cr, uid)[0]
domain.append(['period_id','in',[current_period]])
todel.append(arg)
break
elif arg[0] == 'period_id' and arg[2] == 'current_year':
current_year = fiscalyear_obj.find(cr, uid)
ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
domain.append(['period_id','in',ids])
todel.append(arg)
for a in [['period_id','in','current_year'], ['period_id','in','current_period']]:
if a in domain:
domain.remove(a)
return super(account_entries_report, self).read_group(cr, uid, domain, *args, **kwargs)
if context.get('period', False) == 'current_period':
current_period = period_obj.find(cr, uid)[0]
domain.append(['period_id','in',[current_period]])
elif context.get('year', False) == 'current_year':
current_year = fiscalyear_obj.find(cr, uid)
ids = fiscalyear_obj.read(cr, uid, [current_year], ['period_ids'])[0]['period_ids']
domain.append(['period_id','in',ids])
else:
domain = domain
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby)
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_entries_report')

View File

@ -70,11 +70,11 @@
<group colspan="10" col="12">
<filter icon="terp-go-year" string="This F.Year"
name="thisyear"
domain="[('period_id','in','current_year')]"
context="{'year':'current_year'}"
help="Journal Entries with period in current year"/>
<filter icon="terp-go-month" string="This Period"
name="period"
domain="[('period_id','in','current_period')]"
context="{'period':'current_period'}"
help="Journal Entries with period in current period"/>
<separator orientation="vertical"/>
<filter string="Unposted" icon="terp-document-new" domain="[('move_state','=','draft')]" help = "entries"/>

View File

@ -64,8 +64,8 @@ class common_report_header(object):
def _get_target_move(self, data):
if data.get('form', False) and data['form'].get('target_move', False):
if data['form']['target_move'] == 'all':
return 'All Entries'
return 'All Posted Entries'
return _('All Entries')
return _('All Posted Entries')
return ''
def _get_end_date(self, data):
@ -94,10 +94,10 @@ class common_report_header(object):
def _get_filter(self, data):
if data.get('form', False) and data['form'].get('filter', False):
if data['form']['filter'] == 'filter_date':
return 'Date'
return _('Date')
elif data['form']['filter'] == 'filter_period':
return 'Periods'
return 'No Filter'
return _('Periods')
return _('No Filter')
def _sum_debit_period(self, period_id, journal_id=None):
journals = journal_id or self.journal_ids

View File

@ -40,7 +40,6 @@ class account_followup_stat(osv.osv):
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'blocked': fields.boolean('Blocked', readonly=True),
'period_id': fields.many2one('account.period', 'Period', readonly=True),
}
_order = 'date_move'
@ -69,7 +68,7 @@ class account_followup_stat(osv.osv):
cr.execute("""
create or replace view account_followup_stat as (
SELECT
l.id AS id,
l.partner_id as id,
l.partner_id AS partner_id,
min(l.date) AS date_move,
max(l.date) AS date_move_last,

View File

@ -219,8 +219,8 @@ class account_followup_print_all(osv.osv_memory):
partners = []
dict_lines = {}
for line in move_lines:
partners.append(line.name)
dict_lines[line.name.id] =line
partners.append(line.partner_id)
dict_lines[line.partner_id.id] =line
for partner in partners:
ids_lines = move_obj.search(cr,uid,[('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','in',['receivable'])])
data_lines = move_obj.browse(cr, uid, ids_lines, context=context)
@ -275,8 +275,11 @@ class account_followup_print_all(osv.osv_memory):
sub = tools.ustr(data['email_subject'])
msg = ''
if dest:
tools.email_send(src,dest,sub,body)
msg_sent += partner.name + '\n'
try:
tools.email_send(src, dest, sub, body)
msg_sent += partner.name + '\n'
except Exception, e:
raise osv.except_osv('Error !', e )
else:
msg += partner.name + '\n'
msg_unsent += msg
@ -301,7 +304,7 @@ class account_followup_print_all(osv.osv_memory):
'type': 'ir.actions.act_window',
'target': 'new',
'nodestroy': True
}
}
def do_print(self, cr, uid, ids, context=None):
if context is None:

View File

@ -27,25 +27,6 @@ from osv import osv, fields
import decimal_precision as dp
from tools.translate import _
class account_move_line(osv.osv):
_inherit = 'account.move.line'
def _unreconciled(self, cr, uid, ids, prop, unknow_none, context=None):
res = {}
for line in self.browse(cr, uid, ids, context=context):
res[line.id] = line.debit - line.credit
if line.reconcile_partial_id:
res[line.id] = 0
for partial in line.reconcile_partial_id.line_partial_ids:
res[line.id] += partial.debit - partial.credit
res[line.id] = abs(res[line.id])
return res
_columns = {
'amount_unreconciled': fields.function(_unreconciled, method=True, string='Unreconciled Amount'),
}
account_move_line()
class account_voucher(osv.osv):
@ -165,6 +146,8 @@ class account_voucher(osv.osv):
return abs(amount - abs(credit - debit))
def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount):
if not line_dr_ids and not line_cr_ids:
return {'value':{}}
line_dr_ids = [x[2] for x in line_dr_ids]
line_cr_ids = [x[2] for x in line_cr_ids]
return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount)}}
@ -491,31 +474,32 @@ class account_voucher(osv.osv):
continue
total_credit += line.credit or 0.0
total_debit += line.debit or 0.0
for line in moves:
if line.credit and line.reconcile_partial_id and ttype == 'receipt':
continue
if line.debit and line.reconcile_partial_id and ttype == 'payment':
continue
original_amount = line.credit or line.debit or 0.0
amount_unreconciled = currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, abs(line.amount_residual_currency), context=context_multi_currency)
rs = {
'name':line.move_id.name,
'type': line.credit and 'dr' or 'cr',
'move_line_id':line.id,
'account_id':line.account_id.id,
'amount_original':currency_pool.compute(cr, uid, company_currency, currency_id, original_amount, context=context_multi_currency),
'amount_original': currency_pool.compute(cr, uid, line.currency_id and line.currency_id.id or company_currency, currency_id, line.currency_id and abs(line.amount_currency) or original_amount, context=context_multi_currency),
'date_original':line.date,
'date_due':line.date_maturity,
'amount_unreconciled':currency_pool.compute(cr, uid, company_currency, currency_id, line.amount_unreconciled, context=context_multi_currency)
'amount_unreconciled': amount_unreconciled,
}
if line.credit:
amount = min(line.amount_unreconciled, total_debit)
rs['amount'] = currency_pool.compute(cr, uid, company_currency, currency_id, amount, context=context_multi_currency)
amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_debit), context=context_multi_currency))
rs['amount'] = amount
total_debit -= amount
else:
amount = min(line.amount_unreconciled, total_credit)
rs['amount'] = currency_pool.compute(cr, uid, company_currency, currency_id, amount, context=context_multi_currency)
amount = min(amount_unreconciled, currency_pool.compute(cr, uid, company_currency, currency_id, abs(total_credit), context=context_multi_currency))
rs['amount'] = amount
total_credit -= amount
default['value']['line_ids'].append(rs)
@ -687,6 +671,7 @@ class account_voucher(osv.osv):
debit = -credit
credit = 0.0
sign = debit - credit < 0 and -1 or 1
#create the first line of the voucher
move_line = {
'name': inv.name or '/',
'debit': debit,
@ -701,9 +686,7 @@ class account_voucher(osv.osv):
'date': inv.date,
'date_maturity': inv.date_due
}
if (debit == 0.0 or credit == 0.0 or debit+credit > 0) and (debit > 0.0 or credit > 0.0):
master_line = move_line_pool.create(cr, uid, move_line)
move_line_pool.create(cr, uid, move_line)
rec_list_ids = []
line_total = debit - credit
if inv.type == 'sale':
@ -712,9 +695,14 @@ class account_voucher(osv.osv):
line_total = line_total + currency_pool.compute(cr, uid, inv.currency_id.id, company_currency, inv.tax_amount, context=context_multi_currency)
for line in inv.line_ids:
#create one move line per voucher line where amount is not 0.0
if not line.amount:
continue
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
#we check if the voucher line is fully paid or not and create a move line to balance the payment and initial invoice if needed
if line.amount == line.amount_unreconciled:
amount = line.move_line_id.amount_residual #residual amount in company currency
else:
amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
move_line = {
'journal_id': inv.journal_id.id,
'period_id': inv.period_id.id,
@ -753,9 +741,9 @@ class account_voucher(osv.osv):
raise osv.except_osv(_('No Account Base Code and Account Tax Code!'),_("You have to configure account base code and account tax code on the '%s' tax!") % (tax_data.name))
sign = (move_line['debit'] - move_line['credit']) < 0 and -1 or 1
move_line['amount_currency'] = company_currency <> current_currency and sign * line.amount or 0.0
master_line = move_line_pool.create(cr, uid, move_line)
voucher_line = move_line_pool.create(cr, uid, move_line)
if line.move_line_id.id:
rec_ids = [master_line, line.move_line_id.id]
rec_ids = [voucher_line, line.move_line_id.id]
rec_list_ids.append(rec_ids)
if not currency_pool.is_zero(cr, uid, inv.currency_id, line_total):
@ -764,7 +752,6 @@ class account_voucher(osv.osv):
if inv.payment_option == 'with_writeoff':
account_id = inv.writeoff_acc_id.id
elif inv.type in ('sale', 'receipt'):
# if inv.journal_id.type in ('sale','sale_refund', 'cash', 'bank'):
account_id = inv.partner_id.property_account_receivable.id
else:
account_id = inv.partner_id.property_account_payable.id
@ -776,12 +763,10 @@ class account_voucher(osv.osv):
'date': inv.date,
'credit': diff > 0 and diff or 0.0,
'debit': diff < 0 and -diff or 0.0,
'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0,
'currency_id': company_currency <> current_currency and current_currency or False,
'analytic_account_id': inv.analytic_id.id,
#'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0,
#'currency_id': company_currency <> current_currency and current_currency or False,
}
move_line_pool.create(cr, uid, move_line)
self.write(cr, uid, [inv.id], {
'move_id': move_id,
'state': 'posted',
@ -817,6 +802,8 @@ class account_voucher_line(osv.osv):
currency_pool = self.pool.get('res.currency')
rs_data = {}
for line in self.browse(cr, uid, ids, context=context):
ctx = context.copy()
ctx.update({'date': line.voucher_id.date})
res = {}
company_currency = line.voucher_id.journal_id.company_id.currency_id.id
voucher_currency = line.voucher_id.currency_id.id
@ -826,13 +813,15 @@ class account_voucher_line(osv.osv):
res['amount_original'] = 0.0
res['amount_unreconciled'] = 0.0
elif move_line.currency_id:
res['amount_original'] = currency_pool.compute(cr, uid, move_line.currency_id.id, voucher_currency, move_line.amount_currency, context=ctx)
elif move_line and move_line.credit > 0:
res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.credit)
res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.credit, context=ctx)
else:
res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.debit)
res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.debit, context=ctx)
if move_line:
res['amount_unreconciled'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.amount_unreconciled)
res['amount_unreconciled'] = currency_pool.compute(cr, uid, move_line.currency_id and move_line.currency_id.id or company_currency, voucher_currency, abs(move_line.amount_residual_currency), context=ctx)
rs_data[line.id] = res
return rs_data

View File

@ -3,7 +3,7 @@
-
!record {model: account.voucher, id: account_voucher_seagate_0}:
account_id: account.a_recv
amount: 0.0
amount: 30000.0
company_id: base.main_company
currency_id: base.EUR
journal_id: account.sales_journal
@ -13,7 +13,6 @@
type: cr
partner_id: base.res_partner_seagate
period_id: account.period_9
tax_amount: 0.0
type: sale
-

View File

@ -89,13 +89,13 @@
<form string="Bill Payment">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/>
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection" select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
string="Payment Method"/>
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="reference" select="1" string="Payment Ref"/>
<field name="name" colspan="2"/>
<field name="account_id"
@ -152,13 +152,13 @@
<form string="Bill Payment">
<group col="6" colspan="4">
<field name="partner_id" domain="[('supplier','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/>
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection" select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
string="Payment Method"/>
<field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="reference" select="1" string="Payment Ref"/>
<field name="name" colspan="2"/>
<field name="account_id"
@ -199,9 +199,9 @@
<group col="2" colspan="1">
<group col="2" colspan="1">
<separator string="Payment Options" colspan="2"/>
<field name="payment_option" required="1"/>
<field name="writeoff_amount"
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
<field name="payment_option" required="1"/>
<field name="writeoff_acc_id"
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
domain="[('type','=','other')]"/>
@ -211,6 +211,7 @@
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"
groups="analytic.group_analytic_accounting"/>
</group>
<separator string="Other Information" colspan="2"/>
<group col="4" colspan="1">
<field name="currency_id" invisible="True"/>
<field name="number"/>
@ -236,6 +237,8 @@
<field name="credit"/>
<field name="state"/>
<field name="reconcile_id"/>
<field name="amount_currency"/>
<field name="currency_id"/>
</tree>
</field>
</page>
@ -286,15 +289,15 @@
<form string="Customer Payment">
<group col="6" colspan="4">
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Customer"/>
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="amount"
string="Paid Amount"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection" select="1"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"
string="Payment Method"/>
<field name="amount"
string="Paid Amount"
on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/>
<field name="reference" select="1" string="Payment Ref"/>
<field name="name" colspan="2"/>
<field name="account_id"
@ -373,6 +376,8 @@
<field name="credit"/>
<field name="state"/>
<field name="reconcile_id"/>
<field name="amount_currency"/>
<field name="currency_id"/>
</tree>
</field>
</page>

View File

@ -1,9 +1,9 @@
-
In order to test the procurement with product type buy in OpenERP, I will create product
In order to test the procurement with product type buy in OpenERP, I will create product
and then I will create procurement for this product.
-
-
I create product.
-
-
!record {model: product.product, id: product_product_cddrive0}:
categ_id: product.product_category_3
cost_method: standard
@ -27,12 +27,12 @@
name: base.res_partner_asus
min_qty: 2.0
qty: 5.0
-
-
I create procurement order.
-
-
!record {model: procurement.order, id: procurement_order_testcase0}:
company_id: base.main_company
date_planned: '2010-07-07 15:38:53'
date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
location_id: stock.stock_location_stock
name: Test Case
priority: '1'
@ -43,13 +43,13 @@
product_uos: product.product_uom_unit
product_uos_qty: 0.0
state: draft
-
-
I confirm on procurement order.
-
-
!workflow {model: procurement.order, action: button_confirm, ref: procurement_order_testcase0}
-
-
I run the scheduler.
-
-
!function {model: procurement.order, name: run_scheduler}:
- model: procurement.order
search: "[]"
@ -66,19 +66,19 @@
!python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.browse(cr, uid, [ref('procurement_order_testcase0')])[0]
assert(proc_ids.state == 'running'), _('Exception')
-
assert(proc_ids.state == 'running'), _('Exception')
-
I confirm and Approve the purchase order.
-
-
!python {model: purchase.order}: |
procurement_obj = self.pool.get('procurement.order')
proc_ids = procurement_obj.browse(cr, uid, [ref('procurement_order_testcase0')])[0]
import netsvc
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'purchase.order',proc_ids.purchase_id.id,'purchase_confirm', cr)
-
wf_service.trg_validate(uid, 'purchase.order',proc_ids.purchase_id.id,'purchase_confirm', cr)
-
I receive the order of the supplier ASUStek from the Incoming Shipments menu.
-
-
!python {model: stock.picking }: |
import time
procurement_obj = self.pool.get('procurement.order')
@ -96,7 +96,7 @@
'product_id': move.product_id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
}
self.do_partial(cr, uid, [picking.id], partial_datas)
-
I confirm the Reservation.
@ -111,4 +111,4 @@
!python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.browse(cr, uid, [ref('procurement_order_testcase0')])[0]
assert(proc_ids.state == 'done'), _('Order is not in done state')
assert(proc_ids.state == 'done'), _('Order is not in done state')

View File

@ -28,11 +28,11 @@
-
!record {model: purchase.order, id: purchase_order_po1}:
company_id: base.main_company
date_order: '2010-05-11'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_method: manual
location_id: stock.stock_location_stock
order_line:
- date_planned: '2010-05-13'
- date_planned: !eval time.strftime('%Y-%m-%d')
name: iPod
price_unit: 100.0
product_id: 'product_product_ipod0'

View File

@ -23,16 +23,16 @@
weight_net: 0.0
-
In order to test the purchase flow,I create a new record where "invoice_method" is From Order.
-
-
I create purchase order for iPod.
-
-
!record {model: purchase.order, id: purchase_order_po0}:
company_id: base.main_company
date_order: '2010-05-11'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_method: order
location_id: stock.stock_location_stock
order_line:
- date_planned: '2010-05-13'
- date_planned: !eval time.strftime('%Y-%m-%d')
name: iPod
price_unit: 100.0
product_id: 'product_product_ipod0'
@ -42,20 +42,20 @@
partner_address_id: base.res_partner_address_7
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
-
Initially purchase order is in the draft state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'draft'
- state == 'draft'
-
I confirm the purchase order for iPod.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0}
-
-
I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'approved'
- state == 'approved'
-
I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
-
@ -76,7 +76,7 @@
I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
pur_obj=self.pool.get('purchase.order')
ids = []
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po0"))
for line in pur_id1.order_line:
@ -104,7 +104,7 @@
I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'approved'
- state == 'approved'
-
I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
@ -112,7 +112,7 @@
pur_id=self.browse(cr, uid, ref("purchase_order_po0"))
assert(pur_id.date_approve)
-
I check that an entry gets created in the pickings.
I check that an entry gets created in the pickings.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po0"))
@ -132,7 +132,7 @@
-
I check that Traceability moves are created.
-
I check that an invoice_ids field of Delivery&Invoices gets bind with the value.
I check that an invoice_ids field of Delivery&Invoices gets bind with the value.
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po0"))

View File

@ -28,11 +28,11 @@
-
!record {model: purchase.order, id: purchase_order_po2}:
company_id: base.main_company
date_order: '2010-05-11'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_method: picking
location_id: stock.stock_location_stock
order_line:
- date_planned: '2010-05-13'
- date_planned: !eval time.strftime('%Y-%m-%d')
name: iPod
price_unit: 100.0
product_id: 'product_product_ipod0'
@ -132,10 +132,11 @@
Then I create an invoice from picking by clicking on "Create Invoice" wizard
-
!python {model: stock.invoice.onshipping}: |
import time
pur_obj=self.pool.get('purchase.order')
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2"))
pick_ids = [x.id for x in pur_id1.picking_ids]
id = self.create(cr, uid, {'invoice_date': '2010-05-11', 'journal_id': ref('account.expenses_journal')},
id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.expenses_journal')},
{'active_ids': pick_ids})
self.create_invoice(cr, uid, [id], {"active_ids": pick_ids, "active_id": pick_ids[0]})
-

View File

@ -2,10 +2,10 @@
-
In order to test the purchase requisition module, I will do a sale order -> purchase_requisition ->
purchase flow and I will buy the required products at two different suppliers.
-
-
I start by creating a new product 'Laptop ACER', which is purchased at Asustek, in MTO,
with the generation of purchase requisitions.
-
-
!record {model: product.product, id: product_product_laptopacer0}:
categ_id: product.product_category_3
cost_method: standard
@ -26,12 +26,12 @@
warranty: 0.0
weight: 0.0
weight_net: 0.0
list_price: 100.0
-
list_price: 100.0
-
Then I sell 5 Laptop ACER to the customer Agrolait, sale order TEST/TENDER/0001.
-
-
!record {model: sale.order, id: sale_order_testtender0}:
date_order: '2010-05-10'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: TEST/TENDER/0001
order_line:
@ -53,43 +53,43 @@
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
-
I confirm the sale order.
-
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_testtender0}
-
-
I launch the scheduler to compute all procurements, and specify all requisitions orders.
-
-
!python {model: procurement.order.compute.all}: |
proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr,uid)
-
On the purchase requisition, I create a new purchase order for the supplier 'DistriPC' by clicking on
the button 'New RfQ'. This opens a window to ask me the supplier and I set DistriPC .
-
the button 'New RfQ'. This opens a window to ask me the supplier and I set DistriPC .
-
!record {model: purchase.requisition.partner, id: purchase_requisition_partner_0}:
partner_address_id: base.res_partner_address_7
partner_id: base.res_partner_4
-
-
I create a new purchase order.
-
-
!python {model: purchase.requisition.partner}: |
req_obj = self.pool.get('purchase.requisition')
ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER')])
self.create_order(cr, uid, [ref("purchase_requisition_partner_0")], {"lang":
'en_US', "active_model": "purchase.requisition", "tz": False, "record_id":
1, "active_ids": ids, "active_id": ids[0], })
-
I check that I have two purchase orders on the purchase requisition.
I check that I have two purchase orders on the purchase requisition.
-
!python {model: purchase.order}: |
from tools.translate import _
from tools.translate import _
order_ids =self.search(cr, uid, [('origin','=','TEST/TENDER/0001')])
ids=len(order_ids)
assert(ids == 2), _('Purchase Order not Created')
assert(ids == 2), _('Purchase Order not Created')
-
-
I set the purchase requisition as 'Not Exclusive'.
-
!python {model: purchase.requisition}: |
@ -98,49 +98,49 @@
-
I change the quantities so that the purchase order for DistriPC includes 3 pieces and the
purchase order for Asustek includes 2 pieces.
-
-
!python {model: purchase.order}: |
line_obj=self.pool.get('purchase.order.line')
partner_obj=self.pool.get('res.partner')
line_obj=self.pool.get('purchase.order.line')
partner_obj=self.pool.get('res.partner')
requistion_obj=self.pool.get('purchase.requisition')
requistion_ids =requistion_obj.search(cr, uid, [('origin','=','Laptop ACER')])
partner_id1=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0]
partner_id2=partner_obj.search(cr,uid,[('name','=','Distrib PC')])[0]
requistion_ids =requistion_obj.search(cr, uid, [('origin','=','Laptop ACER')])
partner_id1=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0]
partner_id2=partner_obj.search(cr,uid,[('name','=','Distrib PC')])[0]
purchase_id1= self.search(cr, uid, [('partner_id','=',partner_id1),('requisition_id','in',requistion_ids)])
purchase_id2= self.search(cr, uid, [('partner_id','=',partner_id2),('requisition_id','in',requistion_ids)])
order_line1=self.browse(cr, uid, purchase_id1, context)[0].order_line[0].id
order_line2=self.browse(cr, uid, purchase_id2, context)[0].order_line[0].id
line_obj.write(cr, uid, order_line1, {'product_qty':2})
line_obj.write(cr, uid, order_line2, {'product_qty':3})
line_obj.write(cr, uid, order_line2, {'product_qty':3})
-
I confirm and validate both purchase orders.
-
!python {model: purchase.order}: |
order_ids= self.search(cr, uid, [])
import netsvc
wf_service = netsvc.LocalService("workflow")
for id in order_ids:
wf_service.trg_validate(uid, 'purchase.order',id,'purchase_confirm', cr)
wf_service.trg_validate(uid, 'purchase.order',id,'purchase_approve', cr)
wf_service = netsvc.LocalService("workflow")
for id in order_ids:
wf_service.trg_validate(uid, 'purchase.order',id,'purchase_confirm', cr)
wf_service.trg_validate(uid, 'purchase.order',id,'purchase_approve', cr)
-
I check that the delivery order of the customer is in state 'Waiting Goods'.
-
!python {model: stock.picking }: |
from tools.translate import _
from tools.translate import _
picking_id = self.search(cr, uid, [('origin','=','TEST/TENDER/0001')])
if picking_id:
pick=self.browse(cr,uid,picking_id[0])
assert (pick.state =='confirmed'),_('Picking is not in confirm state.')
assert (pick.move_lines[0].state == 'waiting'), _('Stock Move is not Waiting state.')
assert (pick.move_lines[0].state == 'waiting'), _('Stock Move is not Waiting state.')
-
I receive the order of the supplier Asustek from the Incoming Products menu.
-
!python {model: stock.picking }: |
import time
partner_obj=self.pool.get('res.partner')
partner_obj=self.pool.get('res.partner')
order_obj=self.pool.get('purchase.order')
partner_id=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0]
partner_id=partner_obj.search(cr,uid,[('name','=','ASUStek')])[0]
picking_id = self.search(cr, uid, [('address_id.partner_id','=',partner_id),('type','=','in')])
if picking_id:
pick=self.browse(cr,uid,picking_id[0])
@ -154,14 +154,14 @@
'product_id': move.product_id.id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
}
self.do_partial(cr, uid, picking_id,partial_datas)
-
I receive the order of the supplier DistriPC from the Incoming Shipments menu.
-
-
!python {model: stock.picking }: |
import time
partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0]
partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0]
picking_id = self.search(cr, uid, [('address_id.partner_id','=',partner_id),('type','=','in')])
if picking_id:
pick=self.browse(cr,uid,picking_id[0])
@ -175,7 +175,7 @@
'product_id': move.product_id.id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
}
self.do_partial(cr, uid, picking_id,partial_datas)
-
I check that the delivery order of the customer is in the state Available.

View File

@ -3,7 +3,7 @@
purchase flow and I will buy the required products at two different suppliers.
-
I start by creating a new product 'Laptop ACER', which is purchased at Asustek, in MTO,
with the generation of purchase requisitions.
with the generation of purchase requisitions.
-
!record {model: product.product, id: product_product_laptopacer1}:
categ_id: product.product_category_3
@ -17,16 +17,16 @@
- delay: 1
name: base.res_partner_asus
qty: 5.0
min_qty: 1.0
min_qty: 1.0
supply_method: buy
type: product
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
-
uom_po_id: product.product_uom_unit
-
Then I sell 5 Laptop ACER to the customer Agrolait, sale order TEST/TENDER/0002
-
-
!record {model: sale.order, id: sale_order_testtender1}:
date_order: '2010-04-20'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: TEST/TENDER/0002
order_line:
@ -45,21 +45,21 @@
partner_shipping_id: base.res_partner_address_8
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
shop_id: sale.shop
-
I confirm sale order.
-
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_testtender1}
-
-
I launch the scheduler to compute all procurements, and planify all requisitions orders.
-
-
!python {model: procurement.order.compute.all}: |
proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr,uid)
-
I should find a purchase requisition with the origin 'TEST/TENDER/0002', that includes a request for
5 Laptop ACER, and a purchase order on the default supplier for this product.
-
-
!python {model: purchase.requisition}: |
requisition_ids =self.search(cr, uid, [('origin','=','Laptop ACER1')])
ids=len(requisition_ids)
@ -67,15 +67,15 @@
-
On the purchase requisition, I create a new purchase order for the supplier 'DistriPC' by clicking on
the button 'New Request for Quotation'. This opens a window to ask me the supplier and I set DistriPC .
-
-
I Create purchase.requisition.partner .
-
-
!record {model: purchase.requisition.partner, id: purchase_requisition_partner_0}:
partner_address_id: base.res_partner_address_7
partner_id: base.res_partner_4
-
-
I create a new purchase order for the supplier 'DistriPC'.
-
-
!python {model: purchase.requisition.partner}: |
req_obj = self.pool.get('purchase.requisition')
ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
@ -83,31 +83,31 @@
'en_US', "active_model": "purchase.requisition", "tz": False, "record_id":
1, "active_ids": ids, "active_id": ids[0], })
-
I set the purchase requisition as 'Exclusive'
-
I set the purchase requisition as 'Exclusive'
-
!python {model: purchase.requisition}: |
ids =self.search(cr, uid, [('origin','=','Laptop ACER1')])
self.write(cr,uid,ids[0],{'exclusive': 'exclusive' })
-
I confirm and validate the Request for Quotation of ASUStek.
I confirm and validate the Request for Quotation of ASUStek.
-
!python {model: purchase.order}: |
partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0]
req_obj = self.pool.get('purchase.requisition')
ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0]
import netsvc
wf_service = netsvc.LocalService("workflow")
wf_service = netsvc.LocalService("workflow")
if purchase_id:
wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_confirm', cr)
wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_approve', cr)
wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_approve', cr)
-
I check that Request for Quotation of DistriPC is cancelled.
-
-
!python {model: purchase.order}: |
partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0]
req_obj = self.pool.get('purchase.requisition')
ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])
purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0]
state=self.browse(cr,uid,purchase_id).state
assert (state=='cancel')

View File

@ -260,7 +260,7 @@ class sale_order(osv.osv):
'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on', help="The sale order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you want your invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.", required=True, readonly=True, states={'draft': [('readonly', False)]}),
'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True,readonly=True)
}
_defaults = {
'picking_policy': 'direct',

View File

@ -1,9 +1,9 @@
-
In order to test the Deposit wizard of sale module in the Open-ERP,
I create a Sale Order for LG Viewty Smart for qty 100 having order_policy manual.
-
-
!record {model: sale.order, id: sale_order_so5}:
date_order: '2010-07-17'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
order_line:
- name: LG Viewty Smart
@ -26,14 +26,14 @@
shop_id: sale.shop
-
I use the Advance Payment wizard.
-
-
!record {model: sale.advance.payment.inv, id: sale_advance_payment_inv_0}:
amount: 1000.0
product_id: product.product_product_pc3
qtty: 3.0
-
-
Then I click on the "Create Partial Invoice" button
-
-
!python {model: sale.advance.payment.inv}: |
self.create_invoices(cr, uid, [ref("sale_advance_payment_inv_0")], {"lang": 'en_US',
"active_model": 'sale.order', "active_ids": [ref("sale_order_so5")], "tz":
@ -43,8 +43,8 @@
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so5"))
assert so.invoice_ids, "Invoices has not been generated for sale_order_so5"
-
assert so.invoice_ids, "Invoices has not been generated for sale_order_so5"
-
I open the Invoice for the SO.
-
!python {model: account.invoice}: |
@ -91,18 +91,18 @@
assert(sale_id.invoiced == True), "Paid has not been set to true"
-
I confirm the Sale Order.
-
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so5}
-
I click on "Create Invoice" button of Sales order to create the invoice.
-
-
!workflow {model: sale.order, action: manual_invoice, ref: sale_order_so5}
-
I verify whether the invoice has been generated for SO
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so5"))
assert so.invoice_ids[1], "Invoices has not been generated for sale_order_so5"
assert so.invoice_ids[1], "Invoices has not been generated for sale_order_so5"
-
I open the Invoice for the SO.
-
@ -124,7 +124,7 @@
assert invoice_id, "Invoice is not in the open state"
-
I assign an analytic journal to the bank journal
-
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-

View File

@ -1,10 +1,10 @@
-
In order to test the Sale module in OpenERP,
I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice' and Invoice on 'Ordered quantities'
I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice' and Invoice on 'Ordered quantities'
in order to create an invoice based on the ordered quantity
-
!record {model: sale.order, id: sale_order_so9}:
date_order: '2010-07-17'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO006
order_line:
@ -26,13 +26,13 @@
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
-
I confirm the Sale Order.
-
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so9}
-
I verify that the picking has been generated for the sale order
-
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so9"))
assert so.picking_ids,"Picking has not been generated for sale_order_so9"
@ -40,10 +40,10 @@
Then I confirm the picking
-
!record {model: stock.partial.picking, id: stock_partial_picking_0}:
date: '2010-07-17 17:52:09'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
-
Then I done the picking
-
-
!python {model: stock.picking }: |
import time
sale_order_obj = self.pool.get('sale.order')
@ -62,11 +62,11 @@
'product_id': move.product_id.id,
'product_qty': '100',
'product_uom': move.product_uom.id,
}
}
self.do_partial(cr, uid, [pick.id],partial_datas)
-
I click on Create Invoice button to create the invoice.
-
-
!workflow {model: sale.order, action: manual_invoice, ref: sale_order_so9}
-
I verify whether the invoice has been generated for SO
@ -87,7 +87,7 @@
for inv_lines in inv_brw.invoice_line:
qty1 = inv_lines.quantity
assert qty1==qty, "Quantities are not same"
-
-
I open the Invoice for the SO.
-
!python {model: account.invoice}: |
@ -100,7 +100,7 @@
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
-
Assign analytic journal into bank journal
-
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
@ -116,7 +116,7 @@
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='test')
-
I verify the invoice are in paid state or not.
I verify the invoice are in paid state or not.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')

View File

@ -3,7 +3,7 @@
I create a Sale Order for Slider Mobile for 200 quantity having Shipping Policy 'Invoice from Picking' and Invoice on 'Shipped quantities'
-
!record {model: sale.order, id: sale_order_so6}:
date_order: '2010-07-17'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO006BIS
order_line:
@ -25,13 +25,13 @@
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
-
I confirm the Sale Order.
-
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so6}
-
I verify that the picking has been generated for the sale order
-
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so6"))
assert so.picking_ids,"Picking has not been generated for sale_order_so6"
@ -39,10 +39,10 @@
Then I click on the "Product Sent" button of Outgoing Shipments
-
!record {model: stock.partial.picking, id: stock_partial_picking_0}:
date: '2010-07-17 17:52:09'
-
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
-
I change the quantity on the picking to 199, and confirm partially 100 PCE.
-
-
!python {model: stock.picking }: |
import time
sale_order_obj = self.pool.get('sale.order')
@ -69,10 +69,11 @@
Then I click on 'Create Invoices' button
-
!python {model: stock.invoice.onshipping}: |
sale_obj = self.pool.get('sale.order')
import time
sale_obj = self.pool.get('sale.order')
sale_id = sale_obj.browse(cr, uid, ref("sale_order_so6"))
ids = [x.id for x in sale_id.picking_ids]
wiz_id = self.create(cr, uid, {'invoice_date': '2010-07-17', 'journal_id': ref('account.sales_journal')},
wiz_id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.sales_journal')},
{'active_ids': ids})
self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]})
-
@ -98,7 +99,7 @@
for inv_lines in inv_brw.invoice_line:
qty1=inv_lines.quantity
assert (qty1 == qty), "Quantities are not the same"
-
-
I open the Invoice for the SO.
-
!python {model: account.invoice}: |
@ -111,7 +112,7 @@
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
-
Assign analytic journal into bank journal
-
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
@ -127,7 +128,7 @@
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='test')
-
I verify the invoice are in paid state or not.
I verify the invoice are in paid state or not.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')

View File

@ -3,7 +3,7 @@
I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice'
-
!record {model: sale.order, id: sale_order_so0}:
date_order: '2010-07-17'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO002
order_line:
@ -208,7 +208,7 @@
Then I click on the "Products Received" button of Incoming Shipments
-
!record {model: stock.partial.picking, id: stock_partial_picking_0}:
date: '2010-07-17 17:52:09'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
-
I click on the "Validate" button
-

View File

@ -3,7 +3,7 @@
I create a Sale Order for Slider Mobile for qty 500 having Shipping Policy is 'Invoice from Picking'
-
!record {model: sale.order, id: sale_order_so7}:
date_order: '2010-07-15'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO007
order_line:
@ -31,7 +31,7 @@
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so7}
-
I verify that picking has been generated for the sale order.
-
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so7"))
assert so.picking_ids,"Picking has not been generated for sale_order_so7"
@ -62,10 +62,11 @@
Then I click on 'Create Invoices' button
-
!python {model: stock.invoice.onshipping}: |
sale_obj=self.pool.get('sale.order')
import time
sale_obj=self.pool.get('sale.order')
sale_id=sale_obj.browse(cr, uid, ref("sale_order_so7"))
ids = [x.id for x in sale_id.picking_ids]
wiz_id = self.create(cr, uid, {'invoice_date': '2010-07-15', 'journal_id': ref('account.sales_journal')},
wiz_id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.sales_journal')},
{'active_ids': ids})
self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]})
-
@ -87,7 +88,7 @@
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
-
Assign analytic journal into bank journal
-
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
@ -179,7 +180,7 @@
pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)])
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_confirm', cr)
-
-
I click on the "Approved by supplier" button to approve the purchase order
-
!python {model: sale.order}: |
@ -196,7 +197,7 @@
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr)
-
I verify that a picking related to purchase order has been generated.
I verify that a picking related to purchase order has been generated.
-
!python {model: sale.order}: |
modules = self.pool.get('ir.module.module')
@ -208,11 +209,11 @@
pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)])
po = pur_obj.browse(cr, uid, pur_id)[0]
assert(po.picking_ids),"Picking for purchase order has not been generated"
-
-
Then I click on the "Products Received" button of Incoming Shipments
-
!record {model: stock.partial.picking, id: stock_partial_picking_0}:
date: '2010-07-15 17:52:09'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
-
I click on the "Validate" button
-
@ -276,8 +277,8 @@
'product_id': move.product_id.id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
self.do_partial(cr, uid, [pick.id],partial_datas)
}
self.do_partial(cr, uid, [pick.id],partial_datas)
-
I verify that delivery state is done
-
@ -289,12 +290,12 @@
pick = self.browse(cr,uid,picking_id[0])
assert (pick.state) =='done', "Picking for SO is not in done state."
-
I verify that a "Picked" has been set to true
I verify that a "Picked" has been set to true
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so7"))
assert (so.shipped == True), "Picked has not been set to True"
-
-
I verify that a sale order is in done state
-
!python {model: sale.order}: |

View File

@ -3,7 +3,7 @@
I create a Sale Order for Slider Mobile for qty 500 having Shipping Policy is 'Invoice on order after Delivery'
-
!record {model: sale.order, id: sale_order_so8}:
date_order: '2010-07-15'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO008
order_line:
@ -24,19 +24,19 @@
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
-
I confirm the Sale Order.
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so8}
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so8}
-
I verify that the picking has been generated for the sale order
-
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so8"))
assert so.picking_ids,"Picking has not been generated for sale_order_so8"
-
Then I done the picking
-
-
!python {model: stock.picking }: |
import time
sale_order_obj = self.pool.get('sale.order')
@ -55,7 +55,7 @@
'product_id': move.product_id.id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
}
self.do_partial(cr, uid, [pick.id],partial_datas)
-
I verify that picking order is in done state.
@ -66,7 +66,7 @@
picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')])
if picking_id:
pick = self.browse(cr,uid,picking_id[0])
assert (pick.state == 'done'), "Picking for SO is not in done state."
assert (pick.state == 'done'), "Picking for SO is not in done state."
-
I verify that delivery order has been generated for sale order
-
@ -96,8 +96,8 @@
'product_id': move.product_id.id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
self.do_partial(cr, uid, [pick.id],partial_datas)
}
self.do_partial(cr, uid, [pick.id],partial_datas)
-
I verify that delivery state is done
-
@ -170,7 +170,7 @@
pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)])
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_confirm', cr)
-
-
I click on the "Approved by supplier" button to approve the purchase order
-
!python {model: sale.order}: |
@ -187,7 +187,7 @@
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr)
-
I verify that a picking related to purchase order has been generated.
I verify that a picking related to purchase order has been generated.
-
!python {model: sale.order}: |
modules = self.pool.get('ir.module.module')
@ -199,11 +199,11 @@
pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)])
po = pur_obj.browse(cr, uid, pur_id)[0]
assert(po.picking_ids),"Picking for purchase order has not been generated"
-
-
Then I click on the "Products Received" button of Incoming Shipments
-
!record {model: stock.partial.picking, id: stock_partial_picking_0}:
date: '2010-07-15 17:52:09'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
-
I click on the "Validate" button
-
@ -239,7 +239,7 @@
ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')])
assert ids, _('Picking is not in the done state!')
-
I verify that a "Picked" has been set to true
I verify that a "Picked" has been set to true
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so8"))
@ -250,20 +250,20 @@
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so8"))
assert so.invoice_ids, "Invoice has not been generated"
-
-
I open the Invoice for the SO.
-
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so8"))
import netsvc
wf_service = netsvc.LocalService("workflow")
wf_service = netsvc.LocalService("workflow")
invoice_ids = so.invoice_ids
for invoice in invoice_ids:
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
-
Assign analytic journal into bank journal
-
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
@ -279,7 +279,7 @@
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='test')
-
I verify the invoice are in paid state or not.
I verify the invoice are in paid state or not.
-
!python {model: account.invoice}: |
modules = self.pool.get('ir.module.module')
@ -291,13 +291,13 @@
invoice_ids = so.invoice_ids
for invoice in invoice_ids:
assert (invoice.state) =='paid', "Invoice for SO is not in done state."
-
-
I verify that Paid has been set to true.
-
!python {model: sale.order}: |
sale_id=self.browse(cr, uid, ref("sale_order_so8"))
assert(sale_id.invoiced == True), "Paid has not been set to true"
-
-
I verify that sale order is in done state
-
!python {model: sale.order}: |

View File

@ -1,8 +1,8 @@
-
-
I create a Sale Order for LG Viewty Smart for qty 500 having Shipping Policy is 'Payment Before Delivery'
-
!record {model: sale.order, id: sale_order_so1}:
date_order: '2010-07-20'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO001
order_line:
@ -55,7 +55,7 @@
wf_service.trg_validate(uid, 'account.invoice',invoice.id,'invoice_open', cr)
-
I assign an analytic journal to the Bank journal
-
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
@ -71,7 +71,7 @@
ref('account.period_5'), ref('sale.account_journal_bankjournal0'),
name='test002')
-
I verify the invoice is in done state or not.
I verify the invoice is in done state or not.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
@ -133,7 +133,7 @@
assert proc_ids, _('No Procurements!')
-
Then I click on the "Run Procurement" button
-
-
!python {model: procurement.order}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so1"))
@ -168,7 +168,7 @@
pur_obj=self.pool.get('purchase.order')
pur_id=pur_obj.search(cr, uid, [('origin','=',so.name)])
assert pur_id, _('Purchase order has not been generated')
-
-
I click on the "Confirm" button to confirm the purchase order
-
!python {model: sale.order}: |
@ -184,7 +184,7 @@
pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)])
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_confirm', cr)
-
-
I click on the "Approved by supplier" button to approve the purchase order
-
!python {model: sale.order}: |
@ -199,9 +199,9 @@
wf_service = netsvc.LocalService("workflow")
pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)])
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr)
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr)
-
I verify that a picking related to purchase order has been generated.
I verify that a picking related to purchase order has been generated.
-
!python {model: sale.order}: |
modules = self.pool.get('ir.module.module')
@ -217,7 +217,7 @@
Then I click on the "Products Received" button of Incoming Shipments
-
!record {model: stock.partial.picking, id: stock_partial_picking_0}:
date: '2010-07-20 17:52:09'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
-
I click on the "Validate" button
-
@ -253,7 +253,7 @@
ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')])
assert ids, _('Picking is not in the done state!')
-
I verify that a "Picked" has been set to true
I verify that a "Picked" has been set to true
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so1"))

View File

@ -25,7 +25,7 @@
uom_po_id: product.product_uom_kgm
-
I define Minimum stock rule for my stockable product Wood (qty between 10 and 15)
-
-
!record {model: stock.warehouse.orderpoint, id: stock_warehouse_orderpoint_op0}:
company_id: base.main_company
location_id: stock.stock_location_stock
@ -38,11 +38,11 @@
warehouse_id: stock.warehouse0
-
Now I make a sale order for table.
-
-
!record {model: sale.order, id: sale_order_so3}:
amount_total: 5.0
amount_untaxed: 5.0
date_order: '2010-04-30'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
order_line:
- company_id: base.main_company
@ -65,7 +65,7 @@
shop_id: sale.shop
-
I confirm the order.
-
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so3}
-
I check that procurement is generated.
@ -76,7 +76,7 @@
so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
proc_ids = self.search(cr, uid, [('origin','=',so.name)])
assert proc_ids, _('No Procurements!')
-
-
I run the scheduler.
-
!function {model: procurement.order, name: run_scheduler}:

View File

@ -5,7 +5,7 @@
I create a Sale Order for Slider Mobile for qty 100 having order_policy manual.
-
!record {model: sale.order, id: sale_order_so3}:
date_order: '2010-08-02'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO003
order_line:
@ -34,7 +34,7 @@
I create a Sale Order for products Slider Mobile and LG Viewty Smart for qty 100 having order_policy manual.
-
!record {model: sale.order, id: sale_order_so4}:
date_order: '2010-08-02'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO004
order_line:
@ -74,7 +74,7 @@
-
!record {model: sale.make.invoice, id: sale_make_invoice_1}:
grouped: 1
invoice_date: '2010-08-02'
invoice_date: !eval time.strftime('%Y-%m-%d')
-
Then I click on the "Create Invoices" button of wizard
-

View File

@ -3,7 +3,7 @@
I create a Sale Order for two products LG Viewty Smart and Slider mobile for qty 100 having order_policy manual.
-
!record {model: sale.order, id: sale_order_so3}:
date_order: '2010-07-12'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO003
order_line:
@ -27,7 +27,7 @@
product_id: sale.product_product_lgviewtysmart0
product_uos_qty: 100.0
th_weight: 0.0
type: make_to_order
type: make_to_order
order_policy: manual
partner_id: sale.res_partner_cleartrail0
partner_invoice_id: sale.res_partner_address_2
@ -36,9 +36,9 @@
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
-
-
I confirm the Sale Order.
-
-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so3}
-
I click on the "Make Invoice" button of sale order line
@ -47,11 +47,11 @@
{}
-
I click on the "Create Invoice" button of wizard
-
-
!python {model: sale.order.line.make.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
sol = so.order_line[0]
sol = so.order_line[0]
self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_0")], {"lang": "en_US",
"tz": False, "active_model": "sale.order.line", "active_ids": [sol.id],
"search_default_uninvoiced": 1, "active_id": sol.id,
@ -61,7 +61,7 @@
-
!python {model: sale.order}: |
sale_id=self.browse(cr, uid, ref("sale_order_so3"))
sol = sale_id.order_line[0]
sol = sale_id.order_line[0]
assert(sol.invoiced == True), "Invoiced has not been set to true"
-
I verify that an invoice for sale order line has been created.
@ -90,7 +90,7 @@
assert invoice_id, "Invoice is not in the open state"
-
I assign an analytic journal to the bank journal
-
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
@ -106,7 +106,7 @@
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='test')
-
I verify that an invoice is in done state.
I verify that an invoice is in done state.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
@ -123,14 +123,14 @@
I create an invoice for another sale order line. I click on the "Make Invoice" button of sale order line
-
!record {model: sale.order.line.make.invoice, id: sale_order_line_make_invoice_1}:
{}
{}
-
I click on the "Create Invoice" button of wizard
-
!python {model: sale.order.line.make.invoice}: |
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
sol = so.order_line[1]
sol = so.order_line[1]
self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_1")], {"lang": "en_US",
"tz": False, "active_model": "sale.order.line", "active_ids": [sol.id],
"search_default_uninvoiced": 1, "active_id": sol.id,
@ -146,7 +146,7 @@
-
!python {model: sale.order}: |
sale_id=self.browse(cr, uid, ref("sale_order_so3"))
sol = sale_id.order_line[1]
sol = sale_id.order_line[1]
assert(sol.invoiced == True), "Invoiced has not been set to true"
-
I verify that "Paid" has been set to False.
@ -175,7 +175,7 @@
assert invoice_id, "Invoice is not in the open state"
-
Assign analytic journal into bank journal
-
-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
@ -191,7 +191,7 @@
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='test')
-
I verify the invoice is in done state.
I verify the invoice is in done state.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')

View File

@ -5,7 +5,7 @@
I place a sale order for product keyboard, quantity 50
-
!record {model: sale.order, id: sale_order_so11}:
date_order: '2010-08-04'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO011
order_line:
@ -36,4 +36,4 @@
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so11"))
assert so.margin, "No margin !"
assert so.margin, "No margin !"

View File

@ -5,9 +5,9 @@
-
!record {model: product.category, id: product_category_allproductssellable0}:
name: Mobile Products Sellable
-
I define product category Mobile Services.
-
-
I define product category Mobile Services.
-
!record {model: product.category, id: product_category_services0}:
name: Mobile Services
-
@ -64,7 +64,7 @@
-
!record {model: sale.order, id: sale_order_so0}:
client_order_ref: ref1
date_order: '2010-08-4'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: Test_SO001
order_line:

View File

@ -2,56 +2,56 @@
-
In order to test the stock module, I will create product,
create physical inventory ,fill inventory lines from location,split inventory line into production lot
-
-
I create Asset Account Type.
-
-
!record {model: account.account.type, id: account_account_type_asset0}:
close_method: balance
code: asset
name: Asset
sign: 1
-
-
I create Income Account Type.
-
-
!record {model: account.account.type, id: account_account_type_income0}:
close_method: unreconciled
code: income
name: Income
sign: 1
-
-
I create Expense Account Type.
-
-
!record {model: account.account.type, id: account_account_type_expense0}:
close_method: unreconciled
code: expense
name: Expense
sign: 1
-
sign: 1
-
I create Cash Account Type.
-
-
!record {model: account.account.type, id: account_account_type_cash0}:
close_method: balance
code: cash
name: Cash
sign: 1
-
-
I create Receivable Account Type.
-
-
!record {model: account.account.type, id: account_account_type_receivable0}:
close_method: balance
code: receivable
name: Receivable
sign: 1
-
I create Receivable Account .
-
-
!record {model: account.account, id: account_account_receivable0}:
code: '40000-stock-test'
company_id: base.main_company
@ -61,9 +61,9 @@
parent_right: 2
type: receivable
user_type: account_account_type_receivable0
-
-
I create Payable Account.
-
-
!record {model: account.account, id: account_account_payable0}:
code: '440000-stock-test'
company_id: base.main_company
@ -72,10 +72,10 @@
parent_left: 3
parent_right: 4
type: payable
user_type: account_account_type_expense0
-
user_type: account_account_type_expense0
-
I create Purchase Journal.
-
-
!record {model: account.journal, id: account_journal_purchasejournal0}:
code: pur
company_id: base.main_company
@ -83,10 +83,10 @@
sequence_id: account.sequence_purchase_journal
type: purchase
view_id: account.account_journal_bank_view
-
-
I create Sale Journal.
-
-
!record {model: account.journal, id: account_journal_salejouran0}:
code: sal
company_id: base.main_company
@ -94,10 +94,10 @@
sequence_id: account.sequence_sale_journal
type: sale
view_id: account.account_journal_view
-
-
I create Expense Account.
-
-
!record {model: account.account, id: account_account_expenseaccount0}:
code: Expe
company_id: base.main_company
@ -107,9 +107,9 @@
parent_right: 6
type: consolidation
user_type: account_account_type_asset0
-
-
I create Product Sale Account.
-
-
!record {model: account.account, id: account_account_productsale0}:
code: '001-stock-test'
company_id: base.main_company
@ -117,11 +117,11 @@
name: Product Sale
type: other
user_type: stock.account_account_type_income0
-
-
I create Product Purchase Account.
-
-
!record {model: account.account, id: account_account_productpurchase0}:
code: '0002-stock-test'
company_id: base.main_company
@ -129,64 +129,64 @@
name: Product Purchase
type: other
user_type: account_account_type_expense0
-
-
I create partner.
-
-
!record {model: res.partner, id: res_partner_shawtrust0}:
address:
- country_id: base.in
- country_id: base.in
- street: St James House, Vicar Lane, Sheffield
lang: en_US
name: 'Shaw Trust '
property_account_payable: account_account_payable0
property_account_receivable: account_account_receivable0
-
-
I create partner.
-
-
!record {model: res.partner, id: res_partner_diasorinltd0}:
address:
- country_id: base.in
street: Ash House, Ash Road
name: DiaSorin Ltd
supplier: true
-
I create partner.
-
-
!record {model: res.partner, id: res_partner_microlinktechnologies0}:
address:
- street: Kailash Vaibhav, Parksite
name: Micro Link Technologies
property_account_payable: account_account_payable0
property_account_receivable: account_account_receivable0
supplier: true
property_account_receivable: account_account_receivable0
supplier: true
-
I create partner address.
-
-
!record {model: res.partner.address, id: res_partner_address_0}:
country_id: base.in
partner_id: stock.res_partner_diasorinltd0
street: Ash House, Ash Road
title: base.res_partner_title_miss
-
-
I create product.category .
-
-
!record {model: product.category, id: product_category_computer0}:
name: Computer
-
-
I create product HP Pavilion Desktop PCs .
-
-
!record {model: product.product, id: product_product_hppaviliondesktoppcs0}:
categ_id: stock.product_category_computer0
cost_method: standard
mes_type: fixed
list_price: 1000.0
list_price: 1000.0
name: HP Pavilion Desktop PCs
procure_method: make_to_stock
seller_ids:
@ -198,11 +198,11 @@
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
property_account_expense: account_account_productsale0
property_account_income: account_account_productsale0
-
property_account_income: account_account_productsale0
-
I create product HP CD writers.
-
-
!record {model: product.product, id: product_product_hpcdwriters0}:
categ_id: stock.product_category_computer0
cost_method: standard
@ -220,14 +220,14 @@
uom_po_id: product.product_uom_unit
property_account_expense: account_account_productpurchase0
property_account_income: account_account_productsale0
-
-
I create Physical Inventory for the products.
-
!record {model: stock.inventory, id: stock_inventory_physicalinventoy0}:
-
!record {model: stock.inventory, id: stock_inventory_physicalinventoy0}:
company_id: base.main_company
date: '2010-05-10 18:19:13'
date_done: '2010-05-10 18:19:59'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
date_done: !eval time.strftime('%Y-%m-%d %H:%M:%S')
inventory_line_id:
- company_id: base.main_company
location_id: stock.stock_location_stock
@ -241,40 +241,40 @@
product_uom: product.product_uom_unit
name: Physical inventory
state: draft
-
-
I confirm the Inventory for HP CD writers.
-
-
!python {model: stock.inventory}: |
self.action_confirm(cr,uid,[ref('stock_inventory_physicalinventoy0')])
self.action_done(cr,uid,[ref('stock_inventory_physicalinventoy0')])
-
-
I create stock.fill.inventory .
-
-
!record {model: stock.fill.inventory, id: stock_fill_inventory_0}:
location_id: stock.stock_location_stock
-
-
I fill inventory for HP CD writers.
-
-
!python {model: stock.fill.inventory}: |
self.fill_inventory(cr, uid, [ref("stock_fill_inventory_0")], {"lang": 'en_US',
"full": "1", "tz": False, "active_model": "stock.inventory", "active_ids":
[ref("stock_inventory_physicalinventoy0")], "active_id": ref("stock_inventory_physicalinventoy0"), })
-
-
I create stock.move.split record.
-
-
!record {model: stock.move.split, id: stock_move_split_0}:
line_ids:
- name: '00001-stock-test'
quantity: 5
quantity: 5
product_id: stock.product_product_hpcdwriters0
-
-
I Split into production line.
-
-
!python {model: stock.move.split}: |
move_obj=self.pool.get('stock.move')
product_obj=self.pool.get('product.product')
@ -284,52 +284,52 @@
"stock.move", "active_ids": move_ids, "tz": False, "active_id":move_ids[0]
})
-
In Order to test the picking I create picking with move lines.
-
-
!record {model: stock.picking, id: stock_picking_0}:
name: test_picking
address_id: base.res_partner_address_4
company_id: base.main_company
date: '2010-05-11 15:18:52'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
invoice_state: none
move_lines:
- company_id: base.main_company
date: '2010-05-11 15:18:57'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
location_dest_id: stock.stock_location_customers
location_id: stock.stock_location_stock
name: HP CD writers
product_id: product.product_product_pc1
product_qty: 3.0
product_uom: product.product_uom_unit
date: '2010-05-11 15:18:57'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
product_uos_qty: 3.0
move_type: direct
type: internal
-
-
I click on draft_force_assign on picking.
-
-
!python {model: stock.picking}: |
self.draft_force_assign(cr, uid, [ref("stock_picking_0")], {"lang": "en_US", "active_model":
"ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display":
"partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id":
ref("stock.menu_action_picking_tree6"), })
-
-
I click on force_assign on picking.
-
-
!python {model: stock.picking}: |
self.force_assign(cr, uid, [ref("stock_picking_0")], {"lang": "en_US", "active_model":
"ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display":
"partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id":
ref("stock.menu_action_picking_tree6"), })
-
I confirm the picking.
-
-
!python {model: stock.picking }: |
import time
pick=self.browse(cr,uid,ref('stock_picking_0'))
@ -343,5 +343,5 @@
'product_id': move.product_id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
}
self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas)

View File

@ -10,8 +10,8 @@
invoice_state: 2binvoiced
move_lines:
- company_id: base.main_company
date_expected: '2010-08-03 11:05:47'
date: '2010-08-03 11:05:47'
date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
location_id: stock.stock_location_stock
product_id: product.product_product_pc1
product_qty: 3.0
@ -37,19 +37,19 @@
1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner",
"active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"),
})
-
-
I create a record for partial picking.
-
-
!record {model: stock.partial.picking, id: stock_partial_picking_0}:
date: '2010-08-03 11:25:58'
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
-
I make picking order Done.
-
-
!python {model: stock.partial.picking}: |
pick_obj = self.pool.get('stock.picking')
partial = self.browse(cr, uid, ref('stock_partial_picking_0'), context)
partial_datas = {
'delivery_date' : partial.date
'delivery_date' : partial.date
}
for pick in pick_obj.browse(cr, uid, [ref('stock_picking_out0')]):
for m in pick.move_lines:
@ -59,13 +59,13 @@
'product_uom' : m.product_uom.id
}
pick_obj.do_partial(cr, uid, [ref('stock_picking_out0')], partial_datas, context=context)
-
-
As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order.
-
-
!python {model: stock.invoice.onshipping}: |
wiz_id = self.create(cr, uid, {'invoice_date': '2010-08-04', 'journal_id': ref('account.bank_journal')},
{'active_ids': [ref("stock_picking_out0")]})
self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US",
self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US",
"search_default_available": 1, "tz": False, "active_model": "stock.picking",
"contact_display": "partner", "active_ids": [ref("stock_picking_out0")], "active_id": ref("stock_picking_out0")})
-
@ -77,4 +77,4 @@
partner = picking[0].address_id.partner_id.id
inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner)])
assert inv_ids, 'No Invoice is generated!'

View File

@ -1,41 +1,41 @@
-
In order to test the product pulled flow , I create ,partner,product,procurement
-
In order to test the product pulled flow , I create ,partner,product,procurement
-
I create a account type Asset.
-
-
!record {model: account.account.type, id: account_account_type_asset0}:
close_method: balance
code: asset_test
name: Asset For Tests
sign: 1
-
-
I create a account type income.
-
-
!record {model: account.account.type, id: account_account_type_income0}:
close_method: unreconciled
code: income_test
name: Income For Tests
sign: 1
-
-
I create a account type Expense.
-
-
!record {model: account.account.type, id: account_account_type_expense0}:
close_method: unreconciled
code: expense_test
name: Expense For Tests
sign: 1
-
sign: 1
-
I create a account type Receivable.
-
-
!record {model: account.account.type, id: account_account_type_receivable0}:
close_method: balance
code: receivable_test
name: Receivable For Tests
sign: 1
-
I create a account Receivable.
-
-
!record {model: account.account, id: account_account_receivable0}:
code: 40000_test
company_id: base.main_company
@ -43,19 +43,19 @@
name: Receivable For Tests
type: receivable
user_type: account_account_type_receivable0
-
-
I create a account Payable.
-
-
!record {model: account.account, id: account_account_payable0}:
code: 440000_test
company_id: base.main_company
currency_mode: current
name: Payable For Tests
type: payable
user_type: account_account_type_expense0
-
user_type: account_account_type_expense0
-
I create a Purchase Journal.
-
-
!record {model: account.journal, id: account_journal_purchasejournal0}:
code: pur_test
company_id: base.main_company
@ -63,10 +63,10 @@
sequence_id: account.sequence_purchase_journal
type: purchase
view_id: account.account_journal_bank_view
-
-
I create a Sale Journal.
-
-
!record {model: account.journal, id: account_journal_salejouran0}:
code: sal_test
company_id: base.main_company
@ -74,10 +74,10 @@
sequence_id: account.sequence_sale_journal
type: sale
view_id: account.account_journal_view
-
-
I create an Expense Account
-
-
!record {model: account.account, id: account_account_expenseaccount0}:
code: Expe_test
company_id: base.main_company
@ -85,9 +85,9 @@
name: Expense Account For Tests
type: consolidation
user_type: account_account_type_asset0
-
-
I create Product Sale account.
-
-
!record {model: account.account, id: account_account_productsale0}:
code: 001_test
company_id: base.main_company
@ -96,9 +96,9 @@
type: other
user_type: account_account_type_income0
-
-
I create Product Product Purchase.
-
-
!record {model: account.account, id: account_account_productpurchase0}:
code: 0002_test
company_id: base.main_company
@ -106,9 +106,9 @@
name: Product Purchase For Tests
type: other
user_type: account_account_type_expense0
-
-
I create a Supplier.
-
-
!record {model: res.partner, id: res_partner_shawtrust0}:
address:
- country_id: base.in
@ -116,16 +116,16 @@
lang: en_US
name: 'Shaw Trust '
property_account_payable: account_account_payable0
property_account_receivable: account_account_receivable0
-
property_account_receivable: account_account_receivable0
-
I create a product category.
-
-
!record {model: product.category, id: product_category_computer0}:
name: Computer
-
I create a product and define the pulled flow condition for stock move.
I set shipping type Sending Goods. and set Procurement type to move.
-
-
!record {model: product.product, id: product_product_hpcdwriters0}:
categ_id: product_category_computer0
cost_method: standard
@ -169,12 +169,12 @@
property_stock_procurement: stock.location_procurement
property_stock_production: stock.location_production
qty_available: 15
-
-
I create a procurement order.
-
-
!record {model: procurement.order, id: procurement_order_test0}:
company_id: base.main_company
date_planned: '2010-10-07 18:24:24'
date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
location_id: stock.stock_location_shop0
name: Testing pulled flow
priority: '1'
@ -184,21 +184,21 @@
product_uom: product.product_uom_unit
product_uos: product.product_uom_unit
product_uos_qty: 0.0
-
-
I confirm the procurement order.
-
-
!workflow {model: procurement.order, action: button_confirm, ref: procurement_order_test0}
-
-
I launch the scheduler to compute procurement.
-
-
!python {model: procurement.order.compute.all}: |
proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr,uid)
-
I check the state of procurement order is cancel and stock move is cancel.
-
!python {model: procurement.order }: |
from tools.translate import _
I check the state of procurement order is cancel and stock move is cancel.
-
!python {model: procurement.order }: |
from tools.translate import _
procurement_ids=self.search(cr, uid, [('id', '=', ref('procurement_order_test0'))])
if procurement_ids:
order=self.browse(cr,uid,procurement_ids)[0]
@ -206,14 +206,14 @@
-
I check the new procurement order has been created .
-
!python {model: procurement.order }: |
from tools.translate import _
!python {model: procurement.order }: |
from tools.translate import _
procurement_ids=self.search(cr, uid, [('name','=','E001')])
assert len(procurement_ids), "Procurement order hasn't Created."
-
I check the Outgoing Picking is created for source location Shop 2 and destination shop1.
-
!python {model: stock.picking }: |
from tools.translate import _
from tools.translate import _
picking_id = self.search(cr, uid, [('origin','=','Testing pulled flow:E001'),('type','=','out')])
assert len(picking_id), "Picking hasn't Created."

View File

@ -3,36 +3,36 @@
Push flow specification indicates which location is chained with which location.
-
I create product category.
-
-
!record {model: product.category, id: product_category_computer0}:
name: Computer
-
I create Supplier.
-
-
!record {model: res.partner, id: res_partner_microlinktechnologies0}:
address:
- street: Kailash Vaibhav, Parksite
name: Micro Link Technologies
property_account_payable: account_account_payable0
property_account_receivable: account_account_receivable0
supplier: true
property_account_receivable: account_account_receivable0
supplier: true
-
I create Supplier address.
-
-
!record {model: res.partner.address, id: res_partner_address_0}:
country_id: base.in
partner_id: res_partner_microlinktechnologies0
street: Ash House, Ash Road
title: base.res_partner_title_miss
-
I create product and define the pushed flow .
-
I set the chain location Supplier to stock Input
Stock Input to Quality test and Quality test -Stock .
-
Stock Input to Quality test and Quality test -Stock .
-
!record {model: product.product, id: product_product_hpcdwriters0}:
categ_id: product_category_computer0
cost_method: standard
@ -62,13 +62,13 @@
property_stock_production: stock.location_production
-
In order to test pushed flow .I buy the product from Micro Link Technologies supplier. I create a Picking.
-
-
!record {model: stock.picking , id: stock_picking_in0}:
address_id: res_partner_address_0
company_id: base.main_company
invoice_state: none
move_lines:
- date_expected: '2010-10-08 15:36:53'
- date_expected: !eval time.strftime('%Y-%m-%d %H:%M:%S')
location_dest_id: stock.stock_location_stock
location_id: stock.stock_location_suppliers
name: 'HP CD writers'
@ -79,7 +79,7 @@
name: Pushed Flow Test
type: in
-
I confirm picking.
I confirm picking.
-
!python {model: stock.picking }: |
self.draft_force_assign(cr, uid, [ref("stock_picking_in0")], {"lang": "en_US",
@ -91,7 +91,7 @@
Stock/Input To Quality test and Quality test To Stock.
-
I check the move is in waiting state.
-
-
!python {model: stock.picking }: |
from tools.translate import _
picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
@ -117,11 +117,11 @@
'product_id': move.product_id.id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
self.do_partial(cr, uid, picking_id,partial_datas)
}
self.do_partial(cr, uid, picking_id,partial_datas)
-
I check the Outgoing Orders is automatically done.
-
-
!python {model: stock.picking }: |
from tools.translate import _
picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])

View File

@ -1,5 +1,5 @@
-
In order to test the module with OpenERP, I will make products with No auto-picking
In order to test the module with OpenERP, I will make products with No auto-picking
to allow an intermediate picking process to provide raw materials to production orders.
-
I create product category for measuring the liquid products. Say Litre.
@ -138,7 +138,7 @@
bom_id: mrp_bom_cupoftea0
routing_id: mrp_routing_productionrouting0
company_id: base.main_company
date_planned: '2010-08-03 15:12:32'
date_planned: !eval time.strftime('%Y-%m-%d %H:%M:%S')
location_dest_id: stock.stock_location_stock
location_src_id: stock.stock_location_stock
name: MO/00002

View File

@ -5,39 +5,39 @@
I create weekly stock periods for the month of July.
-
I create stock period for the first week of July.
-
-
!record {model: stock.period, id: stock_period_01}:
date_start: '2010-07-01 00:00:00'
date_stop: '2010-07-06 23:59:00'
name: 2010, week 27
date_start: !eval "'%s-07-01 00:00:00' %(datetime.now().year)"
date_stop: !eval "'%s-07-06 23:59:00' %(datetime.now().year)"
name: !eval "'%s, week 27' %(datetime.now().year)"
-
I create stock period for the second week of July.
-
-
!record {model: stock.period, id: stock_period_02}:
date_start: '2010-07-07 00:00:00'
date_stop: '2010-07-12 23:59:00'
name: 2010, week 28
date_start: !eval "'%s-07-07 00:00:00' %(datetime.now().year)"
date_stop: !eval "'%s-07-12 23:59:00' %(datetime.now().year)"
name: !eval "'%s, week 28' %(datetime.now().year)"
-
I create stock period for the third week of July.
-
-
!record {model: stock.period, id: stock_period_03}:
date_start: '2010-07-15 00:00:00'
date_stop: '2010-07-20 23:59:00'
name: 2010, week 29
date_start: !eval "'%s-07-15 00:00:00' %(datetime.now().year)"
date_stop: !eval "'%s-07-20 23:59:00' %(datetime.now().year)"
name: !eval "'%s, week 29' %(datetime.now().year)"
-
I create stock period for the fourth week of July.
-
-
!record {model: stock.period, id: stock_period_04}:
date_start: '2010-07-22 00:00:00'
date_stop: '2010-07-27 23:59:00'
name: 2010, week 30
date_start: !eval "'%s-07-22 00:00:00' %(datetime.now().year)"
date_stop: !eval "'%s-07-27 23:59:00' %(datetime.now().year)"
name: !eval "'%s, week 30' %(datetime.now().year)"
-
I create stock period for the fifth week of July.
-
-
!record {model: stock.period, id: stock_period_05}:
date_start: '2010-07-29 00:00:00'
date_stop: '2010-07-31 23:59:00'
name: 2010, week 31
date_start: !eval "'%s-07-29 00:00:00' %(datetime.now().year)"
date_stop: !eval "'%s-07-31 23:59:00' %(datetime.now().year)"
name: !eval "'%s, week 31' %(datetime.now().year)"
-
Now I create the forecast for this period for all PCs.
-
@ -46,7 +46,7 @@
period_id: stock_period_03
product_categ_id: product.product_category_pc
warehouse_id: stock.warehouse0
-
-
Performing an osv_memory action create_forecast on module stock.sale.forecast.createlines
-
!python {model: stock.sale.forecast.createlines}: |
@ -56,9 +56,9 @@
})
-
I create a sale order for PC1-Basic PC and PC3-Medium PC.
-
-
!record {model: sale.order, id: sale_order_so0}:
date_order: '2010-07-20'
date_order: !eval time.strftime('%Y-%m-%d')
invoice_quantity: order
name: SO006
order_line:
@ -105,17 +105,17 @@
False, "search_default_create_uid": 1, "active_model": "ir.ui.menu", "department_id":
False, "active_ids": [ref("stock_planning.menu_stock_sale_forecast_all")], "active_id":
ref("stock_planning.menu_stock_sale_forecast_all"), })
-
-
I create Master procurement schedule for the third week of July.
-
-
!record {model: stock.planning.createlines, id: stock_planning_createlines_0}:
company_id: base.main_company
period_id: stock_period_03
product_categ_id: product.product_category_pc
warehouse_id: stock.warehouse0
-
-
Performing an osv_memory action create_planning on module stock.planning.createlines
-
-
!python {model: stock.planning.createlines}: |
self.create_planning(cr, uid, [ref("stock_planning_createlines_0")], {"lang":
"en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_planning_createlines")],
@ -146,5 +146,5 @@
I check whether the procurement orders are created or not.
-
!python {model: procurement.order}: |
proc_ids = self.search(cr, uid, [('origin','=','MPS(admin) 2010, week 29'),('product_id','=',ref("product.product_product_pc1"))])
proc_ids = self.search(cr, uid, [('origin','=','MPS(admin) 2011, week 29'),('product_id','=',ref("product.product_product_pc1"))])
assert proc_ids,'No Procurements!'