-
- [[ repeatIn(objects,'o') ]][[ setLang(o.partner_id.lang) ]]
@@ -523,6 +501,5 @@
-
diff --git a/addons/account_invoice_layout/test/account_invoice_layout_report.yml b/addons/account_invoice_layout/test/account_invoice_layout_report.yml
index 91967358a3d..61ca39c654b 100644
--- a/addons/account_invoice_layout/test/account_invoice_layout_report.yml
+++ b/addons/account_invoice_layout/test/account_invoice_layout_report.yml
@@ -1,22 +1,9 @@
--
- In order to Print the Invoice layout report in Normal Mode, we will create a invoice record
--
- !record {model: account.invoice, id: test_invoice_1}:
- currency_id: base.EUR
- company_id: base.main_company
- address_invoice_id: base.res_partner_address_tang
- partner_id: base.res_partner_asus
- state: draft
- type: out_invoice
- account_id: account.a_recv
- name: Test invoice 1
- address_contact_id: base.res_partner_address_tang
-
Print the Invoice layout report in Normal Mode
-
!python {model: account.invoice}: |
import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.account.invoice.layout').create(cr, uid, [ref('test_invoice_1')], {}, {})
+ (data, format) = netsvc.LocalService('report.account.invoice.layout').create(cr, uid, [ref('account.demo_invoice_0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout.'+format), 'wb+').write(data)
@@ -25,7 +12,7 @@
-
!python {model: account.invoice}: |
ctx={}
- ctx.update({'model': 'account.invoice','active_ids': [ref('test_invoice_1')]})
+ ctx.update({'model': 'account.invoice','active_ids': [ref('account.demo_invoice_0')]})
data_dict = {'message':ref('account_invoice_layout.demo_message1')}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_invoice_special_msg',wiz_data=data_dict, context=ctx, our_module='account_invoice_layout')
diff --git a/addons/account_invoice_layout/wizard/account_invoice_special_message.xml b/addons/account_invoice_layout/wizard/account_invoice_special_message.xml
index b1cf7357241..d849595bfca 100644
--- a/addons/account_invoice_layout/wizard/account_invoice_special_message.xml
+++ b/addons/account_invoice_layout/wizard/account_invoice_special_message.xml
@@ -2,43 +2,43 @@
-
- Account Invioce Special Message
- account.invoice.special.msg
- form
-
-
-
-
+
+ Account Invioce Special Message
+ account.invoice.special.msg
+ form
+
+
+
+
-
- Invoices with Layout and Message
- ir.actions.act_window
- account.invoice.special.msg
- form
- form
-
- new
-
+
+ Invoices and Message
+ ir.actions.act_window
+ account.invoice.special.msg
+ form
+ form
+
+ new
+
-
-
-
- Account Invioce Special Message
- client_print_multi
-
- action
- account.invoice
-
+
+
+
+ Account Invioce Special Message
+ client_print_multi
+
+ action
+ account.invoice
+
-
\ No newline at end of file
+
diff --git a/addons/account_sequence/account_sequence.xml b/addons/account_sequence/account_sequence.xml
index 6b9e2c94402..ba97025bae7 100644
--- a/addons/account_sequence/account_sequence.xml
+++ b/addons/account_sequence/account_sequence.xml
@@ -70,7 +70,7 @@
-
+
diff --git a/addons/account_voucher/__init__.py b/addons/account_voucher/__init__.py
index 098d82ea361..9796f81d5e5 100644
--- a/addons/account_voucher/__init__.py
+++ b/addons/account_voucher/__init__.py
@@ -20,9 +20,8 @@
##############################################################################
import account_voucher
-import company
import invoice
import report
import wizard
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py
index 7b2a293c508..7da2b2da99c 100644
--- a/addons/account_voucher/__openerp__.py
+++ b/addons/account_voucher/__openerp__.py
@@ -25,22 +25,15 @@
"author" : 'OpenERP SA',
'complexity': "normal",
"description": """
-Account Voucher module offers an easy way to deal with all the basic requirements of Voucher Entries
-====================================================================================================
+Account Voucher module includes all the basic requirements of Voucher Entries for Bank, Cash, Sales, Purchase, Expanse, Contra, etc.
+====================================================================================================================================
-Its increased usabililty allows you to create easily sales/purchases documents but also to encode payments.
-Doing so, you'll be able to see all the open transactions for the selected partner and that will help you
-to reconcile your entry with its invoice.
-
-Account Voucher module multi-currency support
-=============================================
-
-Thanks to the contribution of Camptocamp, the vouchers fully support the multi currency and compute the
-currency rate difference besides the write off amount. Of course, the accounting entries are also created
-accordingly.
+ * Voucher Entry
+ * Voucher Receipt
+ * Cheque Register
""",
"category" : "Finance",
- "website" : "http://www.openerp.com",
+ "website" : "http://tinyerp.com",
"images" : ["images/customer_payment.jpeg","images/journal_voucher.jpeg","images/sales_receipt.jpeg","images/supplier_voucher.jpeg"],
"depends" : ["account"],
"init_xml" : [],
@@ -55,7 +48,6 @@ accordingly.
"wizard/account_voucher_unreconcile_view.xml",
"wizard/account_statement_from_invoice_view.xml",
"account_voucher_view.xml",
- "company_view.xml",
"voucher_payment_receipt_view.xml",
"voucher_sales_purchase_view.xml",
"account_voucher_wizard.xml",
@@ -67,12 +59,7 @@ accordingly.
"test/account_voucher.yml",
"test/sales_receipt.yml",
"test/sales_payment.yml",
- "test/account_voucher_report.yml",
- "test/case1_usd_usd.yml",
- "test/case2_usd_eur.yml",
- "test/case2_suppl_usd_eur.yml",
- "test/case3_eur_eur.yml",
- "test/case4_cad_chf.yml",
+ "test/account_voucher_report.yml"
],
'certificate': '0037580727101',
"active": False,
diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py
index bdb498c8554..da9dbe87893 100644
--- a/addons/account_voucher/account_voucher.py
+++ b/addons/account_voucher/account_voucher.py
@@ -29,6 +29,17 @@ from tools.translate import _
class account_voucher(osv.osv):
+ def _check_paid(self, cr, uid, ids, name, args, context=None):
+ res = {}
+ for voucher in self.browse(cr, uid, ids, context=context):
+ ok = True
+ for line in voucher.move_ids:
+ if (line.account_id.type, 'in', ('receivable', 'payable')) and not line.reconcile_id:
+ ok = False
+ res[voucher.id] = ok
+ return res
+
+
def _get_type(self, cr, uid, context=None):
if context is None:
@@ -39,10 +50,7 @@ class account_voucher(osv.osv):
if context is None: context = {}
if context.get('period_id', False):
return context.get('period_id')
- if context.get('invoice_id', False):
- company_id = self.pool.get('account.invoice').browse(cr, uid, context['invoice_id'], context=context).company_id.id
- context.update({'company_id': company_id})
- periods = self.pool.get('account.period').find(cr, uid, context=context)
+ periods = self.pool.get('account.period').find(cr, uid)
return periods and periods[0] or False
def _get_journal(self, cr, uid, context=None):
@@ -145,102 +153,39 @@ class account_voucher(osv.osv):
res['arch'] = etree.tostring(doc)
return res
- def _check_paid(self, cr, uid, ids, name, args, context=None):
- res = {}
- for voucher in self.browse(cr, uid, ids, context=context):
- ok = True
- for line in voucher.move_ids:
- if (line.account_id.type, 'in', ('receivable', 'payable')) and not line.reconcile_id:
- ok = False
- res[voucher.id] = ok
- return res
-
- def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=None):
- if context is None:
- context = {}
- currency_pool = self.pool.get('res.currency')
- ctx = context.copy()
- voucher_type = context.get('type', False)
- counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0
- ctx.update({'date': voucher_date})
+ def _compute_writeoff_amount(self, cr, uid, line_dr_ids, line_cr_ids, amount):
+ debit = credit = 0.0
for l in line_dr_ids:
- #compute the amount in voucher currency and in company currency if there aren't set yet
- if not l.get('amount_in_company_currency', False):
- ctx.update({'date': l['date_original']})
- amount_in_company_currency = currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx)
- ctx.update({'date': voucher_date})
- else:
- amount_in_company_currency = l.get('amount_in_company_currency', 0.0)
- if not l.get('amount_in_voucher_currency'):
- amount_in_voucher_currency = currency_pool.compute(cr, uid, l['currency_id'], l['voucher_currency_id'], l['amount'], context=ctx)
- else:
- amount_in_voucher_currency = l.get('amount_in_voucher_currency', 0.0)
- real_amount -= amount_in_company_currency
- counter_for_writeoff -= l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or amount_in_voucher_currency
- counter_for_currency_diff -= currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx)
+ debit += l['amount']
for l in line_cr_ids:
- #compute the amount in voucher currency and in company currency if there aren't set yet
- if not l.get('amount_in_company_currency', False):
- ctx.update({'date': l['date_original']})
- amount_in_company_currency = currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx)
- ctx.update({'date': voucher_date})
- else:
- amount_in_company_currency = l.get('amount_in_company_currency', 0.0)
- if not l.get('amount_in_voucher_currency'):
- amount_in_voucher_currency = currency_pool.compute(cr, uid, l['currency_id'], l['voucher_currency_id'], l['amount'], context=ctx)
- else:
- amount_in_voucher_currency = l.get('amount_in_voucher_currency', 0.0)
- real_amount += amount_in_company_currency
- counter_for_writeoff += l.get('voucher_currency_id') == l.get('currency_id') and l['amount'] or amount_in_voucher_currency
- counter_for_currency_diff += currency_pool.compute(cr, uid, l['currency_id'], l['company_currency_id'], l['amount'], context=ctx)
- sign = voucher_type in ['sale','receipt'] and 1 or -1
- writeoff_amount = (sign * amount) - counter_for_writeoff
- currency_rate_difference = real_amount - counter_for_currency_diff
- return writeoff_amount, currency_rate_difference
+ credit += l['amount']
+ return abs(amount - abs(credit - debit))
- def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_date, context=None):
+ def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, context=None):
+ context = context or {}
if not line_dr_ids and not line_cr_ids:
return {'value':{}}
line_osv = self.pool.get("account.voucher.line")
line_dr_ids = resolve_o2m_operations(cr, uid, line_osv, line_dr_ids, ['amount'], context)
line_cr_ids = resolve_o2m_operations(cr, uid, line_osv, line_cr_ids, ['amount'], context)
- writeoff_amount, currency_rate_diff = self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount, voucher_date, context=context)
- return {'value': {'writeoff_amount': writeoff_amount, 'currency_rate_difference': currency_rate_diff}}
+ return {'value': {'writeoff_amount': self._compute_writeoff_amount(cr, uid, line_dr_ids, line_cr_ids, amount)}}
def _get_writeoff_amount(self, cr, uid, ids, name, args, context=None):
if not ids: return {}
- if context is None:
- context = {}
- res = {}.fromkeys(ids,{})
- counter_for_writeoff = counter_for_currency_diff = real_amount = 0.0
- currency_pool = self.pool.get('res.currency')
- for voucher in self.browse(cr, uid, ids, context=context):
- ctx = context.copy()
- ctx.update({'date': voucher.date})
- for l in voucher.line_dr_ids:
- real_amount -= l.amount_in_company_currency
- counter_for_writeoff -= (l.voucher_currency_id.id == l.currency_id.id) and l.amount or l.amount_in_voucher_currency
- counter_for_currency_diff -= currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx)
- for l in voucher.line_cr_ids:
- real_amount += l.amount_in_company_currency
- counter_for_writeoff += (l.voucher_currency_id.id == l.currency_id.id) and l.amount or l.amount_in_voucher_currency
- counter_for_currency_diff += currency_pool.compute(cr, uid, l.currency_id.id, voucher.company_id.currency_id.id, l.amount, context=ctx)
- sign = voucher.type in ['sale','receipt'] and 1 or -1
- writeoff_amount = (sign * voucher.amount) - counter_for_writeoff
- res[voucher.id]['writeoff_amount'] = writeoff_amount
- res[voucher.id]['currency_rate_difference'] = real_amount - counter_for_currency_diff
- return res
-
- def _currency_id(self, cr, uid, ids, name, args, context=None):
res = {}
+ debit = credit = 0.0
for voucher in self.browse(cr, uid, ids, context=context):
- currency = voucher.journal_id.currency and voucher.journal_id.currency.id or voucher.company_id.currency_id.id
- res[voucher.id] = {'currency_id': currency, 'currency_id2': currency}
+ for l in voucher.line_dr_ids:
+ debit += l.amount
+ for l in voucher.line_cr_ids:
+ credit += l.amount
+ res[voucher.id] = abs(voucher.amount - abs(credit - debit))
return res
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "date desc, id desc"
+# _rec_name = 'number'
_columns = {
'type':fields.selection([
('sale','Sale'),
@@ -250,7 +195,7 @@ class account_voucher(osv.osv):
],'Default Type', readonly=True, states={'draft':[('readonly',False)]}),
'name':fields.char('Memo', size=256, readonly=True, states={'draft':[('readonly',False)]}),
'date':fields.date('Date', readonly=True, select=True, states={'draft':[('readonly',False)]}, help="Effective date for accounting entries"),
- 'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}, change_default=1),
+ 'journal_id':fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'account_id':fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'line_ids':fields.one2many('account.voucher.line','voucher_id','Voucher Lines', readonly=True, states={'draft':[('readonly',False)]}),
'line_cr_ids':fields.one2many('account.voucher.line','voucher_id','Credits',
@@ -259,11 +204,9 @@ class account_voucher(osv.osv):
domain=[('type','=','dr')], context={'default_type':'dr'}, readonly=True, states={'draft':[('readonly',False)]}),
'period_id': fields.many2one('account.period', 'Period', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'narration':fields.text('Notes', readonly=True, states={'draft':[('readonly',False)]}),
- 'currency_id': fields.function(_currency_id, type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, multi="currency"),
- #duplicated field for display purposes
- 'currency_id2': fields.function(_currency_id, type='many2one', relation='res.currency', string='Currency', store=True, readonly=True, multi="currency"),
- 'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
- 'company_currency': fields.related('company_id','currency_id', type='many2one', relation='res.currency', string='Currency', readonly=True),
+# 'currency_id':fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'currency_id': fields.related('journal_id','currency', type='many2one', relation='res.currency', string='Currency', readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'state':fields.selection(
[('draft','Draft'),
('proforma','Pro-forma'),
@@ -282,6 +225,7 @@ class account_voucher(osv.osv):
'move_ids': fields.related('move_id','line_id', type='one2many', relation='account.move.line', string='Journal Items', readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', change_default=1, readonly=True, states={'draft':[('readonly',False)]}),
'audit': fields.related('move_id','to_check', type='boolean', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.', relation='account.move', string='To Review'),
+ 'paid': fields.function(_check_paid, string='Paid', type='boolean', help="The Voucher has been totally paid."),
'pay_now':fields.selection([
('pay_now','Pay Directly'),
('pay_later','Pay Later or Group Funds'),
@@ -291,14 +235,13 @@ class account_voucher(osv.osv):
'date_due': fields.date('Due Date', readonly=True, select=True, states={'draft':[('readonly',False)]}),
'payment_option':fields.selection([
('without_writeoff', 'Keep Open'),
- ('with_writeoff', 'Reconcile'),
+ ('with_writeoff', 'Reconcile Payment Balance'),
], 'Payment Difference', required=True, readonly=True, states={'draft': [('readonly', False)]}),
- 'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', readonly=True, states={'draft': [('readonly', False)]}),
- 'comment': fields.char('Write-Off Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}),
+ 'exchange_acc_id': fields.many2one('account.account', 'Exchange Diff. Account', readonly=True, states={'draft': [('readonly', False)]}),
+ 'writeoff_acc_id': fields.many2one('account.account', 'Counterpart Account', readonly=True, states={'draft': [('readonly', False)]}),
+ 'comment': fields.char('Counterpart Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}),
'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}),
- 'writeoff_amount': fields.function(_get_writeoff_amount, string='Write-Off Amount', type='float', readonly=True, multi="writeoff"),
- 'currency_rate_difference': fields.function(_get_writeoff_amount, string="Currency Rate Difference", type='float', multi="writeoff"),
- 'paid': fields.function(_check_paid, string='Paid', type='boolean', help="The Voucher has been totally paid."),
+ 'writeoff_amount': fields.function(_get_writeoff_amount, string='Reconcile Amount', type='float', readonly=True),
}
_defaults = {
'period_id': _get_period,
@@ -323,7 +266,7 @@ class account_voucher(osv.osv):
tax_pool = self.pool.get('account.tax')
partner_pool = self.pool.get('res.partner')
position_pool = self.pool.get('account.fiscal.position')
- voucher_voucher_line_obj = self.pool.get('account.voucher.line')
+ voucher_line_pool = self.pool.get('account.voucher.line')
voucher_pool = self.pool.get('account.voucher')
if context is None: context = {}
@@ -332,7 +275,7 @@ class account_voucher(osv.osv):
for line in voucher.line_ids:
voucher_amount += line.untax_amount or line.amount
line.amount = line.untax_amount or line.amount
- voucher_voucher_line_obj.write(cr, uid, [line.id], {'amount':line.amount, 'untax_amount':line.untax_amount})
+ voucher_line_pool.write(cr, uid, [line.id], {'amount':line.amount, 'untax_amount':line.untax_amount})
if not voucher.tax_id:
self.write(cr, uid, [voucher.id], {'amount':voucher_amount, 'tax_amount':0.0})
@@ -360,7 +303,7 @@ class account_voucher(osv.osv):
line_total += tax_line.get('price_unit')
total_tax += line_tax
untax_amount = line.untax_amount or line.amount
- voucher_voucher_line_obj.write(cr, uid, [line.id], {'amount':line_total, 'untax_amount':untax_amount})
+ voucher_line_pool.write(cr, uid, [line.id], {'amount':line_total, 'untax_amount':untax_amount})
self.write(cr, uid, [voucher.id], {'amount':total, 'tax_amount':total_tax})
return True
@@ -370,14 +313,14 @@ class account_voucher(osv.osv):
tax_pool = self.pool.get('account.tax')
partner_pool = self.pool.get('res.partner')
position_pool = self.pool.get('account.fiscal.position')
- voucher_line_obj = self.pool.get('account.voucher.line')
+ line_pool = self.pool.get('account.voucher.line')
res = {
'tax_amount': False,
'amount': False,
}
voucher_total = 0.0
- line_ids = resolve_o2m_operations(cr, uid, voucher_line_obj, line_ids, ["amount"], context)
+ line_ids = resolve_o2m_operations(cr, uid, line_pool, line_ids, ["amount"], context)
total = 0.0
total_tax = 0.0
@@ -466,8 +409,8 @@ class account_voucher(osv.osv):
return default
- def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, voucher_currency_id, ttype, date, context=None):
- """price
+ def onchange_partner_id(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
+ """
Returns a dict that contains new values and context
@param partner_id: latest value from user input for field partner_id
@@ -476,36 +419,43 @@ class account_voucher(osv.osv):
@return: Returns a dict which contains new values, and context
"""
- if not journal_id:
- return {}
if context is None:
context = {}
+ if not journal_id:
+ return {}
context_multi_currency = context.copy()
if date:
context_multi_currency.update({'date': date})
+ line_pool = self.pool.get('account.voucher.line')
+ line_ids = ids and line_pool.search(cr, uid, [('voucher_id', '=', ids[0])]) or False
+ if line_ids:
+ line_pool.unlink(cr, uid, line_ids)
+
currency_pool = self.pool.get('res.currency')
- move_line_obj = self.pool.get('account.move.line')
+ move_line_pool = self.pool.get('account.move.line')
partner_pool = self.pool.get('res.partner')
journal_pool = self.pool.get('account.journal')
- voucher_line_obj = self.pool.get('account.voucher.line')
- #get default values
- vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context=context)
- vals = vals.get('value',{})
- voucher_currency_id = vals.get('currency_id', voucher_currency_id)
- default = {
- 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id': voucher_currency_id},
- }
- #drop existing lines
- line_ids = ids and voucher_line_obj.search(cr, uid, [('voucher_id', 'in', ids)]) or []
- if line_ids:
- voucher_line_obj.unlink(cr, uid, line_ids, context=context)
+ vals = self.onchange_journal(cr, uid, ids, journal_id, [], False, partner_id, context)
+ vals = vals.get('value')
+
+ journal = journal_pool.browse(cr, uid, journal_id, context=context)
+ currency_id = vals.get('currency_id', currency_id)
+ default = {
+ 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id':currency_id},
+ }
+ currency_id = currency_id or journal.company_id.currency_id.id
if not partner_id:
return default
- journal = journal_pool.browse(cr, uid, journal_id, context=context)
+ if not partner_id and ids:
+ line_ids = line_pool.search(cr, uid, [('voucher_id', '=', ids[0])])
+ if line_ids:
+ line_pool.unlink(cr, uid, line_ids)
+ return default
+
partner = partner_pool.browse(cr, uid, partner_id, context=context)
account_id = False
if journal.type in ('sale','sale_refund'):
@@ -520,98 +470,78 @@ class account_voucher(osv.osv):
if journal.type not in ('cash', 'bank'):
return default
+ total_credit = 0.0
+ total_debit = 0.0
account_type = 'receivable'
if ttype == 'payment':
account_type = 'payable'
+ total_debit = price or 0.0
else:
+ total_credit = price or 0.0
account_type = 'receivable'
if not context.get('move_line_ids', False):
- ids = move_line_obj.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context)
+ ids = move_line_pool.search(cr, uid, [('state','=','valid'), ('account_id.type', '=', account_type), ('reconcile_id', '=', False), ('partner_id', '=', partner_id)], context=context)
else:
ids = context['move_line_ids']
-
- #computation of the assignation of voucher amount on voucher lines
- total_credit = account_type == 'receivable' and price or 0.0
- total_debit = account_type == 'payable' and price or 0.0
- moves = move_line_obj.browse(cr, uid, ids, context=context)
- company_currency = journal.company_id.currency_id.id
- invoice_id = context.get('invoice_id', False)
- move_line_found = False
- #order the lines by most old first
ids.reverse()
+ moves = move_line_pool.browse(cr, uid, ids, context=context)
+
+ #company_currency = journal.company_id.currency_id.id
+ #if company_currency != currency_id and ttype == 'payment':
+ # total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit, context=context_multi_currency)
+ #elif company_currency != currency_id and ttype == 'receipt':
+ # total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit, context=context_multi_currency)
+
+ company_currency = journal.company_id.currency_id.id
+ 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
+
+ if line.currency_id and currency_id==line.currency_id.id:
+ total_credit += line.amount_currency <0 and -line.amount_currency or 0.0
+ total_debit += line.amount_currency >0 and line.amount_currency or 0.0
+ else:
+ total_credit += currency_pool.compute(cr, uid, company_currency, currency_id, line.credit or 0.0)
+ total_debit += currency_pool.compute(cr, uid, company_currency, currency_id, 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
- if invoice_id:
- if line.invoice.id == invoice_id:
- #if the invoice linked to the voucher line is equal to the invoice_id in context
- #then we assign the amount on that line, whatever the other voucher lines
- move_line_found = line.id
- break
- elif voucher_currency_id == company_currency:
- #otherwise treatments is the same but with other field names
- if line.amount_residual == price:
- #if the amount residual is equal the amount voucher, we assign it to that voucher
- #line, whatever the other voucher lines
- move_line_found = line.id
- break
- #otherwise we will split the voucher amount on each line (by most old first)
- total_credit += line.credit or 0.0
- total_debit += line.debit or 0.0
- elif voucher_currency_id == line.currency_id.id:
- if line.amount_residual_currency == price:
- move_line_found = line.id
- break
- total_credit += line.credit and line.amount_currency or 0.0
- total_debit += line.debit and line.amount_currency or 0.0
- #voucher line creation
- 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_original, amount_unreconciled = voucher_line_obj._get_amounts(cr, uid, line, context=context)
- currency_id = line.currency_id and line.currency_id.id or line.company_id.currency_id.id
+ if line.currency_id and currency_id==line.currency_id.id:
+ amount_original = abs(line.amount_currency)
+ amount_unreconciled = abs(line.amount_residual_currency)
+ else:
+ amount_original = currency_pool.compute(cr, uid, company_currency, currency_id, line.credit or line.debit or 0.0)
+ amount_unreconciled = currency_pool.compute(cr, uid, company_currency, currency_id, abs(line.amount_residual))
+
+ #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': amount_original,
- 'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0,
- 'currency_id': currency_id,
- 'voucher_currency_id': voucher_currency_id,
'date_original':line.date,
- 'company_currency_id': line.company_id.currency_id.id,
'date_due':line.date_maturity,
'amount_unreconciled': amount_unreconciled,
+
}
- #split voucher amount by most old first
- if not move_line_found:
- if company_currency == voucher_currency_id:
- if line.credit:
- amount = min(amount_unreconciled, abs(total_debit))
- rs['amount'] = amount
- total_debit -= amount
- else:
- amount = min(amount_unreconciled, abs(total_credit))
- rs['amount'] = amount
- total_credit -= amount
- elif voucher_currency_id == line.currency_id.id:
- if line.credit:
- amount = min(amount_unreconciled, abs(total_debit))
- rs['amount'] = amount
- total_debit -= amount
- else:
- amount = min(amount_unreconciled, abs(total_credit))
- rs['amount'] = amount
- total_credit -= amount
+
+ if line.credit:
+ amount = min(amount_unreconciled, total_debit)
+ rs['amount'] = amount
+ total_debit -= amount
+ else:
+ amount = min(amount_unreconciled, total_credit)
+ rs['amount'] = amount
+ total_credit -= amount
default['value']['line_ids'].append(rs)
if rs['type'] == 'cr':
@@ -623,7 +553,7 @@ class account_voucher(osv.osv):
default['value']['pre_line'] = 1
elif ttype == 'receipt' and len(default['value']['line_dr_ids']) > 0:
default['value']['pre_line'] = 1
- default['value']['writeoff_amount'], default['value']['currency_rate_difference'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price, date, context=context)
+ default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price)
return default
def onchange_date(self, cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=None):
@@ -633,13 +563,9 @@ class account_voucher(osv.osv):
@param context: context arguments, like lang, time zone
@return: Returns a dict which contains new values, and context
"""
- if context is None: context = {}
period_pool = self.pool.get('account.period')
res = self.onchange_partner_id(cr, uid, ids, partner_id, journal_id, price, currency_id, ttype, date, context=context)
- if context.get('invoice_id', False):
- company_id = self.pool.get('account.invoice').browse(cr, uid, context['invoice_id'], context=context).company_id.id
- context.update({'company_id': company_id})
- pids = period_pool.find(cr, uid, date, context=context)
+ pids = period_pool.search(cr, uid, [('date_start', '<=', date), ('date_stop', '>=', date)])
if pids:
if not 'value' in res:
res['value'] = {}
@@ -647,9 +573,8 @@ class account_voucher(osv.osv):
return res
def onchange_journal(self, cr, uid, ids, journal_id, line_ids, tax_id, partner_id, context=None):
- if context is None: context = {}
if not journal_id:
- return {}
+ return False
journal_pool = self.pool.get('account.journal')
journal = journal_pool.browse(cr, uid, journal_id, context=context)
account_id = journal.default_credit_account_id or journal.default_debit_account_id
@@ -659,14 +584,10 @@ class account_voucher(osv.osv):
vals = self.onchange_price(cr, uid, ids, line_ids, tax_id, partner_id, context)
vals['value'].update({'tax_id':tax_id})
- currency_id = journal.company_id.currency_id.id
+ currency_id = False #journal.company_id.currency_id.id
if journal.currency:
currency_id = journal.currency.id
vals['value'].update({'currency_id':currency_id})
- context.update({'company_id': journal.company_id.id})
- periods = self.pool.get('account.period').find(cr, uid, context=context)
- if periods:
- vals['value'].update({'period_id':periods[0]})
return vals
def proforma_voucher(self, cr, uid, ids, context=None):
@@ -707,9 +628,10 @@ class account_voucher(osv.osv):
def unlink(self, cr, uid, ids, context=None):
for t in self.read(cr, uid, ids, ['state'], context=context):
if t['state'] not in ('draft', 'cancel'):
- raise osv.except_osv(_('Invalid action !'), _('In order to delete a voucher, you must cancel it!'))
+ raise osv.except_osv(_('Invalid action !'), _('Cannot delete Voucher(s) which are already opened or paid !'))
return super(account_voucher, self).unlink(cr, uid, ids, context=context)
+ # TODO: may be we can remove this method if not used anyware
def onchange_payment(self, cr, uid, ids, pay_now, journal_id, partner_id, ttype='sale'):
res = {}
if not partner_id:
@@ -730,7 +652,6 @@ class account_voucher(osv.osv):
return {'value':res}
def action_move_line_create(self, cr, uid, ids, context=None):
-
def _get_payment_term_lines(term_id, amount):
term_pool = self.pool.get('account.payment.term')
if term_id and amount:
@@ -740,44 +661,49 @@ class account_voucher(osv.osv):
if context is None:
context = {}
move_pool = self.pool.get('account.move')
- move_line_obj = self.pool.get('account.move.line')
+ move_line_pool = self.pool.get('account.move.line')
currency_pool = self.pool.get('res.currency')
tax_obj = self.pool.get('account.tax')
seq_obj = self.pool.get('ir.sequence')
- for voucher in self.browse(cr, uid, ids, context=context):
- if voucher.move_id:
+ for inv in self.browse(cr, uid, ids, context=context):
+ if inv.move_id:
continue
context_multi_currency = context.copy()
- context_multi_currency.update({'date': voucher.date})
+ context_multi_currency.update({'date': inv.date})
- if voucher.number:
- name = voucher.number
+ if inv.number:
+ name = inv.number
+ elif inv.journal_id.sequence_id:
+ name = seq_obj.get_id(cr, uid, inv.journal_id.sequence_id.id)
else:
- name = seq_obj.get_id(cr, uid, voucher.journal_id.sequence_id.id)
- if not voucher.reference:
+ raise osv.except_osv(_('Error !'), _('Please define a sequence on the journal !'))
+ if not inv.reference:
ref = name.replace('/','')
else:
- ref = voucher.reference
+ ref = inv.reference
move = {
'name': name,
- 'journal_id': voucher.journal_id.id,
- 'narration': voucher.narration,
- 'date': voucher.date,
+ 'journal_id': inv.journal_id.id,
+ 'narration': inv.narration,
+ 'date': inv.date,
'ref': ref,
- 'period_id': voucher.period_id and voucher.period_id.id or False
+ 'period_id': inv.period_id and inv.period_id.id or False
}
move_id = move_pool.create(cr, uid, move)
#create the first line manually
- company_currency = voucher.journal_id.company_id.currency_id.id
- voucher_currency = voucher.currency_id.id
+ company_currency = inv.journal_id.company_id.currency_id.id
+ current_currency = inv.currency_id.id or company_currency
+ current_currency_obj = inv.currency_id or inv.journal_id.company_id.currency_id
debit = 0.0
credit = 0.0
- if voucher.type in ('purchase', 'payment'):
- credit = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.amount, context=context_multi_currency)
- elif voucher.type in ('sale', 'receipt'):
- debit = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.amount, context=context_multi_currency)
+ # TODO: is there any other alternative then the voucher type ??
+ # -for sale, purchase we have but for the payment and receipt we do not have as based on the bank/cash journal we can not know its payment or receipt
+ if inv.type in ('purchase', 'payment'):
+ credit = currency_pool.compute(cr, uid, current_currency, company_currency, inv.amount, context=context_multi_currency)
+ elif inv.type in ('sale', 'receipt'):
+ debit = currency_pool.compute(cr, uid, current_currency, company_currency, inv.amount, context=context_multi_currency)
if debit < 0:
credit = -debit
debit = 0.0
@@ -785,71 +711,53 @@ 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
+ #create the first line of the voucher, the payment made
move_line = {
- 'name': voucher.name or '/',
+ 'name': inv.name or '/',
'debit': debit,
'credit': credit,
- 'account_id': voucher.account_id.id,
+ 'account_id': inv.account_id.id,
'move_id': move_id,
- 'journal_id': voucher.journal_id.id,
- 'period_id': voucher.period_id.id,
- 'partner_id': voucher.partner_id.id,
- 'currency_id': company_currency <> voucher_currency and voucher_currency or False,
- 'amount_currency': company_currency <> voucher_currency and sign * voucher.amount or 0.0,
- 'date': voucher.date,
- 'date_maturity': voucher.date_due
+ 'journal_id': inv.journal_id.id,
+ 'period_id': inv.period_id.id,
+ 'partner_id': inv.partner_id.id,
+ 'currency_id': company_currency <> current_currency and current_currency or False,
+ 'amount_currency': company_currency <> current_currency and sign * inv.amount or 0.0,
+ 'date': inv.date,
+ 'date_maturity': inv.date_due
}
- move_line_obj.create(cr, uid, move_line)
-
- #create the move line for the currency difference
- if voucher.currency_rate_difference:
- if voucher.currency_rate_difference > 0:
- account_id = voucher.company_id.property_expense_currency_exchange
- if not account_id:
- raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Expense Currency Rate' on the company! "))
- else:
- account_id = voucher.company_id.property_income_currency_exchange
- if not account_id:
- raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Income Currency Rate' on the company! "))
-
- currency_diff_line = {
- 'name': _('Currency Difference'),
- 'debit': voucher.currency_rate_difference > 0 and voucher.currency_rate_difference or 0.0,
- 'credit': voucher.currency_rate_difference < 0 and -voucher.currency_rate_difference or 0.0,
- 'account_id': account_id.id,
- 'move_id': move_id,
- 'journal_id': voucher.journal_id.id,
- 'period_id': voucher.period_id.id,
- 'partner_id': voucher.partner_id.id,
- 'date': voucher.date,
- 'date_maturity': voucher.date_due
- }
- move_line_obj.create(cr, uid, currency_diff_line, context=context)
-
+ move_line_pool.create(cr, uid, move_line)
rec_list_ids = []
- for line in voucher.line_ids:
+ line_total = debit - credit
+ if inv.type == 'sale':
+ line_total = line_total - currency_pool.compute(cr, uid, current_currency, company_currency, inv.tax_amount, context=context_multi_currency)
+ elif inv.type == 'purchase':
+ line_total = line_total + currency_pool.compute(cr, uid, current_currency, 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
#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
+ amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
+ amount_residual = line.move_line_id.amount_residual - amount #residual amount in company currency
else:
- amount = line.amount_in_company_currency
+ amount = currency_pool.compute(cr, uid, current_currency, company_currency, line.untax_amount or line.amount, context=context_multi_currency)
+ amount_residual = 0.0
move_line = {
- 'journal_id': voucher.journal_id.id,
- 'period_id': voucher.period_id.id,
+ 'journal_id': inv.journal_id.id,
+ 'period_id': inv.period_id.id,
'name': line.name or '/',
'account_id': line.account_id.id,
'move_id': move_id,
- 'partner_id': voucher.partner_id.id,
- 'currency_id': company_currency <> line.currency_id.id and line.currency_id.id or False,
+ 'partner_id': inv.partner_id.id,
+ 'currency_id': company_currency <> current_currency and current_currency or False,
'analytic_account_id': line.account_analytic_id and line.account_analytic_id.id or False,
'quantity': 1,
'credit': 0.0,
'debit': 0.0,
- 'date': voucher.date
+ 'date': inv.date
}
if amount < 0:
amount = -amount
@@ -858,68 +766,97 @@ class account_voucher(osv.osv):
else:
line.type = 'dr'
if (line.type=='dr'):
+ line_total += amount
move_line['debit'] = amount
else:
+ line_total -= amount
move_line['credit'] = amount
- if voucher.tax_id and voucher.type in ('sale', 'purchase'):
+ if inv.tax_id and inv.type in ('sale', 'purchase'):
move_line.update({
- 'account_tax_id': voucher.tax_id.id,
+ 'account_tax_id': inv.tax_id.id,
})
if move_line.get('account_tax_id', False):
tax_data = tax_obj.browse(cr, uid, [move_line['account_tax_id']], context=context)[0]
if not (tax_data.base_code_id and tax_data.tax_code_id):
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 <> line.currency_id.id and sign * line.amount or 0.0
- voucher_line = move_line_obj.create(cr, uid, move_line)
+ move_line['amount_currency'] = company_currency <> current_currency and sign * line.amount or 0.0
+ voucher_line = move_line_pool.create(cr, uid, move_line)
+ rec_ids = [voucher_line, line.move_line_id.id]
+
+ # Change difference entry
+ if amount_residual:
+ if not inv.exchange_acc_id.id:
+ raise osv.except_osv(_('Error!'), _('You must provide an account for the exchange difference.'))
+ move_line = {
+ 'journal_id': inv.journal_id.id,
+ 'period_id': inv.period_id.id,
+ 'name': _('change')+': '+(line.name or '/'),
+ 'account_id': line.account_id.id,
+ 'move_id': move_id,
+ 'partner_id': inv.partner_id.id,
+ 'currency_id': company_currency <> current_currency and current_currency or False,
+ 'amount_currency': 0.0,
+ 'quantity': 1,
+ 'credit': amount_residual > 0 and amount_residual or 0.0,
+ 'debit': amount_residual < 0 and -amount_residual or 0.0,
+ 'date': inv.date
+ }
+ new_id = move_line_pool.create(cr, uid, move_line)
+ move_line = {
+ 'journal_id': inv.journal_id.id,
+ 'period_id': inv.period_id.id,
+ 'name': _('change')+': '+(line.name or '/'),
+ 'account_id': inv.exchange_acc_id.id,
+ 'move_id': move_id,
+ 'amount_currency': 0.0,
+ 'partner_id': inv.partner_id.id,
+ 'currency_id': company_currency <> current_currency and current_currency or False,
+ 'quantity': 1,
+ 'debit': amount_residual > 0 and amount_residual or 0.0,
+ 'credit': amount_residual < 0 and -amount_residual or 0.0,
+ 'date': inv.date
+ }
+ move_line_pool.create(cr, uid, move_line)
+ rec_ids.append(new_id)
+
if 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, voucher.currency_id, voucher.writeoff_amount):
- #create one line for the write off if needed
- diff = currency_pool.compute(cr, uid, voucher_currency, company_currency, voucher.writeoff_amount, context=context_multi_currency)
+ if not currency_pool.is_zero(cr, uid, current_currency_obj, line_total):
+ diff = line_total
account_id = False
write_off_name = ''
-
- if voucher.payment_option == 'with_writeoff':
- account_id = voucher.writeoff_acc_id.id
- write_off_name = voucher.comment
- elif voucher.type in ('sale', 'receipt'):
- if not voucher.partner_id:
- account_id = property_obj.search(cr,uid,[('name','=','property_account_receivable'),('res_id','=',False)])
- else:
- account_id = voucher.partner_id.property_account_receivable.id
+ if inv.payment_option == 'with_writeoff':
+ account_id = inv.writeoff_acc_id.id
+ write_off_name = inv.comment
+ elif inv.type in ('sale', 'receipt'):
+ account_id = inv.partner_id.property_account_receivable.id
else:
- if not voucher.partner_id:
- account_id = property_obj.search(cr,uid,[('name','=','property_account_payable'),('res_id','=',False)])
- else:
- account_id = voucher.partner_id.property_account_payable.id
- if not account_id:
- raise osv.except_osv(_('Error !'), _('No receivable/payable account defined in properties!'))
+ account_id = inv.partner_id.property_account_payable.id
move_line = {
'name': write_off_name or name,
'account_id': account_id,
'move_id': move_id,
- 'partner_id': voucher.partner_id.id,
- 'date': voucher.date,
- 'debit': diff < 0 and -diff or 0.0,
+ 'partner_id': inv.partner_id.id,
+ 'date': inv.date,
'credit': diff > 0 and diff or 0.0,
- 'amount_currency': company_currency <> voucher_currency and -voucher.writeoff_amount or 0.0,
- 'currency_id': company_currency <> voucher_currency and voucher_currency or False,
+ '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,
}
- move_line_obj.create(cr, uid, move_line)
- self.write(cr, uid, [voucher.id], {
+ move_line_pool.create(cr, uid, move_line)
+ self.write(cr, uid, [inv.id], {
'move_id': move_id,
'state': 'posted',
'number': name,
})
- if voucher.journal_id.entry_posted:
+ if inv.journal_id.entry_posted:
move_pool.post(cr, uid, [move_id], context={})
for rec_ids in rec_list_ids:
if len(rec_ids) >= 2:
- move_line_obj.reconcile_partial(cr, uid, rec_ids)
+ move_line_pool.reconcile_partial(cr, uid, rec_ids, writeoff_acc_id=inv.exchange_acc_id.id, writeoff_period_id=inv.period_id.id, writeoff_journal_id=inv.journal_id.id)
return True
def copy(self, cr, uid, id, default={}, context=None):
@@ -942,86 +879,45 @@ class account_voucher_line(osv.osv):
_description = 'Voucher Lines'
_order = "move_line_id"
- def _currency_id(self, cr, uid, ids, name, args, context=None):
- res = {}
- for line in self.browse(cr, uid, ids, context=context):
- move_line = line.move_line_id
- if move_line:
- res[line.id] = move_line.currency_id and move_line.currency_id.id or move_line.company_id.currency_id.id
- else:
- res[line.id] = line.voucher_id.currency_id.id
- return res
-
- def _get_amounts(self, cr, uid, line_browse_rec, context=None):
- if line_browse_rec.currency_id:
- amount_original = line_browse_rec.amount_currency or 0.0
- amount_unreconciled = line_browse_rec.amount_residual_currency
- elif line_browse_rec.credit > 0:
- amount_original = line_browse_rec.credit or 0.0
- amount_unreconciled = line_browse_rec.amount_residual
- else:
- amount_original = line_browse_rec.debit or 0.0
- amount_unreconciled = line_browse_rec.amount_residual
- return amount_original, amount_unreconciled
-
+ # If the payment is in the same currency than the invoice, we keep the same amount
+ # Otherwise, we compute from company currency to payment currency
def _compute_balance(self, cr, uid, ids, name, args, context=None):
currency_pool = self.pool.get('res.currency')
- res = {}
+ rs_data = {}
for line in self.browse(cr, uid, ids, context=context):
- amount_original, amount_unreconciled = self._get_amounts(cr, uid, line.move_line_id, context)
- res[line.id] = {
- 'amount_original': amount_original,
- 'amount_unreconciled': amount_unreconciled,
- }
+ 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 and line.voucher_id.currency_id.id or company_currency
+ move_line = line.move_line_id or False
- return res
+ if not move_line:
+ res['amount_original'] = 0.0
+ res['amount_unreconciled'] = 0.0
+ elif move_line.currency_id and voucher_currency==move_line.currency_id.id:
+ res['amount_original'] = currency_pool.compute(cr, uid, move_line.currency_id.id, voucher_currency, abs(move_line.amount_currency), context=ctx)
+ 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)
+ elif move_line and move_line.credit > 0:
+ res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.credit, context=ctx)
+ res['amount_unreconciled'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, abs(move_line.amount_residual), context=ctx)
+ else:
+ res['amount_original'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, move_line.debit, context=ctx)
+ res['amount_unreconciled'] = currency_pool.compute(cr, uid, company_currency, voucher_currency, abs(move_line.amount_residual), context=ctx)
- def __company_currency_amount(self, cr, uid, line, amount, context=None):
- if context is None:
- context = {}
- ctx = context.copy()
- ctx.update({'date': line.date_original})
- currency_pool = self.pool.get('res.currency')
- amount_company_cur = currency_pool.compute(cr, uid, line.currency_id.id, line.company_currency_id.id, amount, context=ctx)
- ctx.update({'date': line.voucher_id.date})
- amount_voucher_cur = currency_pool.compute(cr, uid, line.currency_id.id, line.voucher_currency_id.id, amount, context=ctx)
- return amount_company_cur, amount_voucher_cur
-
- def onchange_amount(self, cr, uid, ids, amount, context=None):
- if not amount or not ids:
- return {'value':{'amount_in_company_currency': 0.0, 'amount_in_voucher_currency': 0.0}}
- for line in self.browse(cr, uid, ids, context=context):
- amount_company_cur, amount_voucher_cur = self.__company_currency_amount(cr, uid, line, amount, context=context)
- return {'value': {'amount_in_company_currency': amount_company_cur, 'amount_in_voucher_currency': amount_voucher_cur}}
-
- def _get_amount_in_company_currency(self, cr, uid, ids, name, args, context=None):
- res = {}
- for line in self.browse(cr, uid, ids, context=context):
- amount_in_company_currency, amount_in_voucher_currency = self.__company_currency_amount(cr, uid, line, line.amount, context=context)
- res[line.id] = {
- 'amount_in_company_currency': amount_in_company_currency,
- 'amount_in_voucher_currency': amount_in_voucher_currency,
- }
- return res
+ rs_data[line.id] = res
+ return rs_data
_columns = {
'voucher_id':fields.many2one('account.voucher', 'Voucher', required=1, ondelete='cascade'),
- 'move_line_id': fields.many2one('account.move.line', 'Journal Item'),
- 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Dr/Cr'),
'name':fields.char('Description', size=256),
'account_id':fields.many2one('account.account','Account', required=True),
- 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
'partner_id':fields.related('voucher_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'),
'untax_amount':fields.float('Untax Amount'),
-
- 'currency_id': fields.function(_currency_id, string='Currency', type='many2one', relation='res.currency'),
- 'company_currency_id': fields.related('move_line_id','company_id','currency_id', type='many2one', relation='res.currency', string="Company Currency"),
- 'voucher_currency_id': fields.related('voucher_id', 'currency_id', type='many2one', relation='res.currency', string="Voucher Currency"),
-
'amount':fields.float('Amount', digits_compute=dp.get_precision('Account')),
- 'amount_in_company_currency': fields.function(_get_amount_in_company_currency, string='Amount in Company Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"),
- 'amount_in_voucher_currency': fields.function(_get_amount_in_company_currency, string='Amount in Voucher Currency', type='float', digits_compute=dp.get_precision('Account'), multi="voucher_line_amount"),
-
+ 'type':fields.selection([('dr','Debit'),('cr','Credit')], 'Dr/Cr'),
+ 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
+ 'move_line_id': fields.many2one('account.move.line', 'Journal Item'),
'date_original': fields.related('move_line_id','date', type='date', relation='account.move.line', string='Date', readonly=1),
'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly=1),
'amount_original': fields.function(_compute_balance, multi='dc', type='float', string='Original Amount', store=True),
@@ -1043,9 +939,9 @@ class account_voucher_line(osv.osv):
@return: Returns a dict which contains new values, and context
"""
res = {}
- move_line_obj = self.pool.get('account.move.line')
+ move_line_pool = self.pool.get('account.move.line')
if move_line_id:
- move_line = move_line_obj.browse(cr, user, move_line_id, context=context)
+ move_line = move_line_pool.browse(cr, user, move_line_id, context=context)
if move_line.credit:
ttype = 'dr'
else:
@@ -1120,7 +1016,7 @@ class account_bank_statement(osv.osv):
bank_st_line_obj = self.pool.get('account.bank.statement.line')
st_line = bank_st_line_obj.browse(cr, uid, st_line_id, context=context)
if st_line.voucher_id:
- voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number, 'date': st_line.date}, context=context)
+ voucher_obj.write(cr, uid, [st_line.voucher_id.id], {'number': next_number}, context=context)
if st_line.voucher_id.state == 'cancel':
voucher_obj.action_cancel_draft(cr, uid, [st_line.voucher_id.id], context=context)
wf_service.trg_validate(uid, 'account.voucher', st_line.voucher_id.id, 'proforma_voucher', cr)
@@ -1130,7 +1026,7 @@ class account_bank_statement(osv.osv):
'move_ids': [(4, v.move_id.id, False)]
})
- return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id, 'date': st_line.date}, update_check=False, context=context)
+ return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id}, context=context)
return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line.id, company_currency_id, next_number, context=context)
account_bank_statement()
diff --git a/addons/account_voucher/account_voucher_pay_invoice.xml b/addons/account_voucher/account_voucher_pay_invoice.xml
index fc3ddd96cae..345241cb4ee 100644
--- a/addons/account_voucher/account_voucher_pay_invoice.xml
+++ b/addons/account_voucher/account_voucher_pay_invoice.xml
@@ -1,28 +1,27 @@
-
- account.invoice.customer.pay
- account.invoice
- form
-
-
-
-
-
-
-
- account.invoice.supplier.pay
- account.invoice
- form
-
-
-
-
-
-
-
+
+ account.invoice.customer.pay
+ account.invoice
+ form
+
+
+
+
+
+
+
+
+ account.invoice.supplier.pay
+ account.invoice
+ form
+
+
+
+
+
+
+
diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml
index e44fd264879..8f8a0d0854a 100644
--- a/addons/account_voucher/account_voucher_view.xml
+++ b/addons/account_voucher/account_voucher_view.xml
@@ -43,7 +43,7 @@
-
+
diff --git a/addons/account_voucher/company.py b/addons/account_voucher/company.py
deleted file mode 100644
index 5a5b5d040d7..00000000000
--- a/addons/account_voucher/company.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields, osv
-
-class res_company(osv.osv):
- _inherit = "res.company"
- _columns = {
- 'property_income_currency_exchange': fields.property(
- 'account.account',
- type='many2one',
- relation='account.account',
- string="Income Currency Rate",
- view_load=True,
- domain="[('type', '=', 'other')]",),
- 'property_expense_currency_exchange': fields.property(
- 'account.account',
- type='many2one',
- relation='account.account',
- string="Expense Currency Rate",
- view_load=True,
- domain="[('type', '=', 'other')]",),
- }
-
-res_company()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_voucher/company_view.xml b/addons/account_voucher/company_view.xml
deleted file mode 100644
index 97d6edc31b7..00000000000
--- a/addons/account_voucher/company_view.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- res.company.form.inherit
-
- res.company
- form
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/account_voucher/invoice.py b/addons/account_voucher/invoice.py
index b108bc14fe3..0230cac1009 100644
--- a/addons/account_voucher/invoice.py
+++ b/addons/account_voucher/invoice.py
@@ -45,11 +45,10 @@ class invoice(osv.osv):
'close_after_process': True,
'invoice_type':inv.type,
'invoice_id':inv.id,
- 'default_type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment',
- 'type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment'
+ 'default_type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment'
}
}
invoice()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/account_voucher/report/account_voucher_sales_receipt.py b/addons/account_voucher/report/account_voucher_sales_receipt.py
index 06511c9a118..b31dedc8aa1 100644
--- a/addons/account_voucher/report/account_voucher_sales_receipt.py
+++ b/addons/account_voucher/report/account_voucher_sales_receipt.py
@@ -73,7 +73,7 @@ class sale_receipt_report(osv.osv):
to_char(av.date, 'MM') as month,
to_char(av.date, 'YYYY-MM-DD') as day,
av.partner_id as partner_id,
- av.currency_id as currency_id,
+ aj.currency as currency_id,
av.journal_id as journal_id,
rp.user_id as user_id,
av.company_id as company_id,
@@ -111,7 +111,7 @@ class sale_receipt_report(osv.osv):
to_char(av.date, 'MM'),
to_char(av.date, 'YYYY-MM-DD'),
av.partner_id,
- av.currency_id,
+ aj.currency,
av.journal_id,
rp.user_id,
av.company_id,
diff --git a/addons/account_voucher/test/case1_usd_usd.yml b/addons/account_voucher/test/case1_usd_usd.yml
deleted file mode 100755
index dc7654ab9c3..00000000000
--- a/addons/account_voucher/test/case1_usd_usd.yml
+++ /dev/null
@@ -1,355 +0,0 @@
--
- In order to check the Account_voucher module with multi-currency in OpenERP,
- I create 2 Invoices in USD and make 2 Payments in USD based on the currency rating on that particular date
--
- I create currency USD in OpenERP for January of 1.333333 Rate
--
- !python {model: res.currency.rate}: |
- from datetime import datetime
- curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])
- date = '%s-01-01' %(datetime.now().year)
- ids = self.search(cr, uid, [('currency_id','=',curr_id), ('name', '=', date)])
- self.write(cr, uid, ids, {'rate': 1.333333})
--
- I create currency USD in OpenERP for February of 1.250000 Rate
--
- !record {model: res.currency.rate, id: feb_usd}:
- currency_id: base.USD
- name: !eval "'%s-02-01' %(datetime.now().year)"
- rate: 1.250000
-
--
- I create currency USD in OpenERP for March of 1.111111 Rate
--
- !record {model: res.currency.rate, id: mar_usd}:
- currency_id: base.USD
- name: !eval "'%s-03-01' %(datetime.now().year)"
- rate: 1.111111
-
--
- I create currency USD in OpenERP for April of 1.052632 Rate
--
- !record {model: res.currency.rate, id: apr_usd}:
- currency_id: base.USD
- name: !eval "'%s-04-01' %(datetime.now().year)"
- rate: 1.052632
-
--
- I create a bank journal with USD as currency
--
- !record {model: account.journal, id: bank_journal_USD}:
- name: Bank Journal(USD)
- code: BUSD
- type: bank
- analytic_journal_id: account.sit
- sequence_id: account.sequence_bank_journal
- default_debit_account_id: account.cash
- default_credit_account_id: account.cash
- currency: base.USD
- company_id: base.main_company
- view_id: account.account_journal_bank_view
-
--
- I set up some accounts for currency rate expense/income in my company
--
- !record {model: res.company, id: base.main_company}:
- property_expense_currency_exchange: account.o_expense
- property_income_currency_exchange: account.o_income
--
- I create new partner Mark Strauss.
--
- !record {model: res.partner, id: res_partner_strauss0}:
- address:
- - city: paris
- country_id: base.fr
- name: Mark Strauss
- street: 1 rue Rockfeller
- type: invoice
- zip: '75016'
- name: Mr. Mark Strauss
--
- I create the first invoice on 1st January for 200 USD
--
- !record {model: account.invoice, id: account_invoice_jan}:
- account_id: account.a_recv
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.USD
- date_invoice: !eval "'%s-01-01' %(datetime.now().year)"
- period_id: account.period_1
- invoice_line:
- - account_id: account.a_sale
- name: '[PC1] Basic PC'
- price_unit: 200.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_strauss0
- reference_type: none
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_jan}
--
- I check that first invoice move is correct for debtor account (debit - credit == 150.0)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_invoice_jan"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == 150.0), "Invoice move is not correct for debtors account"
--
- I create the second invoice on 1st February for 100 USD
--
- !record {model: account.invoice, id: account_invoice_feb}:
- account_id: account.a_recv
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.USD
- date_invoice: !eval "'%s-02-01' %(datetime.now().year)"
- period_id: account.period_2
- invoice_line:
- - account_id: account.a_sale
- name: '[PC1] Basic PC'
- price_unit: 100.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_strauss0
- reference_type: none
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_feb}
--
- I check that second invoice move is correct for debtor account (debit - credit == 80)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_invoice_feb"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == 80), "Invoice move is not correct for debtors account"
-
--
- I create the first voucher of payment
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 240.00, 2, ttype='receipt', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 240.00,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.USD'),
- 'journal_id': ref('bank_journal_USD'),
- 'partner_id': ref('res_partner_strauss0'),
- 'period_id': ref('account.period_3'),
- 'type': 'receipt',
- 'date': time.strftime("%Y-03-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'First payment',
- }
- if not res['value']['line_cr_ids']:
- res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
- for item in res['value']['line_cr_ids']:
- if item['amount_unreconciled'] == 200.00:
- item['amount'] = 180.00
- else:
- item['amount'] = 70.00
- vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is -10.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == -10.0), "Writeoff amount is not -10.0"
--
- I check that currency rate difference is -34.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.currency_rate_difference == -34.0), "Currency rate difference is not -34.0"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that the move of my first voucher is valid
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- assert move_line.state == 'valid', "Voucher move is not valid"
--
- I check that my debtor account is correct
--
- I check that the debtor account has 2 new lines with -180 and -70 as amount_currency columns and that their credit columns are respectively 135 and 56
--
- I check that my currency rate difference is correct. 34 in credit with no amount_currency
--
- I check that my write-off is correct. 9 debit and 10 amount_currency
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.amount_currency == -180.00:
- assert move_line.credit == 135.00, "Debtor account has wrong entry."
- elif move_line.amount_currency == -70.00:
- assert move_line.credit == 56.00, "Debtor account has wrong entry."
- elif move_line.credit == 34.00:
- assert move_line.amount_currency == 0.00, "Incorrect currency rate difference."
- elif move_line.amount_currency == 10.00:
- assert move_line.debit == 9.00, "Writeoff amount is wrong."
--
- I check the residual amount of Invoice1, should be 20 in amount_currency and 15 in company currency
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_invoice_jan"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 20.0 and move_line.amount_residual == 15.0) , "Residual amount is not correct for first Invoice"
--
- I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_invoice_feb"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 30.0 and move_line.amount_residual == 24.0) , "Residual amount is not correct for first Invoice"
--
- I create the second voucher of payment
-
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_strauss0"), ref('bank_journal_USD'), 45.00, 2, ttype='receipt', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 45.00,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.USD'),
- 'journal_id': ref('bank_journal_USD'),
- 'partner_id': ref('res_partner_strauss0'),
- 'period_id': ref('account.period_3'),
- 'type': 'receipt',
- 'date': time.strftime("%Y-04-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'Second payment',
- }
- if not res['value']['line_cr_ids']:
- res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
- for item in res['value']['line_cr_ids']:
- if item['amount_unreconciled'] == 20.00:
- item['amount'] = 20.00
- else:
- item['amount'] = 30.00
- vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is -5.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == -5.0), "Writeoff amount is not -5.0"
--
- I check that currency rate difference is -8.50
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.currency_rate_difference == -8.50), "Currency rate difference is not -8.50"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that the move of my second voucher is valid
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- assert move_line.state == 'valid', "Voucher move is not valid"
--
- I check that my debtor account is correct
--
- I check that the debtor account has 2 new lines with -20 and -30 as amount_currency columns and their credit columns are respectively 15 and 24.
--
- I check that my currency rate difference is correct. 8.5 in credit with no amount_currency
--
- I check that my writeoff is correct. 4.75 debit and 5 amount_currency
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_strauss0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.amount_currency == -20.00:
- assert move_line.credit == 15.00, "Debtor account has wrong entry."
- elif move_line.amount_currency == -30.00:
- assert move_line.credit == 24.00, "Debtor account has wrong entry."
- elif move_line.credit == 8.50:
- assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
- elif move_line.amount_currency == 5.00:
- assert move_line.debit == 4.75, "Writeoff amount is wrong."
--
- I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual and paid
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_invoice_jan"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice"
--
- I check the residual amuont of Invoice2, should be 0 in residual currency and 0 in amount_residual and paid
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_invoice_feb"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice"
\ No newline at end of file
diff --git a/addons/account_voucher/test/case2_suppl_usd_eur.yml b/addons/account_voucher/test/case2_suppl_usd_eur.yml
deleted file mode 100644
index 31e756d5355..00000000000
--- a/addons/account_voucher/test/case2_suppl_usd_eur.yml
+++ /dev/null
@@ -1,328 +0,0 @@
--
- In order to check the Account_voucher module with multi-currency in OpenERP,
- I create 2 Invoices in USD and make 2 Payments one in USD and another in EUR, based on the currency rating on that particular date
--
- I create a bank journal with EUR as currency
--
- !record {model: account.journal, id: bank_journal_EUR}:
- name: Bank Journal(EUR)
- code: BEUR
- type: bank
- analytic_journal_id: account.sit
- sequence_id: account.sequence_bank_journal
- default_debit_account_id: account.cash
- default_credit_account_id: account.cash
- currency: base.EUR
- company_id: base.main_company
- view_id: account.account_journal_bank_view
--
- I create a bank journal with USD as currency
--
- !record {model: account.journal, id: bank_journal_USD}:
- name: Bank Journal(USD)
- code: BUSD
- type: bank
- analytic_journal_id: account.sit
- sequence_id: account.sequence_bank_journal
- default_debit_account_id: account.cash
- default_credit_account_id: account.cash
- currency: base.USD
- company_id: base.main_company
- view_id: account.account_journal_bank_view
--
- I create a new partner Robert Clements
--
- !record {model: res.partner, id: res_partner_clements0}:
- address:
- - city: marseille
- country_id: base.fr
- name: Robert
- street: 1 rue Rockfeller
- type: invoice
- zip: '13016'
- name: Mr.Robert Clements
--
- I create the first invoice on 1st January for 200 USD
--
- !record {model: account.invoice, id: account_first_invoice_jan_suppl}:
- account_id: account.a_pay
- type : in_invoice
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.USD
- date_invoice: !eval "'%s-01-01' %(datetime.now().year)"
- period_id: account.period_1
- invoice_line:
- - account_id: account.a_expense
- name: '[PC1] Basic PC'
- price_unit: 200.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_clements0
- reference_type: none
- check_total : 200
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_suppl}
--
- I check that first invoice move is correct for debtor account(debit - credit == -150)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_suppl"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == -150.00), "Invoice move is incorrect for debtors account"
--
- I create the second invoice on 1st February for 100 USD
--
- !record {model: account.invoice, id: account_second_invoice_feb_suppl}:
- account_id: account.a_pay
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.USD
- date_invoice: !eval "'%s-02-01' %(datetime.now().year)"
- period_id: account.period_2
- type : in_invoice
- invoice_line:
- - account_id: account.a_expense
- name: '[PC1] Basic PC'
- price_unit: 100.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_clements0
- reference_type: none
- check_total : 100.0
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb_suppl}
--
- I check that second invoice move is correct for debtor account (debit - credit == -80)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_suppl"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == -80), "Invoice move is incorrect for debtors account"
--
- I create the first voucher of payment
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_clements0"), ref('bank_journal_EUR'), 240.0, 2, ttype='payment', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 240.0,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.EUR'),
- 'journal_id': ref('bank_journal_EUR'),
- 'partner_id': ref('res_partner_clements0'),
- 'period_id': ref('account.period_3'),
- 'type': 'payment',
- 'date': time.strftime("%Y-03-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'First payment',
- }
- if not res['value']['line_dr_ids']:
- res['value']['line_dr_ids'] = [{'type': 'dr', 'account_id': ref('account.a_pay'),}]
- for item in res['value']['line_dr_ids']:
- if item['amount_unreconciled'] == 200.00:
- item['amount'] = 180.00
- else:
- item['amount'] = 70.00
- vals['line_dr_ids'] = [(0,0,i) for i in res['value']['line_dr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is -15.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == -15.0), "Writeoff amount is not -15.0"
--
- I check that currency rate difference is 34.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.currency_rate_difference == 34.0), "Currency rate difference is not 34.0"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that the move of my voucher is valid
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- assert move_line.state == 'valid', "Voucher move is not valid"
--
- I check that my creditor account is correct
--
- I check that the creditor account has 2 new lines with 180 and 70 in amount_currency columns and their debit columns are respectively 135 and 56 and currency is USD($).
--
- I check that my currency rate difference is correct. -34 in credit with no amount_currency
--
- I check that my writeoff is correct. -15 in credit with no amount_currency
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.amount_currency == 180.00:
- assert move_line.debit == 135.00, "Creditor account has wrong entry."
- elif move_line.amount_currency == 70.00:
- assert move_line.debit == 56.00, "Debtor account has wrong entry."
- elif move_line.debit == 34.00:
- assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
- elif move_line.debit == 15.00:
- assert move_line.amount_currency == 0.00, "Writeoff amount is wrong."
--
- I check the residual amount of Invoice1, should be 20 in residual currency and 15 in amount_residual
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_suppl"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 20.0 and move_line.amount_residual == 15) , "Residual amount is not correct for first Invoice"
--
- I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_suppl"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 30 and move_line.amount_residual == 24) , "Residual amount is not correct for second Invoice"
--
- I create the second voucher of payment
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_clements0"), ref('bank_journal_EUR'), 45.0, 2, ttype='payment', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 45.0,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.USD'),
- 'journal_id': ref('bank_journal_USD'),
- 'partner_id': ref('res_partner_clements0'),
- 'period_id': ref('account.period_3'),
- 'type': 'payment',
- 'date': time.strftime("%Y-04-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'Second payment',
- }
- if not res['value']['line_dr_ids']:
- res['value']['line_dr_ids'] = [{'type': 'dr', 'account_id': ref('account.a_pay'),}]
- for item in res['value']['line_dr_ids']:
- if item['amount_unreconciled'] == 20.00:
- item['amount'] = 20.00
- else:
- item['amount'] = 30.00
- vals['line_dr_ids'] = [(0,0,i) for i in res['value']['line_dr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is -5.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == 5.0), "Writeoff amount is not 5.0"
--
- I check that currency rate difference is 8.50
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.currency_rate_difference == 8.50), "Currency rate difference is not 8.50"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that my voucher state is posted
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert voucher_id.state == 'posted', "Voucher state is not posted"
--
- I check that my creditor account is correct
--
- I check that the creditor account has 2 new lines with 20 and 30 in amount_currency columns and their debit columns are respectively 15 and 24 and currency is USD($).
--
- I check that my currency rate difference is correct. 8.50 in debit with no amount_currency
--
- I check that my writeoff is correct. 4.75 in credit and 5 in amount_currency
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_clements0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.amount_currency == 20.00:
- assert move_line.debit == 15.00, "Debtor account has wrong entry."
- elif move_line.amount_currency == 30.00:
- assert move_line.debit == 24.00, "Debtor account has wrong entry."
- elif move_line.debit == 8.50:
- assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
- elif move_line.amount_currency == -5.00:
- assert move_line.credit == 4.75, "Writeoff amount is wrong."
--
- I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual and paid
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_suppl"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice"
--
- I check the residual amount of invoice 2, should be 0 in residual currency and 0 in amount_residual and paid
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_suppl"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice"
diff --git a/addons/account_voucher/test/case2_usd_eur.yml b/addons/account_voucher/test/case2_usd_eur.yml
deleted file mode 100644
index ded95095e5a..00000000000
--- a/addons/account_voucher/test/case2_usd_eur.yml
+++ /dev/null
@@ -1,360 +0,0 @@
--
- In order to check the Account_voucher module with multi-currency in OpenERP,
- I create 2 Invoices in USD and make 2 Payments one in USD and another in EUR, based on the currency rating on that particular date
--
- I create currency USD in OpenERP for January of 1.333333 Rate
--
- !python {model: res.currency.rate}: |
- from datetime import datetime
- curr_id = self.pool.get('res.currency').search(cr, uid, [('name', '=', 'USD')])
- date = '%s-01-01' %(datetime.now().year)
- ids = self.search(cr, uid, [('currency_id', '=', curr_id), ('name', '=', date)])
- self.write(cr, uid, ids, {'rate': 1.333333})
--
- I create currency USD in OpenERP for February of 1.250000 Rate
--
- !record {model: res.currency.rate, id: febr_usd}:
- currency_id: base.USD
- name: !eval "'%s-02-01' %(datetime.now().year)"
- rate: 1.250000
--
- I create currency USD in OpenERP for March of 1.111111 Rate
--
- !record {model: res.currency.rate, id: marc_usd}:
- currency_id: base.USD
- name: !eval "'%s-03-01' %(datetime.now().year)"
- rate: 1.111111
--
- I create currency USD in OpenERP for April of 1.052632 Rate
--
- !record {model: res.currency.rate, id: apri_usd}:
- currency_id: base.USD
- name: !eval "'%s-04-01' %(datetime.now().year)"
- rate: 1.052632
--
- I create a bank journal with EUR as currency
--
- !record {model: account.journal, id: bank_journal_EUR}:
- name: Bank Journal(EUR)
- code: BEUR
- type: bank
- analytic_journal_id: account.sit
- sequence_id: account.sequence_bank_journal
- default_debit_account_id: account.cash
- default_credit_account_id: account.cash
- currency: base.EUR
- company_id: base.main_company
- view_id: account.account_journal_bank_view
--
- I create a bank journal with USD as currency
--
- !record {model: account.journal, id: bank_journal_USD}:
- name: Bank Journal(USD)
- code: BUSD
- type: bank
- analytic_journal_id: account.sit
- sequence_id: account.sequence_bank_journal
- default_debit_account_id: account.cash
- default_credit_account_id: account.cash
- currency: base.USD
- company_id: base.main_company
- view_id: account.account_journal_bank_view
--
- I set up some accounts for currency rate expense/income in my company
--
- !record {model: res.company, id: base.main_company}:
- property_expense_currency_exchange: account.o_expense
- property_income_currency_exchange: account.o_income
--
- I create a new partner Michael Geller
--
- !record {model: res.partner, id: res_partner_michael0}:
- address:
- - city: paris
- country_id: base.fr
- name: Michael
- street: 1 rue Rockfeller
- type: invoice
- zip: '75016'
- name: Mr.Michael Geller
--
- I create the first invoice on 1st January for 200 USD
--
- !record {model: account.invoice, id: account_first_invoice_jan}:
- account_id: account.a_recv
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.USD
- date_invoice: !eval "'%s-01-01' %(datetime.now().year)"
- period_id: account.period_1
- invoice_line:
- - account_id: account.a_sale
- name: '[PC1] Basic PC'
- price_unit: 200.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_michael0
- reference_type: none
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan}
--
- I check that first invoice move is correct for debtor account(debit - credit == 150)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == 150.00), "Invoice move is incorrect for debtors account"
--
- I create the second invoice on 1st February for 100 USD
--
- !record {model: account.invoice, id: account_second_invoice_feb}:
- account_id: account.a_recv
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.USD
- date_invoice: !eval "'%s-02-01' %(datetime.now().year)"
- period_id: account.period_2
- invoice_line:
- - account_id: account.a_sale
- name: '[PC1] Basic PC'
- price_unit: 100.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_michael0
- reference_type: none
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb}
--
- I check that second invoice move is correct for debtor account (debit - credit == 80)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == 80), "Invoice move is incorrect for debtors account"
--
- I create the first voucher of payment
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_michael0"), ref('bank_journal_EUR'), 240.0, 2, ttype='receipt', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 240.0,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.EUR'),
- 'journal_id': ref('bank_journal_EUR'),
- 'partner_id': ref('res_partner_michael0'),
- 'period_id': ref('account.period_3'),
- 'type': 'receipt',
- 'date': time.strftime("%Y-03-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'First payment',
- }
- if not res['value']['line_cr_ids']:
- res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
- for item in res['value']['line_cr_ids']:
- if item['amount_unreconciled'] == 200.00:
- item['amount'] = 180.00
- else:
- item['amount'] = 70.00
- vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is 15.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == 15.0), "Writeoff amount is not 15.0"
--
- I check that currency rate difference is -34.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.currency_rate_difference == -34.0), "Currency rate difference is not -34.0"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that the move of my voucher is valid
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- assert move_line.state == 'valid', "Voucher move is not valid"
--
- I check that my debtor account is correct
--
- I check that the debtor account has 2 new lines with -180 and -70 in amount_currency columns and their credit columns are respectively 135 and 56 and currency is USD($).
--
- I check that my currency rate difference is correct. 34 in credit with no amount_currency
--
- I check that my writeoff is correct. 15 in credit with no amount_currency
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.amount_currency == -180.00:
- assert move_line.credit == 135.00, "Debtor account has wrong entry."
- elif move_line.amount_currency == -70.00:
- assert move_line.credit == 56.00, "Debtor account has wrong entry."
- elif move_line.credit == 34.00:
- assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
- elif move_line.credit == 15.00:
- assert move_line.amount_currency == 0.00, "Writeoff amount is wrong."
--
- I check the residual amount of Invoice1, should be 20 in residual currency and 15 in amount_residual
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 20.0 and move_line.amount_residual == 15) , "Residual amount is not correct for first Invoice"
--
- I check the residual amuont of Invoice2, should be 30 in residual currency and 24 in amount_residual
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 30 and move_line.amount_residual == 24) , "Residual amount is not correct for second Invoice"
--
- I create the second voucher of payment
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_michael0"), ref('bank_journal_EUR'), 45.0, 2, ttype='receipt', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 45.0,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.USD'),
- 'journal_id': ref('bank_journal_USD'),
- 'partner_id': ref('res_partner_michael0'),
- 'period_id': ref('account.period_3'),
- 'type': 'receipt',
- 'date': time.strftime("%Y-04-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'Second payment',
- }
- if not res['value']['line_cr_ids']:
- res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
- for item in res['value']['line_cr_ids']:
- if item['amount_unreconciled'] == 20.00:
- item['amount'] = 20.00
- else:
- item['amount'] = 30.00
- vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is -5.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == -5.0), "Writeoff amount is not -5.0"
--
- I check that currency rate difference is -8.50
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.currency_rate_difference == -8.50), "Currency rate difference is not -8.50"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that my voucher state is posted
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert voucher_id.state == 'posted', "Voucher state is not posted"
--
- I check that my debtor account is correct
--
- I check that the debtor account has 2 new lines with -20 and -30 in amount_currency columns and their credit columns are respectively 15 and 24 and currency is USD($).
--
- I check that my currency rate difference is correct. 8.50 in credit with no amount_currency
--
- I check that my writeoff is correct. 4.75 in debit and 5 in amount_currency
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_michael0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.amount_currency == -20.00:
- assert move_line.credit == 15.00, "Debtor account has wrong entry."
- elif move_line.amount_currency == -30.00:
- assert move_line.credit == 24.00, "Debtor account has wrong entry."
- elif move_line.credit == 8.50:
- assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
- elif move_line.amount_currency == 5.00:
- assert move_line.debit == 4.75, "Writeoff amount is wrong."
--
- I check the residual amount of invoice 1, should be 0 in residual currency and 0 in amount_residual and paid
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice"
--
- I check the residual amuont of invoice 2, should be 0 in residual currency and 0 in amount_residual and paid
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for second Invoice"
\ No newline at end of file
diff --git a/addons/account_voucher/test/case3_eur_eur.yml b/addons/account_voucher/test/case3_eur_eur.yml
deleted file mode 100644
index b35daf49402..00000000000
--- a/addons/account_voucher/test/case3_eur_eur.yml
+++ /dev/null
@@ -1,331 +0,0 @@
--
- In order to check the Account_voucher module with multi-currency in OpenERP,
- I create 2 Invoices in EUR and make 2 Payments in EUR based on the currency rating on that particular date.
--
- I create currency EUR in OpenERP for January of 1.000000 Rate
--
- !record {model: res.currency.rate, id: jan_eur}:
- currency_id: base.EUR
- name: !eval "'%s-01-01' %(datetime.now().year)"
- rate: 1.000000
--
- I create currency EUR in OpenERP for February of 1.000000 Rate
--
- !record {model: res.currency.rate, id: feb_eur}:
- currency_id: base.EUR
- name: !eval "'%s-02-01' %(datetime.now().year)"
- rate: 1.000000
--
- I create currency EUR in OpenERP for March of 1.000000 Rate
--
- !record {model: res.currency.rate, id: mar_eur}:
- currency_id: base.EUR
- name: !eval "'%s-03-01' %(datetime.now().year)"
- rate: 1.000000
--
- I create currency EUR in OpenERP for April of 1.000000 Rate
--
- !record {model: res.currency.rate, id: apr_eur}:
- currency_id: base.EUR
- name: !eval "'%s-04-01' %(datetime.now().year)"
- rate: 1.000000
--
- I create a bank journal with EUR as currency
--
- !record {model: account.journal, id: bank_journal_EUR}:
- name: Bank Journal(EUR)
- code: BEUR
- type: bank
- analytic_journal_id: account.sit
- sequence_id: account.sequence_bank_journal
- default_debit_account_id: account.cash
- default_credit_account_id: account.cash
- currency: base.EUR
- company_id: base.main_company
- view_id: account.account_journal_bank_view
--
- I set up some accounts for currency rate expense/income in my company
--
- !record {model: res.company, id: base.main_company}:
- property_expense_currency_exchange: account.o_expense
- property_income_currency_exchange: account.o_income
--
- I create a new partner Peter Lawson.
--
- !record {model: res.partner, id: res_partner_peter0}:
- address:
- - city: paris
- country_id: base.fr
- name: Peter
- street: 1 rue Rockfeller
- type: invoice
- zip: '75016'
- name: Mr.Peter Lawson
--
- I create the first invoice on 1st January for 150 EUR
--
- !record {model: account.invoice, id: account_first_invoice_jan_eur}:
- account_id: account.a_recv
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.EUR
- date_invoice: !eval "'%s-01-01' %(datetime.now().year)"
- period_id: account.period_1
- invoice_line:
- - account_id: account.a_sale
- name: '[PC1] Basic PC'
- price_unit: 150.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_peter0
- reference_type: none
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_eur}
--
- I check that first invoice move is correct for debtor account(debit - credit == 150)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_eur"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == 150.00), "Invoice move is incorrect for debtors account"
--
- I create the second invoice on 1st February for 80 EUR
--
- !record {model: account.invoice, id: account_second_invoice_feb_eur}:
- account_id: account.a_recv
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.EUR
- date_invoice: !eval "'%s-02-01' %(datetime.now().year)"
- period_id: account.period_1
- invoice_line:
- - account_id: account.a_sale
- name: '[PC1] Basic PC'
- price_unit: 80.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_peter0
- reference_type: none
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_second_invoice_feb_eur}
--
- I check that second invoice move is correct for debtor account (debit - credit == 80)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_eur"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == 80.00), "Invoice move is incorrect for debtors account"
--
- I create the first voucher of payment
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.00, 2, ttype='receipt', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 120.00,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.EUR'),
- 'journal_id': ref('bank_journal_EUR'),
- 'partner_id': ref('res_partner_peter0'),
- 'period_id': ref('account.period_3'),
- 'type': 'receipt',
- 'date': time.strftime("%Y-03-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'First payment',
- }
- if not res['value']['line_cr_ids']:
- res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
- for item in res['value']['line_cr_ids']:
- if item['amount_unreconciled'] == 150.00:
- item['amount'] = 100.00
- else:
- item['amount'] = 20.00
- vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is 0.00
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == 0.00), "Writeoff amount is not 0.00"
--
- I check that currency rate difference is 0.00
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.currency_rate_difference == 0.00), "Currency rate difference is not 0.00"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that the move of my first voucher is valid
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- assert move_line.state == 'valid', "Voucher move is not valid"
--
- I check that my debtor account is correct
--
- I check that the debtor account has 2 new lines with 0.00 and 0.00 in amount_currency columns and their credit are 20 and 100 respectively
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'),('partner_id', '=', ref('res_partner_peter0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.credit == 20.00:
- assert move_line.amount_currency == 0.00, "Debtor account has wrong entry."
- elif move_line.credit == 100.00:
- assert move_line.amount_currency == 0.00, "Debtor account has wrong entry."
--
- I check the residual amount of Invoice1 is 50
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_eur"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 50.0 and move_line.amount_residual == 50.0) , "Residual amount is not correct for first Invoice"
--
- I check the residual amuont of Invoice2 is 60
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_eur"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 60.0 and move_line.amount_residual == 60.0) , "Residual amount is not correct for second Invoice"
--
- I create the second voucher of payment and check to let open the debtor overpaid amount.
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_peter0"), ref('bank_journal_EUR'), 120.00, 2, ttype='receipt', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 120.00,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.EUR'),
- 'journal_id': ref('bank_journal_EUR'),
- 'partner_id': ref('res_partner_peter0'),
- 'period_id': ref('account.period_3'),
- 'type': 'receipt',
- 'date': time.strftime("%Y-04-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'Second payment',
- }
- if not res['value']['line_cr_ids']:
- res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
- for item in res['value']['line_cr_ids']:
- if item['amount_unreconciled'] == 50.00:
- item['amount'] = 50.00
- elif item['amount_unreconciled'] == 60.00:
- item['amount'] = 70.00
- vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is 0.00
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'),('partner_id', '=', ref('res_partner_peter0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == 0.00), "Writeoff amount is not 0"
--
- I check that currency rate difference is 0.00
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.currency_rate_difference == 0.00), "Currency rate difference is not 0"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that the move of my second voucher is valid
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- assert move_line.state == 'valid', "Voucher move is not valid"
--
- I check that my debtor account is correct
--
- I check that the debtor account has 2 new lines with 0.00 and 0.00 in amount_currency columns and their credit are 70 and 50
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'Second payment'), ('partner_id', '=', ref('res_partner_peter0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.credit == 70.00:
- assert move_line.amount_currency == 0.00, "Debtor account has wrong entry."
- elif move_line.credit == 50.00:
- assert move_line.amount_currency == 0.00, "Debtor account has wrong entry."
--
- I check the residual amount of Invoice1 is 0
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_eur"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 0 and move_line.amount_residual == 0) , "Residual amount is not correct for first Invoice"
--
- I check the residual amuont of Invoice2 is -10
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_second_invoice_feb_eur"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == -10.0 and move_line.amount_residual == -10.0) , "Residual amount is not correct for second Invoice"
\ No newline at end of file
diff --git a/addons/account_voucher/test/case4_cad_chf.yml b/addons/account_voucher/test/case4_cad_chf.yml
deleted file mode 100644
index b6ed790dffb..00000000000
--- a/addons/account_voucher/test/case4_cad_chf.yml
+++ /dev/null
@@ -1,194 +0,0 @@
--
- In order to check the Account_voucher module with multi-currency in OpenERP,
- I create an invoice in CAD and make its Payment in CHF based on the currency rating on that particular date.
--
- I create currency CAD in OpenERP for January of 1.338800 Rate
--
- !record {model: res.currency.rate, id: jan_cad}:
- currency_id: base.CAD
- name: !eval "'%s-01-01' %(datetime.now().year)"
- rate: 1.338800
--
- I create currency CAD in OpenERP for March of 2.000000 Rate
--
- !record {model: res.currency.rate, id: mar_cad}:
- currency_id: base.CAD
- name: !eval "'%s-03-01' %(datetime.now().year)"
- rate: 2.000000
--
- I create currency CHF in OpenERP for January of 1.308600 Rate
--
- !record {model: res.currency.rate, id: jan_chf}:
- currency_id: base.CHF
- name: !eval "'%s-01-01' %(datetime.now().year)"
- rate: 1.308600
--
- I create currency CHF in OpenERP for March of 1.250000 Rate
--
- !record {model: res.currency.rate, id: mar_chf}:
- currency_id: base.CHF
- name: !eval "'%s-03-01' %(datetime.now().year)"
- rate: 1.250000
--
- I create a bank journal with CHF as currency
--
- !record {model: account.journal, id: bank_journal_CHF}:
- name: Bank Journal(CHF)
- code: BCHF
- type: bank
- analytic_journal_id: account.sit
- sequence_id: account.sequence_bank_journal
- default_debit_account_id: account.cash
- default_credit_account_id: account.cash
- currency: base.CHF
- company_id: base.main_company
- view_id: account.account_journal_bank_view
--
- I set up some accounts for currency rate expense/income in my company
--
- !record {model: res.company, id: base.main_company}:
- property_expense_currency_exchange: account.o_expense
- property_income_currency_exchange: account.o_income
--
- I create a new partner John Armani.
--
- !record {model: res.partner, id: res_partner_john0}:
- address:
- - city: paris
- country_id: base.fr
- name: John
- street: 1 rue Rockfeller
- type: invoice
- zip: '75016'
- name: Mr.John Armani
--
- I create the first invoice on 1st January for 200 CAD
--
- !record {model: account.invoice, id: account_first_invoice_jan_cad}:
- account_id: account.a_recv
- address_contact_id: base.res_partner_address_3000
- address_invoice_id: base.res_partner_address_3000
- company_id: base.main_company
- currency_id: base.CAD
- date_invoice: !eval "'%s-01-01' %(datetime.now().year)"
- period_id: account.period_1
- invoice_line:
- - account_id: account.a_sale
- name: '[PC1] Basic PC'
- price_unit: 200.0
- quantity: 1.0
- product_id: product.product_product_pc1
- uos_id: product.product_uom_unit
- journal_id: account.sales_journal
- partner_id: res_partner_john0
- reference_type: none
--
- I Validate invoice by clicking on Validate button
--
- !workflow {model: account.invoice, action: invoice_open, ref: account_first_invoice_jan_cad}
--
- I check that first invoice move is correct for debtor account (debit - credit == 149.39)
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_cad"))
- assert invoice_id.move_id, "Move not created for open invoice"
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.debit - move_line.credit == 149.39), "Invoice move is incorrect for debtors account"
--
- I create the first voucher of payment
-
--
- !python {model: account.voucher}: |
- import netsvc, time
- vals = {}
- res = self.onchange_partner_id(cr, uid, [], ref("res_partner_john0"), ref('bank_journal_CHF'), 300.00, 2, ttype='receipt', date=False)
- vals = {
- 'account_id': ref('account.cash'),
- 'amount': 300.00,
- 'company_id': ref('base.main_company'),
- 'currency_id': ref('base.CHF'),
- 'journal_id': ref('bank_journal_CHF'),
- 'partner_id': ref('res_partner_john0'),
- 'period_id': ref('account.period_3'),
- 'type': 'receipt',
- 'date': time.strftime("%Y-03-01"),
- 'payment_option': 'with_writeoff',
- 'writeoff_acc_id': ref('account.a_expense'),
- 'comment': 'Write Off',
- 'name': 'First payment',
- }
- if not res['value']['line_cr_ids']:
- res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
- for item in res['value']['line_cr_ids']:
- if item['amount_unreconciled'] == 200.00:
- item['amount'] = 200.00
- vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
- id = self.create(cr, uid, vals)
- voucher_id = self.browse(cr, uid, id)
- assert (voucher_id.state=='draft'), "Voucher is not in draft state"
--
- I check that writeoff amount computed is 175.0
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- assert (voucher_id.writeoff_amount == 175.0), "Writeoff amount is not 175.0"
--
- I check that currency rate difference is 49.39
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- curr_diff = float(str(voucher_id.currency_rate_difference))
- assert (curr_diff == 49.39), "Currency rate difference is not 49.39"
--
- I confirm the voucher
--
- !python {model: account.voucher}: |
- import netsvc
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))])
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher[0], 'proforma_voucher', cr)
--
- I check that the move of my voucher is valid
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- assert move_line.state == 'valid', "Voucher move is not valid"
- assert voucher_id.state == 'posted', "Voucher state is not posted"
--
- I check that my debtor account is correct
--
- I check that the debtor account has 1 new line with -200 as amount_currency columns and 149.39 of credit and currency is CAD($).
--
- I check that my currency rate difference is correct. 49.39 in debit with no amount_currency
--
- I check that my writeoff is correct. 140 credit and -175 amount_currency
--
- !python {model: account.voucher}: |
- voucher = self.search(cr, uid, [('name', '=', 'First payment'), ('partner_id', '=', ref('res_partner_john0'))])
- voucher_id = self.browse(cr, uid, voucher[0])
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', voucher_id.move_id.id)])
- for move_line in move_line_obj.browse(cr, uid, move_lines):
- if move_line.amount_currency == -200:
- assert move_line.credit == 149.39, "Debtor account has wrong entry."
- elif move_line.debit == 49.39:
- assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
- elif move_line.credit == 140.00:
- assert move_line.amount_currency == -175.00, "Writeoff amount is wrong."
--
- I check the residual amount of Invoice1, should be 0 in residual currency and 0 in amount_residual and paid
--
- !python {model: account.invoice}: |
- invoice_id = self.browse(cr, uid, ref("account_first_invoice_jan_cad"))
- move_line_obj = self.pool.get('account.move.line')
- move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
- move_line = move_line_obj.browse(cr, uid, move_lines[0])
- assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for first Invoice"
diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml
index 98b242443a4..6a9e69ab27e 100644
--- a/addons/account_voucher/voucher_payment_receipt_view.xml
+++ b/addons/account_voucher/voucher_payment_receipt_view.xml
@@ -74,24 +74,14 @@
-
- Import or Create Customers
- ir.actions.act_window
- res.partner
- form
- tree,form
-
- Create some Customers, Suppliers and their contacts manually from this form or you can import your existing partners by CSV spreadsheet from "Import Data" wizard
-
-
-
-
+
+ Create or Import Customers
+ ir.actions.act_window
+ res.partner
+ form
+ tree,form
+
+ Create or Import Customers and their contacts manually from this form or you can import your existing partners by CSV spreadsheet from "Import Data" wizard
+
+
+
+
@@ -221,6 +222,7 @@
+ 1
diff --git a/addons/base_tools/i18n/da.po b/addons/base_tools/i18n/da.po
new file mode 100644
index 00000000000..14effb86350
--- /dev/null
+++ b/addons/base_tools/i18n/da.po
@@ -0,0 +1,32 @@
+# Danish translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:14+0000\n"
+"PO-Revision-Date: 2011-09-23 15:37+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Danish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2011-09-24 04:59+0000\n"
+"X-Generator: Launchpad (build 14012)\n"
+
+#. module: base_tools
+#: model:ir.module.module,shortdesc:base_tools.module_meta_information
+msgid "Common base for tools modules"
+msgstr ""
+
+#. module: base_tools
+#: model:ir.module.module,description:base_tools.module_meta_information
+msgid ""
+"\n"
+" "
+msgstr ""
+"\n"
+" "
diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py
index c2dd5027b71..c3f28c6a66f 100644
--- a/addons/crm/__openerp__.py
+++ b/addons/crm/__openerp__.py
@@ -126,6 +126,11 @@ Creates a dashboard for CRM that includes:
'test/test_crm_recurrent_meeting.yml',
'test/test_crm_stage_changes.yml',
'test/test_crm_recurrent_meeting_case2.yml',
+ 'test/test_crm_lead_case2.yml',
+ 'test/test_crm_opportunity_case2.yml',
+ 'test/test_crm_phonecall_case2.yml',
+ 'test/test_crm_partner2opportunity.yml',
+ 'test/test_crm_segmentation.yml',
],
'installable': True,
'active': False,
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index e831383ceea..4031f3d9868 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -29,8 +29,8 @@ from tools.translate import _
MAX_LEVEL = 15
AVAILABLE_STATES = [
- ('draft', 'Draft'),
- ('open', 'Open'),
+ ('draft', 'New'),
+ ('open', 'In Progress'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('pending', 'Pending'),
diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml
index e517d242f5c..782083e4669 100644
--- a/addons/crm/crm_installer_view.xml
+++ b/addons/crm/crm_installer_view.xml
@@ -26,7 +26,7 @@
- Create Sales Team
+ Define Sales Teamir.actions.act_windowcrm.case.sectionform
@@ -39,6 +39,7 @@
10
+
@@ -54,8 +55,8 @@
+ 10
-
diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml
index 0d13911a5fe..9b0581844a5 100644
--- a/addons/crm/crm_lead_menu.xml
+++ b/addons/crm/crm_lead_menu.xml
@@ -9,7 +9,7 @@
['|', ('type','=','lead'), ('type','=',False)]
- {'search_default_current':1, 'default_type': 'lead', 'search_default_section_id': section_id, 'stage_type': 'lead'}
+ {'search_default_new':1, 'default_type': 'lead', 'search_default_section_id': section_id, 'stage_type': 'lead'}Leads allow you to manage and keep track of all initial contacts with a prospect or partner showing interest in your products or services. A lead is usually the first step in your sales cycle. Once qualified, a lead may be converted into a business opportunity, while creating the related partner for further detailed tracking of any linked activities. You can import a database of prospects, keep track of your business cards or integrate your website's contact form with the OpenERP Leads. Leads can be connected to the email gateway: new emails may create leads, each of them automatically gets the history of the conversation with the prospect.
@@ -62,7 +62,7 @@
crm.leadtree,form,graph,calendar,kanban[('type','=','opportunity')]
- {'search_default_user_id':uid,'search_default_current':1, 'search_default_section_id':section_id, 'stage_type': 'opportunity', 'default_type': 'opportunity'}
+ {'search_default_user_id':uid,'search_default_new':1, 'search_default_open':1, 'search_default_section_id':section_id, 'stage_type': 'opportunity', 'default_type': 'opportunity'}With opportunities you can manage and keep track of your sales pipeline by creating specific customer- or prospect-related sales documents to follow up potential sales. Information such as expected revenue, opportunity stage, expected closing date, communication history and much more can be stored. Opportunities can be connected to the email gateway: new emails may create opportunities, each of them automatically gets the history of the conversation with the customer.
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 9dd4a921324..42587eea2b0 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -120,7 +120,7 @@
-
+
@@ -195,7 +195,7 @@
-
+
@@ -302,7 +302,7 @@
-
+
@@ -372,13 +372,15 @@
@@ -515,7 +517,7 @@
-
+
@@ -580,7 +582,7 @@
-
+
@@ -675,13 +677,15 @@
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index c260841b459..54ea8bd7dfc 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -107,7 +107,7 @@
-
+
diff --git a/addons/crm/i18n/fr.po b/addons/crm/i18n/fr.po
index ff8a76ddbd7..d1c4f486a64 100644
--- a/addons/crm/i18n/fr.po
+++ b/addons/crm/i18n/fr.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:15+0000\n"
-"PO-Revision-Date: 2011-01-18 16:45+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2011-09-26 12:10+0000\n"
+"Last-Translator: lholivier \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-05 05:06+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
+"X-Generator: Launchpad (build 14028)\n"
#. module: crm
#: view:crm.lead.report:0
@@ -2512,7 +2512,7 @@ msgstr "L'étape de l'opportunité \"%s\" a été changé à \"%s\"."
#: code:addons/crm/crm_lead.py:282
#, python-format
msgid "Changed Stage to: %s"
-msgstr ""
+msgstr "Etape passée à : %s"
#. module: crm
#: selection:crm.segmentation.line,operator:0
diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml
index 52472a9d9e8..6a954939e04 100644
--- a/addons/crm/test/test_crm_lead.yml
+++ b/addons/crm/test/test_crm_lead.yml
@@ -1,8 +1,18 @@
-- |
+- |
In order to test the CRM in OpenERP,
I will do a customer qualification process that
starts with a fist contact with a customer (a lead), which will be converted to a
business opportunity and a partner.
+-
+ I check installer report.
+-
+ !record {model: base.setup.installer , id: base_action_rule_0_1}:
+ name: Test_action
+-
+ I create the view at the time of setup.
+-
+ !python {model: base.setup.installer}: |
+ self.fields_view_get(cr, uid,view_id=None, view_type='form', context=None, toolbar=False, submenu=False)
- |
In order to test the flow, I create a two new users "user_crm" and
I assign the group "salesman".
@@ -25,26 +35,36 @@
email_from: info@mycustomer.com
name: New Customer
partner_name: Capegemini
+ partner_id: base.res_partner_9
phone: (855) 924-4364
mobile: (333) 715-1450
section_id: crm.section_sales_department
referred: False
- |
- I check that the lead is in 'draft' state,
+ I check that the lead is in 'draft' state.
-
!assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in Draft}:
- state == "draft"
-
- I open lead by click on "Open" button,
+ I open lead by click on "Open" button.
-
!python {model: crm.lead}: |
self.case_open(cr, uid, [ref("crm_lead_newcustomer0")])
+ fields={
+ 'day_open': 0.0,
+ 'day_close': 0.0
+ }
+ self._compute_day(cr, uid, [ref("crm_lead_newcustomer0")], fields, context)
- |
I check that lead is now in 'open' state.
-
!assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}:
- state == "open"
-
+-
+ I search id for case object.
+-
+ !python {model: crm.case.categ}: |
+ self._find_object_id(cr, uid, context)
- |
As the lead seems to be a real business opportunity, I will convert it to a
partner
@@ -56,16 +76,40 @@
assert action['res_model'] == 'crm.lead2opportunity.partner'
-
|
- Now, select "create a new partner" option in this wizard.
+ I select "create a new partner" option.
-
!record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}:
action: 'create'
name: 'convert'
-
- Then, Click on "Create Opportunity" button of this wizard.
+ Then, Click on "Create Opportunity" button.
-
!python {model: crm.lead2opportunity.partner}: |
self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
+-
+ |
+ I select "Link to an existing partner" option.
+-
+ !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}:
+ action: 'exist'
+ name: 'existing partner'
+-
+ Then, Click on "Create Opportunity" button.
+-
+ !python {model: crm.lead2opportunity.partner}: |
+ self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_1")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
+-
+ |
+ I select "Do not link to a partner" option.
+-
+ !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_2}:
+ action: 'nothing'
+ name: 'Do not link to a partner'
+-
+ Then, Click on "Create Opportunity" button.
+-
+ !python {model: crm.lead2opportunity.partner}: |
+ self.action_apply(cr, uid, [ref("crm_lead2opportunity_partner_create_2")], {'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
- |
In order to check the opportunity is created or not, I check type.
-
@@ -73,6 +117,39 @@
lead = self.browse(cr, uid, ref("crm_lead_newcustomer0"))
assert lead.type == 'opportunity'
+-
+ I create mass report of lead to opprtunity partner.
+-
+ !record {model: crm.lead2opportunity.partner.mass, id: crm_lead2opportunity_partner_mass0}:
+ user_ids:
+ - base.user_root
+ section_id: crm.section_sales_department
+-
+ Then, execute that mass wizard.
+-
+ !python {model: crm.lead2opportunity.partner.mass}: |
+ self.mass_convert(cr, uid, [ref("crm_lead2opportunity_partner_mass0")],{'active_ids': [ref("crm_lead_newcustomer0")], 'active_id': ref("crm_lead_newcustomer0")})
+-
+ I close lead by click on "close" button.
+-
+ !python {model: crm.lead}: |
+ self.case_close(cr, uid, [ref("crm_lead_newcustomer0")])
+- |
+ I check that lead is now in 'done' state.
+-
+ !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in done state}:
+ - state == "done"
+-
+ I cancel lead by click on "cancel" button.
+-
+ !python {model: crm.lead}: |
+ self.case_cancel(cr, uid, [ref("crm_lead_newcustomer0")])
+- |
+ I check that lead is now in 'cancel' state.
+-
+ !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in cancel state}:
+ - state == "cancel"
+
#-
# |
# yaml is also not working with smtp server and send new email.
@@ -89,4 +166,3 @@
- |
I Reply to last Email to lead with some document attached.and check that communication history generated or not.
-
diff --git a/addons/crm/test/test_crm_lead_case2.yml b/addons/crm/test/test_crm_lead_case2.yml
new file mode 100644
index 00000000000..23a654d31a8
--- /dev/null
+++ b/addons/crm/test/test_crm_lead_case2.yml
@@ -0,0 +1,151 @@
+-
+ In order to do complete test the CRM in OpenERP,
+ I will create new full configured record and carry test on it.
+- |
+ I Start by creating "Test Sales Team" with No Unlink.
+ I create a crm.case.section record.
+-
+ !record {model: crm.case.section, id: crm_case_section_demosalesteam}:
+ code: DEMO
+ complete_name: Test Sales Team
+ name: Test Sales Team
+ allow_unlink: False
+ member_ids:
+ - base.user_admin
+ stage_ids:
+ - crm.stage_lead1
+ - crm.stage_lead2
+ - crm.stage_lead3
+ - crm.stage_lead4
+ - crm.stage_lead5
+ - crm.stage_lead6
+ working_hours: 0.0
+ resource_calendar_id: resource.timesheet_group1
+ parent_id: crm.section_sales_department
+-
+ I assign segmentation.
+-
+ !record {model: res.users, id: res_users_usercrm0}:
+ context_section_id: crm_case_section_demosalesteam
+- |
+ I create a new lead "Test Customer" and I provide an address to this
+ demo customer and email "info@democustomer.com" and Also "Test Sales Team".
+-
+ !record {model: crm.lead, id: crm_lead_democustomer}:
+ email_from: info@democustomer.com
+ name: Test Customer
+ partner_name: NotSoTinySARL
+ phone: (+32).81.81.37.00
+ mobile: (+32).81.81.37.00
+ section_id: crm_case_section_demosalesteam
+ referred: False
+ type: lead
+-
+ I check that the lead is in 'draft' state.
+-
+ !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Draft}:
+ - state == "draft"
+-
+ I create categories.
+-
+ !record {model: crm.case.categ, id: crm_case_categ0}:
+ name: crm_case_section_demosalesteam
+ section_id: crm_case_section_demosalesteam
+-
+ I assigning contact detail to the Lead "Test Customer" without address.
+-
+ !python {model: crm.lead}: |
+ self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), None, email=False)
+
+-
+ I assigning contact detail to the Lead "Test Customer" with address.
+-
+ !python {model: crm.lead}: |
+ self.onchange_partner_address_id(cr, uid, ref("crm_lead_democustomer"), ref("base.res_partner_address_notsotinysarl0"), email=False)
+
+-
+ I selecting email "Opt-out" option for the "Test Customer" Lead.
+-
+ !python {model: crm.lead}: |
+ self.on_change_optout(cr, uid, ref("crm_lead_democustomer"), True)
+
+-
+ I change the Opt-out to Opt-in to show email receive preference.
+-
+ !python {model: crm.lead}: |
+ self.on_change_optin(cr, uid, ref("crm_lead_democustomer"), True)
+-
+ I open lead by click on "Open" button.
+-
+ !python {model: crm.lead}: |
+ self.case_open(cr, uid, [ref("crm_lead_democustomer")])
+-
+ I check that lead "Test Customer" is now in 'open' state.
+-
+ !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in open state}:
+ - state == "open"
+-
+ I reset the lead "Test Customer".
+-
+ !python {model: crm.lead}: |
+ self.case_reset(cr, uid, [ref("crm_lead_democustomer")])
+-
+ I again opening lead by click on "Open" button.
+-
+ !python {model: crm.lead}: |
+ self.case_open(cr, uid, [ref("crm_lead_democustomer")])
+-
+ I setting stage "New" for the lead "Test Customer".
+-
+ !python {model: crm.lead}: |
+ self.stage_next(cr, uid, [ref("crm_lead_democustomer")], context={'stage_type': 'lead'})
+-
+ I try to Unlink the Lead "Test Customer" demo Lead.
+-
+ !python {model: crm.lead}: |
+ try:
+ self.unlink(cr, uid, [ref("crm_lead_democustomer")])
+ except:
+ pass
+-
+ I setting Lead "Test Customer" to Pending State.
+-
+ !python {model: crm.lead}: |
+ self.case_pending(cr, uid, [ref("crm_lead_democustomer")])
+-
+ I check that lead "Test Customer" is now in 'Pending' state.
+-
+ !assert {model: crm.lead, id: crm_lead_democustomer, string: Lead in Pending state}:
+ - state == "pending"
+-
+ I Escalate the Lead "Test Customer" Parent "Sales Team".
+-
+ !python {model: crm.lead}: |
+ self.case_escalate(cr, uid, [ref("crm_lead_democustomer")])
+-
+ I add Internal Note Saying Escalated Reason.
+-
+ !record {model: crm.add.note, id: crm_add_note_0}:
+ body: Sales Lead Has Been Escalated Due to Some Technical reason to the parent 'Sales
+ Team'
+ state: unchanged
+-
+ I click a note button to attach the record.
+-
+ !python {model: crm.add.note}: |
+ context['active_model'] = "crm.lead"
+ context['active_ids'] = [ref("crm_lead_democustomer")]
+ self.action_add(cr, uid, [ref("crm_add_note_0")], context=context)
+
+-
+ I Copying this lead "Test Customer" to New Lead.
+-
+ !python {model: crm.lead}: |
+ self.copy(cr, uid, ref("crm_lead_democustomer"))
+-
+ I checking the Lead Copied or Not.
+-
+ !python {model: crm.lead}: |
+ sid = self.search(cr, uid, [('name', '=', 'Test Customer'),('state', '=', 'draft')])
+ if not sid:
+ raise AssertionError("Lead is not copied Successfully")
diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml
index 9b89fff697b..8d851dd58c7 100644
--- a/addons/crm/test/test_crm_meeting.yml
+++ b/addons/crm/test/test_crm_meeting.yml
@@ -1,9 +1,9 @@
- |
- Now I will test Meetings which may be customer meeting or phonecall meeting or
+ I will test Meetings which may be customer meeting or phonecall meeting or
internal Meeting.
- |
- I start by creating a new Meeting.
--
+ I start by creating a new Meeting.
+-
!record {model: crm.meeting, id: crm_meeting_regardingpresentation0}:
categ_id: crm.categ_meet2
date: !eval time.strftime('%Y-%m-%d 16:04:00')
@@ -18,14 +18,14 @@
section_id: crm.section_sales_department
- |
I check that the Meetings is in 'UnConfirmed' state.
--
+-
!assert {model: crm.meeting, id: crm_meeting_regardingpresentation0}:
- - state == "draft"
+ - state == "draft"
- |
- I can set reminder on meeting if I put reminder "40 minutes before"
+ I can set reminder on meeting if I put reminder "40 minutes before" .
- |
For that, I first create alarm.
--
+-
!record {model: res.alarm, id: res_alarm_minituesbefore0}:
name: 40 minutes before
trigger_duration: 40
@@ -33,51 +33,51 @@
trigger_occurs: before
trigger_related: start
- |
- Now I will assign this reminder.
-
+ I will assign this reminder.
+
- !python {model: crm.meeting}: |
self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'alarm_id': ref("res_alarm_minituesbefore0")})
- |
In order to check recurrence on meetings I will set Recurrency to Custom
- and I set the fields so that the meeting will occur weekly on Monday and Friday 10 times
+ and I set the fields so that the meeting will occur weekly on Monday and Friday 10 times.
-
!python {model: crm.meeting}: |
self.write(cr, uid, [ref("crm_meeting_regardingpresentation0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1, 'count':10, 'interval': 1, 'rrule_type': 'weekly'})
-
+
- |
I can see from the calendar view that the meeting is scheduled on Monday and Friday
- for 10 times,
-
+ for 10 times.
+
-
!python {model: crm.meeting}: |
self.fields_view_get(cr, uid, False, 'calendar', context)
-- |
+- |
I will search for one of the recurrent event and count the number of meeting.
-
!python {model: crm.meeting}: |
import time
from datetime import datetime, date, timedelta
ids = self.search(cr, uid, [('date', '>=', time.strftime('%Y-%m-%d 00:00:00')), ('date', '<=', (datetime.now()+timedelta(31)).strftime('%Y-%m-%d 00:00:00')), ('name', '=', 'Regarding Presentation')], context={'virtual_id': True})
- assert len(ids) == 10
+ assert len(ids) == 10
- |
- Now If I want to edit meetings information for all occurrence I click on "Edit All" button.
+ If I want to edit meetings information for all occurrence I click on "Edit All" button.
-
!python {model: crm.meeting}: |
self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'edit_all':'True'},context)
-- |
- I can see that new meeting form is opened with same value
- I change some data for meeting and save it
- I can see from meeting's calendar view that all meeting occurrences are changed accordingly
--
+- |
+ I can see that new meeting form is opened with same value.
+ I change some data for meeting and save it.
+ I can see from meeting's calendar view that all meeting occurrences are changed accordingly.
+-
!record {model: crm.meeting, id: crm.crm_meeting_regardingpresentation0}:
alarm_id: base_calendar.alarm9
rrule_type: weekly
-- |
+- |
In order to invite people for this meetings, I click on "Invite People" button
- I can invite internal user.
--
+ I can invite internal user.
+-
!record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}:
type: internal
send_mail: False
@@ -85,13 +85,13 @@
user_ids:
- base.user_demo
-
- I click on "Invite" button of "Invite attendee" wizard.
+ I click on "Invite" button of "Invite attendee" wizard.
-
!python {model: base_calendar.invite.attendee}: |
- self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'})
+ self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'})
- |
- After direct/indirect confirmation for meetings I can confirm meeting
+ After direct/indirect confirmation for meetings I can confirm meeting.
-
!python {model: crm.meeting}: |
self.case_open(cr, uid, [ref('crm_meeting_regardingpresentation0')])
diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml
index 7640cc67815..734a1cae46c 100644
--- a/addons/crm/test/test_crm_opportunity.yml
+++ b/addons/crm/test/test_crm_opportunity.yml
@@ -11,18 +11,17 @@
stage_id: crm.stage_lead1
categ_id: crm.categ_oppor2
section_id: crm.section_sales_department
-
- |
I check that the opportunity is in 'New' state.
-
!assert {model: crm.lead, id: crm_opportunity_abcfuelcounits0}:
- state == "draft"
-- |
- I open opportunity by click on "Open" button,
--
- !python {model: crm.lead}: |
- self.case_open(cr, uid, [ref("crm_opportunity_abcfuelcounits0")])
+- |
+ I check that phonecall record is created for that opportunity.
+-
+ !python {model: crm.phonecall}: |
+ phone_obj = self.pool.get('crm.phonecall')
- |
I schedule Meeting on this current opportunity by clicking on "schedule
Meeting".
@@ -33,7 +32,7 @@
- |
I can see that Meeting's calendar view is shown.
then I click on the date on which I want to schedule meeting.
- I fill proper data for that meeting and save it
+ I fill proper data for that meeting and save it.
-
!record {model: crm.meeting, id: crm_meeting_abcfuelcounits0}:
date: !eval time.strftime('%Y-%m-%d 00:00:00')
@@ -51,13 +50,13 @@
I click on "schedule call" button and select planned date for the call.
-
!record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}:
- date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')"
+ date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')"
name: 'ABC FUEL CO 829264 - 10002 units'
section_id: crm.section_sales_department
user_id: base.user_demo
categ_id: crm.categ_phone1
- |
- schedule phonecall by apply (action_apply)function of opportunity2phoncall wizard
+ schedule phonecall by opportunity2phoncall wizard.
-
!python {model: crm.opportunity2phonecall}: |
self.action_apply(cr, uid, [ref('crm_opportunity2phonecall_abcfuelcounits0')], {'active_ids': [ref("crm_opportunity_abcfuelcounits0")]})
@@ -72,10 +71,43 @@
I can see phonecall record after click on "Schedule call" wizard.
-
!record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}:
- date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')"
+ date: !eval "(datetime.now() + timedelta(1)).strftime('%Y-%m-%d 11:15:00')"
duration: 3.0
name: 'ABC FUEL CO 829264 - 10002 units'
partner_address_id: base.res_partner_address_1
partner_id: base.res_partner_9
section_id: crm.section_sales_department
-
+- |
+ I Merge the opportunities.
+-
+ for that create two opportunities first opportunity 'Test FUEL CO'.
+-
+ !record {model: crm.lead, id: crm_opportunity_1}:
+ email_from: info@balmerinc.be
+ name: 'Test FUEL CO 829264 - 10002 units'
+ partner_address_id: base.res_partner_address_1
+ partner_id: base.res_partner_9
+ probability: 1.0
+ stage_id: crm.stage_lead1
+ categ_id: crm.categ_oppor2
+ section_id: crm.section_sales_department
+-
+ I create the opportunity 'FUEL CO'.
+-
+ !record {model: crm.lead, id: crm_opportunity_2}:
+ email_from: info@balmerinc.be
+ name: 'FUEL CO 829264 - 10002 units'
+ partner_address_id: base.res_partner_address_1
+ partner_id: base.res_partner_9
+ probability: 1.0
+ stage_id: crm.stage_lead1
+ categ_id: crm.categ_oppor2
+ section_id: crm.section_sales_department
+- |
+ I Merge two Opportunities.
+-
+ !python {model: crm.merge.opportunity}: |
+ op_list = [ref('crm_opportunity_1'),ref('crm_opportunity_2')]
+ op_ids=self.pool.get('crm.lead').browse(cr,uid,op_list)
+ lead_ids = [ref('crm_lead_newcustomer0')]
+ self.merge(cr, uid, op_ids, {'lead_ids': lead_ids})
diff --git a/addons/crm/test/test_crm_opportunity_case2.yml b/addons/crm/test/test_crm_opportunity_case2.yml
new file mode 100644
index 00000000000..dc0dbe517f1
--- /dev/null
+++ b/addons/crm/test/test_crm_opportunity_case2.yml
@@ -0,0 +1,45 @@
+- |
+ I start by creating a new Opportunity. And I select partner for opportunity.
+ I can see that after selecting partner his contact and email is automatically filled.
+-
+ !record {model: crm.lead, id: crm_opportunity_demotestopportunity}:
+ email_from: info@balmerinc.be
+ name: 'Demo Test Opportunity'
+ partner_address_id: base.res_partner_address_1
+ partner_id: base.res_partner_9
+ probability: 1.0
+ categ_id: crm.categ_oppor2
+ section_id: crm.section_sales_department
+ type: opportunity
+-
+ I check that the opportunity is in 'New' state.
+-
+ !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity in Draft}:
+ - state == "draft"
+-
+ I open opportunity by click on "Open" button.
+-
+ !python {model: crm.lead}: |
+ self.case_open(cr, uid, [ref("crm_opportunity_demotestopportunity")])
+-
+ I change partner of the opportunity.
+-
+ !python {model: crm.lead}: |
+ self.onchange_partner_id(cr, uid, [ref("crm_opportunity_demotestopportunity")], ref("base.res_partner_agrolait"))
+
+-
+ I change Contact Detail of the opportunity.
+-
+ !python {model: crm.lead}: |
+ self.onchange_partner_address_id(cr, uid,[ref("crm_opportunity_demotestopportunity")], ref("base.res_partner_address_8invoice"))
+
+-
+ I change Opportunity to Won State.
+-
+ !python {model: crm.lead}: |
+ self.case_mark_won(cr, uid, [ref("crm_opportunity_demotestopportunity")])
+-
+ I check that the opportunity is in 'Done' state.
+-
+ !assert {model: crm.lead, id: crm_opportunity_demotestopportunity, string: Opportunity is Won}:
+ - state == "done"
diff --git a/addons/crm/test/test_crm_partner2opportunity.yml b/addons/crm/test/test_crm_partner2opportunity.yml
new file mode 100644
index 00000000000..fe026074f4f
--- /dev/null
+++ b/addons/crm/test/test_crm_partner2opportunity.yml
@@ -0,0 +1,25 @@
+- |
+ I start by creating a new opportunity from partner.
+-
+ !record {model: crm.partner2opportunity, id: crm_partner2opportunity_id_0}:
+ name: test
+ planned_revenue: 0.0
+ partner_id: base.res_partner_9
+ probability: 0.0
+-
+ I click on "Create Opportunity" button of this wizard.
+-
+ !python {model: crm.partner2opportunity}: |
+ fields = {
+ 'name': 'test',
+ 'planned_revenue': '0.0',
+ 'partner_id': ref('base.res_partner_9'),
+ 'probability': '0.0'
+ }
+ self.default_get(cr, uid, fields, {"active_ids": [ref("crm_partner2opportunity_id_0")]})
+- |
+ In order to check the opportunity is created or not, I check type.
+-
+ !python {model: crm.partner2opportunity}: |
+ opportunity = self.make_opportunity(cr, uid, [ref("crm_partner2opportunity_id_0")], {"active_ids": [ref("crm_partner2opportunity_id_0")]})
+ assert True
diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml
index 1885e34a5ce..0754a5b9544 100644
--- a/addons/crm/test/test_crm_phonecall.yml
+++ b/addons/crm/test/test_crm_phonecall.yml
@@ -7,16 +7,19 @@
duration: 2.0
section_id: crm.section_sales_department
-
- Now , I select partner by click on "Create a Partner" button.
+ I select partner by click on "Create a Partner" button.
-
!record {model: crm.phonecall2partner, id: crm_phonecall2partner_1}:
action: exist
partner_id: base.res_partner_9
-
- Now, click on "Continue" button of this wizard.
+ I click on "Continue" button of this wizard and make partner.
-
!python {model: crm.phonecall2partner}: |
+
+ self._select_partner(cr, uid,{"active_ids": [ref("crm_phonecall_interviewcall0")]})
+ self.open_create_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
- |
@@ -28,31 +31,28 @@
partner_id: base.res_partner_9
planned_revenue: 0.0
probability: 0.0
--
- Now, I click on "Convert" button of this wizard.
--
- !python {model: crm.phonecall2opportunity}: |
- self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")})
-
- |
I can see that a business opportunity is now assigned to this phonecall
-
!assert {model: crm.phonecall, id: crm_phonecall_interviewcall0}:
- opportunity_id != False
-
+-
+ I click on "Convert" button of this wizard.
+-
+ !python {model: crm.phonecall2opportunity}: |
+ self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")})
- |
And I check that the phonecall and the newly created business opportunity is linked
- to same partner
+ to same partner.
-
!python {model: crm.phonecall}: |
obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0'))
ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)])
obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0]
assert obj_phonecall.partner_id == obj_opp.partner_id
-
- |
I schedule Meeting on this current phonecall by clicking on "schedule
- Meeting"
+ Meeting".
-
!python {model: crm.phonecall}: |
self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')])
@@ -60,7 +60,7 @@
- |
I can see that Meeting's calendar view is shown.
then I click on the date on which I want schedule meeting.
- I fill proper data for that meeting and save it
+ I fill proper data for that meeting and save it.
-
!record {model: crm.meeting, id: crm_meeting_interviewcall0}:
alarm_id: base_calendar.alarm3
@@ -85,9 +85,32 @@
name: Interview call
section_id: crm.section_sales_department
user_id: base.user_root
+ action: schedule
+ categ_id: crm.categ_phone1
+-
+ I click on "schedule other call" button. and plan for other call.
+-
+ !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall1}:
+ date: !eval "'%s-%s-%s 19:49:00' %(datetime.now().year,datetime.now().month,datetime.now().day)"
+ name: Interview call
+ section_id: crm.section_sales_department
+ user_id: base.user_root
+ action: log
categ_id: crm.categ_phone1
- |
I click on "Schedule" button of this wizard.
-
!python {model: crm.phonecall2phonecall}: |
+ fields = {
+ 'name': 'Interview call',
+ 'section_id': ref('crm.section_sales_department'),
+ 'user_id': ref('base.user_root'),
+ 'categ_id': ref('crm.categ_phone1')
+ }
+ self.default_get(cr, uid, fields,{'active_id': ref('crm_phonecall_interviewcall0')})
self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')})
+- |
+ I click on "Schedule" button of this wizard with log option.
+-
+ !python {model: crm.phonecall2phonecall}: |
+ self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall1')], {'active_id': ref('crm_phonecall_interviewcall0')})
diff --git a/addons/crm/test/test_crm_phonecall_case2.yml b/addons/crm/test/test_crm_phonecall_case2.yml
new file mode 100644
index 00000000000..1b07121183c
--- /dev/null
+++ b/addons/crm/test/test_crm_phonecall_case2.yml
@@ -0,0 +1,26 @@
+- |
+ I start by creating a new phonecall.
+-
+ !record {model: crm.phonecall, id: crm_phonecall_dummycall}:
+ date: !eval time.strftime('%Y-%m-%d 08:00:00')
+ name: Dummy call
+ duration: 0.0
+ section_id: crm.section_sales_department
+ partner_id: base.res_partner_agrolait
+ state: open
+-
+ I change Contact Detail of the Partner.
+-
+ !python {model: crm.phonecall}: |
+ self.onchange_partner_address_id(cr, uid,[ref("crm_phonecall_dummycall")], ref("base.res_partner_address_8invoice"))
+
+-
+ I setting Phone call to Held (Done).
+-
+ !python {model: crm.phonecall}: |
+ self.case_close(cr, uid, [ref("crm_phonecall_dummycall")])
+-
+ I check that the hone call is in 'Held' state.
+-
+ !assert {model: crm.phonecall, id: crm_phonecall_dummycall, string: Phone call Helded}:
+ - state == "done"
diff --git a/addons/crm/test/test_crm_recurrent_meeting_case2.yml b/addons/crm/test/test_crm_recurrent_meeting_case2.yml
index 585c6af73ae..b6afeb6906e 100644
--- a/addons/crm/test/test_crm_recurrent_meeting_case2.yml
+++ b/addons/crm/test/test_crm_recurrent_meeting_case2.yml
@@ -21,7 +21,7 @@
meeting_ids = self.search(cr, uid, [('id', 'in', [ref('crm_meeting_testmeeting0')]),('date','>=','2011-03-13'), ('date_deadline', '<=', '2011-05-13')], context={'virtual_id': True})
assert len(meeting_ids) == 5, 'Recurrent daily meetings are not created !'
-
- Now I create a weekly meeting till a particular end date.
+ I create a weekly meeting till a particular end date.
-
!record {model: crm.meeting, id: crm_meeting_reviewcodewithprogrammer0}:
date: '2011-04-18 11:47:00'
@@ -95,4 +95,3 @@
meeting_ids = self.search(cr, uid, [('recurrent_uid', '=', ref('crm_meeting_reviewcodewithprogrammer0')), ('recurrent_id','=','2011-04-25 12:47:00')], context)
assert meeting_ids, 'Meeting is not edited !'
-
\ No newline at end of file
diff --git a/addons/crm/test/test_crm_segmentation.yml b/addons/crm/test/test_crm_segmentation.yml
new file mode 100644
index 00000000000..5563f1ce52f
--- /dev/null
+++ b/addons/crm/test/test_crm_segmentation.yml
@@ -0,0 +1,38 @@
+- |
+ I will test segmentation which create specific partner categories criteria.
+-
+ I create a new segmentation record.
+-
+ !record {model: crm.segmentation, id: crm_segmentation_id_0}:
+ categ_id: base.res_partner_category_5
+ exclusif: true
+ name: segment
+ som_interval: 0.0
+ sales_purchase_active : True
+-
+ I start the process.
+-
+ !python {model: crm.segmentation}: |
+ self.process_start(cr, uid, [ref("crm_segmentation_id_0")],context)
+-
+ I continue the segmentation process.
+-
+ !python {model: crm.segmentation}: |
+ context.update({'start': True})
+ self.process_continue(cr, uid, [ref("crm_segmentation_id_0")], context)
+-
+ I create the segmentation line.
+-
+ !record {model: crm.segmentation.line, id: crm_segmentation_line_id_0}:
+ expr_name: sale
+ expr_operator: '>'
+ expr_value: 1000.0
+ name: Rule1
+ operator: or
+ segmentation_id: crm_segmentation_id_0
+
+-
+ I check the Segmentation line record.
+-
+ !python {model: crm.segmentation.line}: |
+ self.test(cr, uid, [ref("crm_segmentation_line_id_0")],partner_id=0)
diff --git a/addons/crm/test/test_crm_stage_changes.yml b/addons/crm/test/test_crm_stage_changes.yml
index c9c25bec604..391a328bffe 100644
--- a/addons/crm/test/test_crm_stage_changes.yml
+++ b/addons/crm/test/test_crm_stage_changes.yml
@@ -1,10 +1,10 @@
-
In order to test the changes on stage of a lead or an opportunity with OpenERP,
I create some leads and test the stage changes.
--
+-
I want to change the probability to 0.0 when the opportunity is marked as lost.
So I set its Change probability automatically true.
--
+-
!record {model: crm.case.stage, id: crm.stage_lead6}:
name: Lost
on_change: true
@@ -12,9 +12,9 @@
section_ids:
- crm.section_sales_department
sequence: 0
--
+-
I create a lead 'Test Lead1'.
--
+-
!record {model: crm.lead, id: crm_lead_openerppresentation0}:
categ_id: crm.categ_oppor4
day_close: 0.0
@@ -29,7 +29,17 @@
!python {model: crm.lead}: |
self.case_open(cr, uid, [ref('crm_lead_openerppresentation0')])
-
- I find that this lead can be converted to opportunity.
+ I assigning stage.
+-
+ !python {model: crm.lead}: |
+ self.onchange_stage_id(cr, uid, [ref('crm_lead_openerppresentation0')], [], context)
+-
+ I assigning percent.
+-
+ !python {model: crm.lead}: |
+ self.stage_find_percent(cr, uid, 10.0, [])
+-
+ I find that this lead can be converted to opportunity.
-
!record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner0}:
action: 'create'
@@ -51,7 +61,7 @@
!python {model: crm.lead}: |
self.case_mark_lost(cr, uid, [ref('crm_lead_openerppresentation0')])
-
- Now I check whether the probability is set according to stage change or not.
+ I check whether the probability is set according to stage change or not.
-
!python {model: crm.lead}: |
opportunity = self.browse(cr, uid, ref('crm_lead_openerppresentation0'))
diff --git a/addons/crm/wizard/crm_lead_to_partner.py b/addons/crm/wizard/crm_lead_to_partner.py
index 790c6222de6..88ccacffef5 100644
--- a/addons/crm/wizard/crm_lead_to_partner.py
+++ b/addons/crm/wizard/crm_lead_to_partner.py
@@ -158,6 +158,7 @@ class crm_lead2partner(osv.osv_memory):
'name': lead.partner_name or lead.contact_name or lead.name,
'user_id': lead.user_id.id,
'comment': lead.description,
+ 'address': []
})
contact_obj.create(cr, uid, {
'partner_id': partner_id,
diff --git a/addons/crm/wizard/crm_partner_to_opportunity_view.xml b/addons/crm/wizard/crm_partner_to_opportunity_view.xml
index 762303f06ba..1111bbbbc50 100644
--- a/addons/crm/wizard/crm_partner_to_opportunity_view.xml
+++ b/addons/crm/wizard/crm_partner_to_opportunity_view.xml
@@ -31,17 +31,16 @@
formformnew
-
+
-
+
-
-
-
+
+
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index cb1e7f93eb5..a2ad01e0651 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -106,7 +106,7 @@
-
+
diff --git a/addons/crm_claim/test/test_crm_claim.yml b/addons/crm_claim/test/test_crm_claim.yml
index a99831c0588..9ee130329a7 100644
--- a/addons/crm_claim/test/test_crm_claim.yml
+++ b/addons/crm_claim/test/test_crm_claim.yml
@@ -1,10 +1,10 @@
- |
- Now I check claims which contain customer claim information about document
- related problem, product related problem.
+ I check claims which contain customer claim information about document
+ related problem, product related problem.
- |
- I start by creating new claims for Damaged product as Value Claims with priority High and specify
+ I start by creating new claims for Damaged product as Value Claims with priority High and specify
date of claim at which claim is created.
--
+-
!record {model: crm.claim, id: crm_claim_damagedproduct0}:
categ_id: crm_claim.categ_claim2
date: !eval time.strftime('%Y-%m-%d %H:%M:%S')
@@ -21,13 +21,24 @@
!assert {model: crm.claim, id: crm_claim_damagedproduct0}:
- state == 'draft'
- |
- I can change that stage by next button right on it
+ I can change that stage by next button right on it.
-
!python {model: crm.claim}: |
- self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')])
+ self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')])
- |
- I make this claim as Open
+ I make this claim as Open.
-
!python {model: crm.claim}: |
- self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')])
-
+ self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')])
+- |
+ I am changing partner Assigned to the Claim.
+-
+ !python {model: crm.claim}: |
+ self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], [])
+ self.onchange_partner_id(cr, uid, [ref('crm_claim_damagedproduct0')], ref('base.res_partner_10'))
+- |
+ I am changing partner Address to the Claim.
+-
+ !python {model: crm.claim}: |
+ self.onchange_partner_address_id(cr, uid, [ref('crm_claim_damagedproduct0')], [], email = False)
+
diff --git a/addons/crm_fundraising/crm_fundraising_view.xml b/addons/crm_fundraising/crm_fundraising_view.xml
index 91993ef840c..7c89b68590a 100644
--- a/addons/crm_fundraising/crm_fundraising_view.xml
+++ b/addons/crm_fundraising/crm_fundraising_view.xml
@@ -110,7 +110,7 @@
-
+
diff --git a/addons/crm_fundraising/test/test_crm_fund.yml b/addons/crm_fundraising/test/test_crm_fund.yml
index e310dfa4d47..ef81afeb563 100644
--- a/addons/crm_fundraising/test/test_crm_fund.yml
+++ b/addons/crm_fundraising/test/test_crm_fund.yml
@@ -1,11 +1,11 @@
- |
- Now I start test Fund Raising which contain information about Donation or charity
+ I start test Fund Raising which contain information about Donation or charity
given by user.
- |
- I start by creating new Funds entry for donation for books to poor school children
+ I start by creating new Funds entry for donation for books to poor school children
with cost 500000.00 and category as "Learning And Education"
- I make payment by Cheque so I make sure that the mode on fund is selected as cheque
--
+ I make payment by Cheque so I make sure that the mode on fund is selected as cheque.
+-
!record {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}:
categ_id: crm_fundraising.categ_fund2
email_from: info@balmerinc.be
@@ -21,12 +21,25 @@
!assert {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}:
- state == 'draft'
- |
- Now I open Funds by click on "Open" button
+ I open Funds by click on "Open" button.
-
!python {model: crm.fundraising}: |
- self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])
-- |
- I can close Funds by click on "Done" button.
+ self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])
+-
+ I create the message regarding the all details of fundraising.
-
!python {model: crm.fundraising}: |
- self.case_close(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])
+ msg = {
+ 'subject': 'fundraising_email',
+ 'body_text': 'fundraising details',
+ 'from': 'Administrator ',
+ 'priority':'3',
+ }
+ context = None
+ self.message_new(cr, uid,msg,context)
+
+- |
+ After a request via email now I close this fundraising Request by clicking on "Done" button.
+-
+ !python {model: crm.fundraising}: |
+ self.case_close(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')])
diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py
index 48bc2a1bb2e..97ed007f456 100644
--- a/addons/crm_helpdesk/crm_helpdesk.py
+++ b/addons/crm_helpdesk/crm_helpdesk.py
@@ -71,10 +71,10 @@ class crm_helpdesk(crm.crm_case, osv.osv):
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'probability': fields.float('Probability (%)'),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
- domain="[('section_id','=',section_id),\
- ('object_id.model', '=', 'crm.helpdesk')]"),
- 'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
- 'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
+ domain="['|',('section_id','=',False),('section_id','=',section_id),\
+ ('object_id.model', '=', 'crm.helpdesk')]"),
+ 'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
+ 'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml
index f9f5318bfc2..5b3203f19d0 100644
--- a/addons/crm_helpdesk/crm_helpdesk_view.xml
+++ b/addons/crm_helpdesk/crm_helpdesk_view.xml
@@ -69,7 +69,7 @@
-
+
diff --git a/addons/crm_helpdesk/test/test_crm_helpdesk.yml b/addons/crm_helpdesk/test/test_crm_helpdesk.yml
index 4023fad8c63..eb0a25d2110 100644
--- a/addons/crm_helpdesk/test/test_crm_helpdesk.yml
+++ b/addons/crm_helpdesk/test/test_crm_helpdesk.yml
@@ -10,6 +10,17 @@
partner_address_id: base.res_partner_address_1
partner_id: base.res_partner_9
section_id: crm.section_sales_department
+-
+ I create the message.
+-
+ !python {model: crm.helpdesk}: |
+ msg = {
+ 'subject': 'test_email',
+ 'body_text': 'Testing',
+ 'from': 'Administrator ',
+ }
+ context = None
+ self.message_new(cr, uid,msg,context)
- |
I check that the Helpdesk request is in 'Draft' state.
@@ -17,10 +28,27 @@
!assert {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}:
- state == 'draft'
- |
- In order to make this helpdesk request to be considered I make it "Open"
+ I make it "Open".
-
!python {model: crm.helpdesk}: |
self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')])
+-
+ Update the created message.
+-
+ !python {model: crm.helpdesk}: |
+ vals = {}
+ msg = {
+ 'subject': 'test_email',
+ 'body_text': 'Testing',
+ 'from': 'Administrator ',
+ 'priority': 'done'
+ }
+ context = None
+ default_act = 'pending'
+ try:
+ self.message_update(cr, uid,[ref('crm_helpdesk_somefunctionalquestion0')], msg,context)
+ except:
+ pass
- |
After a proper communication for the request via email I make sure that the request is fulfilled and
I close this HelpDesk Request by clicking on "Close" button.
diff --git a/addons/crm_partner_assign/test/test_crm_partner_assign.yml b/addons/crm_partner_assign/test/test_crm_partner_assign.yml
index a63ae6beaed..359fa8454f6 100644
--- a/addons/crm_partner_assign/test/test_crm_partner_assign.yml
+++ b/addons/crm_partner_assign/test/test_crm_partner_assign.yml
@@ -30,6 +30,11 @@
-
!record {model: res.partner, id: base.res_partner_desertic_hispafuentes}:
grade_id: res_partner_grade_first0
+-
+ I change the User email id or partner if needed.
+-
+ !python {model: res.partner}: |
+ self.geo_localize(cr, uid, [ref('base.res_partner_desertic_hispafuentes')], context)
-
I assgin a reply-to email address to Sales Team.
-
@@ -57,7 +62,44 @@
probability: 0.0
type: opportunity
-
- Now I click on Forward button.
+ I change the assigned partner.
+-
+ !python {model: crm.lead}: |
+ self.onchange_assign_id(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes'), context)
+ self.assign_partner(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], context)
+-
+ I change the User email id or partner if needed.
+-
+ !python {model: crm.lead.forward.to.partner}: |
+ context.update({'history': 'latest', })
+ user = ref('base.user_root')
+ self.on_change_email(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], user)
+ self.on_change_partner(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], ref('base.res_partner_desertic_hispafuentes'))
+-
+ I change in history define.
+-
+ !python {model: crm.lead.forward.to.partner}: |
+ context.update({'history': 'info', })
+ self.on_change_history(cr, uid, [ref('crm_lead_questionnaireonopenerp0')], context.get('history'), context)
+-
+ I check the case history.
+-
+ !python {model: crm.lead.forward.to.partner}: |
+ context.update({'history': 'latest', })
+ self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context)
+
+ context.update({'history': 'info', })
+ self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context)
+
+ context.update({'history': 'whole', })
+ self._get_case_history(cr, uid, context.get('history'), ref('crm_lead_questionnaireonopenerp0'), context=context)
+-
+ I get lead details.
+-
+ !python {model: crm.lead.forward.to.partner}: |
+ self.get_lead_details(cr, uid, ref('crm_lead_questionnaireonopenerp0'), context)
+-
+ I click on Forward button.
-
!python {model: crm.lead.forward.to.partner}: |
from tools import config
@@ -67,9 +109,29 @@
'email_from': 'Administrator ',
'reply_to': 'sales_openerp@openerp.com',
'state': 'draft',
+ 'history': 'latest',
}
ids = self.create(cr, uid, vals, context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
host = config.get('smtp_user', '127.0.0.1')
assert config.get(host, True), 'SMTP not configured !'
- self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
-
+ try:
+ self.action_forward(cr, uid, [ids], context={'active_id': ref('crm_lead_questionnaireonopenerp0'), 'active_model': 'crm.lead'})
+ except:
+ pass
+-
+ I create the opportunity.
+-
+ !record {model: crm.lead, id: crm_opportunity2}:
+ email_from: info@balmerinc.be
+ name: 'FUEL CO 829264 - 10002 units'
+ partner_address_id: base.res_partner_address_1
+ partner_id: base.res_partner_9
+ probability: 1.0
+ stage_id: crm.stage_lead1
+ categ_id: crm.categ_oppor2
+ section_id: crm.section_sales_department
+- |
+ I Update the data.
+-
+ !python {model: crm.merge.opportunity}: |
+ self._update_data([ref('crm_opportunity2')], ref('crm_lead_questionnaireonopenerp0'))
diff --git a/addons/crm_profiling/__openerp__.py b/addons/crm_profiling/__openerp__.py
index c76278201b1..98d69aca7b5 100644
--- a/addons/crm_profiling/__openerp__.py
+++ b/addons/crm_profiling/__openerp__.py
@@ -41,6 +41,7 @@ It also has been merged with the earlier CRM & SRM segmentation tool because the
'init_xml': [],
'update_xml': ['security/ir.model.access.csv', 'crm_profiling_view.xml'],
'demo_xml': ['crm_profiling_demo.xml'],
+ 'test': ['test/test_crm_profiling.yml'],
'installable': True,
'active': False,
'certificate': '0033984979005',
diff --git a/addons/crm_profiling/test/test_crm_profiling.yml b/addons/crm_profiling/test/test_crm_profiling.yml
new file mode 100644
index 00000000000..2b70cac592b
--- /dev/null
+++ b/addons/crm_profiling/test/test_crm_profiling.yml
@@ -0,0 +1,77 @@
+- |
+ I check segmentation which allows users to perform segmentation within partners.
+-
+ I create a crm profiling question record.
+-
+ !record {model: crm_profiling.question, id: crm_profiling_question_openerppartner0}:
+ answers_ids:
+ - name: 'no'
+ name: OpenERP partner?
+-
+ I create a crm profiling answer record.
+-
+ !record {model: crm_profiling.answer, id: crm_profiling_answer_openerppartner0}:
+ name: 'yes'
+ question_id: crm_profiling_question_openerppartner0
+-
+ I create Partner category Customers.
+-
+ !record {model: res.partner.category, id: res_partner_category_customers0}:
+ name: Customers
+- |
+ I'm creating new partner "John" with his email "info@mycustomer.com".
+-
+ !record {model: res.partner, id: res_partner_john0}:
+ address:
+ - city: Bruxelles
+ country_id: base.be
+ street: Rue des Palais 51, bte 33
+ type: default
+ zip: '1000'
+ email: 'info@mycustomer.com'
+ name: John
+ category_id:
+ - res_partner_category_customers0
+ answers_ids:
+ - crm_profiling_answer_openerppartner0
+
+-
+ Define the answers and category to partner.
+-
+ !python {model: res.partner}: |
+ data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')}
+ self._questionnaire_compute(cr, uid, data, context)
+- |
+ I start by creating new Questionnaire.
+-
+ !record {model: crm_profiling.questionnaire, id: crm_profiling_questionnaire_basequestionnaire0}:
+ description: First questionnaire.
+ name: Base questionnaire
+ questions_ids:
+ - crm_profiling.activity_sector
+ - crm_profiling.nb_employees
+ - crm_profiling.partner_level
+- |
+ I create the form for the "Base questionnaire".
+-
+ !python {model: crm_profiling.questionnaire}: |
+ context.update({'active_id':ref('res_partner_john0')})
+ data ={'form': {'questionnaire_name': ref('res_partner_john0')}, 'ids': [ref('res_partner_john0')], 'report_type': 'pdf', 'model': 'res.partner', 'id': ref('res_partner_john0')}
+ self.build_form(cr, uid, data, context)
+-
+ I create a segmentation record.
+-
+ !record {model: crm.segmentation, id: crm_segmentation_test1}:
+ answer_yes:
+ - crm_profiling_answer_openerppartner0
+ categ_id: res_partner_category_customers0
+ name: test
+ parent_id: crm_profiling.crm_segmentation0
+ profiling_active: true
+ som_interval: 0.0
+- |
+ I continue the process of segmentation.
+-
+ !python {model: crm.segmentation}: |
+ self.process_continue(cr, uid, [ref('crm_segmentation_test1')], start=False)
+
diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py
index 55199a9aa19..94a21289925 100644
--- a/addons/delivery/delivery.py
+++ b/addons/delivery/delivery.py
@@ -238,6 +238,25 @@ class delivery_grid_line(osv.osv):
delivery_grid_line()
+class define_delivery_steps(osv.osv_memory):
+ _name = 'delivery.define.delivery.steps.wizard'
+
+ _columns = {
+ 'picking_policy' : fields.selection([('direct', 'Partial Delivery'), ('one', 'Complete Delivery'),],
+ 'Picking Policy', required=True),
+ }
+
+ def apply_cb(self, cr, uid, ids, context=None):
+ ir_values_obj = self.pool.get('ir.values')
+
+ wizard = self.browse(cr, uid, ids, context=context)[0]
+
+ ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], wizard.picking_policy)
+
+ return {'type' : 'ir.actions.act_window_close'}
+
+define_delivery_steps()
+
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml
index 4ade9b321a7..23147a2716f 100644
--- a/addons/delivery/delivery_view.xml
+++ b/addons/delivery/delivery_view.xml
@@ -72,7 +72,7 @@
- Delivery Method
+ Define Delivery Methodsir.actions.act_windowdelivery.carrierform
@@ -332,8 +332,36 @@
+ 10
+
+ delivery.define_delivery_steps
+ delivery.define.delivery.steps.wizard
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Setup Your Delivery Steps
+ delivery.define.delivery.steps.wizard
+ form
+ form
+ new
+
+
+
+
+
diff --git a/addons/document_webdav/dav_fs.py b/addons/document_webdav/dav_fs.py
index d21dcdc0335..c167d90ba42 100644
--- a/addons/document_webdav/dav_fs.py
+++ b/addons/document_webdav/dav_fs.py
@@ -455,7 +455,7 @@ class openerp_dav_handler(dav_interface):
def get_cr(self, uri, allow_last=False):
""" Split the uri, grab a cursor for that db
"""
- pdb = self.parent.auth_proxy.last_auth
+ pdb = self.parent.auth_provider.last_auth
dbname, uri2 = self.get_db(uri, rest_ret=True, allow_last=allow_last)
uri2 = (uri2 and uri2.split('/')) or []
if not dbname:
@@ -463,10 +463,10 @@ class openerp_dav_handler(dav_interface):
# if dbname was in our uri, we should have authenticated
# against that.
assert pdb == dbname, " %s != %s" %(pdb, dbname)
- res = self.parent.auth_proxy.auth_creds.get(dbname, False)
+ res = self.parent.auth_provider.auth_creds.get(dbname, False)
if not res:
- self.parent.auth_proxy.checkRequest(self.parent, uri, dbname)
- res = self.parent.auth_proxy.auth_creds[dbname]
+ self.parent.auth_provider.checkRequest(self.parent, uri, dbname)
+ res = self.parent.auth_provider.auth_creds[dbname]
user, passwd, dbn2, uid = res
db,pool = pooler.get_db_and_pool(dbname)
cr = db.cursor()
diff --git a/addons/document_webdav/webdav_server.py b/addons/document_webdav/webdav_server.py
index e23daab9f66..aeff0a23f25 100644
--- a/addons/document_webdav/webdav_server.py
+++ b/addons/document_webdav/webdav_server.py
@@ -40,7 +40,7 @@ from dav_fs import openerp_dav_handler
from tools.config import config
from DAV.WebDAVServer import DAVRequestHandler
from service import http_server
-from service.websrv_lib import HTTPDir, FixSendError, HttpOptions
+from service.websrv_lib import FixSendError, HttpOptions
from BaseHTTPServer import BaseHTTPRequestHandler
import urlparse
import urllib
@@ -174,11 +174,11 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler):
pass
elif self.close_connection == 1: # close header already sent
pass
- else:
- if headers is None:
- headers = {}
- if self.headers.get('Connection',False) == 'Keep-Alive':
- headers['Connection'] = 'keep-alive'
+ elif headers and self.headers.get('Connection',False) == 'Keep-Alive':
+ headers['Connection'] = 'keep-alive'
+
+ if headers is None:
+ headers = {}
DAVRequestHandler.send_body(self, DATA, code=code, msg=msg, desc=desc,
ctype=ctype, headers=headers)
@@ -572,7 +572,7 @@ try:
conf = OpenDAVConfig(**_dc)
handler._config = conf
- reg_http_service(HTTPDir(directory,DAVHandler,DAVAuthProvider()))
+ reg_http_service(directory, DAVHandler, DAVAuthProvider)
logging.getLogger('webdav').info("WebDAV service registered at path: %s/ "% directory)
if not (config.get_misc('webdav', 'no_root_hack', False)):
@@ -592,9 +592,7 @@ try:
# the StaticHttpHandler can find its dir_path.
config.misc.setdefault('static-http',{})['dir_path'] = dir_path
- if reg_http_service(HTTPDir('/', DAVStaticHandler)):
- logging.getLogger("web-services").info("WebDAV registered HTTP dir %s for /" % \
- (dir_path))
+ reg_http_service('/', DAVStaticHandler)
except Exception, e:
logging.getLogger('webdav').error('Cannot launch webdav: %s' % e)
@@ -613,8 +611,7 @@ def init_well_known():
reps['/'+uri] = path
if int(num_svcs):
- if http_server.reg_http_service(HTTPDir('/.well-known', RedirectHTTPHandler)):
- logging.getLogger("web-services").info("Registered HTTP redirect handler at /.well-known" )
+ reg_http_service('/.well-known', RedirectHTTPHandler)
init_well_known()
@@ -641,7 +638,7 @@ def init_principals_redirect():
dbname = config.get('db_name', False)
if dbname:
PrincipalsRedirect.redirect_paths[''] = '/webdav/%s/principals' % dbname
- reg_http_service(HTTPDir('/principals', PrincipalsRedirect))
+ reg_http_service('/principals', PrincipalsRedirect)
logging.getLogger("web-services").info(
"Registered HTTP redirect handler for /principals to the %s db.",
dbname)
diff --git a/addons/event/i18n/da.po b/addons/event/i18n/da.po
new file mode 100644
index 00000000000..3e36a6a53ee
--- /dev/null
+++ b/addons/event/i18n/da.po
@@ -0,0 +1,1229 @@
+# Danish translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:15+0000\n"
+"PO-Revision-Date: 2011-09-23 14:35+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Danish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2011-09-24 04:58+0000\n"
+"X-Generator: Launchpad (build 14012)\n"
+
+#. module: event
+#: view:event.event:0
+msgid "Invoice Information"
+msgstr "Faktura information"
+
+#. module: event
+#: help:event.event,register_max:0
+msgid "Provide Maximun Number of Registrations"
+msgstr ""
+
+#. module: event
+#: view:partner.event.registration:0
+msgid "Event Details"
+msgstr ""
+
+#. module: event
+#: field:event.event,main_speaker_id:0
+msgid "Main Speaker"
+msgstr "Hovedtaler"
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+#: view:report.event.registration:0
+msgid "Group By..."
+msgstr ""
+
+#. module: event
+#: field:event.event,register_min:0
+msgid "Minimum Registrations"
+msgstr ""
+
+#. module: event
+#: model:ir.model,name:event.model_event_confirm_registration
+msgid "Confirmation for Event Registration"
+msgstr ""
+
+#. module: event
+#: field:event.registration.badge,title:0
+msgid "Title"
+msgstr ""
+
+#. module: event
+#: field:event.event,mail_registr:0
+msgid "Registration Email"
+msgstr ""
+
+#. module: event
+#: model:ir.actions.act_window,name:event.action_event_confirm_registration
+msgid "Make Invoices"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+msgid "Registration Date"
+msgstr ""
+
+#. module: event
+#: help:event.event,main_speaker_id:0
+msgid "Speaker who are giving speech on event."
+msgstr ""
+
+#. module: event
+#: view:partner.event.registration:0
+msgid "_Close"
+msgstr ""
+
+#. module: event
+#: model:event.event,name:event.event_0
+msgid "Concert of Bon Jovi"
+msgstr ""
+
+#. module: event
+#: help:event.event,unit_price:0
+msgid ""
+"This will be the default price used as registration cost when invoicing this "
+"event. Note that you can specify for each registration a specific amount if "
+"you want to"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "March"
+msgstr "Marts"
+
+#. module: event
+#: field:event.event,mail_confirm:0
+msgid "Confirmation Email"
+msgstr ""
+
+#. module: event
+#: code:addons/event/wizard/event_make_invoice.py:63
+#, python-format
+msgid "Registration doesn't have any partner to invoice."
+msgstr ""
+
+#. module: event
+#: field:event.event,company_id:0
+#: field:event.registration,company_id:0
+#: view:report.event.registration:0
+#: field:report.event.registration,company_id:0
+msgid "Company"
+msgstr "Virksomhed"
+
+#. module: event
+#: field:event.make.invoice,invoice_date:0
+msgid "Invoice Date"
+msgstr "Faktura dato"
+
+#. module: event
+#: code:addons/event/wizard/partner_event_registration.py:93
+#: view:event.registration:0
+#: model:ir.actions.act_window,name:event.action_partner_event_registration
+#: model:ir.model,name:event.model_event_registration
+#: view:partner.event.registration:0
+#, python-format
+msgid "Event Registration"
+msgstr ""
+
+#. module: event
+#: view:report.event.registration:0
+msgid "Last 7 Days"
+msgstr "Seneste 7 dage"
+
+#. module: event
+#: field:event.event,parent_id:0
+msgid "Parent Event"
+msgstr ""
+
+#. module: event
+#: model:ir.actions.act_window,name:event.action_make_invoices
+msgid "Make Invoice"
+msgstr ""
+
+#. module: event
+#: field:event.registration,price_subtotal:0
+msgid "Subtotal"
+msgstr ""
+
+#. module: event
+#: view:report.event.registration:0
+msgid "Event on Registration"
+msgstr ""
+
+#. module: event
+#: view:report.event.registration:0
+msgid "Current Events"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "Add Internal Note"
+msgstr ""
+
+#. module: event
+#: model:ir.actions.act_window,name:event.action_report_event_registration
+#: model:ir.model,name:event.model_report_event_registration
+#: model:ir.ui.menu,name:event.menu_report_event_registration
+#: view:report.event.registration:0
+msgid "Events Analysis"
+msgstr ""
+
+#. module: event
+#: field:event.registration,message_ids:0
+msgid "Messages"
+msgstr ""
+
+#. module: event
+#: field:event.event,mail_auto_confirm:0
+msgid "Mail Auto Confirm"
+msgstr ""
+
+#. module: event
+#: model:product.template,name:event.event_product_1_product_template
+msgid "Ticket for Opera"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:122
+#: view:event.event:0
+#, python-format
+msgid "Confirm Event"
+msgstr ""
+
+#. module: event
+#: selection:event.event,state:0
+#: selection:event.registration,state:0
+#: selection:report.event.registration,state:0
+msgid "Cancelled"
+msgstr ""
+
+#. module: event
+#: field:event.event,reply_to:0
+msgid "Reply-To"
+msgstr "Svar til"
+
+#. module: event
+#: model:ir.actions.act_window,name:event.open_board_associations_manager
+msgid "Event Dashboard"
+msgstr ""
+
+#. module: event
+#: model:event.event,name:event.event_1
+msgid "Opera of Verdi"
+msgstr ""
+
+#. module: event
+#: field:event.event,pricelist_id:0
+msgid "Pricelist"
+msgstr "Prisliste"
+
+#. module: event
+#: field:event.registration,contact_id:0
+msgid "Partner Contact"
+msgstr ""
+
+#. module: event
+#: model:ir.model,name:event.model_event_registration_badge
+msgid "event.registration.badge"
+msgstr ""
+
+#. module: event
+#: field:event.registration,ref:0
+msgid "Reference"
+msgstr ""
+
+#. module: event
+#: help:event.event,date_end:0
+#: help:partner.event.registration,end_date:0
+msgid "Closing Date of Event"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "Emails"
+msgstr "E-mails"
+
+#. module: event
+#: view:event.registration:0
+msgid "Extra Info"
+msgstr "Ekstra information"
+
+#. module: event
+#: code:addons/event/wizard/event_make_invoice.py:83
+#, python-format
+msgid "Customer Invoices"
+msgstr ""
+
+#. module: event
+#: selection:event.event,state:0
+#: selection:report.event.registration,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: event
+#: field:event.type,name:0
+msgid "Event type"
+msgstr ""
+
+#. module: event
+#: model:ir.model,name:event.model_event_type
+msgid " Event Type "
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+#: field:event.registration,event_id:0
+#: model:ir.model,name:event.model_event_event
+#: model:ir.module.module,shortdesc:event.module_meta_information
+#: field:partner.event.registration,event_id:0
+#: view:report.event.registration:0
+#: field:report.event.registration,event_id:0
+#: view:res.partner:0
+msgid "Event"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+#: field:event.registration,badge_ids:0
+msgid "Badges"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: selection:event.event,state:0
+#: view:event.registration:0
+#: selection:event.registration,state:0
+#: selection:report.event.registration,state:0
+msgid "Confirmed"
+msgstr ""
+
+#. module: event
+#: view:event.confirm.registration:0
+msgid "Registration Confirmation"
+msgstr ""
+
+#. module: event
+#: help:event.event,pricelist_id:0
+msgid "Pricelist version for current event."
+msgstr ""
+
+#. module: event
+#: help:event.event,product_id:0
+msgid ""
+"The invoices of this event registration will be created with this Product. "
+"Thus it allows you to set the default label and the accounting info you want "
+"by default on these invoices."
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "Misc"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: field:event.event,speaker_ids:0
+msgid "Other Speakers"
+msgstr ""
+
+#. module: event
+#: model:ir.model,name:event.model_event_make_invoice
+msgid "Event Make Invoice"
+msgstr ""
+
+#. module: event
+#: help:event.registration,nb_register:0
+msgid "Number of Registrations or Tickets"
+msgstr ""
+
+#. module: event
+#: code:addons/event/wizard/event_make_invoice.py:50
+#: code:addons/event/wizard/event_make_invoice.py:54
+#: code:addons/event/wizard/event_make_invoice.py:58
+#: code:addons/event/wizard/event_make_invoice.py:62
+#, python-format
+msgid "Warning !"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "Send New Email"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Location"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "Reply"
+msgstr ""
+
+#. module: event
+#: field:event.event,register_current:0
+#: view:report.event.registration:0
+msgid "Confirmed Registrations"
+msgstr ""
+
+#. module: event
+#: field:event.event,mail_auto_registr:0
+msgid "Mail Auto Register"
+msgstr ""
+
+#. module: event
+#: field:event.event,type:0
+#: field:partner.event.registration,event_type:0
+msgid "Type"
+msgstr ""
+
+#. module: event
+#: field:event.registration,email_from:0
+msgid "Email"
+msgstr "E-mail"
+
+#. module: event
+#: field:event.registration,tobe_invoiced:0
+msgid "To be Invoiced"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:394
+#, python-format
+msgid "Error !"
+msgstr "Fejl!"
+
+#. module: event
+#: field:event.registration,create_date:0
+msgid "Creation Date"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+#: view:res.partner:0
+msgid "Cancel Registration"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:395
+#, python-format
+msgid "Registered partner doesn't have an address to make the invoice."
+msgstr ""
+
+#. module: event
+#: field:event.registration,nb_register:0
+msgid "Quantity"
+msgstr ""
+
+#. module: event
+#: help:event.event,type:0
+msgid "Type of Event like Seminar, Exhibition, Conference, Training."
+msgstr ""
+
+#. module: event
+#: help:event.event,mail_confirm:0
+msgid ""
+"This email will be sent when the event gets confimed or when someone "
+"subscribes to a confirmed event. This is also the email sent to remind "
+"someone about the event."
+msgstr ""
+
+#. module: event
+#: help:event.event,register_prospect:0
+msgid "Total of Prospect Registrati./event/event.py:41:ons"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "July"
+msgstr "Juli"
+
+#. module: event
+#: view:event.event:0
+msgid "Event Organization"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "History Information"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "Dates"
+msgstr "Datoer"
+
+#. module: event
+#: view:event.confirm:0
+#: view:event.confirm.registration:0
+msgid "Confirm Anyway"
+msgstr ""
+
+#. module: event
+#: code:addons/event/wizard/event_confirm_registration.py:54
+#, python-format
+msgid "Warning: The Event '%s' has reached its Maximum Limit (%s)."
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+#: field:event.registration.badge,registration_id:0
+#: model:ir.actions.act_window,name:event.act_event_list_register_event
+msgid "Registration"
+msgstr ""
+
+#. module: event
+#: field:report.event.registration,nbevent:0
+msgid "Number Of Events"
+msgstr ""
+
+#. module: event
+#: help:event.event,state:0
+msgid ""
+"If event is created, the state is 'Draft'.If event is confirmed for the "
+"particular dates the state is set to 'Confirmed'. If the event is over, the "
+"state is set to 'Done'.If event is cancelled the state is set to 'Cancelled'."
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Cancel Event"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+msgid "Contact"
+msgstr ""
+
+#. module: event
+#: view:report.event.registration:0
+msgid "Last 30 Days"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+#: field:event.registration,partner_id:0
+#: model:ir.model,name:event.model_res_partner
+msgid "Partner"
+msgstr ""
+
+#. module: event
+#: view:board.board:0
+#: model:ir.actions.act_window,name:event.act_event_reg
+#: view:report.event.registration:0
+msgid "Events Filling Status"
+msgstr ""
+
+#. module: event
+#: field:event.make.invoice,grouped:0
+msgid "Group the invoices"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Mailing"
+msgstr ""
+
+#. module: event
+#: model:product.template,name:event.event_product_0_product_template
+msgid "Ticket for Concert"
+msgstr ""
+
+#. module: event
+#: view:board.board:0
+#: field:event.event,register_prospect:0
+msgid "Unconfirmed Registrations"
+msgstr ""
+
+#. module: event
+#: field:event.registration,partner_invoice_id:0
+msgid "Partner Invoiced"
+msgstr ""
+
+#. module: event
+#: field:event.registration,log_ids:0
+msgid "Logs"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: field:event.event,state:0
+#: view:event.registration:0
+#: field:event.registration,state:0
+#: view:report.event.registration:0
+#: field:report.event.registration,state:0
+msgid "State"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "September"
+msgstr "September"
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "December"
+msgstr "December"
+
+#. module: event
+#: field:event.registration,event_product:0
+msgid "Invoice Name"
+msgstr ""
+
+#. module: event
+#: field:report.event.registration,draft_state:0
+msgid " # No of Draft Registrations"
+msgstr ""
+
+#. module: event
+#: view:report.event.registration:0
+#: field:report.event.registration,month:0
+msgid "Month"
+msgstr "Måned"
+
+#. module: event
+#: view:event.event:0
+msgid "Event Done"
+msgstr ""
+
+#. module: event
+#: model:ir.module.module,description:event.module_meta_information
+msgid ""
+"Organization and management of Event.\n"
+"\n"
+" This module allow you\n"
+" * to manage your events and their registrations\n"
+" * to use emails to automatically confirm and send acknowledgements "
+"for any registration to an event\n"
+" * ...\n"
+" A dashboard for associations that includes:\n"
+" * Registration by Events (graph)\n"
+" Note that:\n"
+" - You can define new types of events in\n"
+" Events / Configuration / Types of Events\n"
+" - You can access predefined reports about number of registration per "
+"event or per event category in:\n"
+" Events / Reporting\n"
+msgstr ""
+
+#. module: event
+#: field:event.confirm.registration,msg:0
+msgid "Message"
+msgstr ""
+
+#. module: event
+#: constraint:event.event:0
+msgid "Error ! You cannot create recursive event."
+msgstr ""
+
+#. module: event
+#: field:event.registration,ref2:0
+msgid "Reference 2"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:357
+#: view:report.event.registration:0
+#, python-format
+msgid "Invoiced"
+msgstr "Faktureret"
+
+#. module: event
+#: view:event.event:0
+#: view:report.event.registration:0
+msgid "My Events"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Speakers"
+msgstr ""
+
+#. module: event
+#: view:event.make.invoice:0
+msgid "Create invoices"
+msgstr ""
+
+#. module: event
+#: help:event.registration,email_cc:0
+msgid ""
+"These email addresses will be added to the CC field of all inbound and "
+"outbound emails for this record before being sent. Separate multiple email "
+"addresses with a comma"
+msgstr ""
+
+#. module: event
+#: constraint:res.partner:0
+msgid "Error ! You can not create recursive associated members."
+msgstr ""
+
+#. module: event
+#: view:event.make.invoice:0
+msgid "Do you really want to create the invoice(s) ?"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Beginning Date"
+msgstr ""
+
+#. module: event
+#: field:event.registration,date_closed:0
+msgid "Closed"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: model:ir.actions.act_window,name:event.action_event_view
+#: model:ir.ui.menu,name:event.menu_board_associations_manager
+#: model:ir.ui.menu,name:event.menu_event_event
+#: model:ir.ui.menu,name:event.menu_event_event_assiciation
+#: view:res.partner:0
+msgid "Events"
+msgstr ""
+
+#. module: event
+#: field:partner.event.registration,nb_register:0
+msgid "Number of Registration"
+msgstr ""
+
+#. module: event
+#: field:event.event,child_ids:0
+msgid "Child Events"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "August"
+msgstr "August"
+
+#. module: event
+#: field:res.partner,event_ids:0
+#: field:res.partner,event_registration_ids:0
+msgid "unknown"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "June"
+msgstr "Juni"
+
+#. module: event
+#: help:event.event,mail_auto_registr:0
+msgid ""
+"Check this box if you want to use the automatic mailing for new registration"
+msgstr ""
+
+#. module: event
+#: field:event.registration,write_date:0
+msgid "Write Date"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "My Registrations"
+msgstr ""
+
+#. module: event
+#: view:event.confirm:0
+msgid ""
+"Warning: This Event has not reached its Minimum Registration Limit. Are you "
+"sure you want to confirm it?"
+msgstr ""
+
+#. module: event
+#: field:event.registration,active:0
+msgid "Active"
+msgstr "Aktiv"
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "November"
+msgstr "November"
+
+#. module: event
+#: view:report.event.registration:0
+msgid "Extended Filters..."
+msgstr ""
+
+#. module: event
+#: help:event.event,reply_to:0
+msgid "The email address put in the 'Reply-To' of all emails sent by OpenERP"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "October"
+msgstr "Oktober"
+
+#. module: event
+#: help:event.event,register_current:0
+msgid "Total of Open and Done Registrations"
+msgstr ""
+
+#. module: event
+#: field:event.event,language:0
+msgid "Language"
+msgstr "Sprog"
+
+#. module: event
+#: view:event.registration:0
+#: field:event.registration,email_cc:0
+msgid "CC"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "January"
+msgstr "Januar"
+
+#. module: event
+#: help:event.registration,email_from:0
+msgid "These people will receive email."
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Set To Draft"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:472
+#: view:event.event:0
+#: view:event.registration:0
+#: view:res.partner:0
+#, python-format
+msgid "Confirm Registration"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:report.event.registration:0
+#: view:res.partner:0
+msgid "Date"
+msgstr "Dato"
+
+#. module: event
+#: model:ir.ui.menu,name:event.board_associations
+msgid "Dashboard"
+msgstr "Oversigt"
+
+#. module: event
+#: view:event.event:0
+msgid "Confirmation Email Body"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+#: view:res.partner:0
+msgid "History"
+msgstr ""
+
+#. module: event
+#: field:event.event,address_id:0
+msgid "Location Address"
+msgstr ""
+
+#. module: event
+#: model:ir.ui.menu,name:event.menu_event_type
+#: model:ir.ui.menu,name:event.menu_event_type_association
+msgid "Types of Events"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "Attachments"
+msgstr ""
+
+#. module: event
+#: code:addons/event/wizard/event_make_invoice.py:59
+#, python-format
+msgid "Event related doesn't have any product defined"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Auto Confirmation Email"
+msgstr ""
+
+#. module: event
+#: view:report.event.registration:0
+msgid "Last 365 Days"
+msgstr "Sidste 365 dage"
+
+#. module: event
+#: constraint:event.event:0
+msgid "Error ! Closing Date cannot be set before Beginning Date."
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:442
+#: selection:event.event,state:0
+#: view:event.make.invoice:0
+#: selection:event.registration,state:0
+#: selection:report.event.registration,state:0
+#, python-format
+msgid "Done"
+msgstr ""
+
+#. module: event
+#: field:event.event,date_begin:0
+msgid "Beginning date"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+#: field:event.registration,invoice_id:0
+msgid "Invoice"
+msgstr ""
+
+#. module: event
+#: view:report.event.registration:0
+#: field:report.event.registration,year:0
+msgid "Year"
+msgstr "År"
+
+#. module: event
+#: code:addons/event/event.py:517
+#, python-format
+msgid "Cancel"
+msgstr ""
+
+#. module: event
+#: view:event.confirm:0
+#: view:event.confirm.registration:0
+#: view:event.make.invoice:0
+msgid "Close"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Event by Registration"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:432
+#, python-format
+msgid "Open"
+msgstr ""
+
+#. module: event
+#: field:event.event,user_id:0
+msgid "Responsible User"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:538
+#: code:addons/event/event.py:545
+#, python-format
+msgid "Auto Confirmation: [%s] %s"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+#: field:event.registration,user_id:0
+#: view:report.event.registration:0
+#: field:report.event.registration,user_id:0
+msgid "Responsible"
+msgstr ""
+
+#. module: event
+#: field:event.event,unit_price:0
+#: view:event.registration:0
+#: field:partner.event.registration,unit_price:0
+msgid "Registration Cost"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.registration:0
+msgid "Current"
+msgstr ""
+
+#. module: event
+#: field:event.registration,unit_price:0
+msgid "Unit Price"
+msgstr "Enhedspris"
+
+#. module: event
+#: view:report.event.registration:0
+#: field:report.event.registration,speaker_id:0
+#: field:res.partner,speaker:0
+msgid "Speaker"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+msgid "Details"
+msgstr ""
+
+#. module: event
+#: model:event.event,name:event.event_2
+msgid "Conference on ERP Buisness"
+msgstr ""
+
+#. module: event
+#: field:event.event,section_id:0
+#: field:event.registration,section_id:0
+#: view:report.event.registration:0
+#: field:report.event.registration,section_id:0
+msgid "Sale Team"
+msgstr ""
+
+#. module: event
+#: field:partner.event.registration,start_date:0
+msgid "Start date"
+msgstr ""
+
+#. module: event
+#: field:event.event,date_end:0
+#: field:partner.event.registration,end_date:0
+msgid "Closing date"
+msgstr ""
+
+#. module: event
+#: field:event.event,product_id:0
+#: view:report.event.registration:0
+#: field:report.event.registration,product_id:0
+msgid "Product"
+msgstr "Vare"
+
+#. module: event
+#: view:event.event:0
+#: field:event.event,note:0
+#: view:event.registration:0
+#: field:event.registration,description:0
+msgid "Description"
+msgstr ""
+
+#. module: event
+#: field:report.event.registration,confirm_state:0
+msgid " # No of Confirmed Registrations"
+msgstr ""
+
+#. module: event
+#: model:ir.actions.act_window,name:event.act_register_event_partner
+msgid "Subscribe"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "May"
+msgstr "Maj"
+
+#. module: event
+#: view:res.partner:0
+msgid "Events Registration"
+msgstr ""
+
+#. module: event
+#: help:event.event,mail_registr:0
+msgid "This email will be sent when someone subscribes to the event."
+msgstr ""
+
+#. module: event
+#: model:product.template,name:event.event_product_2_product_template
+msgid "Ticket for Conference"
+msgstr ""
+
+#. module: event
+#: field:event.registration.badge,address_id:0
+msgid "Address"
+msgstr "Adresse"
+
+#. module: event
+#: view:board.board:0
+#: model:ir.actions.act_window,name:event.act_event_view
+msgid "Next Events"
+msgstr ""
+
+#. module: event
+#: view:partner.event.registration:0
+msgid "_Subcribe"
+msgstr ""
+
+#. module: event
+#: model:ir.model,name:event.model_partner_event_registration
+msgid " event Registration "
+msgstr ""
+
+#. module: event
+#: help:event.event,date_begin:0
+#: help:partner.event.registration,start_date:0
+msgid "Beginning Date of Event"
+msgstr ""
+
+#. module: event
+#: selection:event.registration,state:0
+msgid "Unconfirmed"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:542
+#, python-format
+msgid "Auto Registration: [%s] %s"
+msgstr ""
+
+#. module: event
+#: field:event.registration,date_deadline:0
+msgid "End Date"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "February"
+msgstr "Februar"
+
+#. module: event
+#: view:board.board:0
+msgid "Association Dashboard"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: field:event.registration.badge,name:0
+msgid "Name"
+msgstr ""
+
+#. module: event
+#: help:event.event,mail_auto_confirm:0
+msgid ""
+"Check this box if you want ot use the automatic confirmation emailing or the "
+"reminder"
+msgstr ""
+
+#. module: event
+#: field:event.event,country_id:0
+msgid "Country"
+msgstr "Land"
+
+#. module: event
+#: code:addons/event/wizard/event_make_invoice.py:55
+#, python-format
+msgid "Registration is set as Cannot be invoiced"
+msgstr ""
+
+#. module: event
+#: code:addons/event/event.py:500
+#: view:event.event:0
+#: view:event.registration:0
+#: view:res.partner:0
+#, python-format
+msgid "Close Registration"
+msgstr ""
+
+#. module: event
+#: selection:report.event.registration,month:0
+msgid "April"
+msgstr "April"
+
+#. module: event
+#: field:event.event,name:0
+#: field:event.registration,name:0
+msgid "Summary"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: view:event.type:0
+#: view:report.event.registration:0
+#: field:report.event.registration,type:0
+msgid "Event Type"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+#: field:event.event,registration_ids:0
+#: model:ir.actions.act_window,name:event.action_registration
+#: model:ir.ui.menu,name:event.menu_action_registration
+#: model:ir.ui.menu,name:event.menu_action_registration_association
+msgid "Registrations"
+msgstr ""
+
+#. module: event
+#: field:event.registration,date:0
+msgid "Start Date"
+msgstr ""
+
+#. module: event
+#: field:event.event,register_max:0
+#: field:report.event.registration,register_max:0
+msgid "Maximum Registrations"
+msgstr ""
+
+#. module: event
+#: field:report.event.registration,date:0
+msgid "Event Start Date"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Registration Email Body"
+msgstr ""
+
+#. module: event
+#: view:partner.event.registration:0
+msgid "Event For Registration"
+msgstr ""
+
+#. module: event
+#: code:addons/event/wizard/event_make_invoice.py:51
+#, python-format
+msgid "Invoice cannot be created if the registration is in %s state."
+msgstr ""
+
+#. module: event
+#: view:event.confirm:0
+#: model:ir.actions.act_window,name:event.action_event_confirm
+#: model:ir.model,name:event.model_event_confirm
+msgid "Event Confirmation"
+msgstr ""
+
+#. module: event
+#: view:event.event:0
+msgid "Auto Registration Email"
+msgstr ""
+
+#. module: event
+#: view:event.registration:0
+#: view:report.event.registration:0
+#: field:report.event.registration,total:0
+msgid "Total"
+msgstr ""
+
+#. module: event
+#: help:event.event,register_min:0
+msgid "Providee Minimum Number of Registrations"
+msgstr ""
+
+#. module: event
+#: field:event.event,speaker_confirmed:0
+msgid "Speaker Confirmed"
+msgstr ""
+
+#. module: event
+#: model:ir.actions.act_window,help:event.action_event_view
+msgid ""
+"Event is the low level object used by meeting and others documents that "
+"should be synchronized with mobile devices or calendar applications through "
+"caldav. Most of the users should work in the Calendar menu, and not in the "
+"list of events."
+msgstr ""
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index b7460965c3b..f45b5e955a0 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -78,6 +78,22 @@ class fetchmail_server(osv.osv):
'attach': True,
}
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+
+ result = super(fetchmail_server, self).default_get(cr, uid, fields, context=context)
+
+ model = context.pop('fetchmail_model', False) or False
+
+ if isinstance(model, basestring):
+ model_id = self.pool.get('ir.model').search(cr, uid, [('model', '=', model)], context=context)
+ result.update(
+ object_id = model_id[0],
+ )
+
+ return result
+
def onchange_server_type(self, cr, uid, ids, server_type=False, ssl=False):
port = 0
if server_type == 'pop':
diff --git a/addons/sale_margin/report/__init__.py b/addons/fetchmail_crm/__init__.py
similarity index 71%
rename from addons/sale_margin/report/__init__.py
rename to addons/fetchmail_crm/__init__.py
index 2ec61a1e939..5831b3284bb 100644
--- a/addons/sale_margin/report/__init__.py
+++ b/addons/fetchmail_crm/__init__.py
@@ -1,13 +1,13 @@
-# -*- coding: utf-8 -*-
+#-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
+# Copyright (C) 2011 OpenERP S.A. (). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,6 +18,3 @@
# along with this program. If not, see .
#
##############################################################################
-
-import report_margin
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/fetchmail_crm/__openerp__.py b/addons/fetchmail_crm/__openerp__.py
new file mode 100644
index 00000000000..2be9920ee83
--- /dev/null
+++ b/addons/fetchmail_crm/__openerp__.py
@@ -0,0 +1,39 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2011 OpenERP S.A. (). All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+{
+ "name" : "Fetchmail for CRM",
+ "version" : "1.0",
+ "depends" : ["fetchmail", "crm"],
+ "author" : "OpenERP SA",
+ "category": 'Tools',
+ "description": """
+ """,
+ 'website': 'http://www.openerp.com',
+ 'init_xml': [],
+ 'update_xml': [
+ "installer.xml",
+ ],
+ 'demo_xml': [
+ ],
+ 'installable': True,
+ 'active': False,
+}
diff --git a/addons/fetchmail_crm/installer.xml b/addons/fetchmail_crm/installer.xml
new file mode 100644
index 00000000000..def954eb286
--- /dev/null
+++ b/addons/fetchmail_crm/installer.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ Create Leads from Email Account
+ ir.actions.act_window
+ fetchmail.server
+ form
+ form
+ {'default_name' : "Email Account For Leads", 'fetchmail_model' : 'crm.lead'}
+
+
+
+
+
+
+
+
diff --git a/addons/fetchmail_crm_claim/__init__.py b/addons/fetchmail_crm_claim/__init__.py
new file mode 100644
index 00000000000..5831b3284bb
--- /dev/null
+++ b/addons/fetchmail_crm_claim/__init__.py
@@ -0,0 +1,20 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2011 OpenERP S.A. (). All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
diff --git a/addons/fetchmail_crm_claim/__openerp__.py b/addons/fetchmail_crm_claim/__openerp__.py
new file mode 100644
index 00000000000..b8f0fa24470
--- /dev/null
+++ b/addons/fetchmail_crm_claim/__openerp__.py
@@ -0,0 +1,39 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2011 OpenERP S.A. (). All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+{
+ "name" : "Fetchmail for CRM Claim",
+ "version" : "1.0",
+ "depends" : ["fetchmail", "crm_claim"],
+ "author" : "OpenERP SA",
+ "category": 'Tools',
+ "description": """
+ """,
+ 'website': 'http://www.openerp.com',
+ 'init_xml': [],
+ 'update_xml': [
+ "installer.xml",
+ ],
+ 'demo_xml': [
+ ],
+ 'installable': True,
+ 'active': False,
+}
diff --git a/addons/fetchmail_crm_claim/installer.xml b/addons/fetchmail_crm_claim/installer.xml
new file mode 100644
index 00000000000..232d95f6ea2
--- /dev/null
+++ b/addons/fetchmail_crm_claim/installer.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ Create Claims from Email Account
+ ir.actions.act_window
+ fetchmail.server
+ form
+ form
+ {'default_name' : "Email Account For Claims", 'fetchmail_model' : 'crm.claim'}
+
+
+
+
+
+
+
+
diff --git a/addons/fetchmail_hr_recruitment/__init__.py b/addons/fetchmail_hr_recruitment/__init__.py
new file mode 100644
index 00000000000..5831b3284bb
--- /dev/null
+++ b/addons/fetchmail_hr_recruitment/__init__.py
@@ -0,0 +1,20 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2011 OpenERP S.A. (). All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
diff --git a/addons/fetchmail_hr_recruitment/__openerp__.py b/addons/fetchmail_hr_recruitment/__openerp__.py
new file mode 100644
index 00000000000..fd5b8346227
--- /dev/null
+++ b/addons/fetchmail_hr_recruitment/__openerp__.py
@@ -0,0 +1,39 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2011 OpenERP S.A. (). All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+{
+ "name" : "Fetchmail for Applicants",
+ "version" : "1.0",
+ "depends" : ["fetchmail", "hr_recruitment"],
+ "author" : "OpenERP SA",
+ "category": 'Tools',
+ "description": """
+ """,
+ 'website': 'http://www.openerp.com',
+ 'init_xml': [],
+ 'update_xml': [
+ "installer.xml",
+ ],
+ 'demo_xml': [
+ ],
+ 'installable': True,
+ 'active': False,
+}
diff --git a/addons/fetchmail_hr_recruitment/installer.xml b/addons/fetchmail_hr_recruitment/installer.xml
new file mode 100644
index 00000000000..f9dc497f357
--- /dev/null
+++ b/addons/fetchmail_hr_recruitment/installer.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ Create Applicants from Email Account
+ ir.actions.act_window
+ fetchmail.server
+ form
+ form
+ {'default_name' : "Email Account For Applicant", 'fetchmail_model' : 'hr.applicant'}
+
+
+
+
+
+
+
+
diff --git a/addons/fetchmail_project_issue/__init__.py b/addons/fetchmail_project_issue/__init__.py
new file mode 100644
index 00000000000..5831b3284bb
--- /dev/null
+++ b/addons/fetchmail_project_issue/__init__.py
@@ -0,0 +1,20 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2011 OpenERP S.A. (). All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
diff --git a/addons/fetchmail_project_issue/__openerp__.py b/addons/fetchmail_project_issue/__openerp__.py
new file mode 100644
index 00000000000..641012fc9ab
--- /dev/null
+++ b/addons/fetchmail_project_issue/__openerp__.py
@@ -0,0 +1,39 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2011 OpenERP S.A. (). All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+{
+ "name" : "Fetchmail for Project Issue",
+ "version" : "1.0",
+ "depends" : ["fetchmail", "project_issue"],
+ "author" : "OpenERP SA",
+ "category": 'Tools',
+ "description": """
+ """,
+ 'website': 'http://www.openerp.com',
+ 'init_xml': [],
+ 'update_xml': [
+ "installer.xml",
+ ],
+ 'demo_xml': [
+ ],
+ 'installable': True,
+ 'active': False,
+}
diff --git a/addons/fetchmail_project_issue/installer.xml b/addons/fetchmail_project_issue/installer.xml
new file mode 100644
index 00000000000..300ffdc22d1
--- /dev/null
+++ b/addons/fetchmail_project_issue/installer.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ Create Issues from Email Account
+ ir.actions.act_window
+ fetchmail.server
+ form
+ form
+ {'default_name' : "Email Account For Issue", 'fetchmail_model' : 'project.issue'}
+
+
+
+
+
+
+
+
diff --git a/addons/hr/hr_installer.xml b/addons/hr/hr_installer.xml
index 6aae7a3ac85..bd6e7ed3f6b 100644
--- a/addons/hr/hr_installer.xml
+++ b/addons/hr/hr_installer.xml
@@ -1,49 +1,66 @@
-
+
-
- hr.installer.view
- base.setup.installer
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- HR Management
- 5
-
+
+ hr.installer.view
+ base.setup.installer
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- Create your employees
- ir.actions.act_window
- hr.employee
- form
- form
-
-
+
+ HR Management
+ 5
+
-
-
-
-
+
+
+ Create your employees
+ ir.actions.act_window
+ hr.employee
+ form
+ form
+
+
-
+
+
+
+
+
+
+
+ Define Your Department Structure
+ ir.actions.act_window
+ hr.department
+ form
+ tree,form
+
+ Your Company's Department Structure is used to manage all documents related to employees by departments: expenses and timesheet validation, leaves management, recruitments, etc.
+
+
+
+
+
+ 3
+
+
+
diff --git a/addons/hr_contract/hr_contract.py b/addons/hr_contract/hr_contract.py
index 3a6ea844012..4f82d1b3014 100644
--- a/addons/hr_contract/hr_contract.py
+++ b/addons/hr_contract/hr_contract.py
@@ -63,7 +63,7 @@ class hr_contract(osv.osv):
_name = 'hr.contract'
_description = 'Contract'
_columns = {
- 'name': fields.char('Contract Reference', size=32, required=True),
+ 'name': fields.char('Contract Reference', size=64, required=True),
'employee_id': fields.many2one('hr.employee', "Employee", required=True),
'department_id': fields.related('employee_id','department_id', type='many2one', relation='hr.department', string="Department", readonly=True),
'type_id': fields.many2one('hr.contract.type', "Contract Type", required=True),
diff --git a/addons/hr_evaluation/__openerp__.py b/addons/hr_evaluation/__openerp__.py
index adf1d9d69c4..95ef4512d5c 100644
--- a/addons/hr_evaluation/__openerp__.py
+++ b/addons/hr_evaluation/__openerp__.py
@@ -47,8 +47,8 @@ in the form of pdf file. Implements a dashboard for My Current Evaluations
"hr_evaluation_view.xml",
"report/hr_evaluation_report_view.xml",
"board_hr_evaluation_view.xml",
- 'hr_evaluation_installer_view.xml',
'hr_evaluation_data.xml',
+ 'hr_evaluation_installer.xml',
],
"test": ["test/test_hr_evaluation.yml"],
"active": False,
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 7634052704c..d79cf90b915 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -158,7 +158,7 @@ class hr_evaluation(osv.osv):
'survey_request_ids': fields.one2many('hr.evaluation.interview','evaluation_id','Appraisal Forms'),
'plan_id': fields.many2one('hr_evaluation.plan', 'Plan', required=True),
'state': fields.selection([
- ('draft','Draft'),
+ ('draft','New'),
('wait','Plan In Progress'),
('progress','Waiting Appreciation'),
('done','Done'),
diff --git a/addons/hr_evaluation/hr_evaluation_installer.xml b/addons/hr_evaluation/hr_evaluation_installer.xml
new file mode 100644
index 00000000000..4ef0013a4c2
--- /dev/null
+++ b/addons/hr_evaluation/hr_evaluation_installer.xml
@@ -0,0 +1,17 @@
+
+
+
+
+ Review Evaluation Plans
+ ir.actions.act_window
+ hr_evaluation.plan
+ form
+ form,tree
+
+
+
+
+
+
+
+
diff --git a/addons/hr_evaluation/hr_evaluation_installer_view.xml b/addons/hr_evaluation/hr_evaluation_installer_view.xml
deleted file mode 100644
index 27dd0945553..00000000000
--- a/addons/hr_evaluation/hr_evaluation_installer_view.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- Define Your Department Structure
- ir.actions.act_window
- hr.department
- form
- tree,form
-
- Your Company's Department Structure is used to manage all documents related to employees by departments: expenses and timesheet validation, leaves management, recruitments, etc.
-
-
-
-
-
- 3
-
-
-
diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml
index 58c5452799e..2736785b1fe 100644
--- a/addons/hr_evaluation/hr_evaluation_view.xml
+++ b/addons/hr_evaluation/hr_evaluation_view.xml
@@ -201,7 +201,7 @@
-
+
-
+
-
+
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 9ca68bdb55e..2dcb448d3cf 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -111,7 +111,7 @@ class hr_holidays(osv.osv):
_columns = {
'name': fields.char('Description', required=True, size=64),
- 'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
+ 'state': fields.selection([('draft', 'New'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')],
'State', readonly=True, help='The state is set to \'Draft\', when a holiday request is created.\
\nThe state is \'Waiting Approval\', when holiday request is confirmed by user.\
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 58d37490bd7..80a33b0b72c 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -83,7 +83,7 @@
-
+
@@ -126,7 +126,7 @@
-
+
@@ -445,7 +445,7 @@
- Assign Legal Leaves to Employees
+ Allocate Leaves for Employeesir.actions.act_windowhr.employeeform
diff --git a/addons/hr_payroll/security/ir.model.access.csv b/addons/hr_payroll/security/ir.model.access.csv
index d19ec411d5d..4d2afff54c3 100644
--- a/addons/hr_payroll/security/ir.model.access.csv
+++ b/addons/hr_payroll/security/ir.model.access.csv
@@ -13,3 +13,4 @@
"access_hr_payslip_run","hr.payslip.run","model_hr_payslip_run","base.group_hr_manager",1,1,1,1
"access_hr_payslip_input","hr.payslip.input","model_hr_payslip_input","base.group_hr_manager",1,1,1,1
"access_hr_rule_input","hr.rule.input","model_hr_rule_input","base.group_hr_manager",1,1,1,1
+"access_hr_salary_rule_user","hr.salary.rule.user","model_hr_salary_rule","base.group_hr_user",1,1,1,1
\ No newline at end of file
diff --git a/addons/hr_payroll_account/hr_payroll_account.py b/addons/hr_payroll_account/hr_payroll_account.py
index 8e4e73458f2..a2c2a4129a8 100644
--- a/addons/hr_payroll_account/hr_payroll_account.py
+++ b/addons/hr_payroll_account/hr_payroll_account.py
@@ -125,7 +125,7 @@ class hr_payslip(osv.osv):
debit_sum += debit_line[2]['debit'] - debit_line[2]['credit']
if credit_account_id:
line_ids.append(credit_line)
- credit_sum += credit_line[2]['credit'] - credit_line['debit']
+ credit_sum += credit_line[2]['credit'] - credit_line[2]['debit']
if debit_sum > credit_sum:
adjust_credit = (0, 0, {
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 9ad7180441c..77a1bcb7b8f 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -443,6 +443,12 @@ class hr_applicant(crm.crm_case, osv.osv):
self.write(cr, uid, ids, {'date_open': False, 'date_closed': False})
return res
+ def write(self, cr, uid, ids, vals, context=None):
+ if 'stage_id' in vals and vals['stage_id']:
+ stage = self.pool.get('hr.recruitment.stage').browse(cr, uid, vals['stage_id'], context=context)
+ text = _("Changed Stage to: %s") % stage.name
+ self.message_append(cr, uid, ids, text, body_text=text, context=context)
+ return super(hr_applicant,self).write(cr, uid, ids, vals, context=context)
hr_applicant()
diff --git a/addons/hr_recruitment/hr_recruitment_data.xml b/addons/hr_recruitment/hr_recruitment_data.xml
index 9fafbaf1e03..a1d271c01c8 100644
--- a/addons/hr_recruitment/hr_recruitment_data.xml
+++ b/addons/hr_recruitment/hr_recruitment_data.xml
@@ -88,7 +88,6 @@
Job Survey
- draft20
diff --git a/addons/hr_recruitment/hr_recruitment_installer_view.xml b/addons/hr_recruitment/hr_recruitment_installer_view.xml
index 5fdf1df849a..3d7d49d595e 100644
--- a/addons/hr_recruitment/hr_recruitment_installer_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_installer_view.xml
@@ -1,19 +1,19 @@
-
-
- Review Recruitment Stages
- ir.actions.act_window
- hr.recruitment.stage
- form
- tree,form
- Check if the following stages are matching your recruitment process. Don't forget to specify the department if your recruitment process is different according to the job position.
-
-
+
+
+ Review Recruitment Stages
+ ir.actions.act_window
+ hr.recruitment.stage
+ form
+ tree,form
+ Check if the following stages are matching your recruitment process. Don't forget to specify the department if your recruitment process is different according to the job position.
+
+
-
-
-
- 3
-
+
+
+
+ 3
+
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index ff8357b61f6..8dd5e171206 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -132,7 +132,7 @@
-
+
@@ -172,7 +172,7 @@
icon="terp-mail-replied" type="action"/>
-
+
diff --git a/addons/hr_timesheet/__openerp__.py b/addons/hr_timesheet/__openerp__.py
index 411ac68d57b..40e3f720da1 100644
--- a/addons/hr_timesheet/__openerp__.py
+++ b/addons/hr_timesheet/__openerp__.py
@@ -53,6 +53,7 @@ to set up a management by affair.
'wizard/hr_timesheet_print_employee_view.xml',
'wizard/hr_timesheet_print_users_view.xml',
'wizard/hr_timesheet_sign_in_out_view.xml',
+ 'hr_timesheet_installer.xml',
],
'demo_xml': ['hr_timesheet_demo.xml'],
'test': ['test/test_hr_timesheet.yml',
diff --git a/addons/hr_timesheet/hr_timesheet_installer.xml b/addons/hr_timesheet/hr_timesheet_installer.xml
new file mode 100644
index 00000000000..66289ed0c0c
--- /dev/null
+++ b/addons/hr_timesheet/hr_timesheet_installer.xml
@@ -0,0 +1,17 @@
+
+
+
+
+ Define your Analytic Structure
+ ir.actions.act_window
+ account.analytic.account
+ form
+ tree,form
+
+
+
+
+
+
+
+
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
index 66975695814..0e056b81e61 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_final_invoice_create.py
@@ -126,6 +126,8 @@ class final_invoice_create(osv.osv_memory):
taxes = []
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
+ if not account_id:
+ raise osv.except_osv(_("Configuration Error"), _("No income account defined for product '%s'") % product.name)
curr_line = {
'price_unit': -amount,
'quantity': 1.0,
@@ -146,6 +148,8 @@ class final_invoice_create(osv.osv_memory):
taxes = product.taxes_id
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
+ if not account_id:
+ raise osv.except_osv(_("Configuration Error"), _("No income account defined for product '%s'") % product.name)
curr_line = {
'price_unit': account.amount_max - amount_total,
'quantity': 1.0,
diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
index 4372a19a89a..502d35ff2d1 100644
--- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
+++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
@@ -155,6 +155,8 @@ class hr_timesheet_invoice_create(osv.osv_memory):
taxes = product.taxes_id
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
+ if not account_id:
+ raise osv.except_osv(_("Configuration Error"), _("No income account defined for product '%s'") % product.name)
curr_line = {
'price_unit': price,
'quantity': qty,
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index 8f5c9638a53..1983b75d3f6 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -321,10 +321,10 @@ class hr_timesheet_sheet(osv.osv):
return time.strftime('%Y-12-31')
return time.strftime('%Y-%m-%d')
- def _default_employee(self,cr, uid, context=None):
+ def _default_employee(self, cr, uid, context=None):
emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
return emp_ids and emp_ids[0] or False
-
+
_defaults = {
'date_from' : _default_date_from,
'date_current' : lambda *a: time.strftime('%Y-%m-%d'),
@@ -382,6 +382,12 @@ class hr_timesheet_sheet(osv.osv):
raise osv.except_osv(_('Invalid action !'), _('You cannot delete a timesheet which have attendance entries!'))
return super(hr_timesheet_sheet, self).unlink(cr, uid, ids, context=context)
+ def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
+ department_id = False
+ if employee_id:
+ department_id = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).department_id.id
+ return {'value': {'department_id': department_id}}
+
hr_timesheet_sheet()
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 87f212112c5..0e97577298e 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -62,7 +62,7 @@
-
+
@@ -143,8 +143,8 @@
-
-
+
+
diff --git a/addons/html_view/i18n/ar.po b/addons/html_view/i18n/ar.po
new file mode 100644
index 00000000000..e0ffbe9d036
--- /dev/null
+++ b/addons/html_view/i18n/ar.po
@@ -0,0 +1,63 @@
+# Arabic translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:15+0000\n"
+"PO-Revision-Date: 2011-09-26 21:06+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Arabic \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
+"X-Generator: Launchpad (build 14028)\n"
+
+#. module: html_view
+#: field:html.view,name:0
+msgid "Name"
+msgstr "اسم"
+
+#. module: html_view
+#: field:html.view,comp_id:0
+msgid "Company"
+msgstr "شركة"
+
+#. module: html_view
+#: model:ir.actions.act_window,name:html_view.action_html_view_form
+#: model:ir.ui.menu,name:html_view.html_form
+msgid "Html Test"
+msgstr "إختبار HTML"
+
+#. module: html_view
+#: view:html.view:0
+msgid "Html Example"
+msgstr "مثال HTML"
+
+#. module: html_view
+#: model:ir.module.module,shortdesc:html_view.module_meta_information
+msgid "Html View"
+msgstr "عرض HTML"
+
+#. module: html_view
+#: field:html.view,bank_ids:0
+msgid "Banks"
+msgstr "المصارف"
+
+#. module: html_view
+#: model:ir.module.module,description:html_view.module_meta_information
+msgid ""
+"\n"
+" This is the test module which shows html tag supports in normal xml form "
+"view.\n"
+" "
+msgstr ""
+
+#. module: html_view
+#: model:ir.model,name:html_view.model_html_view
+msgid "html.view"
+msgstr ""
diff --git a/addons/html_view/i18n/da.po b/addons/html_view/i18n/da.po
new file mode 100644
index 00000000000..91bd304d59b
--- /dev/null
+++ b/addons/html_view/i18n/da.po
@@ -0,0 +1,63 @@
+# Danish translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:15+0000\n"
+"PO-Revision-Date: 2011-09-24 09:55+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Danish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2011-09-25 04:41+0000\n"
+"X-Generator: Launchpad (build 14012)\n"
+
+#. module: html_view
+#: field:html.view,name:0
+msgid "Name"
+msgstr ""
+
+#. module: html_view
+#: field:html.view,comp_id:0
+msgid "Company"
+msgstr "Virksomhed"
+
+#. module: html_view
+#: model:ir.actions.act_window,name:html_view.action_html_view_form
+#: model:ir.ui.menu,name:html_view.html_form
+msgid "Html Test"
+msgstr "HTML test"
+
+#. module: html_view
+#: view:html.view:0
+msgid "Html Example"
+msgstr ""
+
+#. module: html_view
+#: model:ir.module.module,shortdesc:html_view.module_meta_information
+msgid "Html View"
+msgstr ""
+
+#. module: html_view
+#: field:html.view,bank_ids:0
+msgid "Banks"
+msgstr ""
+
+#. module: html_view
+#: model:ir.module.module,description:html_view.module_meta_information
+msgid ""
+"\n"
+" This is the test module which shows html tag supports in normal xml form "
+"view.\n"
+" "
+msgstr ""
+
+#. module: html_view
+#: model:ir.model,name:html_view.model_html_view
+msgid "html.view"
+msgstr ""
diff --git a/addons/idea/idea.py b/addons/idea/idea.py
index 49d0cbca155..7645b17a348 100644
--- a/addons/idea/idea.py
+++ b/addons/idea/idea.py
@@ -185,7 +185,7 @@ class idea_idea(osv.osv):
'count_votes': fields.function(_vote_count, string="Count of votes", type="integer"),
'count_comments': fields.function(_comment_count, string="Count of comments", type="integer"),
'category_id': fields.many2one('idea.category', 'Category', required=True, readonly=True, states={'draft':[('readonly',False)]}),
- 'state': fields.selection([('draft', 'Draft'),
+ 'state': fields.selection([('draft', 'New'),
('open', 'Opened'),
('close', 'Accepted'),
('cancel', 'Refused')],
diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml
index 38817f10e0c..4ac27fee51f 100644
--- a/addons/idea/idea_view.xml
+++ b/addons/idea/idea_view.xml
@@ -247,7 +247,7 @@
-
+
diff --git a/addons/l10n_be_hr_payroll/security/hr.salary.rule.csv b/addons/l10n_be_hr_payroll/security/hr.salary.rule.csv
deleted file mode 100644
index a8b6906d244..00000000000
--- a/addons/l10n_be_hr_payroll/security/hr.salary.rule.csv
+++ /dev/null
@@ -1,3 +0,0 @@
-"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_hr_salary_rule_category","hr.salary.rule.category","model_hr_salary_rule_category","base.group_hr_user",1,1,1,1
-"access_hr_salary_rule","hr.salary.rule","model_hr_salary_rule","base.group_hr_user",1,1,1,1
diff --git a/addons/l10n_br/data/account.account.template.csv b/addons/l10n_br/data/account.account.template.csv
index 5657769538c..d0468c68995 100644
--- a/addons/l10n_br/data/account.account.template.csv
+++ b/addons/l10n_br/data/account.account.template.csv
@@ -323,312 +323,312 @@
"account_template_322","3.1","CUSTOS","account_template_321","view","despesa","True"
"account_template_323","3.1.01","CUSTOS DAS MERCADORIAS E PRODUTOS","account_template_322","view","despesa","True"
"account_template_324","3.1.01.01","CUSTOS DAS MERCADORIAS VENDIDAS","account_template_323","view","despesa","True"
-"account_template_325","3.1.01.01.0001","Custo das Mercadorias Vendidas","account_template_324","payable","despesa","True"
+"account_template_325","3.1.01.01.0001","Custo das Mercadorias Vendidas","account_template_324","other","despesa","True"
"account_template_326","3.1.02","CUSTO DOS PRODUTOS VENDIDOS","account_template_322","view","despesa","True"
"account_template_327","3.1.02.01","CUSTO DAS MATÉRIAS PRIMAS","account_template_326","view","despesa","True"
-"account_template_328","3.1.02.01.0001","Custo das Matérias Primas","account_template_327","payable","despesa","True"
+"account_template_328","3.1.02.01.0001","Custo das Matérias Primas","account_template_327","other","despesa","True"
"account_template_329","3.1.02.02","CUSTO DOS PRODUTOS ACABADOS","account_template_326","view","despesa","True"
-"account_template_330","3.1.02.02.0001","Custo dos Produtos Acabados","account_template_329","payable","despesa","True"
+"account_template_330","3.1.02.02.0001","Custo dos Produtos Acabados","account_template_329","other","despesa","True"
"account_template_331","3.1.02.03","CUSTO DE MÃO-DE-OBRA DIRETA","account_template_326","view","despesa","True"
-"account_template_332","3.1.02.03.0001","Salários","account_template_331","payable","despesa","True"
-"account_template_333","3.1.02.03.0002","Horas Extras","account_template_331","payable","despesa","True"
-"account_template_334","3.1.02.03.0003","Adicional Noturno","account_template_331","payable","despesa","True"
-"account_template_335","3.1.02.03.0004","Férias","account_template_331","payable","despesa","True"
-"account_template_336","3.1.02.03.0005","13º Salário","account_template_331","payable","despesa","True"
-"account_template_337","3.1.02.03.0006","Aviso Prévio/Indeniz.Trabalhistas","account_template_331","payable","despesa","True"
-"account_template_338","3.1.02.03.0007","Gratificações","account_template_331","payable","despesa","True"
-"account_template_339","3.1.02.03.0008","INSS Empresa","account_template_331","payable","despesa","True"
-"account_template_340","3.1.02.03.0009","FGTS ","account_template_331","payable","despesa","True"
-"account_template_341","3.1.02.03.0010","Adicional Insalubridade","account_template_331","payable","despesa","True"
-"account_template_342","3.1.02.03.0011","Vale Transporte","account_template_331","payable","despesa","True"
-"account_template_343","3.1.02.03.0012","PAT - Programa Alim. Trabalhador","account_template_331","payable","despesa","True"
-"account_template_344","3.1.02.03.0013","Assistência Médica","account_template_331","payable","despesa","True"
-"account_template_345","3.1.02.03.0014","DSR - Descanso Semanal Remunerado","account_template_331","payable","despesa","True"
-"account_template_346","3.1.02.03.0015","Salário Estagiários","account_template_331","payable","despesa","True"
-"account_template_347","3.1.02.03.0016","Previdência Privada","account_template_331","payable","despesa","True"
-"account_template_348","3.1.02.03.0017","Vestuário","account_template_331","payable","despesa","True"
-"account_template_349","3.1.02.03.0018","Assiduidade","account_template_331","payable","despesa","True"
-"account_template_350","3.1.02.03.0019","Abono Salarial","account_template_331","payable","despesa","True"
-"account_template_351","3.1.02.03.0020","Vale Refeição","account_template_331","payable","despesa","True"
-"account_template_352","3.1.02.03.0021","Farmácia","account_template_331","payable","despesa","True"
-"account_template_353","3.1.02.03.0022","Pró-Labore","account_template_331","payable","despesa","True"
+"account_template_332","3.1.02.03.0001","Salários","account_template_331","other","despesa","True"
+"account_template_333","3.1.02.03.0002","Horas Extras","account_template_331","other","despesa","True"
+"account_template_334","3.1.02.03.0003","Adicional Noturno","account_template_331","other","despesa","True"
+"account_template_335","3.1.02.03.0004","Férias","account_template_331","other","despesa","True"
+"account_template_336","3.1.02.03.0005","13º Salário","account_template_331","other","despesa","True"
+"account_template_337","3.1.02.03.0006","Aviso Prévio/Indeniz.Trabalhistas","account_template_331","other","despesa","True"
+"account_template_338","3.1.02.03.0007","Gratificações","account_template_331","other","despesa","True"
+"account_template_339","3.1.02.03.0008","INSS Empresa","account_template_331","payable","passivo","True"
+"account_template_340","3.1.02.03.0009","FGTS ","account_template_331","payable","passivo","True"
+"account_template_341","3.1.02.03.0010","Adicional Insalubridade","account_template_331","other","despesa","True"
+"account_template_342","3.1.02.03.0011","Vale Transporte","account_template_331","other","despesa","True"
+"account_template_343","3.1.02.03.0012","PAT - Programa Alim. Trabalhador","account_template_331","other","despesa","True"
+"account_template_344","3.1.02.03.0013","Assistência Médica","account_template_331","other","despesa","True"
+"account_template_345","3.1.02.03.0014","DSR - Descanso Semanal Remunerado","account_template_331","other","despesa","True"
+"account_template_346","3.1.02.03.0015","Salário Estagiários","account_template_331","other","despesa","True"
+"account_template_347","3.1.02.03.0016","Previdência Privada","account_template_331","other","despesa","True"
+"account_template_348","3.1.02.03.0017","Vestuário","account_template_331","other","despesa","True"
+"account_template_349","3.1.02.03.0018","Assiduidade","account_template_331","other","despesa","True"
+"account_template_350","3.1.02.03.0019","Abono Salarial","account_template_331","other","despesa","True"
+"account_template_351","3.1.02.03.0020","Vale Refeição","account_template_331","other","despesa","True"
+"account_template_352","3.1.02.03.0021","Farmácia","account_template_331","other","despesa","True"
+"account_template_353","3.1.02.03.0022","Pró-Labore","account_template_331","other","despesa","True"
"account_template_354","3.1.02.04","GASTOS GERAIS DE FABRICAÇÃO","account_template_326","view","despesa","True"
-"account_template_355","3.1.02.04.0001","Aluguel","account_template_354","payable","despesa","True"
-"account_template_356","3.1.02.04.0002","Água e Esgoto","account_template_354","payable","despesa","True"
-"account_template_357","3.1.02.04.0003","Energia Elétrica","account_template_354","payable","despesa","True"
-"account_template_358","3.1.02.04.0004","Fretes e Carretos","account_template_354","payable","despesa","True"
-"account_template_359","3.1.02.04.0005","Material de Consumo","account_template_354","payable","despesa","True"
-"account_template_360","3.1.02.04.0006","Condução","account_template_354","payable","despesa","True"
-"account_template_361","3.1.02.04.0007","Contribuição Sindical/Assoc.de Classe","account_template_354","payable","despesa","True"
-"account_template_362","3.1.02.04.0008","Material de Limpeza","account_template_354","payable","despesa","True"
-"account_template_363","3.1.02.04.0009","Seguros","account_template_354","payable","despesa","True"
-"account_template_364","3.1.02.04.0010","Viagens e Estadias","account_template_354","payable","despesa","True"
-"account_template_365","3.1.02.04.0011","Manutenção de Equipamentos","account_template_354","payable","despesa","True"
-"account_template_366","3.1.02.04.0012","Depreciações e Amortizações","account_template_354","payable","despesa","True"
-"account_template_367","3.1.02.04.0013","Combustíveis e Lubrificantes","account_template_354","payable","despesa","True"
-"account_template_368","3.1.02.04.0014","Bens de Pequeno Valor","account_template_354","payable","despesa","True"
-"account_template_369","3.1.02.04.0015","Leasing","account_template_354","payable","despesa","True"
-"account_template_370","3.1.02.04.0016","Formação de Pessoal","account_template_354","payable","despesa","True"
-"account_template_371","3.1.02.04.0017","Serviços de Terceiros - Pessoa Jurídica","account_template_354","payable","despesa","True"
-"account_template_372","3.1.02.04.0018","Locação de Equipamentos","account_template_354","payable","despesa","True"
-"account_template_373","3.1.02.04.0019","Feiras/Congressos/Simpósios/Cursos","account_template_354","payable","despesa","True"
-"account_template_374","3.1.02.04.0020","Telefone","account_template_354","payable","despesa","True"
-"account_template_375","3.1.02.04.0021","Comissões sobre Serviços","account_template_354","payable","despesa","True"
-"account_template_376","3.1.02.04.0022","Jornais, Revistas e Periódicos","account_template_354","payable","despesa","True"
-"account_template_377","3.1.02.04.0023","Confraternizações","account_template_354","payable","despesa","True"
-"account_template_378","3.1.02.04.0024","Manutenção de Prédios","account_template_354","payable","despesa","True"
-"account_template_379","3.1.02.04.0025","Brindes e Amostras","account_template_354","payable","despesa","True"
-"account_template_380","3.1.02.04.0026","Aluguel de Equipamentos","account_template_354","payable","despesa","True"
-"account_template_381","3.1.02.04.0027","Serv.de Terceiros P.Física - Autônomos","account_template_354","payable","despesa","True"
-"account_template_382","3.1.02.04.0028","Manutenção de Veículos","account_template_354","payable","despesa","True"
-"account_template_383","3.1.02.04.0029","Despesas de Importação","account_template_354","payable","despesa","True"
-"account_template_384","3.1.02.04.0030","(-) Crédito PIS Não-Cumulativo","account_template_354","payable","despesa","True"
-"account_template_385","3.1.02.04.0031","(-) Crédito Cofins Não-Cumulativo","account_template_354","payable","despesa","True"
+"account_template_355","3.1.02.04.0001","Aluguel","account_template_354","other","despesa","True"
+"account_template_356","3.1.02.04.0002","Água e Esgoto","account_template_354","other","despesa","True"
+"account_template_357","3.1.02.04.0003","Energia Elétrica","account_template_354","other","despesa","True"
+"account_template_358","3.1.02.04.0004","Fretes e Carretos","account_template_354","other","despesa","True"
+"account_template_359","3.1.02.04.0005","Material de Consumo","account_template_354","other","despesa","True"
+"account_template_360","3.1.02.04.0006","Condução","account_template_354","other","despesa","True"
+"account_template_361","3.1.02.04.0007","Contribuição Sindical/Assoc.de Classe","account_template_354","other","despesa","True"
+"account_template_362","3.1.02.04.0008","Material de Limpeza","account_template_354","other","despesa","True"
+"account_template_363","3.1.02.04.0009","Seguros","account_template_354","other","despesa","True"
+"account_template_364","3.1.02.04.0010","Viagens e Estadias","account_template_354","other","despesa","True"
+"account_template_365","3.1.02.04.0011","Manutenção de Equipamentos","account_template_354","other","despesa","True"
+"account_template_366","3.1.02.04.0012","Depreciações e Amortizações","account_template_354","other","despesa","True"
+"account_template_367","3.1.02.04.0013","Combustíveis e Lubrificantes","account_template_354","other","despesa","True"
+"account_template_368","3.1.02.04.0014","Bens de Pequeno Valor","account_template_354","other","despesa","True"
+"account_template_369","3.1.02.04.0015","Leasing","account_template_354","other","despesa","True"
+"account_template_370","3.1.02.04.0016","Formação de Pessoal","account_template_354","other","despesa","True"
+"account_template_371","3.1.02.04.0017","Serviços de Terceiros - Pessoa Jurídica","account_template_354","other","despesa","True"
+"account_template_372","3.1.02.04.0018","Locação de Equipamentos","account_template_354","other","despesa","True"
+"account_template_373","3.1.02.04.0019","Feiras/Congressos/Simpósios/Cursos","account_template_354","other","despesa","True"
+"account_template_374","3.1.02.04.0020","Telefone","account_template_354","other","despesa","True"
+"account_template_375","3.1.02.04.0021","Comissões sobre Serviços","account_template_354","other","despesa","True"
+"account_template_376","3.1.02.04.0022","Jornais, Revistas e Periódicos","account_template_354","other","despesa","True"
+"account_template_377","3.1.02.04.0023","Confraternizações","account_template_354","other","despesa","True"
+"account_template_378","3.1.02.04.0024","Manutenção de Prédios","account_template_354","other","despesa","True"
+"account_template_379","3.1.02.04.0025","Brindes e Amostras","account_template_354","other","despesa","True"
+"account_template_380","3.1.02.04.0026","Aluguel de Equipamentos","account_template_354","other","despesa","True"
+"account_template_381","3.1.02.04.0027","Serv.de Terceiros P.Física - Autônomos","account_template_354","other","despesa","True"
+"account_template_382","3.1.02.04.0028","Manutenção de Veículos","account_template_354","other","despesa","True"
+"account_template_383","3.1.02.04.0029","Despesas de Importação","account_template_354","other","despesa","True"
+"account_template_384","3.1.02.04.0030","(-) Crédito PIS Não-Cumulativo","account_template_354","other","despesa","True"
+"account_template_385","3.1.02.04.0031","(-) Crédito Cofins Não-Cumulativo","account_template_354","other","despesa","True"
"account_template_386","3.1.02.05","ESTOQUE INICIAL DE PROD.EM ELABORAÇÃO","account_template_326","view","despesa","True"
-"account_template_387","3.1.02.05.0001","Estoque Inicial de Prod. em Elaboração","account_template_386","payable","despesa","True"
+"account_template_387","3.1.02.05.0001","Estoque Inicial de Prod. em Elaboração","account_template_386","other","despesa","True"
"account_template_388","3.1.02.06","ESTOQUE INICIAL DE PROD.ACABADOS","account_template_326","view","despesa","True"
-"account_template_389","3.1.02.06.0001","Estoque Inicial de Prod.Acabados","account_template_388","payable","despesa","True"
+"account_template_389","3.1.02.06.0001","Estoque Inicial de Prod.Acabados","account_template_388","other","despesa","True"
"account_template_390","3.1.02.07","ESTOQUE FINAL DE PROD.EM ELABORAÇÃO","account_template_326","view","despesa","True"
-"account_template_391","3.1.02.07.0001","Estoque Final de Prod.em Elaboração","account_template_390","payable","despesa","True"
+"account_template_391","3.1.02.07.0001","Estoque Final de Prod.em Elaboração","account_template_390","other","despesa","True"
"account_template_392","3.1.02.08","ESTOQUE FINAL DE PROD.ACABADOS","account_template_326","view","despesa","True"
-"account_template_393","3.1.02.08.0001","Estoque Final de Prod.Acabados","account_template_392","payable","despesa","True"
+"account_template_393","3.1.02.08.0001","Estoque Final de Prod.Acabados","account_template_392","other","despesa","True"
"account_template_394","3.2","despesa","account_template_321","view","despesa","True"
"account_template_395","3.2.01","DESPESAS OPERACIONAIS COMERCIAIS","account_template_394","view","despesa","True"
"account_template_396","3.2.01.01","DESPESAS TRABALHISTAS","account_template_395","view","despesa","True"
-"account_template_397","3.2.01.01.0001","Salários","account_template_396","payable","despesa","True"
-"account_template_398","3.2.01.01.0002","Horas Extras","account_template_396","payable","despesa","True"
-"account_template_399","3.2.01.01.0003","Vale Transporte","account_template_396","payable","despesa","True"
-"account_template_400","3.2.01.01.0004","Férias","account_template_396","payable","despesa","True"
-"account_template_401","3.2.01.01.0005","13º Salário","account_template_396","payable","despesa","True"
-"account_template_402","3.2.01.01.0006","Aviso Prévio/Indeniz.Trabalhisas","account_template_396","payable","despesa","True"
-"account_template_403","3.2.01.01.0007","Gratificações","account_template_396","payable","despesa","True"
-"account_template_404","3.2.01.01.0008","Assiduidade","account_template_396","payable","despesa","True"
-"account_template_405","3.2.01.01.0009","Abono Salarial","account_template_396","payable","despesa","True"
-"account_template_406","3.2.01.01.0010","Adicional de Insalubridade","account_template_396","payable","despesa","True"
-"account_template_407","3.2.01.01.0011","Vale Refeição","account_template_396","payable","despesa","True"
-"account_template_408","3.2.01.01.0012","Adicional Noturno","account_template_396","payable","despesa","True"
-"account_template_409","3.2.01.01.0013","Farmácia","account_template_396","payable","despesa","True"
-"account_template_410","3.2.01.01.0014","PAT - Programa Alim. Trabalhador","account_template_396","payable","despesa","True"
-"account_template_411","3.2.01.01.0015","Pró-Labore","account_template_396","payable","despesa","True"
-"account_template_412","3.2.01.01.0016","Assistência Médica","account_template_396","payable","despesa","True"
+"account_template_397","3.2.01.01.0001","Salários","account_template_396","other","despesa","True"
+"account_template_398","3.2.01.01.0002","Horas Extras","account_template_396","other","despesa","True"
+"account_template_399","3.2.01.01.0003","Vale Transporte","account_template_396","other","despesa","True"
+"account_template_400","3.2.01.01.0004","Férias","account_template_396","other","despesa","True"
+"account_template_401","3.2.01.01.0005","13º Salário","account_template_396","other","despesa","True"
+"account_template_402","3.2.01.01.0006","Aviso Prévio/Indeniz.Trabalhisas","account_template_396","other","despesa","True"
+"account_template_403","3.2.01.01.0007","Gratificações","account_template_396","other","despesa","True"
+"account_template_404","3.2.01.01.0008","Assiduidade","account_template_396","other","despesa","True"
+"account_template_405","3.2.01.01.0009","Abono Salarial","account_template_396","other","despesa","True"
+"account_template_406","3.2.01.01.0010","Adicional de Insalubridade","account_template_396","other","despesa","True"
+"account_template_407","3.2.01.01.0011","Vale Refeição","account_template_396","other","despesa","True"
+"account_template_408","3.2.01.01.0012","Adicional Noturno","account_template_396","other","despesa","True"
+"account_template_409","3.2.01.01.0013","Farmácia","account_template_396","other","despesa","True"
+"account_template_410","3.2.01.01.0014","PAT - Programa Alim. Trabalhador","account_template_396","other","despesa","True"
+"account_template_411","3.2.01.01.0015","Pró-Labore","account_template_396","other","despesa","True"
+"account_template_412","3.2.01.01.0016","Assistência Médica","account_template_396","other","despesa","True"
"account_template_413","3.2.01.02","ENCARGOS SOCIAIS","account_template_395","view","despesa","True"
-"account_template_414","3.2.01.02.0001","Inss","account_template_413","payable","despesa","True"
-"account_template_415","3.2.01.02.0002","Fgts","account_template_413","payable","despesa","True"
+"account_template_414","3.2.01.02.0001","Inss","account_template_413","other","despesa","True"
+"account_template_415","3.2.01.02.0002","Fgts","account_template_413","other","despesa","True"
"account_template_416","3.2.01.03","DESPESAS GERAIS COMERCIAIS","account_template_395","view","despesa","True"
-"account_template_417","3.2.01.03.0001","Comissões sobre Vendas","account_template_416","payable","despesa","True"
-"account_template_418","3.2.01.03.0002","Aluguel","account_template_416","payable","despesa","True"
-"account_template_419","3.2.01.03.0003","Agua e Esgoto","account_template_416","payable","despesa","True"
-"account_template_420","3.2.01.03.0004","Energia Elétrica","account_template_416","payable","despesa","True"
-"account_template_421","3.2.01.03.0006","Material de Expediente","account_template_416","payable","despesa","True"
-"account_template_422","3.2.01.03.0007","Condução","account_template_416","payable","despesa","True"
-"account_template_423","3.2.01.03.0008","Correios e Malotes","account_template_416","payable","despesa","True"
-"account_template_424","3.2.01.03.0009","Material de Limpeza","account_template_416","payable","despesa","True"
-"account_template_425","3.2.01.03.0010","Seguros","account_template_416","payable","despesa","True"
-"account_template_426","3.2.01.03.0011","Viagens e Estadias","account_template_416","payable","despesa","True"
-"account_template_427","3.2.01.03.0012","Manutenção e Conservação","account_template_416","payable","despesa","True"
-"account_template_428","3.2.01.03.0013","Depreciação e Amortização","account_template_416","payable","despesa","True"
-"account_template_429","3.2.01.03.0014","Propaganda e Publicidade","account_template_416","payable","despesa","True"
-"account_template_430","3.2.01.03.0015","Fretes e Carretos","account_template_416","payable","despesa","True"
-"account_template_431","3.2.01.03.0016","Combustíveis e Lubrificantes","account_template_416","payable","despesa","True"
-"account_template_432","3.2.01.03.0017","Leasing","account_template_416","payable","despesa","True"
-"account_template_433","3.2.01.03.0018","Serv.Terceiros P.Física - Autônomos","account_template_416","payable","despesa","True"
-"account_template_434","3.2.01.03.0019","Serv.Terceiros Pessoa Jurídica","account_template_416","payable","despesa","True"
-"account_template_435","3.2.01.03.0020","Feiras/Congressos/Simpósios/Cursos","account_template_416","payable","despesa","True"
-"account_template_436","3.2.01.03.0021","Telefone","account_template_416","payable","despesa","True"
-"account_template_437","3.2.01.03.0022","Despesas com Exportação","account_template_416","payable","despesa","True"
-"account_template_438","3.2.01.03.0024","Jornais, Revistas e Periódicos","account_template_416","payable","despesa","True"
-"account_template_439","3.2.01.03.0025","Refeições e Lanches","account_template_416","payable","despesa","True"
-"account_template_440","3.2.01.03.0026","Confraternizações","account_template_416","payable","despesa","True"
-"account_template_441","3.2.01.03.0027","Brindes","account_template_416","payable","despesa","True"
-"account_template_442","3.2.01.03.0028","Internet","account_template_416","payable","despesa","True"
+"account_template_417","3.2.01.03.0001","Comissões sobre Vendas","account_template_416","other","despesa","True"
+"account_template_418","3.2.01.03.0002","Aluguel","account_template_416","other","despesa","True"
+"account_template_419","3.2.01.03.0003","Agua e Esgoto","account_template_416","other","despesa","True"
+"account_template_420","3.2.01.03.0004","Energia Elétrica","account_template_416","other","despesa","True"
+"account_template_421","3.2.01.03.0006","Material de Expediente","account_template_416","other","despesa","True"
+"account_template_422","3.2.01.03.0007","Condução","account_template_416","other","despesa","True"
+"account_template_423","3.2.01.03.0008","Correios e Malotes","account_template_416","other","despesa","True"
+"account_template_424","3.2.01.03.0009","Material de Limpeza","account_template_416","other","despesa","True"
+"account_template_425","3.2.01.03.0010","Seguros","account_template_416","other","despesa","True"
+"account_template_426","3.2.01.03.0011","Viagens e Estadias","account_template_416","other","despesa","True"
+"account_template_427","3.2.01.03.0012","Manutenção e Conservação","account_template_416","other","despesa","True"
+"account_template_428","3.2.01.03.0013","Depreciação e Amortização","account_template_416","other","despesa","True"
+"account_template_429","3.2.01.03.0014","Propaganda e Publicidade","account_template_416","other","despesa","True"
+"account_template_430","3.2.01.03.0015","Fretes e Carretos","account_template_416","other","despesa","True"
+"account_template_431","3.2.01.03.0016","Combustíveis e Lubrificantes","account_template_416","other","despesa","True"
+"account_template_432","3.2.01.03.0017","Leasing","account_template_416","other","despesa","True"
+"account_template_433","3.2.01.03.0018","Serv.Terceiros P.Física - Autônomos","account_template_416","other","despesa","True"
+"account_template_434","3.2.01.03.0019","Serv.Terceiros Pessoa Jurídica","account_template_416","other","despesa","True"
+"account_template_435","3.2.01.03.0020","Feiras/Congressos/Simpósios/Cursos","account_template_416","other","despesa","True"
+"account_template_436","3.2.01.03.0021","Telefone","account_template_416","other","despesa","True"
+"account_template_437","3.2.01.03.0022","Despesas com Exportação","account_template_416","other","despesa","True"
+"account_template_438","3.2.01.03.0024","Jornais, Revistas e Periódicos","account_template_416","other","despesa","True"
+"account_template_439","3.2.01.03.0025","Refeições e Lanches","account_template_416","other","despesa","True"
+"account_template_440","3.2.01.03.0026","Confraternizações","account_template_416","other","despesa","True"
+"account_template_441","3.2.01.03.0027","Brindes","account_template_416","other","despesa","True"
+"account_template_442","3.2.01.03.0028","Internet","account_template_416","other","despesa","True"
"account_template_443","3.2.02","DESPESAS ADMINISTRATIVAS","account_template_394","view","despesa","True"
"account_template_444","3.2.02.01","DESPESAS TRABALHISTAS","account_template_443","view","despesa","True"
-"account_template_445","3.2.02.01.0001","Pro-Labore","account_template_444","payable","despesa","True"
-"account_template_446","3.2.02.01.0002","Salários","account_template_444","payable","despesa","True"
-"account_template_447","3.2.02.01.0003","Horas Extras","account_template_444","payable","despesa","True"
-"account_template_448","3.2.02.01.0004","Férias","account_template_444","payable","despesa","True"
-"account_template_449","3.2.02.01.0005","13º Salário","account_template_444","payable","despesa","True"
-"account_template_450","3.2.02.01.0006","Aviso Prévio/Indeniz.Trabalhistas","account_template_444","payable","despesa","True"
-"account_template_451","3.2.02.01.0007","Gratificações","account_template_444","payable","despesa","True"
-"account_template_452","3.2.02.01.0008","Adicional Insalubridade","account_template_444","payable","despesa","True"
-"account_template_453","3.2.02.01.0009","Adicional Noturno","account_template_444","payable","despesa","True"
-"account_template_454","3.2.02.01.0010","Vale Transporte","account_template_444","payable","despesa","True"
-"account_template_455","3.2.02.01.0011","Farmácia","account_template_444","payable","despesa","True"
-"account_template_456","3.2.02.01.0012","Vale Refeição","account_template_444","payable","despesa","True"
-"account_template_457","3.2.02.01.0013","PAT - Programa Alim. Trabalhador","account_template_444","payable","despesa","True"
-"account_template_458","3.2.02.01.0014","Salário Estagiários","account_template_444","payable","despesa","True"
-"account_template_459","3.2.02.01.0015","Assiduidade","account_template_444","payable","despesa","True"
-"account_template_460","3.2.02.01.0016","Abono Salarial","account_template_444","payable","despesa","True"
-"account_template_461","3.2.02.01.0017","Previdência Privada","account_template_444","payable","despesa","True"
-"account_template_462","3.2.02.01.0018","Assistência Médica","account_template_444","payable","despesa","True"
+"account_template_445","3.2.02.01.0001","Pro-Labore","account_template_444","other","despesa","True"
+"account_template_446","3.2.02.01.0002","Salários","account_template_444","other","despesa","True"
+"account_template_447","3.2.02.01.0003","Horas Extras","account_template_444","other","despesa","True"
+"account_template_448","3.2.02.01.0004","Férias","account_template_444","other","despesa","True"
+"account_template_449","3.2.02.01.0005","13º Salário","account_template_444","other","despesa","True"
+"account_template_450","3.2.02.01.0006","Aviso Prévio/Indeniz.Trabalhistas","account_template_444","other","despesa","True"
+"account_template_451","3.2.02.01.0007","Gratificações","account_template_444","other","despesa","True"
+"account_template_452","3.2.02.01.0008","Adicional Insalubridade","account_template_444","other","despesa","True"
+"account_template_453","3.2.02.01.0009","Adicional Noturno","account_template_444","other","despesa","True"
+"account_template_454","3.2.02.01.0010","Vale Transporte","account_template_444","other","despesa","True"
+"account_template_455","3.2.02.01.0011","Farmácia","account_template_444","other","despesa","True"
+"account_template_456","3.2.02.01.0012","Vale Refeição","account_template_444","other","despesa","True"
+"account_template_457","3.2.02.01.0013","PAT - Programa Alim. Trabalhador","account_template_444","other","despesa","True"
+"account_template_458","3.2.02.01.0014","Salário Estagiários","account_template_444","other","despesa","True"
+"account_template_459","3.2.02.01.0015","Assiduidade","account_template_444","other","despesa","True"
+"account_template_460","3.2.02.01.0016","Abono Salarial","account_template_444","other","despesa","True"
+"account_template_461","3.2.02.01.0017","Previdência Privada","account_template_444","other","despesa","True"
+"account_template_462","3.2.02.01.0018","Assistência Médica","account_template_444","other","despesa","True"
"account_template_463","3.2.02.02","ENCARGOS SOCIAIS","account_template_443","view","despesa","True"
-"account_template_464","3.2.02.02.0001","Inss","account_template_463","payable","despesa","True"
-"account_template_465","3.2.02.02.0002","Fgts","account_template_463","payable","despesa","True"
+"account_template_464","3.2.02.02.0001","Inss","account_template_463","other","despesa","True"
+"account_template_465","3.2.02.02.0002","Fgts","account_template_463","other","despesa","True"
"account_template_466","3.2.02.03","DESPESAS GERAIS ADMINISTRATIVAS","account_template_443","view","despesa","True"
-"account_template_467","3.2.02.03.0001","Aluguel","account_template_466","payable","despesa","True"
-"account_template_468","3.2.02.03.0002","Água e Esgoto","account_template_466","payable","despesa","True"
-"account_template_469","3.2.02.03.0003","Energia Elétrica","account_template_466","payable","despesa","True"
-"account_template_470","3.2.02.03.0004","Copa, Cozinha e Refeitório","account_template_466","payable","despesa","True"
-"account_template_471","3.2.02.03.0005","Material de Escritório","account_template_466","payable","despesa","True"
-"account_template_472","3.2.02.03.0006","Fretes e Carretos","account_template_466","payable","despesa","True"
-"account_template_473","3.2.02.03.0007","Correios e Malotes","account_template_466","payable","despesa","True"
-"account_template_474","3.2.02.03.0008","Material de Limpeza","account_template_466","payable","despesa","True"
-"account_template_475","3.2.02.03.0009","Seguros","account_template_466","payable","despesa","True"
-"account_template_476","3.2.02.03.0010","Viagens e Estadias","account_template_466","payable","despesa","True"
-"account_template_477","3.2.02.03.0011","Manutenção e Conservação","account_template_466","payable","despesa","True"
-"account_template_478","3.2.02.03.0012","Depreciação e Amortização","account_template_466","payable","despesa","True"
-"account_template_479","3.2.02.03.0013","Sindicato Patronal/Assoc.de Classe","account_template_466","payable","despesa","True"
-"account_template_480","3.2.02.03.0014","Feiras/Congressos/Simpósios/Cursos","account_template_466","payable","despesa","True"
-"account_template_481","3.2.02.03.0015","Internet","account_template_466","payable","despesa","True"
-"account_template_482","3.2.02.03.0016","Combustíveis e Lubrificantes","account_template_466","payable","despesa","True"
-"account_template_483","3.2.02.03.0017","Leasing","account_template_466","payable","despesa","True"
-"account_template_484","3.2.02.03.0018","Serviço de Terceiros - Pessoa Jurídica","account_template_466","payable","despesa","True"
-"account_template_485","3.2.02.03.0019","Telefone","account_template_466","payable","despesa","True"
-"account_template_486","3.2.02.03.0020","Legais e Judiciais","account_template_466","payable","despesa","True"
-"account_template_487","3.2.02.03.0021","Bens de Pequeno Valor","account_template_466","payable","despesa","True"
-"account_template_488","3.2.02.03.0022","Jornais Revistas e Periódicos","account_template_466","payable","despesa","True"
-"account_template_489","3.2.02.03.0023","Cópias e Reproduções","account_template_466","payable","despesa","True"
-"account_template_490","3.2.02.03.0024","Confraternizações","account_template_466","payable","despesa","True"
-"account_template_491","3.2.02.03.0025","Formação de Pessoal","account_template_466","payable","despesa","True"
-"account_template_492","3.2.02.03.0026","Segurança e Vigilância","account_template_466","payable","despesa","True"
-"account_template_493","3.2.02.03.0027","Despesas com Veículos","account_template_466","payable","despesa","True"
-"account_template_494","3.2.02.03.0028","Impressos","account_template_466","payable","despesa","True"
-"account_template_495","3.2.02.03.0029","Refeições e Lanches","account_template_466","payable","despesa","True"
-"account_template_496","3.2.02.03.0030","Comissões","account_template_466","payable","despesa","True"
-"account_template_497","3.2.02.03.0031","Condução ","account_template_466","payable","despesa","True"
-"account_template_498","3.2.02.03.0032","Telefone Linha Fixa","account_template_466","payable","despesa","True"
-"account_template_499","3.2.02.03.0033","Telefone Móvel Celular","account_template_466","payable","despesa","True"
-"account_template_500","3.2.02.03.0034","Telefone Nextel","account_template_466","payable","despesa","True"
-"account_template_501","3.2.02.03.0035","Crea-PR","account_template_466","payable","despesa","True"
-"account_template_502","3.2.02.03.0036","Despesas de Cartório","account_template_466","payable","despesa","True"
-"account_template_503","3.2.02.03.0037","Material de Consumo","account_template_466","payable","despesa","True"
-"account_template_504","3.2.02.03.0038","Donativos e Contribuições","account_template_466","payable","despesa","True"
-"account_template_505","3.2.02.03.0039","Locação de Equipamentos","account_template_466","payable","despesa","True"
+"account_template_467","3.2.02.03.0001","Aluguel","account_template_466","other","despesa","True"
+"account_template_468","3.2.02.03.0002","Água e Esgoto","account_template_466","other","despesa","True"
+"account_template_469","3.2.02.03.0003","Energia Elétrica","account_template_466","other","despesa","True"
+"account_template_470","3.2.02.03.0004","Copa, Cozinha e Refeitório","account_template_466","other","despesa","True"
+"account_template_471","3.2.02.03.0005","Material de Escritório","account_template_466","other","despesa","True"
+"account_template_472","3.2.02.03.0006","Fretes e Carretos","account_template_466","other","despesa","True"
+"account_template_473","3.2.02.03.0007","Correios e Malotes","account_template_466","other","despesa","True"
+"account_template_474","3.2.02.03.0008","Material de Limpeza","account_template_466","other","despesa","True"
+"account_template_475","3.2.02.03.0009","Seguros","account_template_466","other","despesa","True"
+"account_template_476","3.2.02.03.0010","Viagens e Estadias","account_template_466","other","despesa","True"
+"account_template_477","3.2.02.03.0011","Manutenção e Conservação","account_template_466","other","despesa","True"
+"account_template_478","3.2.02.03.0012","Depreciação e Amortização","account_template_466","other","despesa","True"
+"account_template_479","3.2.02.03.0013","Sindicato Patronal/Assoc.de Classe","account_template_466","other","despesa","True"
+"account_template_480","3.2.02.03.0014","Feiras/Congressos/Simpósios/Cursos","account_template_466","other","despesa","True"
+"account_template_481","3.2.02.03.0015","Internet","account_template_466","other","despesa","True"
+"account_template_482","3.2.02.03.0016","Combustíveis e Lubrificantes","account_template_466","other","despesa","True"
+"account_template_483","3.2.02.03.0017","Leasing","account_template_466","other","despesa","True"
+"account_template_484","3.2.02.03.0018","Serviço de Terceiros - Pessoa Jurídica","account_template_466","other","despesa","True"
+"account_template_485","3.2.02.03.0019","Telefone","account_template_466","other","despesa","True"
+"account_template_486","3.2.02.03.0020","Legais e Judiciais","account_template_466","other","despesa","True"
+"account_template_487","3.2.02.03.0021","Bens de Pequeno Valor","account_template_466","other","despesa","True"
+"account_template_488","3.2.02.03.0022","Jornais Revistas e Periódicos","account_template_466","other","despesa","True"
+"account_template_489","3.2.02.03.0023","Cópias e Reproduções","account_template_466","other","despesa","True"
+"account_template_490","3.2.02.03.0024","Confraternizações","account_template_466","other","despesa","True"
+"account_template_491","3.2.02.03.0025","Formação de Pessoal","account_template_466","other","despesa","True"
+"account_template_492","3.2.02.03.0026","Segurança e Vigilância","account_template_466","other","despesa","True"
+"account_template_493","3.2.02.03.0027","Despesas com Veículos","account_template_466","other","despesa","True"
+"account_template_494","3.2.02.03.0028","Impressos","account_template_466","other","despesa","True"
+"account_template_495","3.2.02.03.0029","Refeições e Lanches","account_template_466","other","despesa","True"
+"account_template_496","3.2.02.03.0030","Comissões","account_template_466","other","despesa","True"
+"account_template_497","3.2.02.03.0031","Condução ","account_template_466","other","despesa","True"
+"account_template_498","3.2.02.03.0032","Telefone Linha Fixa","account_template_466","other","despesa","True"
+"account_template_499","3.2.02.03.0033","Telefone Móvel Celular","account_template_466","other","despesa","True"
+"account_template_500","3.2.02.03.0034","Telefone Nextel","account_template_466","other","despesa","True"
+"account_template_501","3.2.02.03.0035","Crea-PR","account_template_466","other","despesa","True"
+"account_template_502","3.2.02.03.0036","Despesas de Cartório","account_template_466","other","despesa","True"
+"account_template_503","3.2.02.03.0037","Material de Consumo","account_template_466","other","despesa","True"
+"account_template_504","3.2.02.03.0038","Donativos e Contribuições","account_template_466","other","despesa","True"
+"account_template_505","3.2.02.03.0039","Locação de Equipamentos","account_template_466","other","despesa","True"
"account_template_506","3.2.02.04","DESPESAS INDEDUTÍVEIS","account_template_443","view","despesa","True"
-"account_template_507","3.2.02.04.0001","Autos de Infração","account_template_506","payable","despesa","True"
-"account_template_508","3.2.02.04.0002","Multas Punitívas","account_template_506","payable","despesa","True"
-"account_template_509","3.2.02.04.0003","Contribuições e Doações","account_template_506","payable","despesa","True"
-"account_template_510","3.2.02.04.0004","Impostos Federais - Exerc. Anteriores","account_template_506","payable","despesa","True"
-"account_template_511","3.2.02.04.0005","Impostos Estaduais - Exerc. Anteriores","account_template_506","payable","despesa","True"
-"account_template_512","3.2.02.04.0006","Impostos Municipais - Exerc.Anteriores","account_template_506","payable","despesa","True"
+"account_template_507","3.2.02.04.0001","Autos de Infração","account_template_506","other","despesa","True"
+"account_template_508","3.2.02.04.0002","Multas Punitívas","account_template_506","other","despesa","True"
+"account_template_509","3.2.02.04.0003","Contribuições e Doações","account_template_506","other","despesa","True"
+"account_template_510","3.2.02.04.0004","Impostos Federais - Exerc. Anteriores","account_template_506","other","despesa","True"
+"account_template_511","3.2.02.04.0005","Impostos Estaduais - Exerc. Anteriores","account_template_506","other","despesa","True"
+"account_template_512","3.2.02.04.0006","Impostos Municipais - Exerc.Anteriores","account_template_506","other","despesa","True"
"account_template_513","3.2.03","DESPESAS FINANCEIRAS","account_template_394","view","despesa","True"
"account_template_514","3.2.03.01","DESPESAS COM ATUALIZAÇÕES","account_template_513","view","despesa","True"
-"account_template_515","3.2.03.01.0001","Variação Monetária Passiva","account_template_514","payable","despesa","True"
-"account_template_516","3.2.03.01.0002","Variação Cambial Passiva","account_template_514","payable","despesa","True"
-"account_template_517","3.2.03.01.0003","Despesas de Cobrança","account_template_514","payable","despesa","True"
-"account_template_518","3.2.03.01.0004","Despesas Bancárias","account_template_514","payable","despesa","True"
+"account_template_515","3.2.03.01.0001","Variação Monetária Passiva","account_template_514","other","despesa","True"
+"account_template_516","3.2.03.01.0002","Variação Cambial Passiva","account_template_514","other","despesa","True"
+"account_template_517","3.2.03.01.0003","Despesas de Cobrança","account_template_514","other","despesa","True"
+"account_template_518","3.2.03.01.0004","Despesas Bancárias","account_template_514","other","despesa","True"
"account_template_519","3.2.03.02","JUROS E DESCONTOS","account_template_513","view","despesa","True"
-"account_template_520","3.2.03.02.0001","Juros de Mora","account_template_519","payable","despesa","True"
-"account_template_521","3.2.03.02.0002","Descontos Concedidos","account_template_519","payable","despesa","True"
-"account_template_522","3.2.03.02.0003","Juros s/ Empréstimos e Financiamentos","account_template_519","payable","despesa","True"
-"account_template_523","3.2.03.02.0004","Juros s/ Descontos de Duplicatas","account_template_519","payable","despesa","True"
+"account_template_520","3.2.03.02.0001","Juros de Mora","account_template_519","other","despesa","True"
+"account_template_521","3.2.03.02.0002","Descontos Concedidos","account_template_519","other","despesa","True"
+"account_template_522","3.2.03.02.0003","Juros s/ Empréstimos e Financiamentos","account_template_519","other","despesa","True"
+"account_template_523","3.2.03.02.0004","Juros s/ Descontos de Duplicatas","account_template_519","other","despesa","True"
"account_template_524","3.2.04","DESPESAS TRIBUTÁRIAS","account_template_394","view","despesa","True"
"account_template_525","3.2.04.01","IMPOSTOS, TAXAS E CONTRIBUIÇÕES","account_template_524","view","despesa","True"
-"account_template_526","3.2.04.01.0001","IOF","account_template_525","payable","despesa","True"
-"account_template_527","3.2.04.01.0002","CPMF","account_template_525","payable","despesa","True"
-"account_template_528","3.2.04.01.0003","IPTU","account_template_525","payable","despesa","True"
-"account_template_529","3.2.04.01.0004","IPVA","account_template_525","payable","despesa","True"
-"account_template_530","3.2.04.01.0005","IRF (Exclusivo na Fonte)","account_template_525","payable","despesa","True"
-"account_template_531","3.2.04.01.0006","Impostos e Taxas Federais","account_template_525","payable","despesa","True"
-"account_template_532","3.2.04.01.0007","Impostos e Taxas Estaduais","account_template_525","payable","despesa","True"
-"account_template_533","3.2.04.01.0008","Impostos e Taxas Municipais","account_template_525","payable","despesa","True"
+"account_template_526","3.2.04.01.0001","IOF","account_template_525","other","despesa","True"
+"account_template_527","3.2.04.01.0002","CPMF","account_template_525","other","despesa","True"
+"account_template_528","3.2.04.01.0003","IPTU","account_template_525","other","despesa","True"
+"account_template_529","3.2.04.01.0004","IPVA","account_template_525","other","despesa","True"
+"account_template_530","3.2.04.01.0005","IRF (Exclusivo na Fonte)","account_template_525","other","despesa","True"
+"account_template_531","3.2.04.01.0006","Impostos e Taxas Federais","account_template_525","other","despesa","True"
+"account_template_532","3.2.04.01.0007","Impostos e Taxas Estaduais","account_template_525","other","despesa","True"
+"account_template_533","3.2.04.01.0008","Impostos e Taxas Municipais","account_template_525","other","despesa","True"
"account_template_534","3.2.04.02","MULTAS","account_template_524","view","despesa","True"
-"account_template_535","3.2.04.02.0001","Multas Fiscais Compensatórias","account_template_534","payable","despesa","True"
-"account_template_536","3.2.04.02.0002","Multas de Mora","account_template_534","payable","despesa","True"
-"account_template_537","3.2.04.02.0003","Multas Contratuais","account_template_534","payable","despesa","True"
+"account_template_535","3.2.04.02.0001","Multas Fiscais Compensatórias","account_template_534","other","despesa","True"
+"account_template_536","3.2.04.02.0002","Multas de Mora","account_template_534","other","despesa","True"
+"account_template_537","3.2.04.02.0003","Multas Contratuais","account_template_534","other","despesa","True"
"account_template_538","3.2.05","OUTRAS DESPESAS OPERACIONAIS","account_template_394","view","despesa","True"
"account_template_539","3.2.05.01","PERDAS","account_template_538","view","despesa","True"
-"account_template_540","3.2.05.01.0001","Perdas com Duplicatas Incobráveis","account_template_539","payable","despesa","True"
+"account_template_540","3.2.05.01.0001","Perdas com Duplicatas Incobráveis","account_template_539","other","despesa","True"
"account_template_541","3.2.06","DESPESAS NÃO OPERACIONAIS","account_template_394","view","despesa","True"
"account_template_542","3.2.06.01","PERDAS","account_template_541","view","despesa","True"
-"account_template_543","3.2.06.01.0002","Perda crédito de ICMS s/ Imobilizado","account_template_542","payable","despesa","True"
-"account_template_544","3.2.06.01.0003","Perdas com Sinistros","account_template_542","payable","despesa","True"
-"account_template_545","3.2.06.01.0004","Perdas na Alienação de Imobilizado","account_template_542","payable","despesa","True"
-"account_template_546","3.2.06.01.0001","Perdas na Alienação de Investimentos","account_template_542","payable","despesa","True"
-"account_template_547","3.2.06.01.0005","Perdas, Deterioração de Mercadorias","account_template_542","payable","despesa","True"
+"account_template_543","3.2.06.01.0002","Perda crédito de ICMS s/ Imobilizado","account_template_542","other","despesa","True"
+"account_template_544","3.2.06.01.0003","Perdas com Sinistros","account_template_542","other","despesa","True"
+"account_template_545","3.2.06.01.0004","Perdas na Alienação de Imobilizado","account_template_542","other","despesa","True"
+"account_template_546","3.2.06.01.0001","Perdas na Alienação de Investimentos","account_template_542","other","despesa","True"
+"account_template_547","3.2.06.01.0005","Perdas, Deterioração de Mercadorias","account_template_542","other","despesa","True"
"account_template_548","4","CONTAS DE RESULTADO - RECEITAS","account_template_1","view","receita","True"
"account_template_549","4.1","RECEITAS","account_template_548","view","receita","True"
"account_template_550","4.1.01","RECEITAS OPERACIONAIS VENDAS E SERVIÇOS","account_template_549","view","receita","True"
"account_template_551","4.1.01.01","RECEITA BRUTA VENDAS NO PAÍS ","account_template_550","view","receita","True"
-"account_template_552","4.1.01.01.0001","Venda Produtos Fabricação Própria","account_template_551","receivable","receita","True"
-"account_template_553","4.1.01.01.0002","Industrialização de Mercadorias","account_template_551","receivable","receita","True"
-"account_template_554","4.1.01.01.0003","Revenda de Mercadorias","account_template_551","receivable","receita","True"
-"account_template_555","4.1.01.01.0004","Venda Fabricação Própria","account_template_551","receivable","receita","True"
-"account_template_556","4.1.01.01.0005","Industriazalição de Mercadorias","account_template_551","receivable","receita","True"
-"account_template_557","4.1.01.01.0006","Revenda de Mercadorias","account_template_551","receivable","receita","True"
+"account_template_552","4.1.01.01.0001","Venda Produtos Fabricação Própria","account_template_551","other","receita","True"
+"account_template_553","4.1.01.01.0002","Industrialização de Mercadorias","account_template_551","other","receita","True"
+"account_template_554","4.1.01.01.0003","Revenda de Mercadorias","account_template_551","other","receita","True"
+"account_template_555","4.1.01.01.0004","Venda Fabricação Própria","account_template_551","other","receita","True"
+"account_template_556","4.1.01.01.0005","Industriazalição de Mercadorias","account_template_551","other","receita","True"
+"account_template_557","4.1.01.01.0006","Revenda de Mercadorias","account_template_551","other","receita","True"
"account_template_558","4.1.01.02","RECEITA DE SERVIÇOS NO PAIS ","account_template_550","view","receita","True"
-"account_template_559","4.1.01.02.0001","Receita de Serviços","account_template_558","receivable","receita","True"
-"account_template_560","4.1.01.02.0002","Receita de Serviços","account_template_558","receivable","receita","True"
+"account_template_559","4.1.01.02.0001","Receita de Serviços","account_template_558","other","receita","True"
+"account_template_560","4.1.01.02.0002","Receita de Serviços","account_template_558","other","receita","True"
"account_template_561","4.1.01.03","RECEITA BRUTA DE VENDAS P/EXTERIOR","account_template_550","view","receita","True"
-"account_template_562","4.1.01.03.0001","Venda de Produtos Fabricação Própria(EX)","account_template_561","receivable","receita","True"
-"account_template_563","4.1.01.03.0002","Revenda de Mercadorias (EX)","account_template_561","receivable","receita","True"
+"account_template_562","4.1.01.03.0001","Venda de Produtos Fabricação Própria(EX)","account_template_561","other","receita","True"
+"account_template_563","4.1.01.03.0002","Revenda de Mercadorias (EX)","account_template_561","other","receita","True"
"account_template_564","4.1.02","(-) DEDUÇÕES DA RECEITA BRUTA","account_template_549","view","receita","True"
"account_template_565","4.1.02.01","DEVOLUÇÕES E ABATIMENTOS","account_template_564","view","receita","True"
-"account_template_566","4.1.02.01.0001","Devolução de Vendas","account_template_565","receivable","receita","True"
-"account_template_567","4.1.02.01.0002","Abatimentos Concedidos","account_template_565","receivable","receita","True"
-"account_template_568","4.1.02.01.0003","Devolução de Vendas","account_template_565","receivable","receita","True"
-"account_template_569","4.1.02.01.0004","Abatimentos Concedidos","account_template_565","receivable","receita","True"
+"account_template_566","4.1.02.01.0001","Devolução de Vendas","account_template_565","other","receita","True"
+"account_template_567","4.1.02.01.0002","Abatimentos Concedidos","account_template_565","other","receita","True"
+"account_template_568","4.1.02.01.0003","Devolução de Vendas","account_template_565","other","receita","True"
+"account_template_569","4.1.02.01.0004","Abatimentos Concedidos","account_template_565","other","receita","True"
"account_template_570","4.1.02.02","IMPOSTOS SOBRE VENDAS E SERVIÇOS","account_template_564","view","receita","True"
-"account_template_571","4.1.02.02.0001","ICMS sobre Vendas","account_template_570","receivable","receita","True"
-"account_template_572","4.1.02.02.0002","IPI sobre Vendas","account_template_570","receivable","receita","True"
-"account_template_573","4.1.02.02.0003","PIS sobre Vendas ","account_template_570","receivable","receita","True"
-"account_template_574","4.1.02.02.0004","COFINS sobre Vendas","account_template_570","receivable","receita","True"
-"account_template_575","4.1.02.02.0005","ISS sobre Serviços","account_template_570","receivable","receita","True"
+"account_template_571","4.1.02.02.0001","ICMS sobre Vendas","account_template_570","other","receita","True"
+"account_template_572","4.1.02.02.0002","IPI sobre Vendas","account_template_570","other","receita","True"
+"account_template_573","4.1.02.02.0003","PIS sobre Vendas ","account_template_570","other","receita","True"
+"account_template_574","4.1.02.02.0004","COFINS sobre Vendas","account_template_570","other","receita","True"
+"account_template_575","4.1.02.02.0005","ISS sobre Serviços","account_template_570","other","receita","True"
"account_template_579","4.1.02.03","(-) IMPOSTOS S/ DEVOLUÇÃO DE VENDAS","account_template_564","view","receita","True"
-"account_template_580","4.1.02.03.0001","(-) Cofins Não-Cumulativo s/ Dev. Vendas","account_template_579","receivable","receita","True"
-"account_template_581","4.1.02.03.0002","(-) ICMS sobre Devolução de Vendas","account_template_579","receivable","receita","True"
-"account_template_582","4.1.02.03.0003","(-) IPI s/Devolução de Vendas","account_template_579","receivable","receita","True"
-"account_template_583","4.1.02.03.0004","(-) Pis Não-Cumulativo s/ Dev. Vendas","account_template_579","receivable","receita","True"
+"account_template_580","4.1.02.03.0001","(-) Cofins Não-Cumulativo s/ Dev. Vendas","account_template_579","other","receita","True"
+"account_template_581","4.1.02.03.0002","(-) ICMS sobre Devolução de Vendas","account_template_579","other","receita","True"
+"account_template_582","4.1.02.03.0003","(-) IPI s/Devolução de Vendas","account_template_579","other","receita","True"
+"account_template_583","4.1.02.03.0004","(-) Pis Não-Cumulativo s/ Dev. Vendas","account_template_579","other","receita","True"
"account_template_584","4.1.03","RECEITAS FINANCEIRAS","account_template_549","view","receita","True"
"account_template_585","4.1.03.01","RECEITAS COM ATUALIZAÇÕES","account_template_584","view","receita","True"
-"account_template_586","4.1.03.01.0001","Variação Monetária Ativa","account_template_585","receivable","receita","True"
-"account_template_587","4.1.03.01.0002","Variação Cambial Ativa","account_template_585","receivable","receita","True"
+"account_template_586","4.1.03.01.0001","Variação Monetária Ativa","account_template_585","other","receita","True"
+"account_template_587","4.1.03.01.0002","Variação Cambial Ativa","account_template_585","other","receita","True"
"account_template_588","4.1.03.02","GANHOS COM APLICAÇÕES FINANCEIRAS","account_template_584","view","receita","True"
-"account_template_589","4.1.03.02.0001","Rend. Aplic.Automática C/Corrente","account_template_588","receivable","receita","True"
-"account_template_590","4.1.03.02.0002","Ganho Real Aplicações Renda Fixa","account_template_588","receivable","receita","True"
-"account_template_591","4.1.03.02.0003","Ganho Real Aplic.Renda Variável","account_template_588","receivable","receita","True"
-"account_template_592","4.1.03.02.0004","Rendimento Caderneta de Poupança","account_template_588","receivable","receita","True"
+"account_template_589","4.1.03.02.0001","Rend. Aplic.Automática C/Corrente","account_template_588","other","receita","True"
+"account_template_590","4.1.03.02.0002","Ganho Real Aplicações Renda Fixa","account_template_588","other","receita","True"
+"account_template_591","4.1.03.02.0003","Ganho Real Aplic.Renda Variável","account_template_588","other","receita","True"
+"account_template_592","4.1.03.02.0004","Rendimento Caderneta de Poupança","account_template_588","other","receita","True"
"account_template_593","4.1.03.03","JUROS E DESCONTOS OBTIDOS","account_template_584","view","receita","True"
-"account_template_594","4.1.03.03.0001","Juros Recebidos","account_template_593","receivable","receita","True"
-"account_template_595","4.1.03.03.0002","Descontos Obtidos","account_template_593","receivable","receita","True"
+"account_template_594","4.1.03.03.0001","Juros Recebidos","account_template_593","other","receita","True"
+"account_template_595","4.1.03.03.0002","Descontos Obtidos","account_template_593","other","receita","True"
"account_template_596","4.1.03.04","(-) TRIBUTOS S/RECEITAS FINANCEIRAS","account_template_584","view","receita","True"
-"account_template_597","4.1.03.04.0001","PIS sobre Receitas Financeiras","account_template_596","receivable","receita","True"
-"account_template_598","4.1.03.04.0002","COFINS sobre Receitas Financeiras","account_template_596","receivable","receita","True"
+"account_template_597","4.1.03.04.0001","PIS sobre Receitas Financeiras","account_template_596","other","receita","True"
+"account_template_598","4.1.03.04.0002","COFINS sobre Receitas Financeiras","account_template_596","other","receita","True"
"account_template_599","4.1.04","OUTRAS RECEITAS OPERACIONAIS","account_template_549","view","receita","True"
"account_template_600","4.1.04.01","LUCROS PARTIC.EM OUTRAS SOCIEDADES","account_template_599","view","receita","True"
-"account_template_601","4.1.04.01.0001","Resultado de Coligadas e Controladas","account_template_600","receivable","receita","True"
+"account_template_601","4.1.04.01.0001","Resultado de Coligadas e Controladas","account_template_600","other","receita","True"
"account_template_602","4.1.04.02","VENDAS DIVERSAS","account_template_599","view","receita","True"
-"account_template_603","4.1.04.02.0001","Venda de Sucatas","account_template_602","receivable","receita","True"
+"account_template_603","4.1.04.02.0001","Venda de Sucatas","account_template_602","other","receita","True"
"account_template_604","4.1.04.03","BRINDES E AMOSTRAS","account_template_599","view","receita","True"
-"account_template_605","4.1.04.03.0001","Brindes e Bonificações","account_template_604","receivable","receita","True"
-"account_template_606","4.1.04.03.0002","Amostras","account_template_604","receivable","receita","True"
+"account_template_605","4.1.04.03.0001","Brindes e Bonificações","account_template_604","other","receita","True"
+"account_template_606","4.1.04.03.0002","Amostras","account_template_604","other","receita","True"
"account_template_607","4.2","RESULTADOS NÃO OPERACIONAIS","account_template_548","view","receita","True"
"account_template_608","4.2.01","ALIENAÇÃO DE BENS PERMANENTES","account_template_607","view","receita","True"
"account_template_609","4.2.01.01","ALIENAÇÃO DE INVESTIMENTOS","account_template_608","view","receita","True"
-"account_template_610","4.2.01.01.0001","Dividendos Recebidos","account_template_609","receivable","receita","True"
-"account_template_611","4.2.01.01.0002","Alienação Partic.Societárias","account_template_609","receivable","receita","True"
+"account_template_610","4.2.01.01.0001","Dividendos Recebidos","account_template_609","other","receita","True"
+"account_template_611","4.2.01.01.0002","Alienação Partic.Societárias","account_template_609","other","receita","True"
"account_template_612","4.2.01.02","ALIENAÇÃO DE IMOBILIZADO","account_template_608","view","receita","True"
-"account_template_613","4.2.01.02.0001","Alienação de Máquinas e Equipamentos","account_template_612","receivable","receita","True"
-"account_template_614","4.2.01.02.0002","Alienação de Móveis e Utensílios","account_template_612","receivable","receita","True"
-"account_template_615","4.2.01.02.0003","Alienação de Ferramentas","account_template_612","receivable","receita","True"
-"account_template_616","4.2.01.02.0004","Alienação de Imóveis","account_template_612","receivable","receita","True"
-"account_template_617","4.2.01.02.0005","Alienação de Veículos","account_template_612","receivable","receita","True"
-"account_template_618","4.2.01.02.0006","Alienação de Equip.de Informática","account_template_612","receivable","receita","True"
+"account_template_613","4.2.01.02.0001","Alienação de Máquinas e Equipamentos","account_template_612","other","receita","True"
+"account_template_614","4.2.01.02.0002","Alienação de Móveis e Utensílios","account_template_612","other","receita","True"
+"account_template_615","4.2.01.02.0003","Alienação de Ferramentas","account_template_612","other","receita","True"
+"account_template_616","4.2.01.02.0004","Alienação de Imóveis","account_template_612","other","receita","True"
+"account_template_617","4.2.01.02.0005","Alienação de Veículos","account_template_612","other","receita","True"
+"account_template_618","4.2.01.02.0006","Alienação de Equip.de Informática","account_template_612","other","receita","True"
"account_template_619","4.2.02","DEDUÇÕES DAS ALIENAÇÕES DE BENS","account_template_607","view","receita","True"
"account_template_620","4.2.02.01","CUSTO DA ALIENAÇÃO DE INVESTIMENTOS","account_template_619","view","receita","True"
-"account_template_621","4.2.02.01.0001","Custo Alienação Partic.Societárias","account_template_620","receivable","receita","True"
+"account_template_621","4.2.02.01.0001","Custo Alienação Partic.Societárias","account_template_620","other","receita","True"
"account_template_622","4.2.02.02","CUSTO DA ALIENAÇÃO DE IMOBILIZADO","account_template_619","view","receita","True"
-"account_template_623","4.2.02.02.0001","Custo Alienação Máqs.e Equipamentos","account_template_622","receivable","receita","True"
-"account_template_624","4.2.02.02.0002","Custo Alienação Movs.e Utensílios","account_template_622","receivable","receita","True"
-"account_template_625","4.2.02.02.0003","Custo Alienação Ferramentas","account_template_622","receivable","receita","True"
-"account_template_626","4.2.02.02.0004","Custo Alienação de Imóveis","account_template_622","receivable","receita","True"
-"account_template_627","4.2.02.02.0005","Custo Alienação de Veículos","account_template_622","receivable","receita","True"
-"account_template_628","4.2.02.02.0006","Custo Alienação Equip.Informática","account_template_622","receivable","receita","True"
+"account_template_623","4.2.02.02.0001","Custo Alienação Máqs.e Equipamentos","account_template_622","other","receita","True"
+"account_template_624","4.2.02.02.0002","Custo Alienação Movs.e Utensílios","account_template_622","other","receita","True"
+"account_template_625","4.2.02.02.0003","Custo Alienação Ferramentas","account_template_622","other","receita","True"
+"account_template_626","4.2.02.02.0004","Custo Alienação de Imóveis","account_template_622","other","receita","True"
+"account_template_627","4.2.02.02.0005","Custo Alienação de Veículos","account_template_622","other","receita","True"
+"account_template_628","4.2.02.02.0006","Custo Alienação Equip.Informática","account_template_622","other","receita","True"
"account_template_629","4.2.03","OUTRAS RECEITAS NÃO OPERACIONAIS","account_template_607","view","receita","True"
"account_template_630","4.2.03.01","INDENIZAÇÃO DE SEGUROS","account_template_629","view","receita","True"
-"account_template_631","4.2.03.01.0001","Indenização de Seguros","account_template_630","receivable","receita","True"
+"account_template_631","4.2.03.01.0001","Indenização de Seguros","account_template_630","other","receita","True"
"account_template_632","4.2.03.02","OUTRAS RECEITAS","account_template_629","view","receita","True"
-"account_template_633","4.2.03.02.0001","Recuperação de Despesas","account_template_632","receivable","receita","True"
+"account_template_633","4.2.03.02.0001","Recuperação de Despesas","account_template_632","other","receita","True"
"account_template_634","5","CONTAS DE FECHAMENTO DE BALANÇO","account_template_1","view","resultado","True"
"account_template_635","5.1","RESULTADO DO EXERCÍCIO","account_template_634","view","resultado","True"
"account_template_636","5.1.01","RESULTADO OPERACIONAL","account_template_635","view","resultado","True"
diff --git a/addons/l10n_br/data/account.account.type.csv b/addons/l10n_br/data/account.account.type.csv
index 1b1d8cfddac..9f3844cdd2e 100644
--- a/addons/l10n_br/data/account.account.type.csv
+++ b/addons/l10n_br/data/account.account.type.csv
@@ -1,6 +1,6 @@
"id","code","name","close_method"
-"ativo","1","Ativo","balance"
-"passivo","2","Passivo","balance"
+"ativo","1","Ativo","unreconciled"
+"passivo","2","Passivo","unreconciled"
"despesa","3","Despesas","balance"
"receita","4","Receita","balance"
"resultado","5","Resultado","balance"
diff --git a/addons/l10n_cn/account_chart.xml b/addons/l10n_cn/account_chart.xml
index 624e76a190e..cadd288c810 100644
--- a/addons/l10n_cn/account_chart.xml
+++ b/addons/l10n_cn/account_chart.xml
@@ -12,13 +12,13 @@
资产类1
- balance
+ unreconciledasset负债类2
- balance
+ unreconciledliability
@@ -767,7 +767,7 @@
4103
- payable
+ other本年利润
diff --git a/addons/l10n_de/account_chart_skr03.xml b/addons/l10n_de/account_chart_skr03.xml
index 187f0259dbb..7a7e1fb8ee0 100644
--- a/addons/l10n_de/account_chart_skr03.xml
+++ b/addons/l10n_de/account_chart_skr03.xml
@@ -1228,7 +1228,7 @@
1490receivable
-
+
@@ -1732,7 +1732,7 @@
1401receivable
-
+
@@ -1740,7 +1740,7 @@
1400receivable
-
+
@@ -3164,7 +3164,7 @@
1450receivable
-
+
@@ -3476,7 +3476,7 @@
1630payable
-
+
@@ -3684,7 +3684,7 @@
1480receivable
-
+
@@ -3836,7 +3836,7 @@
1650payable
-
+
@@ -4836,7 +4836,7 @@
1470receivable
-
+
@@ -4844,7 +4844,7 @@
1610payable
-
+
@@ -5956,7 +5956,7 @@
1640payable
-
+
@@ -7084,7 +7084,7 @@
1601payable
-
+
@@ -7092,7 +7092,7 @@
1600payable
-
+
@@ -7108,7 +7108,7 @@
1605payable
-
+
@@ -7116,7 +7116,7 @@
1607payable
-
+
@@ -7124,7 +7124,7 @@
1606payable
-
+
@@ -7732,7 +7732,7 @@
1410receivable
-
+
@@ -8404,7 +8404,7 @@
1446receivable
-
+
@@ -8844,7 +8844,7 @@
1447receivable
-
+
diff --git a/addons/l10n_de/account_chart_skr04.xml b/addons/l10n_de/account_chart_skr04.xml
index 8ca8f35b98f..09af6c20e28 100644
--- a/addons/l10n_de/account_chart_skr04.xml
+++ b/addons/l10n_de/account_chart_skr04.xml
@@ -3313,7 +3313,7 @@
receivable
-
+
@@ -3367,7 +3367,7 @@
receivable
-
+
@@ -3376,7 +3376,7 @@
receivable
-
+
@@ -3385,7 +3385,7 @@
receivable
-
+
@@ -3394,7 +3394,7 @@
receivable
-
+
@@ -3403,7 +3403,7 @@
receivable
-
+
@@ -3412,7 +3412,7 @@
receivable
-
+
@@ -3546,7 +3546,7 @@
receivable
-
+
@@ -3670,7 +3670,7 @@
receivable
-
+
@@ -3794,7 +3794,7 @@
receivable
-
+
@@ -6214,7 +6214,7 @@
payable
-
+
@@ -6223,7 +6223,7 @@
payable
-
+
@@ -6232,7 +6232,7 @@
payable
-
+
@@ -6241,7 +6241,7 @@
payable
-
+
@@ -6268,7 +6268,7 @@
payable
-
+
@@ -6304,7 +6304,7 @@
payable
-
+
@@ -6445,7 +6445,7 @@
payable
-
+
@@ -6525,7 +6525,7 @@
payable
-
+
diff --git a/addons/l10n_es/account_chart.xml b/addons/l10n_es/account_chart.xml
index df0b218ae49..5147024deae 100644
--- a/addons/l10n_es/account_chart.xml
+++ b/addons/l10n_es/account_chart.xml
@@ -37,18 +37,18 @@
Terceros - A Cobrarterceros - recasset
- balance
+ unreconciledTerceros - A Pagarterceros - payliability
- balance
+ unreconciledImpuestostax
- balance
+ unreconciledFinancieras
diff --git a/addons/l10n_in/l10n_in_chart.xml b/addons/l10n_in/l10n_in_chart.xml
index f6851050604..0253756838c 100644
--- a/addons/l10n_in/l10n_in_chart.xml
+++ b/addons/l10n_in/l10n_in_chart.xml
@@ -37,11 +37,13 @@
Assetasset
+ unreconciledassetLiabilityliability
+ unreconciledliability
diff --git a/addons/l10n_it/data/account.account.template.csv b/addons/l10n_it/data/account.account.template.csv
index ff91ccba79a..388d037ad4e 100644
--- a/addons/l10n_it/data/account.account.template.csv
+++ b/addons/l10n_it/data/account.account.template.csv
@@ -66,8 +66,8 @@
2,2,"PASSIVO ",0,"account_type_view","view",TRUE
20,20,"PATRIMONIO NETTO ",2,"account_type_view","view",TRUE
2101,2101,"patrimonio netto ",20,"account_type_view","other",TRUE
-2102,2102,"utile d'esercizio ",20,"account_type_view","receivable",TRUE
-2103,2103,"perdita d'esercizio ",20,"account_type_view","payable",TRUE
+2102,2102,"utile d'esercizio ",20,"account_type_receivable","receivable",TRUE
+2103,2103,"perdita d'esercizio ",20,"account_type_payable","payable",TRUE
2104,2104,"prelevamenti extra gestione ",20,"account_type_view","other",TRUE
2105,2105,"titolare c/ritenute subite ",20,"account_type_view","other",TRUE
22,22,"FONDI PER RISCHI E ONERI ",2,"account_type_view","view",TRUE
diff --git a/addons/l10n_uk/__openerp__.py b/addons/l10n_uk/__openerp__.py
index 58a687e4be9..cf97b79d323 100644
--- a/addons/l10n_uk/__openerp__.py
+++ b/addons/l10n_uk/__openerp__.py
@@ -44,6 +44,7 @@
'demo_xml' : [
'demo/demo.xml'
],
- 'installable': 'True'
+ 'installable': 'True',
+ 'images': ['images/config_chart_l10n_uk.jpeg','images/l10n_uk_chart.jpeg'],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py
index 771779310cb..3c658333e14 100644
--- a/addons/lunch/lunch.py
+++ b/addons/lunch/lunch.py
@@ -138,7 +138,7 @@ class lunch_order(osv.osv):
'cashmove': fields.many2one('lunch.cashmove', 'CashMove' , readonly=True),
'descript': fields.char('Description Order', readonly=True, size=250, \
states = {'draft':[('readonly', False)]}),
- 'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ], \
+ 'state': fields.selection([('draft', 'New'), ('confirmed', 'Confirmed'), ], \
'State', readonly=True, select=True),
'price': fields.function(_price_get, string="Price"),
'category': fields.many2one('lunch.category','Category'),
diff --git a/addons/lunch/lunch_installer_view.xml b/addons/lunch/lunch_installer_view.xml
index a318df9eee0..693ac9aa27f 100644
--- a/addons/lunch/lunch_installer_view.xml
+++ b/addons/lunch/lunch_installer_view.xml
@@ -1,18 +1,32 @@
-
-
- Define Your Lunch Products
- ir.actions.act_window
- lunch.product
- form
- tree,form
-
-
-
-
-
-
- 50
-
+
+
+ Define Your Lunch Products
+ ir.actions.act_window
+ lunch.product
+ form
+ tree,form
+
+
+
+
+
+
+ 50
+
+
+
+ Create CashBox
+ ir.actions.act_window
+ lunch.cashbox
+ form
+ form
+
+
+
+
+
+ 51
+
diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml
index 6721dd7c1e3..0b2cdf04e89 100644
--- a/addons/lunch/lunch_view.xml
+++ b/addons/lunch/lunch_view.xml
@@ -34,7 +34,7 @@
-
+
diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py
index e9716be9e8e..08473cad102 100644
--- a/addons/mail/__openerp__.py
+++ b/addons/mail/__openerp__.py
@@ -62,6 +62,7 @@ The main features are:
"res_partner_view.xml",
'security/ir.model.access.csv',
'mail_data.xml',
+ 'mail_installer.xml',
],
'installable': True,
'active': False,
diff --git a/addons/mail/mail_installer.xml b/addons/mail/mail_installer.xml
new file mode 100644
index 00000000000..3faf5fad630
--- /dev/null
+++ b/addons/mail/mail_installer.xml
@@ -0,0 +1,17 @@
+
+
+
+
+ Configure Email Server
+ ir.actions.act_window
+ ir.mail_server
+ form
+ form
+
+
+
+
+
+
+
+
diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py
index 27c91fcc3fe..547281911c4 100644
--- a/addons/marketing_campaign/marketing_campaign.py
+++ b/addons/marketing_campaign/marketing_campaign.py
@@ -113,7 +113,7 @@ this campaign to be run"),
Test in Realtime - It creates and processes all the activities directly but does not send emails or produce reports.
With Manual Confirmation - the campaigns runs normally, but the user has to validate all workitem manually.
Normal - the campaign runs normally and automatically sends all emails and reports (be very careful with this mode, you're live!)"""),
- 'state': fields.selection([('draft', 'Draft'),
+ 'state': fields.selection([('draft', 'New'),
('running', 'Running'),
('done', 'Done'),
('cancelled', 'Cancelled'),],
@@ -267,7 +267,7 @@ class marketing_campaign_segment(osv.osv):
'"No duplicates" prevents selecting records which have already entered the campaign previously.'\
'If the campaign has a "unique field" set, "no duplicates" will also prevent selecting records which have '\
'the same value for the unique field as other records that already entered the campaign.'),
- 'state': fields.selection([('draft', 'Draft'),
+ 'state': fields.selection([('draft', 'New'),
('running', 'Running'),
('done', 'Done'),
('cancelled', 'Cancelled')],
diff --git a/addons/marketing_campaign/marketing_campaign_view.xml b/addons/marketing_campaign/marketing_campaign_view.xml
index cd872e64635..a60b3943a41 100644
--- a/addons/marketing_campaign/marketing_campaign_view.xml
+++ b/addons/marketing_campaign/marketing_campaign_view.xml
@@ -36,7 +36,7 @@
-
+
@@ -161,7 +161,7 @@
-
+
@@ -382,7 +382,7 @@
-
+
diff --git a/addons/mrp/i18n/fr.po b/addons/mrp/i18n/fr.po
index a1ad6c25fa4..6582e283c5d 100644
--- a/addons/mrp/i18n/fr.po
+++ b/addons/mrp/i18n/fr.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:15+0000\n"
-"PO-Revision-Date: 2011-05-24 16:08+0000\n"
+"PO-Revision-Date: 2011-09-26 12:16+0000\n"
"Last-Translator: lholivier \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-05 04:59+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
+"X-Generator: Launchpad (build 14028)\n"
#. module: mrp
#: field:mrp.bom,product_uos:0
@@ -91,8 +91,8 @@ msgid ""
"The 'Minimum stock rule' allows the system to create procurement orders "
"automatically as soon as the minimum stock is reached."
msgstr ""
-"La \"règle de stock minimum\" permet au système d'enregistrer "
-"automatiquement les besoins dès que le stock minimum est atteint."
+"La \"règle de stock minimum\" permet au système de créer automatiquement les "
+"approvisionnements dès que le stock minimum est atteint."
#. module: mrp
#: field:mrp.production,picking_id:0
@@ -232,8 +232,8 @@ msgid ""
"In case the Supply method of the product is Produce, the system creates a "
"production order."
msgstr ""
-"Dans le cas où la méthode d'approvisionnement de ce produit est Produire, le "
-"système crée un ordre de fabrication"
+"Dans le cas où la méthode de fourniture de ce produit est \"Produire\", le "
+"système crée un ordre de fabrication."
#. module: mrp
#: view:mrp.production:0
@@ -293,7 +293,7 @@ msgstr "["
#. module: mrp
#: model:process.transition,name:mrp.process_transition_procureserviceproduct0
msgid "Procurement of services"
-msgstr "Besoin de services"
+msgstr "Approvisionnement de services"
#. module: mrp
#: view:mrp.workcenter:0
@@ -322,8 +322,8 @@ msgid ""
"products are typically procured manually or through a minimum stock rule."
msgstr ""
"Le système attend que les produits soient disponibles en stock. Typiquement, "
-"les besoins en ces produits sont traités manuellement ou avec une règle de "
-"stock minimum."
+"les approvisionnements de ces produits sont traités manuellement ou avec une "
+"règle de stock minimum."
#. module: mrp
#: report:mrp.production.order:0
@@ -389,7 +389,7 @@ msgstr "Coût des composants de "
#. module: mrp
#: model:process.transition,name:mrp.process_transition_procurestockableproduct0
msgid "Procurement of stockable Product"
-msgstr "Besoin de produit stocké"
+msgstr "Approvisionnement de produit stocké"
#. module: mrp
#: view:mrp.bom:0
@@ -621,7 +621,7 @@ msgstr "Fabriquer"
#. module: mrp
#: help:mrp.workcenter,costs_cycle:0
msgid "Specify Cost of Work Center per cycle."
-msgstr ""
+msgstr "Précisez le coût du poste de charge par cycle"
#. module: mrp
#: selection:mrp.production,state:0
@@ -852,9 +852,9 @@ msgid ""
"order creates a RFQ for a subcontracting purchase order or waits until the "
"service is done (= the delivery of the products)."
msgstr ""
-"En fonction de la méthode choisie pour \"l'approvisionnement\" du service, "
-"le besoin va générer un appel d'offres pour une commande de sous-traitance, "
-"ou va attendre jusqu'à ce que le service soit effectué (= la livraison des "
+"En fonction de la méthode de fourniture du service, l'approvisionnement va "
+"générer un appel d'offres pour une commande de sous-traitance, ou va "
+"attendre jusqu'à ce que le service soit effectué (= la livraison des "
"produits)."
#. module: mrp
@@ -866,7 +866,7 @@ msgstr "Urgent"
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_routing_workcenter
msgid "Work Center Usage"
-msgstr ""
+msgstr "Utilisation du poste de charge"
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_production
@@ -876,7 +876,7 @@ msgstr "Ordre de fabrication"
#. module: mrp
#: model:process.transition,name:mrp.process_transition_productionprocureproducts0
msgid "Procurement of raw material"
-msgstr "Besoin de matière première"
+msgstr "Approvisionnement de matière première"
#. module: mrp
#: help:mrp.routing.workcenter,hour_nbr:0
@@ -1043,6 +1043,9 @@ msgid ""
"Number of operations this Work Center can do in parallel. If this Work "
"Center represents a team of 5 workers, the capacity per cycle is 5."
msgstr ""
+"Nombre d'opérations simultanées que ce poste de charge peut réaliser. Si ce "
+"poste de charge représente une équipe de 5 personnes, la capacité par cycle "
+"est de 5."
#. module: mrp
#: model:process.transition,note:mrp.process_transition_servicerfq0
@@ -1050,8 +1053,8 @@ msgid ""
"If the service has a 'Buy' supply method, this creates a RFQ, a "
"subcontracting demand for instance."
msgstr ""
-"Si la méthode d'approvisionnement du service est \"Acheter\", ceci va créer "
-"un appel d'offres, par exemple une demande de sous-traitance."
+"Si la méthode de fourniture du service est \"Acheter\", ceci va créer un "
+"appel d'offres, par exemple une demande de sous-traitance."
#. module: mrp
#: field:mrp.production,move_prod_id:0
@@ -1066,7 +1069,7 @@ msgstr "En retard"
#. module: mrp
#: model:process.node,name:mrp.process_node_servicemts0
msgid "Make to stock"
-msgstr "Sur stock"
+msgstr "Production sur stock"
#. module: mrp
#: help:mrp.routing.workcenter,sequence:0
@@ -1139,7 +1142,7 @@ msgid ""
"avoids having to wait for the procurement scheduler to run or having to run "
"the procurement scheduler manually."
msgstr ""
-"Permet le calcul en Juste-à-temps des besoins.\n"
+"Permet le calcul en Juste-à-temps des approvisionnements.\n"
"\n"
"Bien que cela soit plus gourmand en ressources que le fonctionnement "
"standard, le calcul en Juste-à-Temps permet d'éviter d'attendre l'activation "
@@ -1225,6 +1228,41 @@ msgid ""
" * List of procurement in exception\n"
" "
msgstr ""
+"\n"
+" Ceci est la module de base de la gestion de fabrication d'OpenERP.\n"
+"\n"
+" Fonctionnalités :\n"
+" * Fabrication pour stockage / Fabrication pour commande (par ligne)\n"
+" * Nomenclatures multi-niveaux (sans limitations)\n"
+" * Gammes multi-niveaux (sans limitations)\n"
+" * Gamme et poste de charge intégrés avec la comptabilité analytique\n"
+" * Re-planification périodique / module juste à temps\n"
+" * Multi-points de vente, multi-stocks\n"
+" * Différentes Stratégies d'ordonnancement\n"
+" * Méthode des coûts par produit : prix standard , prix moyen\n"
+" * Analyse facilitée des besoins et des incidents\n"
+" * Grande flexibilité\n"
+" * Permet de parcourir la totalité des nomenclatures\n"
+" y compris les nomenclatures filles et les nomenclatures fantômes\n"
+" Il intègre complètement la planification des marchandises stockables,\n"
+" et des services consommables. Les services sont integratés avec le "
+"reste\n"
+" du logiciel. Par exemple, on peut placer un service dans une "
+"nomenclature\n"
+" afin de déclencher automatiquement un achat lors d'un ordre de "
+"fabrication.\n"
+"\n"
+" Rapports fournis par ce module :\n"
+" * Structure et composants de nomenclature\n"
+" * Pévision de la charge pour les postes de charge\n"
+" * Impression des ordres de fabrication\n"
+" * Prévision des stocks\n"
+" Tableau de bord de ce module :\n"
+" * Liste des prochains ordres de production\n"
+" * Liste des livraisons (en sortie de colisage)\n"
+" * Graphique de charge des postes de charge\n"
+" * Liste des approvisionnements en défaut\n"
+" "
#. module: mrp
#: model:ir.actions.act_window,name:mrp.mrp_production_action4
@@ -1359,9 +1397,10 @@ msgid ""
"maxi quantity. It's available in the Inventory management menu and "
"configured by product."
msgstr ""
-"La règle du stock minimum est une règle de gestion automatique des besoins, "
-"basée sur des quantités minimum et maximum. Cette règle est disponible dans "
-"le menu de gestion des stocks, et paramétrable pour chaque produit."
+"La règle du stock minimum est une règle de gestion automatique des "
+"approvisionnements, basée sur des quantités minimum et maximum. Cette règle "
+"est disponible dans le menu de gestion des stocks, et paramétrable pour "
+"chaque produit."
#. module: mrp
#: selection:mrp.workcenter.load,time_unit:0
@@ -1455,13 +1494,13 @@ msgid ""
"In case the Supply method of the product is Buy, the system creates a "
"purchase order."
msgstr ""
-"Dans le cas où la méthode d'approvisionnement est \"Acheter\", le système va "
-"créer un Ordre d'Achat"
+"Dans le cas où la méthode de fourniture est \"Acheter\", le système va créer "
+"un ordre d'achat."
#. module: mrp
#: model:ir.model,name:mrp.model_procurement_order
msgid "Procurement"
-msgstr "Besoin"
+msgstr "Approvisionnement"
#. module: mrp
#: model:ir.actions.act_window,name:mrp.action_view_mrp_product_price_wizard
@@ -1542,7 +1581,7 @@ msgstr "Actif"
#. module: mrp
#: model:process.node,name:mrp.process_node_procureproducts0
msgid "Procure Products"
-msgstr "Satisfaire le besoin de produit"
+msgstr "Approvisionner les produits"
#. module: mrp
#: model:ir.actions.act_window,name:mrp.action_report_workcenter_load_tree
@@ -1592,7 +1631,7 @@ msgstr "Modifier les quantités de produit"
#. module: mrp
#: model:process.node,note:mrp.process_node_productionorder0
msgid "Drives the procurement orders for raw material."
-msgstr "Pilote la gestion des besoins de matières premières"
+msgstr "Pilote la gestion des approvisionnement en matières premières"
#. module: mrp
#: view:mrp.production.order:0
@@ -1719,7 +1758,7 @@ msgstr "Produits consommés"
#: model:process.transition,name:mrp.process_transition_servicemto0
#: model:process.transition,name:mrp.process_transition_stockproduct0
msgid "Make to Order"
-msgstr "Fabrication à la commande"
+msgstr "Production à la demande"
#. module: mrp
#: model:ir.actions.act_window,name:mrp.action_report_mrp_production_order
@@ -1914,7 +1953,7 @@ msgstr "Ordre de Production"
#. module: mrp
#: model:process.node,note:mrp.process_node_productminimumstockrule0
msgid "Automatic procurement rule"
-msgstr "Règle de gestion automatique des besoins"
+msgstr "Règle de gestion automatique des approvisionnements"
#. module: mrp
#: view:mrp.production:0
@@ -2110,7 +2149,7 @@ msgstr "Information de coût"
#. module: mrp
#: model:process.node,name:mrp.process_node_purchaseprocure0
msgid "Procurement Orders"
-msgstr "Besoins"
+msgstr "Ordre d'approvisionnement"
#. module: mrp
#: help:mrp.bom,product_rounding:0
@@ -2315,6 +2354,8 @@ msgid ""
"Description of the Work Center. Explain here what's a cycle according to "
"this Work Center."
msgstr ""
+"Description du poste de charge. Expliquer ici ce qu'est un cycle pour un tel "
+"poste de charge."
#. module: mrp
#: model:ir.model,name:mrp.model_mrp_routing
@@ -2368,7 +2409,7 @@ msgstr "Production"
#. module: mrp
#: view:board.board:0
msgid "Procurements in Exception"
-msgstr "Besoins en exception"
+msgstr "Approvisionnements en exception"
#. module: mrp
#: model:process.transition,name:mrp.process_transition_minimumstockprocure0
@@ -2443,7 +2484,7 @@ msgstr ""
#. module: mrp
#: model:process.node,note:mrp.process_node_procureproducts0
msgid "The way to procurement depends on the product type."
-msgstr "Le moyen de satisfaire le besoin dépend du type de produit"
+msgstr "Le moyen d’approvisionnement dépend du type de produit"
#. module: mrp
#: model:ir.ui.menu,name:mrp.menu_mrp_manufacturing
@@ -2477,8 +2518,8 @@ msgid ""
"Depending on the chosen method to supply the stockable products, the "
"procurement order creates a RFQ, a production order, ... "
msgstr ""
-"Selon la méthode d'approvisionnement choisie pour les produits suivis en "
-"stock, le besoin générera un appel d'offres, un ordre de fabrication, ... "
+"Selon la méthode de fourniture choisie pour les produits suivis en stock, "
+"l'approvisionnement générera un appel d'offres, un ordre de fabrication, ... "
#. module: mrp
#: help:mrp.workcenter,time_stop:0
@@ -2496,8 +2537,8 @@ msgid ""
"If the service has a 'Produce' supply method, this creates a task in the "
"project management module of OpenERP."
msgstr ""
-"Si la méthode d'approvisionnement du service est \"Produire\", ceci va créer "
-"une tâche dans le module de gestion de projets."
+"Si la méthode de fourniture du service est \"Produire\", ceci va créer une "
+"tâche dans le module de gestion de projets."
#. module: mrp
#: model:process.transition,note:mrp.process_transition_productionprocureproducts0
@@ -2506,9 +2547,9 @@ msgid ""
"production order creates as much procurement orders as components listed in "
"the BOM, through a run of the schedulers (MRP)."
msgstr ""
-"Afin de s'approvisionner en matières premières (à acheter ou à fabriquer), "
-"l'ordre de fabrication crée autant de besoins que de composants présents "
-"dans la nomenclature, par le biais des planificateurs (MRP)."
+"Afin de fournir les matières premières (à acheter ou à fabriquer), l'ordre "
+"de fabrication crée autant d'ordres d'approvisionnement que de composants "
+"présents dans la nomenclature, par le biais des planificateurs (MRP)."
#. module: mrp
#: help:mrp.product_price,number:0
@@ -3323,6 +3364,15 @@ msgstr "Année"
#~ msgid "Specify Cost of Work center per cycle."
#~ msgstr "Spécifie le coût par cycle d'un poste de charges."
+#~ msgid ""
+#~ "Routing indicates all the workcenters used, for how long and/or cycles.If "
+#~ "Routing is indicated then,the third tab of a production order (workcenters) "
+#~ "will be automatically pre-completed."
+#~ msgstr ""
+#~ "La gamme indique tous les postes de charge utilisés, la durée et/ou le "
+#~ "nombre de cycles. Quand \"Gamme\" est indiqué, le troisième onglet des "
+#~ "ordres de fabrication (postes de charge) est automatiquement pré-rempli."
+
#~ msgid ""
#~ "\n"
#~ " This is the base module to manage the manufacturing process in OpenERP.\n"
@@ -3364,7 +3414,7 @@ msgstr "Année"
#~ "fabrication.\n"
#~ "\n"
#~ " Fonctionnalités:\n"
-#~ " * Fabrication pour stock/ Fabrication à la commande (par ligne)\n"
+#~ " * Production sur stock / à la demande (par ligne)\n"
#~ " * Nomenclatures multi-niveaux, sans limitation\n"
#~ " * Gammes multi-niveaux, sans limitation\n"
#~ " * Gammes et postes de charge intégrés dans la comptabilité analytique\n"
@@ -3396,12 +3446,3 @@ msgstr "Année"
#~ " * Graphique de la charge des postes\n"
#~ " * Liste des approvisionnements ayant subit un incident\n"
#~ " "
-
-#~ msgid ""
-#~ "Routing indicates all the workcenters used, for how long and/or cycles.If "
-#~ "Routing is indicated then,the third tab of a production order (workcenters) "
-#~ "will be automatically pre-completed."
-#~ msgstr ""
-#~ "La gamme indique tous les postes de charge utilisés, la durée et/ou le "
-#~ "nombre de cycles. Quand \"Gamme\" est indiqué, le troisième onglet des "
-#~ "ordres de fabrication (postes de charge) est automatiquement pré-rempli."
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 7b9d403a95d..422700710d8 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -477,7 +477,7 @@ class mrp_production(osv.osv):
'move_created_ids2': fields.one2many('stock.move', 'production_id', 'Produced Products', domain=[('state','in', ('done', 'cancel'))]),
'product_lines': fields.one2many('mrp.production.product.line', 'production_id', 'Scheduled goods'),
'workcenter_lines': fields.one2many('mrp.production.workcenter.line', 'production_id', 'Work Centers Utilisation'),
- 'state': fields.selection([('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'State', readonly=True,
+ 'state': fields.selection([('draft','New'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','Production Started'),('cancel','Cancelled'),('done','Done')],'State', readonly=True,
help='When the production order is created the state is set to \'Draft\'.\n If the order is confirmed the state is set to \'Waiting Goods\'.\n If any exceptions are there, the state is set to \'Picking Exception\'.\
\nIf the stock is available then the state is set to \'Ready to Produce\'.\n When the production gets started then the state is set to \'In Production\'.\n When the production is over, the state is set to \'Done\'.'),
'hour_total': fields.function(_production_calc, type='float', string='Total Hours', multi='workorder', store=True),
diff --git a/addons/mrp/mrp_installer.xml b/addons/mrp/mrp_installer.xml
index 7eabd5a45b1..af2a35b3ce7 100644
--- a/addons/mrp/mrp_installer.xml
+++ b/addons/mrp/mrp_installer.xml
@@ -19,5 +19,54 @@
-
+
+
+
+ MRP Management
+ 6
+
+
+
+ Configure your work centers
+ ir.actions.act_window
+ mrp.workcenter
+ form,tree
+ form
+
+
+
+
+
+
+
+
+
+ Create Bill of Materials
+ ir.actions.act_window
+ mrp.bom
+ form,tree
+ form
+
+
+
+
+
+
+
+
+ Create or Import Products
+ ir.actions.act_window
+ product.product
+ form
+ tree,form
+
+ Create a product form for everything you buy or sell. Specify a supplier if the product can be purchased.
+
+
+
+
+
+ 20
+
+
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index a344545748c..cec6fd42687 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -700,7 +700,7 @@
-
+
diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py
index 3ad4184c413..4bb525db1ff 100644
--- a/addons/mrp/report/mrp_production_order.py
+++ b/addons/mrp/report/mrp_production_order.py
@@ -19,118 +19,4 @@
#
##############################################################################
-from osv import fields,osv
-import tools
-
-
-class mrp_production_order(osv.osv):
- _name = "mrp.production.order"
- _description = "Production Order Report"
- _auto = False
- _columns = {
- 'year': fields.char('Year',size=64,readonly=True),
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
- ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
- 'day': fields.char('Day',size=64,readonly=True),
- 'origin': fields.char('Source Document', size=64),
- 'nbr': fields.integer('# of Lines', readonly=True),
- 'products_to_consume': fields.integer('Products to Consume', readonly=True),
- 'consumed_products': fields.integer('Consumed Products', readonly=True),
- 'date': fields.date('Date', readonly=True),
- 'product_id': fields.many2one('product.product', 'Product', readonly=True),
- 'product_id2': fields.many2one('product.product', 'Product Consumed', readonly=True),
- 'product_qty': fields.float('Product Qty', readonly=True),
- 'state': fields.selection([('draft','Draft'),
- ('picking_except', 'Picking Exception'),
- ('confirmed','Waiting Goods'),
- ('ready','Ready to Produce'),
- ('in_production','In Production'),
- ('cancel','Cancelled'),
- ('done','Done')],
- 'State', readonly=True),
- 'date_planned':fields.date('Scheduled Date'),
- 'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', readonly=True),
- 'date_start': fields.datetime('Start Date',readonly=True),
- 'date_finished': fields.datetime('End Date',readonly=True),
- 'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', readonly=True),
- 'company_id': fields.many2one('res.company','Company',readonly=True),
- 'bom_id': fields.many2one('mrp.bom', 'Bill of Material',readonly=True),
- 'routing_id': fields.many2one('mrp.routing', string='Routing',readonly=True),
- 'picking_id': fields.many2one('stock.picking', 'Picking list', readonly=True),
- 'product_uom': fields.many2one('product.uom', 'Product UOM', readonly=True),
- 'priority': fields.selection([('0','Not urgent'),
- ('1','Normal'),
- ('2','Urgent'),
- ('3','Very Urgent')],
- 'Priority',readonly=True),
-
-
- }
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'mrp_production_order')
- cr.execute("""
- create or replace view mrp_production_order as (
- select
- min(l.id) as id,
- to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY') as date,
- to_char(s.create_date, 'YYYY') as year,
- to_char(s.create_date, 'MM') as month,
- to_char(s.create_date, 'YYYY-MM-DD') as day,
- s.product_id as product_id,
- l.product_id as product_id2,
- l.product_uom,
- sum(l.product_qty * u.factor) as product_qty,
- s.company_id as company_id,
- (select 1) as nbr,
- (select sum(sm.product_qty) from stock_move as sm
- left join mrp_production_move_ids as mv on (sm.id=mv.move_id)
- left join mrp_production_product_line as ll on (ll.production_id=mv.production_id)
- where sm.product_id=ll.product_id and ll.id=l.id
- and sm.state not in ('done','cancel')
- group by sm.product_id) as products_to_consume,
- (select sum(sm.product_qty)/2 from stock_move as sm
- left join mrp_production_move_ids as mv on (sm.id=mv.move_id)
- left join mrp_production_product_line as ll on (ll.production_id=mv.production_id)
- where sm.product_id=ll.product_id and ll.id=l.id
- and sm.state in ('done','cancel')
- group by sm.product_id) as consumed_products,
- s.location_src_id,
- s.location_dest_id,
- s.bom_id,
- s.routing_id,
- s.picking_id,
- s.date_start,
- s.date_finished,
- to_date(to_char(s.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_planned,
- s.origin,
- s.priority,
- s.state
- from mrp_production_product_line l
- left join mrp_production s on (s.id=l.production_id)
- left join product_uom u on (u.id=l.product_uom)
- group by
- to_char(s.create_date, 'YYYY'),
- to_char(s.create_date, 'MM'),
- to_char(s.create_date, 'YYYY-MM-DD'),
- to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY'),
- l.product_id,
- s.product_id,
- l.product_uom,
- s.id,
- l.id,
- s.bom_id,
- s.routing_id,
- s.picking_id,
- s.priority,
- s.location_src_id,
- s.location_dest_id,
- s.state,
- to_date(to_char(s.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY'),
- s.origin,
- s.date_start,
- s.date_finished,
- s.company_id
- )""")
-mrp_production_order()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index fe25ef8fd19..140170e4906 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -1,133 +1,6 @@
-
-
-
- mrp.production.order.tree
- mrp.production.order
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mrp.production.order.graph
- mrp.production.order
- graph
-
-
-
-
-
-
-
-
-
- mrp.production.order.select
- mrp.production.order
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Production Analysis
- mrp.production.order
- form
- tree,graph
-
-
- {'search_default_Product': 1,'search_default_month':1,'group_by_no_leaf':1,'group_by':[]}
- This reporting allows you to analyse your manufacturing activities and performance.
-
-
-
-
- tree
-
-
-
-
-
-
- graph
-
-
-
-
-
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index 4af31e9c902..1d93fb460b5 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -29,7 +29,6 @@
"access_procurement_stock_worker","procurement.order stock_worker","model_procurement_order","stock.group_stock_user",1,1,1,1
"access_procurement_user","procurement.order.user","model_procurement_order","base.group_user",1,1,1,1
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
-"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_manager",1,1,1,1
"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,1,1,1
"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,1,1,1
"access_product_product_manager","product.product manager","product.model_product_product","mrp.group_mrp_manager",1,0,0,0
diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py
index a8dc4aecc89..a486e0b332a 100644
--- a/addons/mrp/stock.py
+++ b/addons/mrp/stock.py
@@ -138,14 +138,15 @@ class StockMove(osv.osv):
wf_service = netsvc.LocalService("workflow")
for move in self.browse(cr, uid, ids, context=context):
new_moves = super(StockMove, self).action_scrap(cr, uid, [move.id], product_qty, location_id, context=context)
- self.write(cr, uid, [move.id], {'prodlot_id': False, 'tracking_id': False})
+ #If we are not scrapping our whole move, tracking and lot references must not be removed
+ #self.write(cr, uid, [move.id], {'prodlot_id': False, 'tracking_id': False})
production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
for prod_id in production_ids:
wf_service.trg_validate(uid, 'mrp.production', prod_id, 'button_produce', cr)
for new_move in new_moves:
production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})
res.append(new_move)
- return {}
+ return res
StockMove()
diff --git a/addons/multi_company/multi_company_demo.xml b/addons/multi_company/multi_company_demo.xml
index d3b46e6d112..5248a26f4f9 100644
--- a/addons/multi_company/multi_company_demo.xml
+++ b/addons/multi_company/multi_company_demo.xml
@@ -267,7 +267,7 @@
-
+
Expenses Credit Notes Journal - (OpenERP IN)ECNJ-OpenERP IN
diff --git a/addons/outlook/outlook_installer.xml b/addons/outlook/outlook_installer.xml
index 7eb6e2b0d68..a85a16c245b 100644
--- a/addons/outlook/outlook_installer.xml
+++ b/addons/outlook/outlook_installer.xml
@@ -75,5 +75,8 @@
+
+
+
diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py
index 3bd0f188581..125449cfc6f 100644
--- a/addons/point_of_sale/__openerp__.py
+++ b/addons/point_of_sale/__openerp__.py
@@ -39,17 +39,15 @@ Main features :
""",
'author': 'OpenERP SA',
'images': ['images/cash_registers.jpeg', 'images/pos_analysis.jpeg','images/register_analysis.jpeg','images/sale_order_pos.jpeg','images/product_pos.jpeg'],
- 'depends': ['sale', 'delivery'],
+ 'depends': ['sale'],
'init_xml': [],
'update_xml': [
'security/point_of_sale_security.xml',
'security/ir.model.access.csv',
'wizard/pos_details.xml',
- 'wizard/pos_add_product.xml',
'wizard/pos_confirm.xml',
'wizard/pos_discount.xml',
- 'wizard/pos_get_sale.xml',
'wizard/pos_open_statement.xml',
'wizard/pos_close_statement.xml',
'wizard/pos_box_entries.xml',
@@ -57,15 +55,10 @@ Main features :
'wizard/pos_payment_report_date_view.xml',
'wizard/pos_box_out.xml',
'wizard/pos_sales_user.xml',
- 'wizard/all_closed_cashbox_of_the_day.xml',
- 'wizard/pos_sales_user_current_user.xml',
- 'wizard/pos_sale_user_today.xml',
'wizard/pos_receipt_view.xml',
'wizard/pos_payment_report_user.xml',
'wizard/pos_payment_report.xml',
'wizard/pos_payment.xml',
- 'wizard/pos_scan_product_view.xml',
- 'wizard/pos_return_view.xml',
'point_of_sale_report.xml',
'point_of_sale_view.xml',
'report/pos_order_report_view.xml',
@@ -75,9 +68,15 @@ Main features :
'account_statement_view.xml',
'account_statement_report.xml',
],
- 'demo_xml': ['point_of_sale_demo.xml','account_statement_demo.xml'],
- 'test': ['test/point_of_sale_test.yml',
- 'test/point_of_sale_report.yml',
+ 'demo_xml': [
+ 'point_of_sale_demo.xml',
+ 'account_statement_demo.xml',
+ 'test/00_register_open.yml'
+ ],
+ 'test': [
+ 'test/01_order_to_payment.yml',
+ 'test/02_order_to_invoice.yml',
+ 'test/point_of_sale_report.yml'
],
'installable': True,
'certificate' : '001156338024966477869',
diff --git a/addons/point_of_sale/account_bank_statement.py b/addons/point_of_sale/account_bank_statement.py
index 706cd50a84b..9cc39ced45c 100644
--- a/addons/point_of_sale/account_bank_statement.py
+++ b/addons/point_of_sale/account_bank_statement.py
@@ -25,10 +25,9 @@ from osv import fields, osv
class account_journal(osv.osv):
_inherit = 'account.journal'
_columns = {
- 'auto_cash': fields.boolean('Automatic Opening', help="This field authorize the automatic creation of the cashbox"),
- 'special_journal': fields.boolean('Special Journal', help="Will put all the orders in waiting status till being accepted"),
- 'check_dtls': fields.boolean('Check Details', help="This field authorize Validation of Cashbox without checking ending details"),
- 'journal_users': fields.many2many('res.users', 'pos_journal_users', 'journal_id', 'user_id', 'Users'),
+ 'auto_cash': fields.boolean('Automatic Opening', help="This field authorize the automatic creation of the cashbox, without control of the initial balance."),
+ 'check_dtls': fields.boolean('Control Balance Before Closing', help="This field authorize Validation of Cashbox without controlling the closing balance."),
+ 'journal_user': fields.boolean('PoS Payment Method', help="Check this box if this journal define a payment method that can be used in point of sales."),
}
_defaults = {
'check_dtls': False,
@@ -49,14 +48,6 @@ class account_cash_statement(osv.osv):
else:
return True
- def _user_allow(self, cr, uid, statement_id, context=None):
- statement = self.browse(cr, uid, statement_id, context=context)
- if (not statement.journal_id.journal_users) and uid == 1: return True
- for user in statement.journal_id.journal_users:
- if uid == user.id:
- return True
- return False
-
def _get_cash_open_box_lines(self, cr, uid, context=None):
res = super(account_cash_statement,self)._get_cash_open_box_lines(cr, uid, context)
curr = [0.01, 0.02, 0.05, 0.10, 0.20, 0.50]
diff --git a/addons/point_of_sale/account_statement_demo.xml b/addons/point_of_sale/account_statement_demo.xml
index 7cdbbf99596..e8ee0a7c349 100644
--- a/addons/point_of_sale/account_statement_demo.xml
+++ b/addons/point_of_sale/account_statement_demo.xml
@@ -1,75 +1,17 @@
-
- Visa Journal
- VIJ
- cash
-
-
-
-
-
-
-
-
-
-
-
-
- Bancontact Journal
- BACJ
- cash
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
-
+
diff --git a/addons/point_of_sale/account_statement_view.xml b/addons/point_of_sale/account_statement_view.xml
index d6bfa4eda66..16cc953d9ef 100644
--- a/addons/point_of_sale/account_statement_view.xml
+++ b/addons/point_of_sale/account_statement_view.xml
@@ -11,28 +11,15 @@
-
+
-
+
-
-
-
-
-
-
account.bank.statement.inheritaccount.bank.statement
@@ -66,7 +53,7 @@
-
+
@@ -141,14 +128,6 @@
-
-
+
+
+
+
+
+
diff --git a/addons/point_of_sale/account_statement_wizard.xml b/addons/point_of_sale/account_statement_wizard.xml
deleted file mode 100644
index 25f099810b4..00000000000
--- a/addons/point_of_sale/account_statement_wizard.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py
index 74c8dc0d4a4..ee2173dcd49 100644
--- a/addons/point_of_sale/point_of_sale.py
+++ b/addons/point_of_sale/point_of_sale.py
@@ -42,125 +42,23 @@ class pos_config_journal(osv.osv):
pos_config_journal()
-
-class pos_company_discount(osv.osv):
- """ Company Discount and Cashboxes """
- _inherit = 'res.company'
-
- _columns = {
- 'company_discount': fields.float('Max Discount(%)', digits_compute=dp.get_precision('Point Of Sale')),
- 'max_diff': fields.float('Max Difference for Cashboxes', digits_compute=dp.get_precision('Point Of Sale Discount')),
- }
-
-pos_company_discount()
-
class pos_order(osv.osv):
- """ Point of sale gives business owners a convenient way of checking out customers
- and of recording sales """
-
_name = "pos.order"
_description = "Point of Sale"
- _order = "date_order, create_date desc"
+ _order = "id desc"
def unlink(self, cr, uid, ids, context=None):
for rec in self.browse(cr, uid, ids, context=context):
- for rec_statement in rec.statement_ids:
- if (rec_statement.statement_id and rec_statement.statement_id.state == 'confirm') or rec.state == 'done':
- raise osv.except_osv(_('Invalid action !'), _('Cannot delete a point of sale which is closed or contains confirmed cashboxes!'))
+ if rec.state not in ('draft','cancel'):
+ raise osv.except_osv(_('Unable to Delete !'), _('In order to delete a sale, it must be new or cancelled.'))
return super(pos_order, self).unlink(cr, uid, ids, context=context)
- def onchange_partner_pricelist(self, cr, uid, ids, part=False, context=None):
-
- """ Changed price list on_change of partner_id"""
+ def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
if not part:
return {'value': {}}
pricelist = self.pool.get('res.partner').browse(cr, uid, part, context=context).property_product_pricelist.id
return {'value': {'pricelist_id': pricelist}}
- def _amount_total(self, cr, uid, ids, field_name, arg, context=None):
- """ Calculates amount_tax of order line
- @param field_names: Names of fields.
- @return: Dictionary of values """
- cr.execute("""
- SELECT
- p.id,
- COALESCE(SUM(
- l.price_unit*l.qty*(1-(l.discount/100.0)))::decimal(16,2), 0
- ) AS amount
- FROM pos_order p
- LEFT OUTER JOIN pos_order_line l ON (p.id = l.order_id)
- WHERE p.id IN %s GROUP BY p.id """,(tuple(ids),))
- res = dict(cr.fetchall())
- for rec in self.browse(cr, uid, ids, context=context):
- if rec.partner_id \
- and rec.partner_id.property_account_position \
- and rec.partner_id.property_account_position.tax_ids:
- res[rec.id] = res[rec.id] - rec.amount_tax
- else :
- res[rec.id] = res[rec.id] + rec.amount_tax
- return res
-
- def _get_date_payment2(self, cr, uid, ids, context=None, *a):
- # Todo need to check this function
- """ Find payment Date
- @param field_names: Names of fields.
- @return: Dictionary of values """
- res = {}
- val = None
- for order in self.browse(cr, uid, ids, context=context):
- cr.execute("SELECT date_payment FROM pos_order WHERE id = %s", (order.id,))
- date_p = cr.fetchone()
- date_p = date_p and date_p[0] or None
- if date_p:
- res[order.id] = date_p
- return res
- if order.invoice_id:
- cr.execute(" SELECT MAX(l.date) "
- " FROM account_move_line l, account_move m, account_invoice i, account_move_reconcile r, pos_order o "
- " WHERE i.move_id = m.id AND l.move_id = m.id AND l.reconcile_id = r.id AND o.id = %s AND o.invoice_id = i.id",
- (order.id,))
- else:
- cr.execute("SELECT MAX(l.date) from account_move_line l "
- "left join account_bank_statement abs on (l.statement_id=abs.id)"
- "left join account_bank_statement_line absl on (absl.statement_id=abs.id) "
- "left join pos_order p on (p.id=absl.pos_statement_id) "
- "left join account_account a on (a.id=absl.account_id) "
- "where p.id=%s and l.reconcile_id is not NULL and a.reconcile=True", (order.id,))
- val = cr.fetchone()
- val = val and val[0] or None
- if val:
- res[order.id] = val
- return res
-
- def _get_date_payment(self, cr, uid, ids, context, *a):
- """ Find Validation Date
- @return: Dictionary of values """
- res = {}
- val = None
- for order in self.browse(cr, uid, ids):
- cr.execute("SELECT date_validation FROM pos_order WHERE id = %s", (order.id,))
- date_p = cr.fetchone()
- date_p = date_p and date_p[0] or None
- if date_p:
- res[order.id] = date_p
- return res
- discount_allowed = order.company_id.company_discount
- for line in order.lines:
- if line.discount > discount_allowed:
- return {order.id: None }
- if order.amount_paid == order.amount_total and not date_p:
- cr.execute("SELECT MAX(date) FROM account_bank_statement_line WHERE pos_statement_id = %s", (order.id,))
- val = cr.fetchone()
- val = val and val[0] or None
- if order.invoice_id and order.invoice_id.move_id and not date_p and not val:
- for o in order.invoice_id.move_id.line_id:
- if o.balance == 0:
- if val < o.date_created:
- val = o.date_created
- if val:
- res[order.id] = val
- return res
-
def _amount_all(self, cr, uid, ids, name, args, context=None):
tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
@@ -171,325 +69,147 @@ class pos_order(osv.osv):
'amount_return':0.0,
'amount_tax':0.0,
}
- val = val1 = 0.0
+ val1 = val2 = 0.0
cur = order.pricelist_id.currency_id
for payment in order.statement_ids:
res[order.id]['amount_paid'] += payment.amount
res[order.id]['amount_return'] += (payment.amount < 0 and payment.amount or 0)
for line in order.lines:
val1 += line.price_subtotal_incl
- if order.price_type != 'tax_excluded':
- res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2),
- tax_obj.compute_inv(cr, uid, line.product_id.taxes_id,
- line.price_unit * \
- (1-(line.discount or 0.0)/100.0), line.qty),
- res[order.id]['amount_tax'])
- elif line.qty != 0.0:
- for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, \
- line.price_unit * (1-(line.discount or 0.0)/100.0), \
- line.qty, line.product_id, line.order_id.partner_id)['taxes']:
- val += c.get('amount', 0.0)
- res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
- res[order.id]['amount_total'] = res[order.id]['amount_tax'] + cur_obj.round(cr, uid, cur, val1)
+ val2 += line.price_subtotal
+ res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val1-val2)
+ res[order.id]['amount_total'] = cur_obj.round(cr, uid, cur, val1)
return res
- def _sale_journal_get(self, cr, uid, context=None):
- """ To get sale journal for this order
- @return: journal """
- journal_obj = self.pool.get('account.journal')
- res = journal_obj.search(cr, uid, [('type', '=', 'sale')], limit=1)
+ def _default_sale_journal(self, cr, uid, context=None):
+ res = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale')], limit=1)
return res and res[0] or False
- def _shop_get(self, cr, uid, context=None):
- """ To get Shop for this order
- @return: Shop id """
+ def _default_shop(self, cr, uid, context=None):
res = self.pool.get('sale.shop').search(cr, uid, [])
return res and res[0] or False
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
- default.update({
+ d = {
'state': 'draft',
- 'partner_id': False,
'invoice_id': False,
'account_move': False,
'picking_id': False,
'statement_ids': [],
'nb_print': 0,
- 'pickings': [],
'name': self.pool.get('ir.sequence').get(cr, uid, 'pos.order'),
- })
- return super(pos_order, self).copy(cr, uid, id, default, context=context)
-
- def _get_v( self, cr, uid, ids, *args):
- """ Changed the Validation state of order
- @return: State """
- res_obj = self.pool.get('res.users')
- company_disc = self.browse(cr, uid, ids)
- list_jrnl = []
- r = {}
- if not company_disc:
- comp = res_obj.browse(cr, uid, uid).company_id.company_discount or 0.0
- else:
- comp = company_disc[0] and company_disc[0].company_id and company_disc[0].company_id.company_discount or 0.0
- cr.execute("SELECT discount FROM pos_order_line WHERE order_id = %s AND discount <= %s", (ids[0], comp))
- res = cr.fetchone()
- cr.execute("SELECT discount FROM pos_order_line WHERE order_id = %s AND discount > %s", (ids[0], comp))
- res2 = cr.fetchone()
- cr.execute("SELECT journal_id FROM account_bank_statement_line WHERE pos_statement_id = %s ", (ids[0], ))
- res3 = cr.fetchall()
- for r in res3:
- cr.execute("SELECT id FROM account_journal WHERE name = '%s' AND special_journal = 't'", (r[0], ))
- res3 = cr.fetchone()
- is_special = res3 and res3[0] or None
- if is_special:
- list_jrnl.append(is_special)
- for order in self.browse(cr, uid, ids):
- if order.state in ('paid', 'done', 'invoiced') and res and not res2 and not len(list_jrnl):
- r[order.id] = 'accepted'
- return r
+ }
+ d.update(default)
+ return super(pos_order, self).copy(cr, uid, id, d, context=context)
_columns = {
- 'name': fields.char('Order Description', size=64, required=True,
+ 'name': fields.char('Order Ref', size=64, required=True,
states={'draft': [('readonly', False)]}, readonly=True),
'company_id':fields.many2one('res.company', 'Company', required=True, readonly=True),
- 'num_sale': fields.char('Internal Note', size=64),
'shop_id': fields.many2one('sale.shop', 'Shop', required=True,
states={'draft': [('readonly', False)]}, readonly=True),
'date_order': fields.datetime('Date Ordered', readonly=True, select=True),
- 'date_validation': fields.function(_get_date_payment,
- string='Validation Date',
- type='date', select=True, store=True),
- 'date_payment': fields.function(_get_date_payment2,
- string='Payment Date',
- type='date', select=True, store=True),
- 'date_validity': fields.date('Validity Date', required=True),
'user_id': fields.many2one('res.users', 'Connected Salesman', help="Person who uses the the cash register. It could be a reliever, a student or an interim employee."),
- 'user_salesman_id': fields.many2one('res.users', 'Cashier', required=True, help="User who is logged into the system."),
- 'sale_manager': fields.many2one('res.users', 'Salesman Manager'),
'amount_tax': fields.function(_amount_all, string='Taxes', digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
'amount_total': fields.function(_amount_all, string='Total', multi='all'),
'amount_paid': fields.function(_amount_all, string='Paid', states={'draft': [('readonly', False)]}, readonly=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
'amount_return': fields.function(_amount_all, 'Returned', digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
'lines': fields.one2many('pos.order.line', 'order_id', 'Order Lines', states={'draft': [('readonly', False)]}, readonly=True),
- 'price_type': fields.selection([
- ('tax_excluded','Tax excluded')],
- 'Price Method', required=True),
'statement_ids': fields.one2many('account.bank.statement.line', 'pos_statement_id', 'Payments', states={'draft': [('readonly', False)]}, readonly=True),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, states={'draft': [('readonly', False)]}, readonly=True),
'partner_id': fields.many2one('res.partner', 'Customer', change_default=True, select=1, states={'draft': [('readonly', False)], 'paid': [('readonly', False)]}),
- 'state': fields.selection([('draft', 'Quotation'),
- ('payment', 'Payment'),
- ('advance','Advance'),
- ('paid', 'Paid'),
- ('done', 'Done'),
+
+ 'state': fields.selection([('draft', 'New'),
+ ('paid', 'Done'),
+ ('done', 'Posted'),
('invoiced', 'Invoiced'),
- ('cancel', 'Cancel')],
+ ('cancel', 'Cancelled')],
'State', readonly=True),
+
'invoice_id': fields.many2one('account.invoice', 'Invoice'),
- 'account_move': fields.many2one('account.move', 'Account Entry', readonly=True),
- 'pickings': fields.one2many('stock.picking', 'pos_order', 'Picking', readonly=True),
- 'picking_id': fields.many2one('stock.picking', 'Last Output Picking', readonly=True),
- 'first_name': fields.char('First Name', size=64),
+ 'account_move': fields.many2one('account.move', 'Journal Entry', readonly=True),
+ 'picking_id': fields.many2one('stock.picking', 'Picking', readonly=True),
'note': fields.text('Internal Notes'),
'nb_print': fields.integer('Number of Print', readonly=True),
'sale_journal': fields.many2one('account.journal', 'Journal', required=True, states={'draft': [('readonly', False)]}, readonly=True),
- 'invoice_wanted': fields.boolean('Create Invoice'),
- 'note_2': fields.char('Customer Note', size=64),
- 'type_rec': fields.char('Type of Receipt', size=64),
- 'remboursed': fields.boolean('Remboursed'),
- 'contract_number': fields.char('Contract Number', size=512, select=1),
- 'journal_entry': fields.boolean('Journal Entry'),
}
- def _select_pricelist(self, cr, uid, context=None):
- """ To get default pricelist for the order
- @param name: Names of fields.
- @return: pricelist ID
- """
+ def _default_pricelist(self, cr, uid, context=None):
res = self.pool.get('sale.shop').search(cr, uid, [], context=context)
if res:
shop = self.pool.get('sale.shop').browse(cr, uid, res[0], context=context)
return shop.pricelist_id and shop.pricelist_id.id or False
return False
- def _journal_default(self, cr, uid, context=None):
- """ To get default pricelist for the order
- @param name: Names of fields.
- @return: journal ID
- """
- journal_list = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash')])
- return journal_list and journal_list[0] or False
-
_defaults = {
- 'user_salesman_id':lambda self, cr, uid, context: uid,
'user_id': lambda self, cr, uid, context: uid,
- 'sale_manager': lambda self, cr, uid, context: uid,
'state': 'draft',
- 'price_type': 'tax_excluded',
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.order'),
'date_order': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
- 'date_validity': lambda *a: (datetime.today() + relativedelta(months=+6)).strftime('%Y-%m-%d'),
'nb_print': 0,
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
- 'sale_journal': _sale_journal_get,
- 'invoice_wanted': False,
- 'shop_id': _shop_get,
- 'pricelist_id': _select_pricelist,
+ 'sale_journal': _default_sale_journal,
+ 'shop_id': _default_shop,
+ 'pricelist_id': _default_pricelist,
}
-
- def test_order_lines(self, cr, uid, order, context=None):
- """ Test order line is created or not for the order
- @param name: Names of fields.
- @return: True
- """
- if not order.lines:
- raise osv.except_osv(_('Error'), _('No order lines defined for this sale.'))
-
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'pos.order', order.id, 'paid', cr)
- return True
-
- def dummy_button(self, cr, uid, order, context=None):
- return True
-
def test_paid(self, cr, uid, ids, context=None):
- """ Test all amount is paid for this order
+ """A Point of Sale is paid when the sum
@return: True
"""
for order in self.browse(cr, uid, ids, context=context):
if order.lines and not order.amount_total:
return True
if (not order.lines) or (not order.statement_ids) or \
- Decimal(str(order.amount_total)) != Decimal(str(order.amount_paid)):
+ (abs(order.amount_total-order.amount_paid) > 0.00001):
return False
return True
- def _get_qty_differences(self, orders, old_picking):
- """check if the customer changed the product quantity """
- order_dict = {}
- for order in orders:
- for line in order.lines:
- order_dict[line.product_id.id] = line
-
- # check the quantity differences:
- diff_dict = {}
- for line in old_picking.move_lines:
- order_line = order_dict.get(line.product_id.id)
- if not order_line:
- deleted = True
- qty_to_delete_from_original_picking = line.product_qty
- diff_dict[line.product_id.id] = (deleted, qty_to_delete_from_original_picking)
- elif line.product_qty != order_line.qty:
- deleted = False
- qty_to_delete_from_original_picking = line.product_qty - order_line.qty
- diff_dict[line.product_id.id] = (deleted, qty_to_delete_from_original_picking)
-
- return diff_dict
-
- def _split_picking(self, cr, uid, ids, context, old_picking, diff_dict):
- """if the customer changes the product quantity, split the picking in two"""
- # create a copy of the original picking and adjust the product qty:
- picking_model = self.pool.get('stock.picking')
- defaults = {
- 'note': "Partial picking from customer", # add a note to tell why we create a new picking
- 'name': self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out'), # increment the sequence
- }
-
- new_picking_id = picking_model.copy(cr, uid, old_picking.id, defaults) # state = 'draft'
- new_picking = picking_model.browse(cr, uid, new_picking_id, context=context)
-
- for line in new_picking.move_lines:
- p_id = line.product_id.id
- if p_id in diff_dict:
- diff = diff_dict[p_id]
- deleted = diff[0]
- qty_to_del = diff[1]
- if deleted: # product has been deleted (customer didn't took it):
- # delete this product from old picking:
- for old_line in old_picking.move_lines:
- if old_line.product_id.id == p_id:
- old_line.write({'state': 'draft'}, context=context) # cannot delete if not draft
- old_line.unlink(context=context)
- elif qty_to_del > 0: # product qty has been modified (customer took less than the ordered quantity):
- # subtract qty from old picking:
- for old_line in old_picking.move_lines:
- if old_line.product_id.id == p_id:
- old_line.write({'product_qty': old_line.product_qty - qty_to_del}, context=context)
- # add qty to new picking:
- line.write({'product_qty': qty_to_del}, context=context)
- else: # product hasn't changed (customer took it without any change):
- # delete this product from new picking:
- line.unlink(context=context)
- else:
- # delete it in the new picking:
- line.unlink(context=context)
-
def create_picking(self, cr, uid, ids, context=None):
"""Create a picking for each order and validate it."""
picking_obj = self.pool.get('stock.picking')
- property_obj = self.pool.get("ir.property")
- move_obj = self.pool.get('stock.move')
- pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out')
- orders = self.browse(cr, uid, ids, context=context)
partner_obj = self.pool.get('res.partner')
- for order in orders:
+ move_obj = self.pool.get('stock.move')
+
+ for order in self.browse(cr, uid, ids, context=context):
addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {}
- if not order.picking_id:
- new = True
- picking_id = picking_obj.create(cr, uid, {
- 'name': pick_name,
- 'origin': order.name,
- 'address_id': addr.get('delivery',False),
- 'type': 'out',
+ picking_id = picking_obj.create(cr, uid, {
+ 'origin': order.name,
+ 'address_id': addr.get('delivery',False),
+ 'type': 'out',
+ 'company_id': order.company_id.id,
+ 'move_type': 'direct',
+ 'note': order.note or "",
+ 'invoice_state': 'none',
+ 'auto_picking': True,
+ }, context=context)
+ self.write(cr, uid, [order.id], {'picking_id': picking_id}, context=context)
+ location_id = order.shop_id.warehouse_id.lot_stock_id.id
+ output_id = order.shop_id.warehouse_id.lot_output_id.id
+
+ for line in order.lines:
+ if line.product_id and line.product_id.type == 'service':
+ continue
+ if line.qty < 0:
+ location_id, output_id = output_id, location_id
+
+ move_obj.create(cr, uid, {
+ 'name': line.name,
+ 'product_uom': line.product_id.uom_id.id,
+ 'product_uos': line.product_id.uom_id.id,
+ 'picking_id': picking_id,
+ 'product_id': line.product_id.id,
+ 'product_uos_qty': abs(line.qty),
+ 'product_qty': abs(line.qty),
+ 'tracking_id': False,
'state': 'draft',
- 'move_type': 'direct',
- 'note': 'POS notes ' + (order.note or ""),
- 'invoice_state': 'none',
- 'auto_picking': True,
- 'pos_order': order.id,
+ 'location_id': location_id,
+ 'location_dest_id': output_id,
}, context=context)
- self.write(cr, uid, [order.id], {'picking_id': picking_id}, context=context)
- else:
- picking_id = order.picking_id.id
- picking_obj.write(cr, uid, [picking_id], {'auto_picking': True}, context=context)
- picking = picking_obj.browse(cr, uid, [picking_id], context=context)[0]
- new = False
-
- # split the picking (if product quantity has changed):
- diff_dict = self._get_qty_differences(orders, picking)
- if diff_dict:
- self._split_picking(cr, uid, ids, context, picking, diff_dict)
-
- if new:
- for line in order.lines:
- if line.product_id and line.product_id.type == 'service':
- continue
- prop_ids = property_obj.search(cr, uid, [('name', '=', 'property_stock_customer')], context=context)
- val = property_obj.browse(cr, uid, prop_ids[0], context=context).value_reference
- cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w WHERE w.lot_stock_id = s.id AND w.id = %s", (order.shop_id.warehouse_id.id, ))
- res = cr.fetchone()
- location_id = res and res[0] or None
- stock_dest_id = val.id
- if line.qty < 0:
- location_id, stock_dest_id = stock_dest_id, location_id
- move_obj.create(cr, uid, {
- 'name': '(POS %d)' % (order.id, ),
- 'product_uom': line.product_id.uom_id.id,
- 'product_uos': line.product_id.uom_id.id,
- 'picking_id': picking_id,
- 'product_id': line.product_id.id,
- 'product_uos_qty': abs(line.qty),
- 'product_qty': abs(line.qty),
- 'tracking_id': False,
- 'pos_line_id': line.id,
- 'state': 'waiting',
- 'location_id': location_id,
- 'location_dest_id': stock_dest_id,
- 'prodlot_id': line.prodlot_id and line.prodlot_id.id or False
- }, context=context)
+ if line.qty < 0:
+ location_id, output_id = output_id, location_id
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
@@ -497,36 +217,27 @@ class pos_order(osv.osv):
return True
def set_to_draft(self, cr, uid, ids, *args):
- """ Changes order state to draft
- @return: True
- """
if not len(ids):
return False
+ for order in self.browse(cr, uid, ids, context=context):
+ if order.state<>'cancel':
+ raise osv.except_osv(_('Error!'), _('In order to set to draft a sale, it must be cancelled.'))
self.write(cr, uid, ids, {'state': 'draft'})
wf_service = netsvc.LocalService("workflow")
for i in ids:
wf_service.trg_create(uid, 'pos.order', i, cr)
return True
- def button_invalidate(self, cr, uid, ids, *args):
- """ Check the access for the sale order
- @return: True
- """
- res_obj = self.pool.get('res.company')
- try:
- part_company = res_obj.browse(cr, uid, uid) and res_obj.browse(cr, uid, uid).parent_id and res_obj.browse(cr, uid, uid).parent_id.id or None
- except Exception:
- raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
- if part_company:
- raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
- return True
-
def cancel_order(self, cr, uid, ids, context=None):
""" Changes order state to cancel
@return: True
"""
+ stock_picking_obj = self.pool.get('stock.picking')
+ for order in self.browse(cr, uid, ids, context=context):
+ wf_service.trg_validate(uid, 'stock.picking', order.picking_id.id, 'button_cancel', cr)
+ if stock_picking_obj.browse(cr, uid, order.picking_id.id, context=context).state <> 'cancel':
+ raise osv.except_osv(_('Error!'), _('Unable to cancel the picking.'))
self.write(cr, uid, ids, {'state': 'cancel'}, context=context)
- self.cancel_picking(cr, uid, ids, context=context)
return True
def add_payment(self, cr, uid, order_id, data, context=None):
@@ -538,28 +249,19 @@ class pos_order(osv.osv):
curr_c = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
curr_company = curr_c.id
order = self.browse(cr, uid, order_id, context=context)
- if not order.num_sale and data['num_sale']:
- self.write(cr, uid, order_id, {'num_sale': data['num_sale']}, context=context)
ids_new = []
args = {
'amount': data['amount'],
}
if 'payment_date' in data.keys():
args['date'] = data['payment_date']
- if 'payment_name' in data.keys():
- args['name'] = data['payment_name'] + ' ' + order.name
+ args['name'] = order.name
+ if data.get('payment_name', False):
+ args['name'] = args['name'] + ': ' + data['payment_name']
account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context)
args['account_id'] = order.partner_id and order.partner_id.property_account_receivable \
and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id
- if data.get('is_acc', False):
- args['is_acc'] = data['is_acc']
- args['account_id'] = prod_obj.browse(cr, uid, data['product_id'], context=context).property_account_income \
- and prod_obj.browse(cr, uid, data['product_id'], context=context).property_account_income.id
- if not args['account_id']:
- raise osv.except_osv(_('Error'), _('Please provide an account for the product: %s')% \
- (prod_obj.browse(cr, uid, data['product_id'], context=context).name))
args['partner_id'] = order.partner_id and order.partner_id.id or None
- args['ref'] = order.contract_number or None
statement_id = statement_obj.search(cr,uid, [
('journal_id', '=', int(data['journal'])),
@@ -584,58 +286,39 @@ class pos_order(osv.osv):
return statement_id
- def add_product(self, cr, uid, order_id, product_id, qty, context=None):
-
- """Create a new order line the order"""
-
- line_obj = self.pool.get('pos.order.line')
- values = self.read(cr, uid, order_id, ['partner_id', 'pricelist_id'])
-
- pricelist = values['pricelist_id'] and values['pricelist_id'][0]
- product = values['partner_id'] and values['partner_id'][0]
-
- price = line_obj.price_by_product(cr, uid, [],
- pricelist, product_id, qty, product)
-
- order_line_id = line_obj.create(cr, uid, {
- 'order_id': order_id,
- 'product_id': product_id,
- 'qty': qty,
- 'price_unit': price,
- }, context=context)
- return order_line_id, price
-
def refund(self, cr, uid, ids, context=None):
-
"""Create a copy of order for refund order"""
-
clone_list = []
line_obj = self.pool.get('pos.order.line')
-
for order in self.browse(cr, uid, ids, context=context):
clone_id = self.copy(cr, uid, order.id, {
'name': order.name + ' REFUND',
- 'date_order': time.strftime('%Y-%m-%d'),
- 'state': 'draft',
- 'note': 'REFUND\n'+ (order.note or ''),
- 'invoice_id': False,
- 'nb_print': 0,
- 'statement_ids': False,
- }, context=context)
+ }, context=context)
clone_list.append(clone_id)
-
for clone in self.browse(cr, uid, clone_list, context=context):
for order_line in clone.lines:
line_obj.write(cr, uid, [order_line.id], {
'qty': -order_line.qty
- }, context=context)
- return clone_list
+ }, context=context)
+
+ new_order = ','.join(map(str,clone_list))
+ abs = {
+ #'domain': "[('id', 'in', ["+new_order+"])]",
+ 'name': _('Return Products'),
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'pos.order',
+ 'res_id':clone_list[0],
+ 'view_id': False,
+ 'context':context,
+ 'type': 'ir.actions.act_window',
+ 'nodestroy': True,
+ 'target': 'current',
+ }
+ return abs
def action_invoice(self, cr, uid, ids, context=None):
-
- """Create a invoice of order """
-
inv_ref = self.pool.get('account.invoice')
inv_line_ref = self.pool.get('account.invoice.line')
product_obj = self.pool.get('product.product')
@@ -675,35 +358,51 @@ class pos_order(osv.osv):
'quantity': line.qty,
}
inv_name = product_obj.name_get(cr, uid, [line.product_id.id], context=context)[0][1]
-
inv_line.update(inv_line_ref.product_id_change(cr, uid, [],
line.product_id.id,
line.product_id.uom_id.id,
line.qty, partner_id = order.partner_id.id,
fposition_id=order.partner_id.property_account_position.id)['value'])
+ if line.product_id.description_sale:
+ inv_line['note'] = line.product_id.description_sale
inv_line['price_unit'] = line.price_unit
inv_line['discount'] = line.discount
inv_line['name'] = inv_name
inv_line['invoice_line_tax_id'] = ('invoice_line_tax_id' in inv_line)\
and [(6, 0, inv_line['invoice_line_tax_id'])] or []
inv_line_ref.create(cr, uid, inv_line, context=context)
+ inv_ref.button_reset_taxes(cr, uid, [inv_id], context=context)
- for i in inv_ids:
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.invoice', i, 'invoice_open', cr)
- return inv_ids
+ if not inv_ids: return {}
+ mod_obj = self.pool.get('ir.model.data')
+ res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
+ res_id = res and res[1] or False
+ return {
+ 'name': _('PoS Invoices'),
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'view_id': res_id,
+ 'res_model': 'account.invoice',
+ 'context': "{'type':'out_invoice'}",
+ 'type': 'ir.actions.act_window',
+ 'nodestroy': True,
+ 'target': 'current',
+ 'res_id': inv_ids and inv_ids[0] or False,
+ }
def create_account_move(self, cr, uid, ids, context=None):
- """Create a account move line of order """
+ """Create a account move line of order grouped by products or not."""
account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
account_period_obj = self.pool.get('account.period')
+ period = account_period_obj.find(cr, uid, context=context)[0]
account_tax_obj = self.pool.get('account.tax')
res_obj=self.pool.get('res.users')
property_obj=self.pool.get('ir.property')
- period = account_period_obj.find(cr, uid, context=context)[0]
for order in self.browse(cr, uid, ids, context=context):
+ if order.state<>'paid': continue
+
curr_c = res_obj.browse(cr, uid, uid).company_id
comp_id = res_obj.browse(cr, order.user_id.id, order.user_id.id).company_id
comp_id = comp_id and comp_id.id or False
@@ -716,19 +415,14 @@ class pos_order(osv.osv):
# Create an entry for the sale
move_id = account_move_obj.create(cr, uid, {
'journal_id': order.sale_journal.id,
- 'period_id': period,
- }, context=context)
+ }, context=context)
# Create an move for each order line
for line in order.lines:
tax_amount = 0
taxes = [t for t in line.product_id.taxes_id]
- if order.price_type == 'tax_excluded':
- computed_taxes = account_tax_obj.compute_all(
- cr, uid, taxes, line.price_unit, line.qty)['taxes']
- else:
- computed_taxes = account_tax_obj.compute_inv(
- cr, uid, taxes, line.price_unit, line.qty)
+ computed = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit * (100.0-line.discount) / 100.0, line.qty)
+ computed_taxes = computed['taxes']
for tax in computed_taxes:
tax_amount += round(tax['amount'], 2)
@@ -740,10 +434,7 @@ class pos_order(osv.osv):
group_tax[group_key] += round(tax['amount'], 2)
else:
group_tax[group_key] = round(tax['amount'], 2)
- if order.price_type != 'tax_excluded':
- amount = line.price_subtotal - tax_amount
- else:
- amount = line.price_subtotal
+ amount = line.price_subtotal
# Search for the income account
if line.product_id.property_account_income.id:
@@ -773,11 +464,12 @@ class pos_order(osv.osv):
if tax_code_id:
break
+
# Create a move for the line
account_move_line_obj.create(cr, uid, {
- 'name': "aa"+order.name,
+ 'name': line.name,
'date': order.date_order[:10],
- 'ref': order.contract_number or order.name,
+ 'ref': order.name,
'quantity': line.qty,
'product_id': line.product_id.id,
'move_id': move_id,
@@ -804,9 +496,9 @@ class pos_order(osv.osv):
continue
account_move_line_obj.create(cr, uid, {
- 'name': "bb" + order.name,
+ 'name': "Tax" + line.name,
'date': order.date_order[:10],
- 'ref': order.contract_number or order.name,
+ 'ref': order.name,
'product_id':line.product_id.id,
'quantity': line.qty,
'move_id': move_id,
@@ -825,9 +517,9 @@ class pos_order(osv.osv):
(tax_code_pos, base_code_pos, account_pos)= (0, 1, 2)
for key, amount in group_tax.items():
account_move_line_obj.create(cr, uid, {
- 'name': "cc" + order.name,
+ 'name': 'Tax',
'date': order.date_order[:10],
- 'ref': order.contract_number or order.name,
+ 'ref': order.name,
'move_id': move_id,
'company_id': comp_id,
'quantity': line.qty,
@@ -843,9 +535,9 @@ class pos_order(osv.osv):
# counterpart
to_reconcile.append(account_move_line_obj.create(cr, uid, {
- 'name': "dd" + order.name,
+ 'name': order.name,
'date': order.date_order[:10],
- 'ref': order.contract_number or order.name,
+ 'ref': order.name,
'move_id': move_id,
'company_id': comp_id,
'account_id': order_account,
@@ -857,71 +549,16 @@ class pos_order(osv.osv):
'period_id': period,
'partner_id': order.partner_id and order.partner_id.id or False
}, context=context))
-
-
- # search the account receivable for the payments:
- account_receivable = order.sale_journal.default_credit_account_id.id
- if not account_receivable:
- raise osv.except_osv(_('Error !'),
- _('There is no receivable account defined for this journal:'\
- ' "%s" (id:%d)') % (order.sale_journal.name, order.sale_journal.id, ))
- for payment in order.statement_ids:
- # Create one entry for the payment
- if payment.is_acc:
- continue
- account_move_obj.create(cr, uid, {
- 'journal_id': payment.statement_id.journal_id.id,
- 'period_id': period,
- }, context=context)
-
- for stat_l in order.statement_ids:
- if stat_l.is_acc and len(stat_l.move_ids):
- for st in stat_l.move_ids:
- for s in st.line_id:
- if s.credit:
- account_move_line_obj.copy(cr, uid, s.id, {
- 'debit': s.credit,
- 'statement_id': False,
- 'credit': s.debit
- })
- account_move_line_obj.copy(cr, uid, s.id, {
- 'statement_id': False,
- 'account_id': order_account
- })
-
- self.write(cr, uid, order.id, {'state':'done'}, context=context)
+ self.write(cr, uid, order.id, {'state':'done', 'account_move': move_id}, context=context)
return True
- def cancel_picking(self, cr, uid, ids, context=None):
- stock_picking_obj = self.pool.get('stock.picking')
- for order in self.browse(cr, uid, ids, context=context):
- for picking in order.pickings:
- stock_picking_obj.unlink(cr, uid, [picking.id], context=context)
- return True
-
-
def action_payment(self, cr, uid, ids, context=None):
- vals = {'state': 'payment'}
- sequence_obj = self.pool.get('ir.sequence')
- for pos in self.browse(cr, uid, ids, context=context):
- create_contract_nb = False
- for line in pos.lines:
- if line.product_id.product_type == 'MD':
- create_contract_nb = True
- break
- if create_contract_nb:
- seq = sequence_obj.get(cr, uid, 'pos.user_%s' % pos.user_salesman_id.login)
- vals['contract_number'] = '%s-%s' % (pos.user_salesman_id.login, seq)
- self.write(cr, uid, ids, vals, context=context)
+ return self.write(cr, uid, ids, {'state': 'payment'}, context=context)
def action_paid(self, cr, uid, ids, context=None):
- if context is None:
- context = {}
- if context.get('flag', False):
- self.create_picking(cr, uid, ids, context=None)
- self.write(cr, uid, ids, {'state': 'paid'}, context=context)
- else:
- context['flag'] = True
+ context = context or {}
+ self.create_picking(cr, uid, ids, context=None)
+ self.write(cr, uid, ids, {'state': 'paid'}, context=context)
return True
def action_cancel(self, cr, uid, ids, context=None):
@@ -929,43 +566,25 @@ class pos_order(osv.osv):
return True
def action_done(self, cr, uid, ids, context=None):
- for order in self.browse(cr, uid, ids, context=context):
- if not order.journal_entry:
- self.create_account_move(cr, uid, ids, context=None)
+ self.create_account_move(cr, uid, ids, context=context)
return True
- def compute_state(self, cr, uid, id):
- cr.execute("SELECT act.id, act.name FROM wkf_activity act "
- "INNER JOIN wkf_workitem item ON act.id = item.act_id "
- "INNER JOIN wkf_instance inst ON item.inst_id = inst.id "
- "INNER JOIN wkf ON inst.wkf_id = wkf.id "
- "WHERE wkf.osv = 'pos.order' AND inst.res_id = %s "
- "ORDER BY act.name", (id, ))
- return [name for id, name in cr.fetchall()]
-
pos_order()
class account_bank_statement(osv.osv):
_inherit = 'account.bank.statement'
_columns= {
- 'user_id': fields.many2one('res.users', ondelete='cascade', string='User', readonly=True),
+ 'user_id': fields.many2one('res.users', 'User', readonly=True),
}
_defaults = {
- 'user_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).id
+ 'user_id': lambda self,cr,uid,c={}: uid
}
account_bank_statement()
class account_bank_statement_line(osv.osv):
_inherit = 'account.bank.statement.line'
- def _get_statement_journal(self, cr, uid, ids, context, *a):
- res = {}
- for line in self.browse(cr, uid, ids):
- res[line.id] = line.statement_id and line.statement_id.journal_id and line.statement_id.journal_id.name or None
- return res
_columns= {
- 'journal_id': fields.function(_get_statement_journal,store=True, string='Journal', type='char', size=64),
- 'am_out': fields.boolean("To count"),
- 'is_acc': fields.boolean("Is accompte"),
+ 'journal_id': fields.related('statement_id','journal_id','name', store=True, string='Journal', type='char', size=64),
'pos_statement_id': fields.many2one('pos.order', ondelete='cascade'),
}
account_bank_statement_line()
@@ -973,275 +592,84 @@ account_bank_statement_line()
class pos_order_line(osv.osv):
_name = "pos.order.line"
_description = "Lines of Point of Sale"
-
- def _get_amount(self, cr, uid, ids, field_name, arg, context=None):
- res = {}
- for line in self.browse(cr, uid, ids, context=context):
- price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id)
- res[line.id] = price
- return res
-
- def _amount_line_ttc(self, cr, uid, ids, field_name, arg, context=None):
- res = dict.fromkeys(ids, 0.0)
- account_tax_obj = self.pool.get('account.tax')
- self.price_by_product_multi(cr, uid, ids)
- for line in self.browse(cr, uid, ids, context=context):
- tax_amount = 0.0
- taxes = [t for t in line.product_id.taxes_id]
- if line.qty == 0.0:
- continue
- computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['taxes']
- for tax in computed_taxes:
- tax_amount += tax['amount']
- if line.discount != 0.0:
- res[line.id] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0)
- else:
- res[line.id] = line.price_unit*line.qty
- res[line.id] = res[line.id] + tax_amount
- return res
-
- def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
- res = {}
- self.price_by_product_multi(cr, uid, ids)
- for line in self.browse(cr, uid, ids, context=context):
- if line.discount!=0.0:
- res[line.id] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0)
- else:
- res[line.id] = line.price_unit * line.qty
- return res
+ _rec_name = "product_id"
def _amount_line_all(self, cr, uid, ids, field_names, arg, context=None):
res = dict([(i, {}) for i in ids])
account_tax_obj = self.pool.get('account.tax')
-
- self.price_by_product_multi(cr, uid, ids)
+ cur_obj = self.pool.get('res.currency')
for line in self.browse(cr, uid, ids, context=context):
- for f in field_names:
- if f == 'price_subtotal':
- if line.discount != 0.0:
- res[line.id][f] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0)
- else:
- res[line.id][f] = line.price_unit * line.qty
- elif f == 'price_subtotal_incl':
- taxes = [t for t in line.product_id.taxes_id]
- if line.qty == 0.0:
- res[line.id][f] = 0.0
- continue
- price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
- computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, price, line.qty)
- cur = line.order_id.pricelist_id.currency_id
- res[line.id][f] = self.pool.get('res.currency').round(cr, uid, cur, computed_taxes['total'])
+ taxes = line.product_id.taxes_id
+ price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
+ taxes = account_tax_obj.compute_all(cr, uid, line.product_id.taxes_id, price, line.qty, product=line.product_id, partner=line.order_id.partner_id or False)
+
+ cur = line.order_id.pricelist_id.currency_id
+ res[line.id]['price_subtotal'] = cur_obj.round(cr, uid, cur, taxes['total'])
+ res[line.id]['price_subtotal_incl'] = cur_obj.round(cr, uid, cur, taxes['total_included'])
return res
- def price_by_product_multi(self, cr, uid, ids, context=None):
- if context is None:
- context = {}
- res = {}.fromkeys(ids, 0.0)
- lines = self.browse(cr, uid, ids, context=context)
+ def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False, context=None):
+ context = context or {}
+ if not product_id:
+ return {}
+ if not pricelist:
+ raise osv.except_osv(_('No Pricelist !'),
+ _('You have to select a pricelist in the sale form !\n' \
+ 'Please set one before choosing a product.'))
- pricelist_ids = [line.order_id.pricelist_id.id for line in lines]
- products_by_qty_by_partner = [(line.product_id.id, line.qty, line.order_id.partner_id.id) for line in lines]
+ price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist],
+ product_id, qty or 1.0, partner_id)[pricelist]
- price_get_multi_res = self.pool.get('product.pricelist').price_get_multi(cr, uid, pricelist_ids, products_by_qty_by_partner, context=context)
+ result = self.onchange_qty(cr, uid, ids, product_id, 0.0, qty, price, context=context)
+ result['value']['price_unit'] = price
+ return result
- for line in lines:
- pricelist = line.order_id.pricelist_id.id
- product_id = line.product_id
+ def onchange_qty(self, cr, uid, ids, product, discount, qty, price_unit, context=None):
+ result = {}
+ if not product:
+ return result
+ account_tax_obj = self.pool.get('account.tax')
+ cur_obj = self.pool.get('res.currency')
- if not product_id:
- res[line.id] = 0.0
- continue
- if not pricelist:
- raise osv.except_osv(_('No Pricelist !'),
- _('You have to select a pricelist in the sale form !\n' \
- 'Please set one before choosing a product.'))
+ prod = self.pool.get('product.product').browse(cr, uid, product, context=context)
- #old_price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product_id.id, qty or 1.0, partner_id, {'uom': uom_id})[pricelist]
- #print "prod_id: %s, pricelist: %s, price: %s" % (product_id.id, pricelist, price)
- price = price_get_multi_res[line.product_id.id][pricelist]
- #print "prod_id: %s, pricelist: %s, price2: %s" % (product_id.id, pricelist, price2)
+ taxes = prod.taxes_id
+ price = price_unit * (1 - (discount or 0.0) / 100.0)
+ taxes = account_tax_obj.compute_all(cr, uid, prod.taxes_id, price, qty, product=prod, partner=False)
- #if old_price != price:
- # raise Exception('old_price != price')
-
- unit_price = price or product_id.list_price
- res[line.id] = unit_price
- if unit_price is False:
- raise osv.except_osv(_('No valid pricelist line found !'),
- _("Couldn't find a pricelist line matching this product" \
- " and quantity.\nYou have to change either the product," \
- " the quantity or the pricelist."))
- return res
-
- def price_by_product(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False):
- if not product_id:
- return 0.0
- if not pricelist:
- raise osv.except_osv(_('No Pricelist !'),
- _('You have to select a pricelist in the sale form !\n' \
- 'Please set one before choosing a product.'))
- p_obj = self.pool.get('product.product').browse(cr, uid, [product_id])[0]
- uom_id = p_obj.uom_po_id.id
- price = self.pool.get('product.pricelist').price_get(cr, uid,
- [pricelist], product_id, qty or 1.0, partner_id, {'uom': uom_id})[pricelist]
- unit_price=price or p_obj.list_price
- if unit_price is False:
- raise osv.except_osv(_('No valid pricelist line found !'),
- _("Couldn't find a pricelist line matching this product" \
- " and quantity.\nYou have to change either the product," \
- " the quantity or the pricelist."))
- return unit_price
-
- def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False):
- price = self.price_by_product(cr, uid, ids, pricelist, product_id, qty, partner_id)
- self.write(cr, uid, ids, {'price_unit':price})
- pos_stot = (price * qty)
- return {'value': {'price_unit': price, 'price_subtotal_incl': pos_stot}}
-
- def onchange_subtotal(self, cr, uid, ids, discount, price, pricelist, qty,partner_id, product_id, *a):
- prod_obj = self.pool.get('product.product')
- price_f = self.price_by_product(cr, uid, ids, pricelist, product_id, qty, partner_id)
- prod_id = ''
- if product_id:
- prod_id = prod_obj.browse(cr, uid, product_id).disc_controle
- disc = 0.0
- if (disc != 0.0 or prod_id) and price_f > 0:
- disc = 100 - (price/price_f*100)
- return {'value': {'discount': disc, 'price_unit': price_f}}
- return {}
-
- def onchange_ded(self, cr, uid, ids, val_ded, price_u, *a):
- res_obj = self.pool.get('res.users')
- comp = res_obj.browse(cr, uid, uid).company_id.company_discount or 0.0
- val = 0.0
- if val_ded and price_u:
- val=100.0 * val_ded / price_u
- if val > comp:
- return {'value': {'discount': val, 'notice': '' }}
- return {'value': {'discount': val}}
-
- def onchange_discount(self, cr, uid, ids, discount, price, *a):
- pos_order = self.pool.get('pos.order.line')
- res_obj = self.pool.get('res.users')
- company_disc = pos_order.browse(cr,uid,ids)
- if discount:
- if not company_disc:
- comp=res_obj.browse(cr,uid,uid).company_id.company_discount or 0.0
- else:
- comp= company_disc[0] and company_disc[0].order_id.company_id and company_disc[0].order_id.company_id.company_discount or 0.0
-
- if discount > comp :
- return {'value': {'notice': '', 'price_ded': price * discount * 0.01 or 0.0 }}
- else:
- return {'value': {'notice': 'Minimum Discount', 'price_ded': price * discount * 0.01 or 0.0 }}
- else :
- return {'value': {'notice': 'No Discount', 'price_ded': price * discount * 0.01 or 0.0}}
-
- def onchange_qty(self, cr, uid, ids, discount, qty, price, context=None):
- subtotal = qty * price
- if discount:
- subtotal = subtotal - (subtotal * discount / 100)
- return {'value': {'price_subtotal_incl': subtotal}}
+ result['price_subtotal'] = taxes['total']
+ result['price_subtotal_incl'] = taxes['total_included']
+ return {'value': result}
_columns = {
- 'name': fields.char('Line Description', size=512),
'company_id': fields.many2one('res.company', 'Company', required=True),
- 'notice': fields.char('Discount Notice', size=128, required=True),
- 'serial_number': fields.char('Serial Number', size=128),
+ 'name': fields.char('Line No', size=32, required=True),
+ 'notice': fields.char('Discount Notice', size=128),
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], required=True, change_default=True),
- 'price_unit': fields.function(_get_amount, string='Unit Price', store=True),
- 'price_ded': fields.float('Discount(Amount)', digits_compute=dp.get_precision('Point Of Sale')),
- 'qty': fields.float('Quantity'),
- 'qty_rfd': fields.float('Refunded Quantity'),
- 'price_subtotal': fields.function(_amount_line_all, multi='pos_order_line_amount', string='Subtotal w/o Tax'),
- 'price_subtotal_incl': fields.function(_amount_line_all, multi='pos_order_line_amount', string='Subtotal'),
+ 'price_unit': fields.float(string='Unit Price', digits=(16, 2)),
+ 'qty': fields.float('Quantity', digits=(16, 2)),
+ 'price_subtotal': fields.function(_amount_line_all, multi='pos_order_line_amount', string='Subtotal w/o Tax', store=True),
+ 'price_subtotal_incl': fields.function(_amount_line_all, multi='pos_order_line_amount', string='Subtotal', store=True),
'discount': fields.float('Discount (%)', digits=(16, 2)),
'order_id': fields.many2one('pos.order', 'Order Ref', ondelete='cascade'),
'create_date': fields.datetime('Creation Date', readonly=True),
- 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', help="You can specify Production lot for stock move created when you validate the pos order"),
}
_defaults = {
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.order.line'),
'qty': lambda *a: 1,
'discount': lambda *a: 0.0,
- 'price_ded': lambda *a: 0.0,
- 'notice': lambda *a: 'No Discount',
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
- }
+ }
- def create(self, cr, user, vals, context=None):
- if vals.get('product_id'):
- return super(pos_order_line, self).create(cr, user, vals, context=context)
- return False
-
- def write(self, cr, user, ids, values, context=None):
- if 'product_id' in values and not values['product_id']:
- return False
- return super(pos_order_line, self).write(cr, user, ids, values, context=context)
-
def copy_data(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
default.update({
- 'prodlot_id': False,
'name': self.pool.get('ir.sequence').get(cr, uid, 'pos.order.line')
})
return super(pos_order_line, self).copy_data(cr, uid, id, default, context=context)
- def _scan_product(self, cr, uid, ean, qty, order):
- # search pricelist_id
- product_obj = self.pool.get('product.product')
- pricelist_id = self.pool.get('pos.order').read(cr, uid, [order], ['pricelist_id'] )
- if not pricelist_id:
- return False
-
- new_line = True
-
- product_id = product_obj.search(cr, uid, [('ean13','=', ean)])
- if not product_id:
- return False
-
- # search price product
- product = product_obj.read(cr, uid, product_id)
- product_name = product[0]['name']
- price = self.price_by_product(cr, uid, 0, pricelist_id[0]['pricelist_id'][0], product_id[0], 1)
-
- order_line_ids = self.search(cr, uid, [('name', '=', product_name), ('order_id', '=' ,order)])
- if order_line_ids:
- new_line = False
- order_line_id = order_line_ids[0]
- qty += self.read(cr, uid, order_line_ids[0], ['qty'])['qty']
-
- if new_line:
- vals = {'product_id': product_id[0],
- 'price_unit': price,
- 'qty': qty,
- 'name': product_name,
- 'order_id': order,
- }
- line_id = self.create(cr, uid, vals)
- if not line_id:
- raise osv.except_osv(_('Error'), _('Create line failed !'))
- else:
- vals = {
- 'qty': qty,
- 'price_unit': price
- }
- line_id = self.write(cr, uid, order_line_id, vals)
- if not line_id:
- raise osv.except_osv(_('Error'), _('Modify line failed !'))
- line_id = order_line_id
-
- price_line = float(qty) * float(price)
- return {
- 'name': product_name,
- 'product_id': product_id[0],
- 'price': price,
- 'price_line': price_line ,
- 'qty': qty
- }
-
pos_order_line()
class product_product(osv.osv):
@@ -1249,20 +677,6 @@ class product_product(osv.osv):
_columns = {
'income_pdt': fields.boolean('Product for Input'),
'expense_pdt': fields.boolean('Product for Output'),
- 'am_out': fields.boolean('Control for Output Operations'),
- 'disc_controle': fields.boolean('Discount Control'),
- }
- _defaults = {
- 'disc_controle': True,
}
product_product()
-class stock_picking(osv.osv):
- _inherit = 'stock.picking'
- _columns = {
- 'pos_order': fields.many2one('pos.order', 'Pos order'),
- }
-
-stock_picking()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/point_of_sale_demo.xml b/addons/point_of_sale/point_of_sale_demo.xml
index e95ce05256f..fe38cb98cb1 100644
--- a/addons/point_of_sale/point_of_sale_demo.xml
+++ b/addons/point_of_sale/point_of_sale_demo.xml
@@ -4,185 +4,175 @@
-
-
+
+
- buy
-
- Cash In
-
- Cash In
-
-
-
-
- buy
-
- Cash Out
-
- Cash Out
-
-
+ buy
+
+ Cash In
+
+ Cash In
+
+
+
+
+ buy
+
+ Cash Out
+
+ Cash Out
+
+
-
- POS/019
- POS/019
- SAJ/2010/010
-
-
-
-
-
- none
-
- open
- out_invoice
- SAJ/2010/010
-
-
-
- /
-
-
-
-
-
-
- Invoice from POS: POS/019
-
-
-
-
- [PC1] Basic PC
-
-
-
-
-
-
-
-
-
-
-
-
- 2011-04-07
-
-
-
-
-
-
-
-
- paid
-
-
-
- POS/019
- tax_excluded
-
-
-
-
-
-
- 10
- open
-
-
-
-
-
-
-
-
- general
-
-
-
- Cash Journal - (test)
-
-
-
-
-
- Payment POS/019
-
-
-
-
- POS/019
-
-
-
- direct
-
- POS notes
- done
- out
-
-
- OUT/00019
- none
-
-
-
- POS/019
-
-
-
-
-
- 1
-
-
- done
-
-
-
- Stock move (POS 12)
-
-
-
-
-
-
-
- No Discount
-
-
-
-
-
- Order Line/07
-
-
+
+ POS/019
+ POS/019
+ SAJ/2010/010
+
+
+
+
+
+ none
+
+ open
+ out_invoice
+ SAJ/2010/010
+
+
+
+ /
+
+
+
+
+
+
+ Invoice from POS: POS/019
+
+
+
+
+ [PC1] Basic PC
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ paid
+
+ POS/019
+ tax_excluded
+
+
+
+
+
+ 10
+ open
+
+
+
+
+
+
+
+
+ general
+
+
+
+ Cash Journal - (test)
+
+
+
+ Payment POS/019
+
+
+
+
+ POS/019
+
+
+
+ direct
+
+ POS notes
+ done
+ out
+
+
+ OUT/00019
+ none
+
+
+
+ POS/019
+
+
+
+
+
+ 1
+
+
+ done
+
+
+
+ Stock move (POS 12)
+
+
+
+
+
+
+
+ No Discount
+
+
+
+
+
+ Order Line/07
+
+
-
+
- tax_excluded
-
-
-
+
+
+
- tax_excluded
-
-
-
-
-
+
+
+
+
+ [PC3] Medium PC
@@ -218,6 +208,6 @@
0.10Discount Applied
-
+
diff --git a/addons/point_of_sale/point_of_sale_report.xml b/addons/point_of_sale/point_of_sale_report.xml
index 3e6a265b34e..b8d5456f1cd 100644
--- a/addons/point_of_sale/point_of_sale_report.xml
+++ b/addons/point_of_sale/point_of_sale_report.xml
@@ -96,17 +96,6 @@
menu="False"
rml="point_of_sale/report/pos_payment_report_user.rml"
/>
-
-
diff --git a/addons/point_of_sale/point_of_sale_sequence.xml b/addons/point_of_sale/point_of_sale_sequence.xml
index 399dccc634f..bf83fe17942 100644
--- a/addons/point_of_sale/point_of_sale_sequence.xml
+++ b/addons/point_of_sale/point_of_sale_sequence.xml
@@ -13,8 +13,8 @@
POS Orderpos.order
- POS/
- 3
+ POS
+ 4
@@ -24,8 +24,8 @@
POS order linepos.order.line
- Order Line/
- 2
+ POSL
+ 4
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index a8552cddc15..ba2d2c0214f 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -13,51 +13,47 @@
form
-
+
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
@@ -74,22 +70,25 @@
-
-
-
-
+
+
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -116,8 +115,6 @@
-
-
@@ -132,13 +129,17 @@
search
-
-
+
+
+
+
+
+
+
+
-
-
@@ -153,65 +154,11 @@
-
+
-
-
- Point of Sale
- ir.actions.act_window
- pos.order
- form
- tree,form
-
- ['|',('state','=','advance')]
- {"search_default_user_id":uid}
-
-
-
-
-
- Accepted Sales
- ir.actions.act_window
- pos.order
- form
- tree,form
- [('state','=', 'paid')]
- {"search_default_user_id":uid}
-
-
-
- Point of Sale
- ir.actions.act_window
- pos.order
- form
- tree,form
- [('date_order','<=', time.strftime('%Y-%m-%d 23:59:59'))]
- {"search_default_user_id":uid}
-
-
-
-
- Point of Sale
- ir.actions.act_window
- pos.order
- form
- tree,form
- {"search_default_user_id":uid}
-
-
-
- Opened Sales
- ir.actions.act_window
- pos.order
- form
- form,tree
- {"search_default_user_id":uid}
-
-
-
Sale linespos.order.line
@@ -632,20 +579,6 @@
tree,calendar,form,graph[('date_order','like',time.strftime('%Y-%m'))]
-
-
- view.company.form.pos
- res.company
- form
-
-
-
-
-
-
-
-
- product.normal.form.inherit
@@ -657,8 +590,6 @@
-
-
@@ -693,7 +624,6 @@
-
@@ -712,7 +642,7 @@
id="menu_point_config_product" sequence="25" groups="group_pos_manager"/>
- Products
+ Products 'Take Money Out'ir.actions.act_windowproduct.productform
@@ -731,14 +661,14 @@
-
+
- Products
+ Products 'Put Money In'ir.actions.act_windowproduct.productform
@@ -757,24 +687,37 @@
-
+
+
+ Payment Methods
+ account.journal
+ form
+ tree,form
+ {'default_journal_user': 1}
+ [('journal_user','=', 1)]
+ Payment methods are defined by accounting journals having the field Payment Method checked.
+
+
+
+
POS Sales Linespos.order.line
@@ -782,7 +725,6 @@
-
@@ -802,6 +744,16 @@
+
+ All Sales Orders
+ ir.actions.act_window
+ pos.order
+ form
+ tree,form
+ []
+
+
+
Invoicesir.actions.act_window
diff --git a/addons/point_of_sale/point_of_sale_workflow.xml b/addons/point_of_sale/point_of_sale_workflow.xml
index c325c4951c9..4058af2696f 100644
--- a/addons/point_of_sale/point_of_sale_workflow.xml
+++ b/addons/point_of_sale/point_of_sale_workflow.xml
@@ -69,7 +69,7 @@
-
+ cancel
diff --git a/addons/point_of_sale/report/__init__.py b/addons/point_of_sale/report/__init__.py
index d7355af0357..171f323e337 100644
--- a/addons/point_of_sale/report/__init__.py
+++ b/addons/point_of_sale/report/__init__.py
@@ -32,11 +32,8 @@ import pos_sales_user
import pos_sales_user_today
import pos_payment_report_date
import pos_payment_report_user
-import pos_sales_user_today_current_user
-import pos_receipt_with_remboursment
-import pos_receipt_without_remboursment
import pos_report
import pos_order_report
import report_cash_register
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/report/pos_details.py b/addons/point_of_sale/report/pos_details.py
index 84f3de8258f..4c23a005674 100644
--- a/addons/point_of_sale/report/pos_details.py
+++ b/addons/point_of_sale/report/pos_details.py
@@ -97,7 +97,7 @@ class pos_details(report_sxw.rml_parse):
def _get_sum_dis_2(self,form,user):
res4=[]
- self.cr.execute ("select sum(pol.price_ded * pol.qty)" \
+ self.cr.execute ("select sum(pol.qty)" \
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, res_users as ru,res_company as rc " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and po.state IN ('paid') " \
"and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date >= %s and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date <= %s " \
@@ -215,4 +215,4 @@ class pos_details(report_sxw.rml_parse):
report_sxw.report_sxw('report.pos.details', 'pos.order', 'addons/point_of_sale_singer/report/pos_details.rml', parser=pos_details, header='internal')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py
index 7a89b101956..0e1cd98fb47 100644
--- a/addons/point_of_sale/report/pos_invoice.py
+++ b/addons/point_of_sale/report/pos_invoice.py
@@ -55,4 +55,4 @@ class pos_invoice(report_sxw.rml_parse):
report_sxw.report_sxw('report.pos.invoice', 'pos.order', 'addons/account/report/account_print_invoice.rml', parser= pos_invoice)
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py
index 00681457495..ceb20a11a36 100644
--- a/addons/point_of_sale/report/pos_order_report.py
+++ b/addons/point_of_sale/report/pos_order_report.py
@@ -35,9 +35,7 @@ class pos_order_report(osv.osv):
'day': fields.char('Day', size=128, readonly=True),
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
- 'state': fields.selection([('draft', 'Draft'), ('payment', 'Payment'),
- ('advance','Advance'),
- ('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')],
+ 'state': fields.selection([('draft', 'New'), ('paid', 'Closed'), ('done', 'Synchronized'), ('invoiced', 'Invoiced'), ('cancel', 'Cancelled')],
'State'),
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
@@ -49,9 +47,6 @@ class pos_order_report(osv.osv):
'product_qty':fields.integer('# of Qty', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal'),
'delay_validation': fields.integer('Delay Validation'),
- 'delay_payment': fields.integer('Delay Payment'),
- 'date_validation': fields.date('Validation Date', required=True),
- 'date_payment': fields.date('Payment Date', required=True),
}
_order = 'date desc'
@@ -65,10 +60,9 @@ class pos_order_report(osv.osv):
to_date(to_char(s.date_order, 'dd-MM-YYYY'),'dd-MM-YYYY') as date,
sum(l.qty * u.factor) as product_qty,
sum(l.qty * l.price_unit) as price_total,
- sum(l.qty * l.price_ded) as total_discount,
+ sum(l.qty * l.discount) as total_discount,
(sum(l.qty*l.price_unit)/sum(l.qty * u.factor))::decimal(16,2) as average_price,
- sum(cast(to_char(date_trunc('day',s.date_validation) - date_trunc('day',s.date_order),'DD') as int)) as delay_validation,
- sum(cast(to_char(date_trunc('day',s.date_payment) - date_trunc('day',s.date_order),'DD') as int)) as delay_payment,
+ sum(cast(to_char(date_trunc('day',s.date_order) - date_trunc('day',s.create_date),'DD') as int)) as delay_validation,
to_char(s.date_order, 'YYYY') as year,
to_char(s.date_order, 'MM') as month,
to_char(s.date_order, 'YYYY-MM-DD') as day,
@@ -78,9 +72,7 @@ class pos_order_report(osv.osv):
s.shop_id as shop_id,
s.company_id as company_id,
s.sale_journal as journal_id,
- l.product_id as product_id,
- s.date_validation,
- s.date_payment
+ l.product_id as product_id
from pos_order_line as l
left join pos_order s on (s.id=l.order_id)
left join product_template pt on (pt.id=l.product_id)
@@ -88,11 +80,10 @@ class pos_order_report(osv.osv):
group by
to_char(s.date_order, 'dd-MM-YYYY'),to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),
to_char(s.date_order, 'YYYY-MM-DD'), s.partner_id,s.state,
- s.user_id,s.shop_id,s.company_id,s.sale_journal,l.product_id,s.date_validation,
- s.date_payment
+ s.user_id,s.shop_id,s.company_id,s.sale_journal,l.product_id,s.create_date
having
sum(l.qty * u.factor) != 0)""")
pos_order_report()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/report/pos_order_report_view.xml b/addons/point_of_sale/report/pos_order_report_view.xml
index 8b18bf0b57a..41fe2c3b4d6 100644
--- a/addons/point_of_sale/report/pos_order_report_view.xml
+++ b/addons/point_of_sale/report/pos_order_report_view.xml
@@ -2,65 +2,62 @@
- report.pos.order.tree
- report.pos.order
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
+ report.pos.order.tree
+ report.pos.order
+ tree
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
- report.pos.order.search
- report.pos.order
- search
-
-
-
-
-
-
-
- report.pos.order.search
+ report.pos.order
+ search
+
+
+
+
+
+
+
+
-
+
-
+
@@ -69,36 +66,31 @@
help="My Sales"
domain="[('user_id','=',uid)]"/>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
- Point of Sale Analysis
- report.pos.order
- form
- tree,graph
-
- {'search_default_today':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
-
+ Point of Sale Analysis
+ report.pos.order
+ form
+ tree,graph
+
+ {'search_default_today':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}
+
-
-
+
+
diff --git a/addons/point_of_sale/report/pos_receipt.rml b/addons/point_of_sale/report/pos_receipt.rml
index b9da3f5e9a6..e3b5583a499 100644
--- a/addons/point_of_sale/report/pos_receipt.rml
+++ b/addons/point_of_sale/report/pos_receipt.rml
@@ -77,7 +77,6 @@
Tel : [[ address and address.phone ]]E-mail : [[ address and address.email ]]Shop : [[ o.shop_id.name ]]
- Vendeur : [[ o.user_salesman_id.name ]]Date : [[ o.date_order ]]
@@ -85,12 +84,10 @@
- [[o.type_rec]]N° : [[ o.name ]]
- Contract : [[ o.contract_number ]]
@@ -165,6 +162,5 @@
- [[o.note_2]]
diff --git a/addons/point_of_sale/report/pos_receipt_with_remboursment.py b/addons/point_of_sale/report/pos_receipt_with_remboursment.py
deleted file mode 100644
index c600a9e2754..00000000000
--- a/addons/point_of_sale/report/pos_receipt_with_remboursment.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import time
-from report import report_sxw
-import pooler
-
-class order(report_sxw.rml_parse):
-
- def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context=context)
-
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid)
- partner = user.company_id.partner_id
-
- self.localcontext.update({
- 'time': time,
- 'disc': self.discount,
- 'net': self.netamount,
- 'get_journal_amt': self._get_journal_amt,
- 'address': partner.address and partner.address[0] or False,
- })
-
- def netamount(self, order_line_id):
- sql = 'select (qty*price_unit) as net_price from pos_order_line where id = %s'
- self.cr.execute(sql, (order_line_id,))
- res = self.cr.fetchone()
- return res[0]
-
- def discount(self, order_id):
- sql = 'select discount, price_unit, qty from pos_order_line where order_id = %s '
- self.cr.execute(sql, (order_id,))
- res = self.cr.fetchall()
- dsum = 0
- for line in res:
- if line[0] != 0:
- dsum = dsum +(line[2] * (line[0]*line[1]/100))
- return dsum
-
- def _get_journal_amt(self, order_id):
- lst=[]
- sql = """ select aj.name from account_bank_statement as abs
- LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
- LEFT JOIN account_journal as aj ON aj.id = abs.journal_id
- WHERE absl.pos_statement_id = %d"""%(order_id.id)
- self.cr.execute(sql)
- res = self.cr.fetchone()
- if not res:
- return ['', 0.0]
- lst.append(res[0]) # todo: improve
- sql2 = """ select sum(absl.amount) as amt from account_bank_statement as abs
- LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
- LEFT JOIN account_journal as aj ON aj.id = abs.journal_id
- where aj.name = '%s' """%(res[0])
- self.cr.execute(sql2)
- res1 = self.cr.fetchone()
- if res1:
- lst.append(res1[0])
- else:
- lst.append(0.0)
- return lst
-
-report_sxw.report_sxw('report.pos.receipt.with.remboursment', 'pos.order', 'addons/point_of_sale/report/pos_receipt_with_remboursment.rml', parser=order, header=False)
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/point_of_sale/report/pos_receipt_with_remboursment.rml b/addons/point_of_sale/report/pos_receipt_with_remboursment.rml
deleted file mode 100644
index 9c25d5f4a89..00000000000
--- a/addons/point_of_sale/report/pos_receipt_with_remboursment.rml
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ repeatIn(objects,'o') ]]
- [[ repeatIn(objects,'o') ]]
- [[o.user_id.company_id.name]]
- [[ address and address.street ]], [[ address and address.zip ]] [[ address and address.city ]]
- [[ address and address.country_id.name ]]
- Tel : [[ address and address.phone ]]
- E-mail : [[ address and address.email ]]
- Salesman : [[ o.user_id.name ]]
- Sale Date : [[ o.date_order ]]
- Refund Receipt: [[o.name]]
-
-
-
-
-
-
-
- Description
-
-
- Qty
-
-
- Price
-
-
-
-
- [[ repeatIn(o.lines,'line') ]]
-
-
-
-
- [[ line.product_id.name ]]
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.f' % line.qty ]]
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][[ '%.2f' % net(line.id) ]] [[ line and line.discount == 0.0 and removeParentNode('font') ]] ([[ '%.f' % line.discount ]]%)
-
-
-
-
-
-
-
- Disc :
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][[ '%.2f' % (disc(o.id) or 0.0,) ]]
-
-
-
-
- Total :
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.2f' % o.amount_total ]] [[ o.pricelist_id.currency_id.name ]]
-
-
-
- [[ get_journal_amt(o)[1] ]]
-
-
-
diff --git a/addons/point_of_sale/report/pos_receipt_without_remboursment.py b/addons/point_of_sale/report/pos_receipt_without_remboursment.py
deleted file mode 100644
index d2fe0f1d542..00000000000
--- a/addons/point_of_sale/report/pos_receipt_without_remboursment.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import time
-from report import report_sxw
-import pooler
-
-class order(report_sxw.rml_parse):
-
- def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context=context)
-
- user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid)
- partner = user.company_id.partner_id
-
- self.localcontext.update({
- 'time': time,
- 'disc': self.discount,
- 'net': self.netamount,
- 'get_journal_amt': self._get_journal_amt,
- 'address': partner.address and partner.address[0] or False,
- })
-
- def netamount(self, order_line_id):
- sql = 'select (qty*price_unit) as net_price from pos_order_line where id = %s'
- self.cr.execute(sql, (order_line_id,))
- res = self.cr.fetchone()
- return res[0]
-
- def discount(self, order_id):
- sql = 'select discount, price_unit, qty from pos_order_line where order_id = %s '
- self.cr.execute(sql, (order_id,))
- res = self.cr.fetchall()
- dsum = 0
- for line in res:
- if line[0] != 0:
- dsum = dsum +(line[2] * (line[0]*line[1]/100))
- return dsum
-
- def _get_journal_amt(self, order_id):
- lst=[]
- sql = """ select aj.name from account_bank_statement as abs
- LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
- LEFT JOIN account_journal as aj ON aj.id = abs.journal_id
- WHERE absl.pos_statement_id = %d"""%(order_id.id)
- self.cr.execute(sql)
- res = self.cr.fetchone()
- if not res:
- return ['', 0.0]
- lst.append(res[0]) # todo: improve
- sql2 = """ select sum(absl.amount) as amt from account_bank_statement as abs
- LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
- LEFT JOIN account_journal as aj ON aj.id = abs.journal_id
- where aj.name = '%s' """%(res[0])
- self.cr.execute(sql2)
- res1 = self.cr.fetchone()
- if res1:
- lst.append(res1[0])
- else:
- lst.append(0.0)
- return lst
-
-report_sxw.report_sxw('report.pos.receipt.without.remboursment', 'pos.order', 'addons/point_of_sale/report/pos_receipt_without_remboursment.rml', parser=order, header=False)
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/point_of_sale/report/pos_receipt_without_remboursment.rml b/addons/point_of_sale/report/pos_receipt_without_remboursment.rml
deleted file mode 100644
index ff6ebc3132c..00000000000
--- a/addons/point_of_sale/report/pos_receipt_without_remboursment.rml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ repeatIn(objects,'o') ]]
- [[ repeatIn(objects,'o') ]]
- [[o.user_id.company_id.name]]
- [[ address and address.street ]], [[ address and address.zip ]] [[ address and address.city ]]
- [[ address and address.country_id.name ]]
- Tel : [[ address and address.phone ]]
- E-mail : [[ address and address.email ]]
- Salesman : [[ o.user_id.name ]]
- Sale Date : [[ str(o.date_order) ]]
- Purchase Voucher : [[o.name]]
-
-
-
-
-
-
-
- Description
-
-
- Qty
-
-
- Price
-
-
-
-
- [[ repeatIn(o.lines,'line') ]]
-
-
-
-
- [[ line.product_id.name ]]
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.f' % line.qty ]]
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][[ '%.2f' % net(line.id) ]] [[ line and line.discount == 0.0 and removeParentNode('font') ]] ([[ '%.f' % line.discount ]]%)
-
-
-
-
-
-
-
- Disc :
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][[ '%.2f' % (disc(o.id) or 0.0,) ]]
-
-
-
-
- Total :
-
-
- [[o.state=='cancel' and o.statement_ids and '-' or '']][['%.2f' % o.amount_total ]] [[ o.pricelist_id.currency_id.name ]]
-
-
-
- [[ get_journal_amt(o)[0] ]] : [[ get_journal_amt(o)[1] ]]
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/report/pos_report.py b/addons/point_of_sale/report/pos_report.py
index cd41eb92944..1ecf80ea519 100644
--- a/addons/point_of_sale/report/pos_report.py
+++ b/addons/point_of_sale/report/pos_report.py
@@ -49,7 +49,7 @@ class report_transaction_pos(osv.osv):
min(absl.id) as id,
count(absl.id) as no_trans,
sum(absl.amount) as amount,
- sum(line.price_ded) as disc,
+ sum((100.0-line.discount) * line.price_unit * line.qty / 100.0) as disc,
to_char(date_trunc('day',absl.create_date),'YYYY-MM-DD')::text as date_create,
po.user_id as user_id,
po.sale_journal as journal_id,
@@ -236,4 +236,4 @@ class report_sales_by_margin_pos_month(osv.osv):
""")
report_sales_by_margin_pos_month()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/report/pos_sales_user_today_current_user.py b/addons/point_of_sale/report/pos_sales_user_today_current_user.py
deleted file mode 100644
index 07cbdcbc488..00000000000
--- a/addons/point_of_sale/report/pos_sales_user_today_current_user.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import time
-from report import report_sxw
-
-class pos_sales_user_today_current_user(report_sxw.rml_parse):
-
- def __init__(self, cr, uid, name, context):
- super(pos_sales_user_today_current_user, self).__init__(cr, uid, name, context=context)
- self.total = 0.0
- self.qty = 0.0
- self.localcontext.update({
- 'time': time,
- 'get_user':self._get_user,
- 'get_data_current_user':self._get_data_current_user,
- 'get_data_current_user_tot':self._get_data_current_user_tot,
- 'get_data_current_user_qty':self._get_data_current_user_qty,
- })
-
- def _get_user(self, user):
- pos_user={}
- self.cr.execute("select name from res_users where id = %s",str(self.uid))
- pos_user=self.cr.dictfetchone()
- return pos_user['name']
-
- def _get_data_current_user(self, user):
- data={}
- self.cr.execute("select po.name,po. state,sum(pol.qty)as Qty,sum((pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0))) as Total " \
- "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, res_users as ru,res_company as rc " \
- "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
- "and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date and po.user_id = ru.id and rc.id = %s and ru.id = %s " \
- "group by po.name, po.state " \
- ,(str(user.company_id.id),str(self.uid)))
-
- data = self.cr.dictfetchall()
- for d in data:
- self.total += d['total']
- self.qty += d['qty']
- return data
-
- def _get_data_current_user_tot(self, user):
- return self.total
-
- def _get_data_current_user_qty(self, user):
- return self.qty
-
-report_sxw.report_sxw('report.pos.sales.user.today.current.user', 'pos.order', 'addons/point_of_sale/report/pos_sales_user_today_current_user.rml', parser=pos_sales_user_today_current_user,header='internal')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/point_of_sale/report/pos_sales_user_today_current_user.rml b/addons/point_of_sale/report/pos_sales_user_today_current_user.rml
deleted file mode 100644
index 7a94f5d6632..00000000000
--- a/addons/point_of_sale/report/pos_sales_user_today_current_user.rml
+++ /dev/null
@@ -1,204 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ repeatIn(objects,'order') ]]
-
-
-
-
-
-
- Today's Sales By Current User
-
-
-
-
-
- [[ formatLang((get_data_current_user_tot(user))) or removeParentNode('blockTable')]] [[company.currency_id.symbol]]
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/test/00_register_open.yml b/addons/point_of_sale/test/00_register_open.yml
new file mode 100644
index 00000000000..7d5aabbcdc3
--- /dev/null
+++ b/addons/point_of_sale/test/00_register_open.yml
@@ -0,0 +1,17 @@
+-
+ In order to test the Point of Sale module, I will open all cash registers through the wizard
+-
+ I go to the window to open the cash registers as admin
+-
+ !record {model: pos.open.statement, id: new_statement_open}:
+-
+ I click on the button to open all statements/cash registers
+-
+ !python {model: pos.open.statement}: |
+ self.open_statement(cr, uid, [ref('new_statement_open')], context={})
+-
+ I check that I have some bank statements open for the admin user
+-
+ !python {model: account.bank.statement}: |
+ ids = self.search(cr, uid, [('state', 'in', ('open','new')), ('user_id', '=', 1)])
+ assert (len(ids)>0), 'No statement open for the admin user!'
diff --git a/addons/point_of_sale/test/01_order_to_payment.yml b/addons/point_of_sale/test/01_order_to_payment.yml
new file mode 100644
index 00000000000..fd8ffbaa3e0
--- /dev/null
+++ b/addons/point_of_sale/test/01_order_to_payment.yml
@@ -0,0 +1,124 @@
+- |
+ In order to test the Point of Sale in module, I will do a full flow from the sale to the payment and invoicing.
+ I will use two products, one with price including a 10% tax, the other one with 5% tax excluded from the price.
+- |
+ I create a VAT tax of 10%, included in the public price
+-
+ !record {model: account.tax, id: account_tax_10_incl}:
+ name: VAT 10 perc Incl
+ type: percent
+ amount: 0.10
+ account_paid_id: account.iva
+ account_collected_id: account.iva
+ price_include: 1
+-
+ I assign this 10 percent tax on the PC1 product as a sale tax
+-
+ !record {model: product.product, id: product.product_product_pc1}:
+ taxes_id: [account_tax_10_incl]
+- |
+ I create a VAT tax of 5%, which is added to the public price
+-
+ !record {model: account.tax, id: account_tax_05_incl}:
+ name: VAT 05 perc Excl
+ type: percent
+ amount: 0.05
+ account_paid_id: account.iva
+ account_collected_id: account.iva
+ price_include: 0
+-
+ I assign this 5 percent tax on the PC2 product as a sale tax
+-
+ !record {model: product.product, id: product.product_product_pc2}:
+ taxes_id: [account_tax_05_incl]
+-
+ I create a PoS order with 2 units of PC1 at 450 EUR (Tax Incl) and 3 units of PC2 at 300 EUR. (Tax Excl)
+-
+ !record {model: pos.order, id: pos_order_pos0}:
+ company_id: base.main_company
+ lines:
+ - name: OL/0001
+ product_id: product.product_product_pc1
+ price_unit: 450
+ discount: 0.0
+ qty: 2.0
+ - name: OL/0002
+ product_id: product.product_product_pc2
+ price_unit: 300
+ discount: 0.0
+ qty: 3.0
+-
+ I check that the total of the order is equal to 450*2 + 300*3*1.05 and the tax of the order is equal to 900 -(450 * 2 / 1.1) + 300*0.05*3
+-
+ !python {model: pos.order}: |
+ order = self.browse(cr, uid, ref('pos_order_pos0'))
+ assert(abs(order.amount_total - (450*2 + 300*3*1.05)) < 0.01), "The order has a wrong amount, tax included"
+ assert(abs(order.amount_tax - (900-(450*2/1.1) + 300*0.05*3)) < 0.01), "The order has a wrong tax amount"
+-
+ I want to add a global discount of 5 percent using the wizard
+-
+ !record {model: pos.discount, id: pos_discount_0}:
+ discount: 5.0
+-
+ I click the apply button to set the discount on all lines
+-
+ !python {model: pos.discount}: |
+ self.apply_discount(cr, uid, [ref("pos_discount_0")], {"active_model": "pos.order",
+ "active_ids": [ref("pos_order_pos0")], "active_id": ref("pos_order_pos0"), })
+-
+ I check that the total of the order is now equal to (450*2 + 300*3*1.05)*0.95
+-
+ !python {model: pos.order}: |
+ order = self.browse(cr, uid, ref('pos_order_pos0'))
+ assert(abs(order.amount_total - (450*2 + 300*3*1.05)*0.95) < 0.01), "The order has a wrong total including tax and discounts"
+-
+ I click on the "Make Payment" wizard to pay the PoS order with a partial amount of 100.0 EUR
+-
+ !record {model: pos.make.payment, id: pos_make_payment_0, context: {'active_id': ref('pos_order_pos0'), 'active_ids': [ref('pos_order_pos0')]} }:
+ amount: 100.0
+-
+ I click on the validate button to register the payment.
+-
+ !python {model: pos.make.payment}: |
+ self.check(cr, uid, [ref('pos_make_payment_0')], context={'active_id': ref('pos_order_pos0'), 'lang':'en_US', 'active_model': 'pos.order', 'tz': False, 'active_ids': [ref('pos_order_pos0')]} )
+- |
+ I check that the order is not marked as paid yet
+-
+ !assert {model: pos.order, id: pos_order_pos0}:
+ - state == 'draft'
+- |
+ On the second payment proposition, I check that it proposes me the remaining balance which is 1790.0 EUR
+-
+ !python {model: pos.make.payment}: |
+ defs = self.default_get(cr, uid, ['amount'], {'active_id': ref('pos_order_pos0')})
+ assert abs(defs['amount'] - ((450*2 + 300*3*1.05)*0.95-100.0)) < 0.01, "The remaining balance is incorrect"
+-
+ I pay the remaining balance.
+-
+ !record {model: pos.make.payment, id: pos_make_payment_1, context: {'active_id': [ref('pos_order_pos0')], 'active_ids': [ref('pos_order_pos0')]} }:
+ amount: !eval >
+ (450*2 + 300*3*1.05)*0.95-100.0
+-
+ I click on the validate button to register the payment.
+-
+ !python {model: pos.make.payment}: |
+ self.check(cr, uid, [ref('pos_make_payment_1')], context={'active_id': ref('pos_order_pos0')} )
+- |
+ I check that the order is marked as paid
+-
+ !assert {model: pos.order, id: pos_order_pos0}:
+ - state == 'paid'
+-
+ I generate the journal entries
+-
+ !python {model: pos.order}: |
+ self.create_account_move(cr, uid, [ref('pos_order_pos0')], {})
+-
+ I test that the generated journal entry is attached to the PoS order
+-
+ !assert {model: pos.order, id: pos_order_pos0}:
+ - bool(account_move)
+
+
+
+
diff --git a/addons/point_of_sale/test/02_order_to_invoice.yml b/addons/point_of_sale/test/02_order_to_invoice.yml
new file mode 100644
index 00000000000..3436e176678
--- /dev/null
+++ b/addons/point_of_sale/test/02_order_to_invoice.yml
@@ -0,0 +1,47 @@
+-
+ I create a new PoS order with 2 units of PC1 at 450 EUR (Tax Incl) and 3 units of PC2 at 300 EUR. (Tax Excl)
+-
+ !record {model: pos.order, id: pos_order_pos1}:
+ company_id: base.main_company
+ partner_id: base.res_partner_asus
+ lines:
+ - name: OL/0001
+ product_id: product.product_product_pc1
+ price_unit: 450
+ discount: 5.0
+ qty: 2.0
+ - name: OL/0002
+ product_id: product.product_product_pc2
+ price_unit: 300
+ discount: 5.0
+ qty: 3.0
+-
+ I click on the "Make Payment" wizard to pay the PoS order
+-
+ !record {model: pos.make.payment, id: pos_make_payment_2, context: {'active_id': ref('pos_order_pos1'), 'active_ids': [ref('pos_order_pos1')]} }:
+ amount: !eval >
+ (450*2 + 300*3*1.05)*0.95
+-
+ I click on the validate button to register the payment.
+-
+ !python {model: pos.make.payment}: |
+ self.check(cr, uid, [ref('pos_make_payment_2')], context={'active_id': ref('pos_order_pos1')} )
+- |
+ I check that the order is marked as paid and there is no invoice attached to it
+-
+ !python {model: pos.order}: |
+ order = self.browse(cr,uid,ref('pos_order_pos1'))
+-
+ !assert {model: pos.order, id: pos_order_pos1, string: State not correct}:
+ - state == 'paid'
+ - not invoice_id
+-
+ I generate the invoice by pressing the Invoice button that calls the workflow
+-
+ !workflow {model: pos.order, action: invoice, ref: pos_order_pos1}
+-
+ I test that the total of the attached invoice is correct
+-
+ !assert {model: pos.order, id: pos_order_pos1, string: Invoice not correct}:
+ - bool(invoice_id)
+ - invoice_id.amount_total == (450*2 + 300*3*1.05)*0.95
diff --git a/addons/point_of_sale/test/point_of_sale_report.yml b/addons/point_of_sale/test/point_of_sale_report.yml
index ead21be6a36..f3ea5995b9e 100644
--- a/addons/point_of_sale/test/point_of_sale_report.yml
+++ b/addons/point_of_sale/test/point_of_sale_report.yml
@@ -34,24 +34,6 @@
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on a Point of Sale, we will print a POS Receipt With Reimbursement Report
--
- !python {model: pos.order}: |
- import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.pos.receipt.with.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt with reimbursement report'+format), 'wb+').write(data)
-
--
- In order to test the PDF reports defined on a point of sale, we will print a POS Receipt Without Reimbursement Report
--
- !python {model: pos.order}: |
- import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.pos.receipt.without.remboursment').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt without reimbursement report'+format), 'wb+').write(data)
-
-
Create a record for the root user in pos.payment.report.user (used by the next python block).
-
@@ -79,56 +61,6 @@
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_report_pos_details',wiz_data=data_dict, context=ctx, our_module='point_of_sale')
--
- I create a cash journal.
--
- !record {model: account.journal, id: account_journal_cash0}:
- name: 'Cash Journal'
- code: 'CSJ'
- type: 'cash'
- view_id: account.account_journal_bank_view
- sequence_id: account.sequence_journal
--
- I create a record for Bank Statement.
--
- !record {model: account.bank.statement, id: account_bank_statement_st0}:
- name: St.05/19
- balance_end_real: 0.0
- date: !eval time.strftime('%Y-%m-%d')
- journal_id: account_journal_cash0
- line_ids:
- - name: statement
- date: !eval "(datetime.now() + timedelta(5*31)).strftime('%Y-%m-%d')"
- type: customer
- account_id: account_pos_account_sales
- amount: 100
- partner_id: base.res_partner_agrolait
- period_id: account.period_5
- state: 'draft'
--
- In order to test the PDF reports defined on a Point Of Sale, we will print a Account Statement Report
--
- !python {model: account.bank.statement}: |
- import netsvc, tools, os, time
- (data, format) = netsvc.LocalService('report.account.statement').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-account_statement_report'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on a Point Of Sale, we will print a POS User Product Report
--
- !python {model: account.bank.statement}: |
- import netsvc, tools, os, time
- (data, format) = netsvc.LocalService('report.pos.user.product').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-user_product_report'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on a Point Of Sale, we will print a POS All Close Cashbox Of the Day Report
--
- !python {model: account.bank.statement}: |
- import netsvc, tools, os, time
- (data, format) = netsvc.LocalService('report.all.closed.cashbox.of.the.day').create(cr, uid, [ref('point_of_sale.account_bank_statement_st0')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-all_closed_cash_box_of_the_day_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Report
-
@@ -138,15 +70,6 @@
(data, format) = netsvc.LocalService('report.pos.sales.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_report'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on a Point of Sale, we will print a POS Sales User Today Report
--
- !python {model: pos.order}: |
- import netsvc, tools, os, time
- data_dict = {'model':'ir.ui.menu', 'form':{'user_id':[ref('base.user_root')] }}
- (data, format) = netsvc.LocalService('report.pos.sales.user.today').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_user_today_report'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Point of Sale, we will print a POS Payment Report
-
@@ -164,11 +87,3 @@
(data, format) = netsvc.LocalService('report.pos.payment.report.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_user_report'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on a Point of Sale, we will print a POS Today's Sales of Current User Report
--
- !python {model: pos.order}: |
- import netsvc, tools, os, time
- (data, format) = netsvc.LocalService('report.pos.sales.user.today.current.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_today_current_user_report'+format), 'wb+').write(data)
diff --git a/addons/point_of_sale/test/point_of_sale_test.yml b/addons/point_of_sale/test/point_of_sale_test.yml
deleted file mode 100644
index 6165e993240..00000000000
--- a/addons/point_of_sale/test/point_of_sale_test.yml
+++ /dev/null
@@ -1,437 +0,0 @@
--
- In order to test the POS in module, To give business owners a convenient way of checking out customers and of recording sales.
-
--
- I configure all details for the Customer, Salesman and Product, Account.
--
- I create View Account Type.
--
- !record {model: account.account.type, id: account_account_type_view0}:
- close_method: none
- code: View
- name: View
- 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
--
- 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 Minimal Chart Account.
--
- !record {model: account.account, id: account_pos_account_minimalchart}:
- code: 'x_0'
- company_id: base.main_company
- currency_mode: current
- name: Minimal Chart
- parent_left: 1
- parent_right: 12
- type: view
- user_type: account_account_type_view0
--
- I create Payable Account.
--
- !record {model: account.account, id: account_pos_account_payable}:
- code: AP
- company_id: base.main_company
- currency_mode: current
- name: Payable
- parent_id: account_pos_account_minimalchart
- parent_left: 2
- parent_right: 3
- reconcile: true
- type: payable
- user_type: account_account_type_expense0
--
- I create Receivable Account.
--
- !record {model: account.account, id: account_pos_account_receivable}:
- code: AR
- company_id: base.main_company
- currency_mode: current
- name: Receivable
- parent_id: account_pos_account_minimalchart
- parent_left: 4
- parent_right: 5
- reconcile: true
- type: receivable
- user_type: account_account_type_income0
--
- I create Cash Account.
--
- !record {model: account.account, id: account_pos_account_cash}:
- code: C
- company_id: base.main_company
- currency_mode: current
- name: Cash
- parent_id: account_pos_account_minimalchart
- parent_left: 6
- parent_right: 7
- type: other
- user_type: account_account_type_cash0
--
- I create Purchases Account.
--
- !record {model: account.account, id: account_pos_account_purchases}:
- code: P
- company_id: base.main_company
- currency_mode: current
- name: Purchases
- parent_id: account_pos_account_minimalchart
- parent_left: 8
- parent_right: 9
- type: other
- user_type: account_account_type_expense0
--
- I create Sales Account.
--
- !record {model: account.account, id: account_pos_account_sales}:
- code: Sale
- company_id: base.main_company
- currency_mode: current
- name: Sales
- parent_id: account_pos_account_minimalchart
- parent_left: 10
- parent_right: 11
- type: other
- user_type: account_account_type_income0
--
- I create Purchase Journal - (test).
--
- !record {model: account.journal, id: account_pos_account_journal_purchasejournal}:
- code: PUJ
- company_id: base.main_company
- default_credit_account_id: account_pos_account_purchases
- default_debit_account_id: account_pos_account_purchases
- name: Purchase Journal - (test)
- sequence_id: account.sequence_purchase_journal
- type: purchase
- view_id: account.account_journal_view
--
- I create Sale Journal.
--
- !record {model: account.journal, id: account_pos_account_journal_salejournal}:
- code: SJ
- company_id: base.main_company
- default_credit_account_id: account_pos_account_sales
- default_debit_account_id: account_pos_account_sales
- name: Sale Journal
- sequence_id: account.sequence_sale_journal
- type: sale
- view_id: account.account_journal_view
--
- I create Bank Journal.
--
- !record {model: account.journal, id: account_pos_account_journal_bankjournal}:
- code: BNK
- company_id: base.main_company
- default_credit_account_id: account_pos_account_cash
- default_debit_account_id: account_pos_account_cash
- name: Bank Journal
- sequence_id: account.sequence_journal
- type: cash
- view_id: account.account_journal_bank_view
--
- I create property for account payable.
--
- !record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}:
- company_id: base.main_company
- fields_id: account.field_res_partner_property_account_payable
- name: property_account_expense_categ
- value_reference: account.account,5
--
- I create property for account receivable.
--
- !record {model: ir.property, id: ir_property_propertyaccountincomecateg0}:
- company_id: base.main_company
- fields_id: account.field_res_partner_property_account_receivable
- name: property_account_income_categ
- value_reference: account.account,6
--
- I create Partner category Customers.
--
- !record {model: res.partner.category, id: res_partner_category_customers0}:
- name: Customers
--
- I create partner
--
- !record {model: res.partner, id: res_partner_cleartrail0}:
- category_id:
- - res_partner_category_customers0
- name: Cleartrail
--
- I create partner address.
--
- !record {model: res.partner.address, id: res_partner_address_1}:
- partner_id: res_partner_cleartrail0
- street: onam plaza, 14 B palasia A B Road
- type: contact
--
- I create partner invoice address.
--
- !record {model: res.partner.address, id: res_partner_address_2}:
- partner_id: res_partner_cleartrail0
- type: invoice
--
- I create partner delivery address.
--
- !record {model: res.partner.address, id: res_partner_address_3}:
- partner_id: res_partner_cleartrail0
- street: sangam house 15 B palasia, A B Road
- type: delivery
--
- I create product category.
--
- !record {model: product.category, id: product_category_allproductssellable0}:
- name: Mobile Products Sellable
--
- I create partner.
--
- !record {model: res.partner, id: res_partner_microlinktechnologies0}:
- address:
- - street: Kailash Vaibhav, Parksite
- name: Micro Link Technologies
- property_account_payable: account_pos_account_payable
- property_account_receivable: account_pos_account_receivable
- supplier: true
--
- I create partner 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 category .
--
- !record {model: product.category, id: product_category_services0}:
- name: Mobile Services
--
- I create product Samsung Mobile.
--
- !record {model: product.product, id: product_product_samsungmobile0}:
- categ_id: product_category_allproductssellable0
- cost_method: standard
- list_price: 170.0
- mes_type: fixed
- name: Samsung Mobile
- procure_method: make_to_order
- property_account_expense: account_pos_account_payable
- property_account_income: account_pos_account_receivable
- seller_delay: '1'
- standard_price: 160.0
- supply_method: produce
- type: product
- uom_id: product.product_uom_unit
- uom_po_id: product.product_uom_unit
--
- 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: product_category_computer0
- cost_method: standard
- mes_type: fixed
- list_price: 1000.0
- name: HP Pavilion Desktop PCs
- procure_method: make_to_stock
- seller_ids:
- - delay: 1
- name: res_partner_microlinktechnologies0
- min_qty: 5.0
- supply_method: buy
- type: product
- uom_id: product.product_uom_unit
- uom_po_id: product.product_uom_unit
- property_account_expense: account_pos_account_payable
- property_account_income: account_pos_account_receivable
--
- I create New Order by adding the details of Salesman and "Product" as Samsung Mobile Quantity as 10.
--
- !record {model: pos.order, id: pos_order_pos0}:
- company_id: base.main_company
- date_order: !eval time.strftime('%Y-%m-%d %H:%M:%S')
- date_validity: !eval "(datetime.now() + timedelta(6*1)).strftime('%Y-%m-%d')"
- lines:
- - company_id: base.main_company
- name: Order Line/01
- notice: No Discount
- product_id: product_product_samsungmobile0
- qty: 10.0
- qty_rfd: 0.0
- partner_id: base.res_partner_agrolait
- name: POS/001
- price_type: tax_excluded
- pricelist_id: product.list0
- sale_journal: account.sales_journal
- shop_id: sale.shop
- user_salesman_id: base.user_root
--
- I add discount.
--
- !record {model: pos.discount, id: pos_discount_0}:
- discount: 5.0
- discount_notes: More then 5 product
--
- I Apply the discount.
--
- !python {model: pos.discount}: |
- self.apply_discount(cr, uid, [ref("pos_discount_0")], {"lang": "en_US", "active_model":
- "pos.order", "active_ids": [ref("pos_order_pos0")], "tz": False, "active_id":
- ref("pos_order_pos0"), })
--
- I open the register.
--
- !record {model: pos.open.statement, id: pos_open_statement_0}:
- {}
--
- I open the statement.
--
- !python {model: pos.open.statement}: |
- jou_obj = self.pool.get('account.journal')
- statement_obj = self.pool.get('account.bank.statement')
- cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users "
- "WHERE user_id = %s ORDER BY journal_id"% (uid, ))
- jou_ids = map(lambda x1: x1[0], cr.fetchall())
- journal_ids = jou_obj.search(cr, uid, [('auto_cash', '=', True), ('type', '=', 'cash'), ('id', 'in', jou_ids)], context=context)
- ids = statement_obj.search(cr, uid, [('state', '=', 'open'), ('user_id', '=', uid), ('journal_id', 'in', journal_ids)], context=context)
- if not ids:
- self.open_statement(cr, uid, [ref("pos_open_statement_0")], {"lang": "en_US", "active_model":
- "ir.ui.menu", "active_ids": [ref("point_of_sale.menu_open_statement")], "tz":
- False, "active_id": ref("point_of_sale.menu_open_statement"), })
--
- I click on the "Make Payment" wizard.
--
- !record {model: pos.make.payment, id: pos_make_payment_0}:
- amount: 1615.0
- journal: 7
- payment_date: !eval time.strftime("%Y-%m-%d")
- payment_name: Payment
- product_id: product_product_hppaviliondesktoppcs0
- pricelist_id: product.list0
- partner_id: base.res_partner_agrolait
--
- I make the payment.
--
- !python {model: pos.make.payment}: |
- self.check(cr, uid, [ref("pos_make_payment_0")], {"lang": "en_US", "active_model":
- "pos.order", "active_ids": [ref("point_of_sale.pos_order_pos0")], "tz":
- False, "active_id": ref("point_of_sale.pos_order_pos0"), })
--
- I check the Statement lines are created automatically when payment is done.
--
- !python {model: pos.order}: |
- order=self.browse(cr,uid,ref("pos_order_pos0"))
- assert(order.statement_ids!=[]), "Statement lines not created"
--
- When I click on Return picking button , I get three option.
--
- 1. Cancel 2.Return Goods and Exchange 3.Return without Refund
--
- When I click on Return Goods and Exchange.
--
- Then it allows me to define the quantity of products, which will return to the stock.
--
- I click on Return Picking button.
--
- !record {model: pos.return, id: pos_return_0}:
- pos_moves_ids:
- - product_id: product_product_hppaviliondesktoppcs0
- quantity: 5.0
--
- I Return the product.
--
- !python {model: pos.return}: |
- self.create_returns(cr, uid, [ref("pos_return_0")], {"lang": "en_US", "active_model":
- "pos.order", "active_ids": [ref("point_of_sale.pos_order_pos0")], "tz":
- False, "active_id": ref("point_of_sale.pos_order_pos0"), })
--
- Then it allows me to define the quantity of products, which will return to the stock.
--
- I select the HP Pavilion Desktop PCs for exchange.
--
- !record {model: pos.add.product, id: pos_add_product_0}:
- product_id: product_product_hppaviliondesktoppcs0
- quantity: 5.0
--
- I click on close button.
--
- !python {model: pos.add.product}: |
- return_obj = self.pool.get('pos.return')
- context['active_ids'] = [ref("pos_order_pos0")]
- return_obj.view_init(cr, uid, [],context=context)
- self.close_action(cr, uid, [ref("pos_add_product_0")], {"lang": "en_US", "active_model":
- "pos.order", "active_ids": [ref("pos_order_pos0")], "tz": False, "active_id": ref("pos_order_pos0"),
- })
--
- I create payment.
--
- !record {model: pos.make.payment, id: pos_make_payment_1}:
- amount: 680.0
- journal: 7
- payment_date: !eval time.strftime("%Y-%m-%d")
- payment_name: Payment
- product_id: product_product_hppaviliondesktoppcs0
- pricelist_id: product.list0
- partner_id: base.res_partner_agrolait
--
- For payment, I click on Make Payment.
--
- !python {model: pos.make.payment}: |
- self.check(cr, uid, [ref("pos_make_payment_1")], {"lang": "en_US", "active_model":
- "pos.order", "active_ids": [ref("pos_order_pos0")], "tz":
- False, "active_id": ref("pos_order_pos0"), })
--
- To check the Return without Refund . I click button "Return without Refund ".
--
- !record {model: pos.return, id: pos_return_0}:
- {}
--
- The quantity which is selected in Return lines wizard is refunded.
--
- !python {model: pos.return}: |
- self.create_returns2(cr, uid, [ref("pos_return_0")], {"lang": "en_US", "active_model":
- "pos.order", "active_ids": [ref("pos_order_pos0")], "tz":
- False, "active_id": ref("pos_order_pos0"), })
--
- To Close order, I use the wizard "Sale Confirm".
--
- !record {model: pos.confirm, id: pos_confirm_0}:
- {}
--
- I close this order.
--
- !python {model: pos.confirm}: |
- self.action_confirm(cr, uid, [ref("pos_confirm_0")], {"lang": "en_US", "active_model":
- "pos.order", "active_ids": [ref("pos_order_pos0")], "tz": False, "active_id": ref("pos_order_pos0"),
- })
--
- I check order state is done.
--
- !python {model: pos.order}: |
- order=self.browse(cr,uid,ref("pos_order_pos0"))
- assert(order.state=='done'), "Order is not done"
diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py
index 4a131d5894b..0985ae906be 100644
--- a/addons/point_of_sale/wizard/__init__.py
+++ b/addons/point_of_sale/wizard/__init__.py
@@ -19,10 +19,8 @@
#
##############################################################################
-import pos_add_product
import pos_confirm
import pos_discount
-import pos_get_sale
import pos_open_statement
import pos_close_statement
import pos_box_entries
@@ -30,15 +28,11 @@ import pos_box_out
import pos_details
import pos_sales_user
import pos_sales_user_today
-import pos_sales_user_current_user
-import all_closed_cashbox_of_the_day
import pos_receipt
import pos_payment_report_user
import pos_payment_report_date
import pos_payment_report
import pos_payment
-import pos_scan_product
-import pos_return
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.py b/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.py
deleted file mode 100644
index 330668548e4..00000000000
--- a/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import osv
-
-class all_closed_cashbox_of_the_day(osv.osv_memory):
- _name = 'all.closed.cashbox.of.the.day'
- _description = 'All closed cashbox of the day'
-
- def print_report(self, cr, uid, ids, context=None):
- """
- To get the date and print the report
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : retrun report
- """
- if context is None:
- context = {}
- datas = {'ids': context.get('active_ids', [])}
- return {
- 'type': 'ir.actions.report.xml',
- 'report_name': 'all.closed.cashbox.of.the.day',
- 'datas': datas,
- }
-
-all_closed_cashbox_of_the_day()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml b/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml
deleted file mode 100644
index e78ef5c6d6a..00000000000
--- a/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
- all closed cashbox of the day
- all.closed.cashbox.of.the.day
- form
-
-
-
-
-
-
-
-
-
-
-
- All Cashboxes Of the day
- all.closed.cashbox.of.the.day
- form
- form
- new
-
-
-
-
diff --git a/addons/point_of_sale/wizard/pos_add_product.py b/addons/point_of_sale/wizard/pos_add_product.py
deleted file mode 100644
index dfbb96a4514..00000000000
--- a/addons/point_of_sale/wizard/pos_add_product.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import osv, fields
-from tools.translate import _
-
-
-class add_product(osv.osv_memory):
- _name = 'pos.add.product'
- _description = 'Add Product'
-
- _columns = {
- 'product_id': fields.many2one('product.product', 'Product', required=True),
- 'quantity': fields.float('Quantity', required=True),
- }
- _defaults = {
- 'quantity': 1,
- }
-
- def select_product(self, cr, uid, ids, context=None):
- """
- To get the product and quantity and add in order .
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : Return the add product form again for adding more product
- """
- if context is None:
- context = {}
- this = self.browse(cr, uid, ids[0], context=context)
- record_id = context and context.get('active_id', False)
- assert record_id, _('Active ID is not found')
- if record_id:
- order_obj = self.pool.get('pos.order')
- order_obj.add_product(cr, uid, record_id, this.product_id.id, this.quantity, context=context)
- return {
- 'name': _('Add Product'),
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'pos.add.product',
- 'view_id': False,
- 'target': 'new',
- 'views': False,
- 'type': 'ir.actions.act_window',
- }
-
- def close_action(self, cr, uid, ids, context=None):
- """
- To get the product and Make the payment .
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : Return the Make Payment
- """
- if context is None:
- context = {}
- record_id = context and context.get('active_id', False)
- order_obj= self.pool.get('pos.order')
- this = self.browse(cr, uid, ids[0], context)
- order_obj.add_product(cr, uid, record_id, this.product_id.id, this.quantity, context=context)
-
- order_obj.write(cr, uid, [record_id], {'state': 'done'}, context=context)
- return {
- 'name': _('Make Payment'),
- 'context': context and context.get('active_id', False),
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'pos.make.payment',
- 'view_id': False,
- 'target': 'new',
- 'views': False,
- 'type': 'ir.actions.act_window',
- }
-
-add_product()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/pos_add_product.xml b/addons/point_of_sale/wizard/pos_add_product.xml
deleted file mode 100644
index ac5fd1c6f65..00000000000
--- a/addons/point_of_sale/wizard/pos_add_product.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
- Add Product
- pos.add.product
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Add Product
- ir.actions.act_window
- pos.add.product
- form
- form
- new
-
-
-
-
diff --git a/addons/point_of_sale/wizard/pos_box_entries.py b/addons/point_of_sale/wizard/pos_box_entries.py
index dcc9779a903..0b417d8b1cf 100644
--- a/addons/point_of_sale/wizard/pos_box_entries.py
+++ b/addons/point_of_sale/wizard/pos_box_entries.py
@@ -37,14 +37,13 @@ def get_journal(self, cr, uid, context=None):
journal_obj = self.pool.get('account.journal')
statement_obj = self.pool.get('account.bank.statement')
- cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users WHERE user_id = %s ORDER BY journal_id", (uid, ))
- j_ids = map(lambda x1: x1[0], cr.fetchall())
- ids = journal_obj.search(cr, uid, [('type', '=', 'cash'), ('id', 'in', j_ids)], context=context)
- obj_ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', 'in', ids)], context=context)
- res_obj = journal_obj.read(cr, uid, ids, ['journal_id'], context=context)
- res_obj = [(r1['id']) for r1 in res_obj]
+
+ j_ids = journal_obj.search(cr, uid, [('journal_user','=',1)], context=context)
+ obj_ids = statement_obj.search(cr, uid, [('state', '=', 'open'), ('user_id', '=', uid), ('journal_id', 'in', j_ids)], context=context)
res = statement_obj.read(cr, uid, obj_ids, ['journal_id'], context=context)
res = [(r['journal_id']) for r in res]
+ if not len(res):
+ raise osv.except_osv(_('Error !'), _('You do not have any open cash register. You must create a payment method or open a cash register.'))
res.insert(0, ('', ''))
return res
@@ -69,12 +68,11 @@ class pos_box_entries(osv.osv_memory):
return res
-
_columns = {
- 'name': fields.char('Description', size=32, required=True),
+ 'name': fields.char('Reason', size=32, required=True),
'journal_id': fields.selection(get_journal, "Cash Register", required=True),
'product_id': fields.selection(_get_income_product, "Operation", required=True),
- 'amount': fields.float('Amount', digits=(16, 2)),
+ 'amount': fields.float('Amount', digits=(16, 2), required=True),
'ref': fields.char('Ref', size=32),
}
_defaults = {
@@ -122,9 +120,6 @@ class pos_box_entries(osv.osv_memory):
vals['amount'] = data['amount'] or 0.0
vals['ref'] = "%s" % (data['ref'] or '')
vals['name'] = "%s: %s " % (product_obj.browse(cr, uid, data['product_id'], context=context).name, data['name'].decode('utf8'))
- address_u = res_obj.browse(cr, uid, uid, context=context).address_id
- if address_u:
- vals['partner_id'] = address_u.partner_id and address_u.partner_id.id or None
bank_statement.create(cr, uid, vals, context=context)
return {}
diff --git a/addons/point_of_sale/wizard/pos_box_entries.xml b/addons/point_of_sale/wizard/pos_box_entries.xml
index e0af60a1f73..2db10e36aa8 100644
--- a/addons/point_of_sale/wizard/pos_box_entries.xml
+++ b/addons/point_of_sale/wizard/pos_box_entries.xml
@@ -3,31 +3,31 @@
-
+ Box Entriespos.box.entriesform
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
- Box Entries
+ Put Money Inir.actions.act_windowpos.box.entriesform
@@ -35,5 +35,5 @@
new
-
+
diff --git a/addons/point_of_sale/wizard/pos_box_out.py b/addons/point_of_sale/wizard/pos_box_out.py
index 74f1a968bc7..b4298745c35 100644
--- a/addons/point_of_sale/wizard/pos_box_out.py
+++ b/addons/point_of_sale/wizard/pos_box_out.py
@@ -49,11 +49,10 @@ class pos_box_out(osv.osv_memory):
return res
_columns = {
- 'name': fields.char('Description', size=32, required=True),
+ 'name': fields.char('Description / Reason', size=32, required=True),
'journal_id': fields.selection(pos_box_entries.get_journal, "Cash Register", required=True),
'product_id': fields.selection(_get_expense_product, "Operation", required=True),
- 'amount': fields.float('Amount', digits=(16, 2)),
- 'ref': fields.char('Ref', size=32),
+ 'amount': fields.float('Amount', digits=(16, 2), required=True),
}
_defaults = {
'journal_id': 1,
@@ -81,18 +80,8 @@ class pos_box_out(osv.osv_memory):
sunday = (datetime.today() + relativedelta(weekday=6)).strftime('%Y-%m-%d')
done_statmt = statement_obj.search(cr, uid, [('date', '>=', monday+' 00:00:00'), ('date', '<=', sunday+' 23:59:59'), ('journal_id', '=', data['journal_id']), ('company_id', '=', curr_company), ('user_id', '=', uid)], context=context)
stat_done = statement_obj.browse(cr, uid, done_statmt, context=context)
- address_u = res_obj.browse(cr, uid, uid, context=context).address_id
am = 0.0
product = product_obj.browse(cr, uid, data['product_id'], context=context)
- amount_check = product.am_out or False
- for st in stat_done:
- for s in st.line_ids:
- if address_u and s.partner_id == address_u.partner_id and s.am_out:
- am += s.amount
- if (-data['amount'] or 0.0) + am < -(res_obj.browse(cr, uid, uid, context=context).company_id.max_diff or 0.0) and amount_check:
- val = (res_obj.browse(cr, uid, uid).company_id.max_diff or 0.0) + am
- raise osv.except_osv(_('Error !'), _('The maximum value you can still withdraw is exceeded. \n Remaining value is equal to %d ')%(val))
-
acc_id = product.property_account_income
if not acc_id:
raise osv.except_osv(_('Error !'), _('please check that account is set to %s')%(product.name))
@@ -115,13 +104,7 @@ class pos_box_out(osv.osv_memory):
if data['amount'] > 0:
amount = -data['amount']
vals['amount'] = amount
- if product.am_out:
- vals['am_out'] = True
- vals['ref'] = data['ref'] or ''
vals['name'] = "%s: %s " % (product.name, data['name'])
- address_u = res_obj.browse(cr, uid, uid, context=context).address_id
- if address_u:
- vals['partner_id'] = address_u.partner_id and address_u.partner_id.id or None
statement_line_obj.create(cr, uid, vals, context=context)
return {}
diff --git a/addons/point_of_sale/wizard/pos_box_out.xml b/addons/point_of_sale/wizard/pos_box_out.xml
index 4647b1e66a7..4f19a407a38 100644
--- a/addons/point_of_sale/wizard/pos_box_out.xml
+++ b/addons/point_of_sale/wizard/pos_box_out.xml
@@ -3,31 +3,31 @@
-
+ Box Outpos.box.outform
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
- Box Out
+ Take Money Outir.actions.act_windowpos.box.outform
@@ -35,5 +35,5 @@
new
-
+
diff --git a/addons/point_of_sale/wizard/pos_close_statement.py b/addons/point_of_sale/wizard/pos_close_statement.py
index 222338f6e10..92dee2f8e4c 100644
--- a/addons/point_of_sale/wizard/pos_close_statement.py
+++ b/addons/point_of_sale/wizard/pos_close_statement.py
@@ -38,27 +38,27 @@ class pos_close_statement(osv.osv_memory):
mod_obj = self.pool.get('ir.model.data')
statement_obj = self.pool.get('account.bank.statement')
journal_obj = self.pool.get('account.journal')
- cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users "
- "WHERE user_id=%s ORDER BY journal_id", (uid, ))
- j_ids = map(lambda x1: x1[0], cr.fetchall())
- journal_ids = journal_obj.search(cr, uid, [('auto_cash', '=', True), ('type', '=', 'cash'), ('id', 'in', j_ids)], context=context)
- ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', 'in', journal_ids)], context=context)
- for journal in journal_obj.browse(cr, uid, journal_ids, context=context):
- if not ids:
- raise osv.except_osv(_('Message'), _('Cash registers are already closed.'))
- else:
- if not journal.check_dtls:
- statement_obj.button_confirm_cash(cr, uid, ids, context=context)
- tree_res = mod_obj.get_object_reference(cr, uid, 'account', 'view_bank_statement_tree')
+ j_ids = journal_obj.search(cr, uid, [('journal_user','=',1)], context=context)
+ ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', 'in', j_ids)], context=context)
+ if not ids:
+ raise osv.except_osv(_('Message'), _('Cash registers are already closed.'))
+ for statement in statement_obj.browse(cr, uid, ids, context=context):
+ statement_obj.write(cr, uid, [statement.id], {
+ 'balance_end_real': statement.balance_end
+ }, context=context)
+ if not statement.journal_id.check_dtls:
+ statement_obj.button_confirm_cash(cr, uid, [statement.id], context=context)
+
+ tree_res = mod_obj.get_object_reference(cr, uid, 'point_of_sale', 'view_cash_statement_pos_tree')
tree_id = tree_res and tree_res[1] or False
form_res = mod_obj.get_object_reference(cr, uid, 'account', 'view_bank_statement_form2')
form_id = form_res and form_res[1] or False
search_id = mod_obj.get_object_reference(cr, uid, 'point_of_sale', 'view_pos_confirm_cash_statement_filter')
-
+
return {
'domain': "[('id', 'in', " + str(ids) + ")]",
- 'name': 'Close Statements',
+ 'name': _('Close Cash Registers'),
'view_type': 'form',
'view_mode': 'tree, form',
'search_view_id': search_id and search_id[1] or False,
@@ -66,7 +66,6 @@ class pos_close_statement(osv.osv_memory):
'views': [(tree_id, 'tree'), (form_id, 'form')],
'type': 'ir.actions.act_window'
}
-
pos_close_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_close_statement.xml b/addons/point_of_sale/wizard/pos_close_statement.xml
index 7a9a5a0e23d..61c984c873e 100644
--- a/addons/point_of_sale/wizard/pos_close_statement.xml
+++ b/addons/point_of_sale/wizard/pos_close_statement.xml
@@ -1,15 +1,16 @@
-
+
-
-
+
+ Close Statementspos.close.statementform
-
-
+
+
+
@@ -22,15 +23,14 @@
-
-
-
+
+
Close Cash Registerir.actions.act_window
@@ -38,6 +38,6 @@
formformnew
-
-
-
+
+
+
diff --git a/addons/point_of_sale/wizard/pos_confirm.py b/addons/point_of_sale/wizard/pos_confirm.py
index c55209650ca..c80f3ed1dd6 100644
--- a/addons/point_of_sale/wizard/pos_confirm.py
+++ b/addons/point_of_sale/wizard/pos_confirm.py
@@ -25,36 +25,21 @@ from osv import osv
class pos_confirm(osv.osv_memory):
_name = 'pos.confirm'
- _description = 'Point of Sale Confirm'
+ _description = 'Post POS Journal Entries'
def action_confirm(self, cr, uid, ids, context=None):
- """
- Confirm the order and close the sales.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return :Blank dictionary
- """
- if context is None:
- context = {}
- record_id = context and context.get('active_id', False)
- if record_id:
- if isinstance(record_id, (int, long)):
- record_id = [record_id]
- if record_id:
- order_obj = self.pool.get('pos.order')
-
- for order_id in order_obj.browse(cr, uid, record_id, context=context):
- if order_id.state == 'paid':
- order_obj.write(cr, uid, [order_id.id], {'journal_entry': True}, context=context)
- order_obj.create_account_move(cr, uid, [order_id.id], context=context)
-
- wf_service = netsvc.LocalService("workflow")
- for i in record_id:
- wf_service.trg_validate(uid, 'pos.order', i, 'done', cr)
+ wf_service = netsvc.LocalService("workflow")
+ order_obj = self.pool.get('pos.order')
+ ids = order_obj.search(cr, uid, [('state','=','paid')], context=context)
+ for order in order_obj.browse(cr, uid, ids, context=context):
+ todo = True
+ for line in order.statement_ids:
+ if line.statement_id.state <> 'confirm':
+ todo = False
+ break
+ if todo:
+ wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr)
return {}
-
pos_confirm()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_confirm.xml b/addons/point_of_sale/wizard/pos_confirm.xml
index 1ea769cae49..85b43bd115d 100644
--- a/addons/point_of_sale/wizard/pos_confirm.xml
+++ b/addons/point_of_sale/wizard/pos_confirm.xml
@@ -1,32 +1,37 @@
-
+
-
-
- Sale Confirm
+
+ Post Journal Entriespos.confirmform
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
- Sale Confirm
+ Post Journal Entriesir.actions.act_windowpos.confirmformformnew
-
-
-
\ No newline at end of file
+
+
+
diff --git a/addons/point_of_sale/wizard/pos_discount.py b/addons/point_of_sale/wizard/pos_discount.py
index 928fe396f0b..aadd85b48eb 100644
--- a/addons/point_of_sale/wizard/pos_discount.py
+++ b/addons/point_of_sale/wizard/pos_discount.py
@@ -23,34 +23,28 @@ from osv import osv, fields
class pos_discount(osv.osv_memory):
_name = 'pos.discount'
- _description = 'Add Discount'
-
+ _description = 'Add a Global Discount'
_columns = {
- 'discount': fields.float('Discount ', required=True),
- 'discount_notes': fields.char('Discount Notes', size= 128, required=True),
+ 'discount': fields.float('Discount (%)', required=True, digits=(16,2)),
}
_defaults = {
'discount': 5,
}
-
- def view_init(self, cr, uid, fields_list, context=None):
- """
- Creates view dynamically and adding fields at runtime.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return: New arch of view with new columns.
- """
- if context is None:
- context = {}
- super(pos_discount, self).view_init(cr, uid, fields_list, context=context)
- record_id = context and context.get('active_id', False) or False
- order = self.pool.get('pos.order').browse(cr, uid, record_id, context=context)
- if not order.lines:
- raise osv.except_osv(_('Error!'), _('No Order Lines'))
- True
+# def view_init(self, cr, uid, fields_list, context=None):
+# """
+# Creates view dynamically and adding fields at runtime.
+# @param self: The object pointer.
+# @param cr: A database cursor
+# @param uid: ID of the user currently logged in
+# @param context: A standard dictionary
+# @return: New arch of view with new columns.
+# """
+# if context is None:
+# context = {}
+# super(pos_discount, self).view_init(cr, uid, fields_list, context=context)
+# record_id = context and context.get('active_id', False) or False
+# True
def apply_discount(self, cr, uid, ids, context=None):
"""
@@ -70,33 +64,8 @@ class pos_discount(osv.osv_memory):
record_id = context and context.get('active_id', False)
if isinstance(record_id, (int, long)):
record_id = [record_id]
-
for order in order_ref.browse(cr, uid, record_id, context=context):
- for line in order.lines:
- company_discount = order.company_id.company_discount
- applied_discount = this.discount
-
- if applied_discount == 0.00:
- notice = 'No Discount'
- elif company_discount >= applied_discount:
- notice = 'Minimum Discount'
- else:
- notice = this.discount_notes
- res_new = {}
- if this.discount <= company_discount:
- res_new = {
- 'discount': this.discount,
- 'notice': notice,
- 'price_ded': line.price_unit * line.qty * (this.discount or 0) * 0.01 or 0.0
- }
- else:
- res_new = {
- 'discount': this.discount,
- 'notice': notice,
- 'price_ded': line.price_unit * line.qty * (this.discount or 0) * 0.01 or 0.0
- }
-
- order_line_ref.write(cr, uid, [line.id], res_new, context=context)
+ order_line_ref.write(cr, uid, [x.id for x in order.lines], {'discount':this.discount}, context=context)
return {}
pos_discount()
diff --git a/addons/point_of_sale/wizard/pos_discount.xml b/addons/point_of_sale/wizard/pos_discount.xml
index a0a7c534a95..bb198e29acf 100644
--- a/addons/point_of_sale/wizard/pos_discount.xml
+++ b/addons/point_of_sale/wizard/pos_discount.xml
@@ -1,22 +1,21 @@
-
+
-
-
+
+ Apply Discountpos.discountform
-
-
-
-
-
-
+
+
+
+
+
@@ -29,6 +28,6 @@
formnew
-
-
-
\ No newline at end of file
+
+
+
diff --git a/addons/point_of_sale/wizard/pos_get_sale.py b/addons/point_of_sale/wizard/pos_get_sale.py
deleted file mode 100644
index 48bd89bce7f..00000000000
--- a/addons/point_of_sale/wizard/pos_get_sale.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import osv, fields
-from tools.translate import _
-
-
-class pos_get_sale(osv.osv_memory):
- _name = 'pos.get.sale'
- _description = 'Get From Sale'
-
- _columns = {
- 'picking_id': fields.many2one('stock.picking', 'Sale Order', domain=[('state', 'in', ('assigned', 'confirmed')), ('type', '=', 'out')], context="{'contact_display': 'partner'}", required=True),
- }
-
- def sale_complete(self, cr, uid, ids, context=None):
- """
- Select the picking order and add the in Point of sale order
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : nothing
- """
- proxy_pos = self.pool.get('pos.order')
- proxy_pick = self.pool.get('stock.picking')
- proxy_order_line = self.pool.get('pos.order.line')
- if context is None:
- context = {}
- this = self.browse(cr, uid, ids[0], context=context)
- record_id = context and context.get('active_id', False)
-
- if record_id:
- order = proxy_pos.browse(cr, uid, record_id, context=context)
- if order.state in ('paid', 'invoiced'):
- raise osv.except_osv(_('UserError '), _("You can't modify this order. It has already been paid"))
-
- for pick in proxy_pick.browse(cr, uid, [this.picking_id.id], context=context):
- proxy_pos.write(cr, uid, record_id, {
- 'picking_id': this.picking_id.id,
- 'partner_id': pick.address_id and pick.address_id.partner_id.id
- }, context=context)
-
- order = proxy_pick.write(cr, uid, [this.picking_id.id], {
- 'invoice_state': 'none',
- 'pos_order': record_id
- }, context=context)
-
- for line in pick.move_lines:
- proxy_order_line.create(cr, uid, {
- 'name': line.sale_line_id.name,
- 'order_id': record_id,
- 'qty': line.product_qty,
- 'product_id': line.product_id.id,
- 'price_unit': line.sale_line_id.price_unit,
- 'discount': line.sale_line_id.discount,
- }, context=context)
- return {}
-
-pos_get_sale()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/pos_get_sale.xml b/addons/point_of_sale/wizard/pos_get_sale.xml
deleted file mode 100644
index 9a28da548d2..00000000000
--- a/addons/point_of_sale/wizard/pos_get_sale.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
- Open Sale Order
- pos.get.sale
- form
-
-
-
-
-
-
-
-
-
-
-
-
- Select an Open Sale Order
- ir.actions.act_window
- pos.get.sale
- form
- form
- new
-
-
-
-
\ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_open_statement.py b/addons/point_of_sale/wizard/pos_open_statement.py
index 241f0a6e1d0..038ca3b6990 100644
--- a/addons/point_of_sale/wizard/pos_open_statement.py
+++ b/addons/point_of_sale/wizard/pos_open_statement.py
@@ -42,46 +42,48 @@ class pos_open_statement(osv.osv_memory):
journal_obj = self.pool.get('account.journal')
if context is None:
context = {}
- company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
- cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users "
- "WHERE user_id = %s ORDER BY journal_id"% (uid, ))
- j_ids = map(lambda x1: x1[0], cr.fetchall())
- journal_ids = journal_obj.search(cr, uid, [('auto_cash', '=', True), ('type', '=', 'cash'), ('id', 'in', j_ids)], context=context)
- for journal in journal_obj.browse(cr, uid, journal_ids, context=context):
+ st_ids = []
+ j_ids = journal_obj.search(cr, uid, [('journal_user','=',1)], context=context)
+
+ for journal in journal_obj.browse(cr, uid, j_ids, context=context):
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)], context=context)
if len(ids):
- raise osv.except_osv(_('Message'), _('You can not open a Cashbox for "%s".\nPlease close its related cash register.') %(journal.name))
+ st_ids += ids
+ continue
- number = ''
if journal.sequence_id:
number = sequence_obj.get_id(cr, uid, journal.sequence_id.id)
else:
number = sequence_obj.get(cr, uid, 'account.cash.statement')
- data.update({'journal_id': journal.id,
- 'company_id': company_id,
- 'user_id': uid,
- 'state': 'draft',
- 'name': number })
+ data.update({
+ 'journal_id': journal.id,
+ 'user_id': uid,
+ 'state': 'draft',
+ 'name': number
+ })
statement_id = statement_obj.create(cr, uid, data, context=context)
- statement_obj.button_open(cr, uid, [statement_id], context)
+ st_ids.append(statement_id)
- tree_res = mod_obj.get_object_reference(cr, uid, 'account', 'view_bank_statement_tree')
+ if journal.auto_cash:
+ statement_obj.button_open(cr, uid, [statement_id], context)
+
+ tree_res = mod_obj.get_object_reference(cr, uid, 'point_of_sale', 'view_cash_statement_pos_tree')
tree_id = tree_res and tree_res[1] or False
form_res = mod_obj.get_object_reference(cr, uid, 'account', 'view_bank_statement_form2')
form_id = form_res and form_res[1] or False
search_id = mod_obj.get_object_reference(cr, uid, 'point_of_sale', 'view_pos_open_cash_statement_filter')
return {
- 'domain': "[('state', '=', 'open'),('user_id', '=', "+ str(uid) +")]",
- 'name': 'Open Statement',
+ 'domain': "[('id', 'in',[ "+','.join(map(str,st_ids))+"])]",
+ 'name': _('Open Cash Registers'),
'view_type': 'form',
'view_mode': 'tree, form',
'search_view_id': search_id and search_id[1] or False ,
'res_model': 'account.bank.statement',
'views': [(tree_id, 'tree'), (form_id, 'form')],
- 'context': {'search_default_open': 1},
+ 'context': {},
'type': 'ir.actions.act_window'
}
pos_open_statement()
diff --git a/addons/point_of_sale/wizard/pos_open_statement.xml b/addons/point_of_sale/wizard/pos_open_statement.xml
index 870d8f71e47..54a66c3c5f7 100644
--- a/addons/point_of_sale/wizard/pos_open_statement.xml
+++ b/addons/point_of_sale/wizard/pos_open_statement.xml
@@ -3,31 +3,31 @@
-
+ Open Statementspos.open.statementform
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+ Open Cash Register
@@ -38,5 +38,5 @@
new
-
-
+
+
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py
index ea5bd2639d7..adf59e3cbce 100644
--- a/addons/point_of_sale/wizard/pos_payment.py
+++ b/addons/point_of_sale/wizard/pos_payment.py
@@ -29,188 +29,44 @@ import pos_box_entries
class pos_make_payment(osv.osv_memory):
_name = 'pos.make.payment'
_description = 'Point of Sale Payment'
-
- def default_get(self, cr, uid, fields, context=None):
- """
- To get default values for the object.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
- @return: A dictionary which of fields with values.
- """
- if context is None:
- context = {}
- journal_obj = self.pool.get('account.journal')
- order_obj = self.pool.get('pos.order')
- res = super(pos_make_payment, self).default_get(cr, uid, fields, context=context)
- active_id = context and context.get('active_id', False)
- if active_id:
- cr.execute("SELECT DISTINCT journal_id FROM pos_journal_users "
- "WHERE user_id = %d ORDER BY journal_id"% (uid, ))
- j_ids = map(lambda x1: x1[0], cr.fetchall())
- journal = journal_obj.search(cr, uid, [('type', '=', 'cash'), ('id', 'in', j_ids)], context=context)
- journal = journal and journal[0] or False
- order = order_obj.browse(cr, uid, active_id, context=context)
- #get amount to pay
- amount = order.amount_total - order.amount_paid
- if amount <= 0.0:
- context.update({'flag': True})
- order_obj.action_paid(cr, uid, [active_id], context)
- elif order.amount_paid > 0.0:
- order_obj.write(cr, uid, [active_id], {'state': 'advance'}, context=context)
- invoice_wanted_checked = False
-
- current_date = time.strftime('%Y-%m-%d')
-
- if 'journal' in fields:
- res.update({'journal': journal})
- if 'amount' in fields:
- res.update({'amount': amount})
- if 'invoice_wanted' in fields:
- res.update({'invoice_wanted': invoice_wanted_checked})
- if 'payment_date' in fields:
- res.update({'payment_date': current_date})
- if 'payment_name' in fields:
- res.update({'payment_name': 'Payment'})
- if 'partner_id' in fields:
- res.update({'partner_id': order.partner_id.id or False})
- if 'pricelist_id' in fields:
- res.update({'pricelist_id': order.pricelist_id.id or False})
- return res
-
- def view_init(self, cr, uid, fields_list, context=None):
- if context is None:
- context = {}
- super(pos_make_payment, self).view_init(cr, uid, fields_list, context=context)
- active_id = context and context.get('active_id', False) or False
- if active_id:
- order = self.pool.get('pos.order').browse(cr, uid, active_id, context=context)
- if not order.lines:
- raise osv.except_osv(_('Error!'),_('No order lines defined for this sale '))
- return True
-
- def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
- """
- Changes the view dynamically
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
-
- @return: New arch of view.
-
- """
- result = super(pos_make_payment, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
- if context is None:
- context = {}
- active_model = context.get('active_model')
- active_id = context and context.get('active_id', False) or False
- if not active_id or (active_model and active_model != 'pos.order'):
- return result
-
- order = self.pool.get('pos.order').browse(cr, uid, active_id, context=context)
- if order.amount_total == order.amount_paid:
- result['arch'] = """
-
-
-
-
-
-
-
- """
- return result
-
- def onchange_product_id(self, cr, uid, ids, product_id, amount):
- """ Changes amount if product_id changes.
- @param product_id: Changed product_id
- @param amount: Amount to be paid
- @return: Dictionary of changed values
- """
- prod_obj = self.pool.get('product.product')
- if product_id:
- product = prod_obj.browse(cr, uid, product_id)
- amount = product.list_price
- return {'value': {'amount': amount}}
-
def check(self, cr, uid, ids, context=None):
"""Check the order:
if the order is not paid: continue payment,
- if the order is paid print invoice (if wanted) or ticket.
+ if the order is paid print ticket.
"""
+ context = context or {}
order_obj = self.pool.get('pos.order')
obj_partner = self.pool.get('res.partner')
- if context is None:
- context = {}
active_id = context and context.get('active_id', False)
+
order = order_obj.browse(cr, uid, active_id, context=context)
amount = order.amount_total - order.amount_paid
- data = self.read(cr, uid, ids, context=context)[0]
- for m2o_field in ['product_id','pricelist_id','partner_id']:
- data[m2o_field] = data.get(m2o_field, False) and data[m2o_field][0] or False
- if data['is_acc']:
- amount = self.pool.get('product.product').browse(cr, uid, data['product_id'], context=context).list_price
+ data = self.read(cr, uid, ids, context=context)[0]
+ # this is probably a problem of osv_memory as it's not compatible with normal OSV's
+ #data['journal'] = data['journal'][0]
if amount != 0.0:
- order_obj.write(cr, uid, [active_id], {'invoice_wanted': data['invoice_wanted'], 'partner_id': data['partner_id']}, context=context)
order_obj.add_payment(cr, uid, active_id, data, context=context)
if order_obj.test_paid(cr, uid, [active_id]):
- if data['partner_id'] and data['invoice_wanted']:
- partner = obj_partner.browse(cr, uid, data['partner_id'], context=context)
- if not partner.address:
- raise osv.except_osv(_('Error!'),_("Customer doesn't have an address to make the invoice"))
- order_obj.action_invoice(cr, uid, [active_id], context=context)
- order_obj.create_picking(cr, uid, [active_id], context=context)
- if context.get('return', False):
- order_obj.write(cr, uid, [active_id], {'state':'done'}, context=context)
- else:
- order_obj.write(cr, uid, [active_id],{'state':'paid'}, context=context)
- return self.create_invoice(cr, uid, ids, context=context)
- else:
- context.update({'flag': True})
- order_obj.action_paid(cr, uid, [active_id], context=context)
- if context.get('return', False):
- order_obj.write(cr, uid, [active_id], {'state':'done'}, context=context)
- else:
- order_obj.write(cr, uid, [active_id], {'state':'paid'}, context=context)
- return self.print_report(cr, uid, ids, context=context)
+ order_obj.action_paid(cr, uid, [active_id], context=context)
+ return self.print_report(cr, uid, ids, context=context)
- context.update({'flag': True})
- # Todo need to check
- order_obj.action_paid(cr, uid, [active_id], context=context)
- order_obj.write(cr, uid, [active_id], {'state': 'advance'}, context=context)
- return self.print_report(cr, uid, ids, context=context)
+ return self.launch_payment(cr, uid, ids, context=context)
-
- def create_invoice(self, cr, uid, ids, context=None):
- """
- Create a invoice
- """
- if context is None:
- context = {}
- active_ids = [context and context.get('active_id', False)]
- datas = {'ids': active_ids}
+ def launch_payment(self, cr, uid, ids, context=None):
return {
- 'type' : 'ir.actions.report.xml',
- 'report_name':'pos.invoice',
- 'datas' : datas,
+ 'name': _('Paiement'),
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'pos.make.payment',
+ 'view_id': False,
+ 'target': 'new',
+ 'views': False,
+ 'type': 'ir.actions.act_window',
}
def print_report(self, cr, uid, ids, context=None):
- """
- @summary: To get the date and print the report
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : retrun report
- """
- if context is None:
- context = {}
active_id = context.get('active_id', [])
datas = {'ids' : [active_id]}
return {
@@ -219,19 +75,29 @@ class pos_make_payment(osv.osv_memory):
'datas': datas,
}
+ def _default_journal(self, cr, uid, context=None):
+ res = pos_box_entries.get_journal(self, cr, uid, context=context)
+ return len(res)>1 and res[1][0] or False
+
+ def _default_amount(self, cr, uid, context=None):
+ order_obj = self.pool.get('pos.order')
+ active_id = context and context.get('active_id', False)
+ if active_id:
+ order = order_obj.browse(cr, uid, active_id, context=context)
+ return order.amount_total - order.amount_paid
+ return False
+
_columns = {
- 'journal': fields.selection(pos_box_entries.get_journal, "Cash Register", required=True),
- 'product_id': fields.many2one('product.product', "Advance"),
+ 'journal': fields.selection(pos_box_entries.get_journal, "Payment Mode", required=True),
'amount': fields.float('Amount', digits=(16,2), required= True),
- 'payment_name': fields.char('Payment name', size=32, required=True),
- 'payment_date': fields.date('Payment date', required=True),
- 'is_acc': fields.boolean('Advance'),
- 'invoice_wanted': fields.boolean('Invoice'),
- 'num_sale': fields.char('Num.File', size=32),
- 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist'),
- 'partner_id': fields.many2one('res.partner', 'Customer'),
+ 'payment_name': fields.char('Payment Reference', size=32),
+ 'payment_date': fields.date('Payment Date', required=True),
+ }
+ _defaults = {
+ 'payment_date': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'amount': _default_amount,
+ 'journal': _default_journal
}
pos_make_payment()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_payment.xml b/addons/point_of_sale/wizard/pos_payment.xml
index a6757be6b78..212c0d8c412 100644
--- a/addons/point_of_sale/wizard/pos_payment.xml
+++ b/addons/point_of_sale/wizard/pos_payment.xml
@@ -2,57 +2,37 @@
-
-
-
+ Add payment :pos.make.paymentform
-
-
-
-
- Sale by Users
- ir.actions.act_window
- pos.sales.user.today
- form
- form
- new
-
-
-
-
\ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_sales_user_current_user.xml b/addons/point_of_sale/wizard/pos_sales_user_current_user.xml
deleted file mode 100644
index e51ecfee760..00000000000
--- a/addons/point_of_sale/wizard/pos_sales_user_current_user.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
- Sales for Current User
- pos.sales.user.today.current_user
- form
-
-
-
-
-
-
-
-
-
-
-
-
- Sales for Current User
- ir.actions.act_window
- pos.sales.user.today.current_user
- form
- form
- new
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_scan_product.py b/addons/point_of_sale/wizard/pos_scan_product.py
deleted file mode 100644
index 8e1e4aace86..00000000000
--- a/addons/point_of_sale/wizard/pos_scan_product.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import osv,fields
-
-
-class pos_scan_product(osv.osv_memory):
- _name = 'pos.scan.product'
- _description = 'Scan product'
-
- _columns = {
- 'gencod': fields.char('Barcode', size=13, required=True)
- }
-
- def scan(self, cr, uid, ids, context=None):
- """
- To get the gencod and scan product
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : retrun gencod
- """
- if context is None:
- context = {}
- data=self.read(cr, uid, ids)[0]
- record_id = context and context.get('active_id', False)
- self. pool.get('pos.order.line')._scan_product(cr, uid, data['gencod'], 1, record_id)
- return {'gencod': False}
-
-pos_scan_product()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/pos_scan_product_view.xml b/addons/point_of_sale/wizard/pos_scan_product_view.xml
deleted file mode 100644
index 3957c6c0415..00000000000
--- a/addons/point_of_sale/wizard/pos_scan_product_view.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
- Scan product
- pos.scan.product
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Scan product
- ir.actions.act_window
- pos.scan.product
- form
- form
- new
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/portal/i18n/fr.po b/addons/portal/i18n/fr.po
index 99499a00149..19e685ebae1 100644
--- a/addons/portal/i18n/fr.po
+++ b/addons/portal/i18n/fr.po
@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2011-07-04 14:16+0000\n"
-"PO-Revision-Date: 2011-07-11 09:51+0000\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2011-09-26 12:28+0000\n"
+"Last-Translator: Numérigraphe \n"
"Language-Team: French \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-05 05:59+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
+"X-Generator: Launchpad (build 14028)\n"
#. module: portal
#: code:addons/portal/wizard/share_wizard.py:55
@@ -73,7 +73,7 @@ msgstr ""
#. module: portal
#: constraint:res.users:0
msgid "The chosen company is not in the allowed companies for this user"
-msgstr ""
+msgstr "La société choisie n'est pas autorisée pour cet utilisateur."
#. module: portal
#: view:res.portal:0
@@ -207,12 +207,12 @@ msgstr ""
#: view:share.wizard:0
#: field:share.wizard,user_ids:0
msgid "Existing users"
-msgstr ""
+msgstr "Utilisateurs existants"
#. module: portal
#: field:res.portal.wizard.user,wizard_id:0
msgid "Wizard"
-msgstr ""
+msgstr "Assistant"
#. module: portal
#: help:res.portal.wizard.user,user_email:0
@@ -224,12 +224,12 @@ msgstr ""
#. module: portal
#: field:res.portal.wizard.user,lang:0
msgid "Language"
-msgstr ""
+msgstr "Langue"
#. module: portal
#: field:res.portal,url:0
msgid "URL"
-msgstr ""
+msgstr "URL"
#. module: portal
#: view:res.portal:0
@@ -249,7 +249,7 @@ msgstr "Annuler"
#. module: portal
#: view:res.portal:0
msgid "Website"
-msgstr ""
+msgstr "Site web"
#. module: portal
#: view:res.portal:0
@@ -271,7 +271,7 @@ msgstr ""
#. module: portal
#: model:ir.model,name:portal.model_res_users
msgid "res.users"
-msgstr ""
+msgstr "res.users"
#. module: portal
#: constraint:res.portal.wizard.user:0
@@ -288,7 +288,7 @@ msgstr ""
#. module: portal
#: model:ir.model,name:portal.model_ir_ui_menu
msgid "ir.ui.menu"
-msgstr ""
+msgstr "ir.ui.menu"
#. module: portal
#: help:res.portal,group_id:0
@@ -323,7 +323,7 @@ msgstr ""
#. module: portal
#: field:res.portal.widget,sequence:0
msgid "Sequence"
-msgstr ""
+msgstr "Séquence"
#. module: portal
#: field:res.users,partner_id:0
@@ -386,7 +386,7 @@ msgstr ""
#. module: portal
#: field:res.portal.wizard.user,partner_id:0
msgid "Partner"
-msgstr ""
+msgstr "Partenaire"
#. module: portal
#: model:ir.actions.act_window,help:portal.portal_list_action
diff --git a/addons/process/process.py b/addons/process/process.py
index 72c8bce10b4..524a3236e7b 100644
--- a/addons/process/process.py
+++ b/addons/process/process.py
@@ -84,12 +84,12 @@ class process_process(osv.osv):
process = pool.get('process.process').browse(cr, uid, id, context=context)
name = process.name
- resource = None
+ resource = False
state = 'N/A'
expr_context = {}
states = {}
- perm = None
+ perm = False
if res_model:
states = dict(pool.get(res_model).fields_get(cr, uid, context=context).get('state', {}).get('selection', {}))
@@ -242,7 +242,9 @@ class process_process(osv.osv):
for k, v in nodes.items():
y = v['y']
v['y'] = min(y - miny + 10, y)
-
+
+ nodes = dict([str(n_key), n_val] for n_key, n_val in nodes.iteritems())
+ transitions = dict([str(t_key), t_val] for t_key, t_val in transitions.iteritems())
return dict(name=name, resource=resource, state=state, perm=perm, notes=notes, nodes=nodes, transitions=transitions)
def copy(self, cr, uid, id, default=None, context=None):
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index f05ca64144d..9b298915f12 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -165,6 +165,10 @@ class procurement_order(osv.osv):
"""
return all(procurement.move_id.state == 'cancel' for procurement in self.browse(cr, uid, ids, context=context))
+ #This Function is create to avoid a server side Error Like 'ERROR:tests.mrp:name 'check_move' is not defined'
+ def check_move(self, cr, uid, ids, context=None):
+ pass
+
def check_move_done(self, cr, uid, ids, context=None):
""" Checks if move is done or not.
@return: True or False.
diff --git a/addons/product/product.py b/addons/product/product.py
index 863081a8155..78fc05fe7e7 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -75,7 +75,7 @@ class product_uom(osv.osv):
_description = 'Product Unit of Measure'
def _compute_factor_inv(self, factor):
- return factor and round(1.0 / factor, 6) or 0.0
+ return factor and (1.0 / factor) or 0.0
def _factor_inv(self, cursor, user, ids, name, arg, context=None):
res = {}
@@ -100,7 +100,7 @@ class product_uom(osv.osv):
'factor': fields.float('Ratio', required=True,digits=(12, 12),
help='How many times this UoM is smaller than the reference UoM in this category:\n'\
'1 * (reference unit) = ratio * (this unit)'),
- 'factor_inv': fields.function(_factor_inv, digits_compute=dp.get_precision('Product UoM'),
+ 'factor_inv': fields.function(_factor_inv, digits=(12,12),
fnct_inv=_factor_inv_write,
string='Ratio',
help='How many times this UoM is bigger than the reference UoM in this category:\n'\
@@ -250,9 +250,9 @@ class product_template(osv.osv):
result[product.id] = {field:False}
result[product.id]['seller_delay'] = 1
if product.seller_ids:
- partner_list = sorted([(partner_id.sequence, partner_id)
+ partner_list = [(partner_id.sequence, partner_id)
for partner_id in product.seller_ids
- if partner_id and isinstance(partner_id.sequence, (int, long))])
+ if partner_id and isinstance(partner_id.sequence, (int, long))]
main_supplier = partner_list and partner_list[0] and partner_list[0][1] or False
result[product.id]['seller_delay'] = main_supplier and main_supplier.delay or 1
result[product.id]['seller_qty'] = main_supplier and main_supplier.qty or 0.0
@@ -713,24 +713,16 @@ class product_supplierinfo(osv.osv):
for supplier_info in self.browse(cr, uid, ids, context=context):
for field in fields:
result[supplier_info.id] = {field:False}
- if supplier_info.product_uom.id:
- qty = product_uom_pool._compute_qty(cr, uid, supplier_info.product_uom.id, supplier_info.min_qty, to_uom_id=supplier_info.product_id.uom_id.id)
- else:
- qty = supplier_info.min_qty
+ qty = supplier_info.min_qty
result[supplier_info.id]['qty'] = qty
return result
- def _get_uom_id(self, cr, uid, context=None):
- if context is None:
- context = {}
- return context.get('uom_id', False)
-
_columns = {
'name' : fields.many2one('res.partner', 'Supplier', required=True,domain = [('supplier','=',True)], ondelete='cascade', help="Supplier of this product"),
'product_name': fields.char('Supplier Product Name', size=128, help="This supplier's product name will be used when printing a request for quotation. Keep empty to use the internal one."),
'product_code': fields.char('Supplier Product Code', size=64, help="This supplier's product code will be used when printing a request for quotation. Keep empty to use the internal one."),
'sequence' : fields.integer('Sequence', help="Assigns the priority to the list of product supplier."),
- 'product_uom': fields.many2one('product.uom', string="Supplier UoM", help="Choose here the Unit of Measure in which the prices and quantities are expressed below."),
+ 'product_uom': fields.related('product_id', 'uom_po_id', type='many2one', relation='product.uom', string="Supplier UoM", readonly="1", help="This comes from the product form."),
'min_qty': fields.float('Minimal Quantity', required=True, help="The minimal quantity to purchase to this supplier, expressed in the supplier Product UoM if not empty, in the default unit of measure of the product otherwise."),
'qty': fields.function(_calc_qty, store=True, type='float', string='Quantity', multi="qty", help="This is a quantity which is converted into Default Uom."),
'product_id' : fields.many2one('product.template', 'Product', required=True, ondelete='cascade', select=True),
@@ -743,17 +735,7 @@ class product_supplierinfo(osv.osv):
'sequence': lambda *a: 1,
'delay': lambda *a: 1,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'product.supplierinfo', context=c),
- 'product_uom': _get_uom_id,
}
- def _check_uom(self, cr, uid, ids, context=None):
- for supplier_info in self.browse(cr, uid, ids, context=context):
- if supplier_info.product_uom and supplier_info.product_uom.category_id.id <> supplier_info.product_id.uom_id.category_id.id:
- return False
- return True
-
- _constraints = [
- (_check_uom, 'Error: The default UOM and the Supplier Product UOM must be in the same category.', ['product_uom']),
- ]
def price_get(self, cr, uid, supplier_ids, product_id, product_qty=1, context=None):
"""
Calculate price from supplier pricelist.
diff --git a/addons/product/wizard/product_installer.xml b/addons/product/wizard/product_installer.xml
index bdfbc1d32bf..01ddf25c56c 100644
--- a/addons/product/wizard/product_installer.xml
+++ b/addons/product/wizard/product_installer.xml
@@ -2,7 +2,7 @@
- Create some Products
+ Create or Import Productsir.actions.act_windowproduct.productform
diff --git a/addons/product_margin/__openerp__.py b/addons/product_margin/__openerp__.py
index 69553f1aced..9ef858fa9ec 100644
--- a/addons/product_margin/__openerp__.py
+++ b/addons/product_margin/__openerp__.py
@@ -37,6 +37,7 @@ The wizard to launch the report has several options to help you get the data you
'wizard/product_margin_view.xml',
'product_margin_view.xml'
],
+ 'test':['test/product_margin.yml'],
'demo_xml': [],
'installable': True,
'active': False,
diff --git a/addons/product_margin/test/product_margin.yml b/addons/product_margin/test/product_margin.yml
new file mode 100644
index 00000000000..fa8241ab206
--- /dev/null
+++ b/addons/product_margin/test/product_margin.yml
@@ -0,0 +1,25 @@
+-
+ In order to test the product_margin module, I create a product margin record
+-
+ !record {model: product.margin, id: product_margin_wiz0}:
+ from_date: !eval "'%s-01-01' %(datetime.now().year)"
+ to_date: !eval "'%s-12-31' %(datetime.now().year)"
+ invoice_state: open_paid
+-
+ I open margin for PC3
+-
+ !python {model: product.margin}: |
+ self.action_open_window(cr, uid, [ref("product_margin_wiz0")], {"lang": 'en_US',
+ "search_default_filter_to_sell": "1", "tz": False, "active_model": "product.product", "disable_log": True,
+ "active_ids": [ref("product.product_product_pc3")], "active_id": ref("product.product_product_pc3")})
+-
+ I read the fields of the product.
+-
+ !python {model: product.product}: |
+ fields = ['sale_avg_price', 'expected_margin_rate', 'total_margin_rate', 'total_cost', 'sale_num_invoiced',
+ 'total_margin', 'sales_gap', 'purchase_num_invoiced', 'expected_margin', 'turnover']
+ self.read(cr, uid, [ref("product_margin_wiz0")], fields, {"lang": 'en_US',
+ "search_default_filter_to_sell": "1", "tz": False, "active_model": "product.product",
+ "bin_size": True, "active_ids": [ref("product.product_product_pc3")],
+ "active_id": ref("product.product_product_pc3")})
+
diff --git a/addons/project/project.py b/addons/project/project.py
index 96bf2f30fdc..3565a877b61 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -430,7 +430,7 @@ class task(osv.osv):
'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of tasks."),
'type_id': fields.many2one('project.task.type', 'Stage'),
- 'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
+ 'state': fields.selection([('draft', 'New'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
\n If the task is over, the states is set to \'Done\'.'),
'create_date': fields.datetime('Create Date', readonly=True,select=True),
diff --git a/addons/project/project_installer.xml b/addons/project/project_installer.xml
index d6538ac1310..3e04b919edd 100644
--- a/addons/project/project_installer.xml
+++ b/addons/project/project_installer.xml
@@ -1,27 +1,74 @@
+
-
+
-
- project.installer.view
- base.setup.installer
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ project.installer.view
+ base.setup.installer
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+ Project Management
+ 7
+
+
+
+ Create your initial projects
+ ir.actions.act_window
+ project.project
+ form
+ form
+
+
+
+
+
+
+
+
+ Configure Default Time Unit for Project
+ ir.actions.act_window
+ res.company
+
+ form
+ form
+ {'res_id' : user.company_id.id}
+
+
+
+
+
+
+
+ Review Task Stages
+ ir.actions.act_window
+ project.task.type
+ form
+ tree,form
+ {}
+ []
+
+
+
+
+
+
+
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index dd2868c9ded..b49241de996 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -45,7 +45,7 @@
-
+
@@ -258,7 +258,7 @@
-
+
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index af756d34c5f..302000950a1 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -196,7 +196,7 @@ class project_issue(crm.crm_case, osv.osv):
domain="[('partner_id','=',partner_id)]"),
'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Description'),
- 'state': fields.selection([('draft', 'New'), ('open', 'To Do'), ('cancel', 'Cancelled'), ('done', 'Closed'),('pending', 'Pending'), ], 'State', size=16, readonly=True,
+ 'state': fields.selection([('draft', 'New'), ('open', 'To Solve'), ('cancel', 'Cancelled'), ('done', 'Closed'),('pending', 'Pending'), ], 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index d4c1f3fdaa0..544606acb5d 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -83,9 +83,9 @@
-
+
-
+
@@ -124,7 +124,7 @@
icon="terp-mail-replied" type="action"/>
-
+
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
index 6c5ef7890bf..7cd6697b67a 100644
--- a/addons/project_long_term/project_long_term.py
+++ b/addons/project_long_term/project_long_term.py
@@ -117,7 +117,7 @@ class project_phase(osv.osv):
'task_ids': fields.one2many('project.task', 'phase_id', "Project Tasks", states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
'resource_ids': fields.one2many('project.resource.allocation', 'phase_id', "Project Resources",states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
'responsible_id': fields.many2one('res.users', 'Responsible', states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}),
- 'state': fields.selection([('draft', 'Draft'), ('open', 'In Progress'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
+ 'state': fields.selection([('draft', 'New'), ('open', 'In Progress'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
help='If the phase is created the state \'Draft\'.\n If the phase is started, the state becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' state.\
\n If the phase is over, the states is set to \'Done\'.'),
'total_hours': fields.function(_compute, string='Total Hours'),
diff --git a/addons/project_long_term/project_long_term_view.xml b/addons/project_long_term/project_long_term_view.xml
index dd83b162997..49b306ebfd5 100644
--- a/addons/project_long_term/project_long_term_view.xml
+++ b/addons/project_long_term/project_long_term_view.xml
@@ -140,7 +140,7 @@
-
+
diff --git a/addons/project_long_term/wizard/project_compute_phases_view.xml b/addons/project_long_term/wizard/project_compute_phases_view.xml
index 9d5754af09c..69b7d94eabd 100644
--- a/addons/project_long_term/wizard/project_compute_phases_view.xml
+++ b/addons/project_long_term/wizard/project_compute_phases_view.xml
@@ -31,7 +31,6 @@
formform
- {'record_id': active_id}newTo schedule phases of all or a specified project. It then open a gantt view.
diff --git a/addons/project_long_term/wizard/project_compute_tasks_view.xml b/addons/project_long_term/wizard/project_compute_tasks_view.xml
index e6540fafff9..e679110acdc 100644
--- a/addons/project_long_term/wizard/project_compute_tasks_view.xml
+++ b/addons/project_long_term/wizard/project_compute_tasks_view.xml
@@ -30,7 +30,6 @@
formform
- {'record_id' : active_id}new
diff --git a/addons/project_scrum/i18n/fr.po b/addons/project_scrum/i18n/fr.po
index adca710673b..4379520c588 100644
--- a/addons/project_scrum/i18n/fr.po
+++ b/addons/project_scrum/i18n/fr.po
@@ -7,15 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:15+0000\n"
-"PO-Revision-Date: 2011-01-18 16:47+0000\n"
-"Last-Translator: Maxime Chambreuil (http://www.savoirfairelinux.com) "
-"\n"
+"PO-Revision-Date: 2011-09-26 12:11+0000\n"
+"Last-Translator: Numérigraphe \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-05 05:03+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
+"X-Generator: Launchpad (build 14028)\n"
#. module: project_scrum
#: help:project.scrum.email,scrum_master_email:0
@@ -991,6 +990,14 @@ msgid ""
"*Blocks encountered:\n"
"_______________________ %s"
msgstr ""
+"\n"
+"* Tâches depuis hier :\n"
+"_______________________%s\n"
+"* Tâches pour aujourd'hui :\n"
+"_______________________ %s\n"
+"\n"
+"* Blocages rencontrés :\n"
+"_______________________ %s"
#. module: project_scrum
#: help:project.scrum.product.backlog,active:0
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index d6c1d4c903f..dcf29bfaceb 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -540,7 +540,7 @@ class purchase_order(osv.osv):
if not order_infos:
order_infos.update({
'origin': porder.origin,
- 'date_order': time.strftime('%Y-%m-%d'),
+ 'date_order': porder.date_order,
'partner_id': porder.partner_id.id,
'partner_address_id': porder.partner_address_id.id,
'dest_address_id': porder.dest_address_id.id,
@@ -553,6 +553,8 @@ class purchase_order(osv.osv):
'fiscal_position': porder.fiscal_position and porder.fiscal_position.id or False,
})
else:
+ if porder.date_order < order_infos['date_order']:
+ order_infos['date_order'] = porder.date_order
if porder.notes:
order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,))
if porder.origin:
@@ -665,7 +667,7 @@ class purchase_order_line(osv.osv):
def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom,
partner_id, date_order=False, fiscal_position=False, date_planned=False,
- name=False, price_unit=False, notes=False):
+ name=False, price_unit=False, notes=False, context={}):
if not pricelist:
raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist or a supplier in the purchase form !\nPlease set one before choosing a product.'))
if not partner_id:
@@ -738,10 +740,10 @@ class purchase_order_line(osv.osv):
def product_uom_change(self, cr, uid, ids, pricelist, product, qty, uom,
partner_id, date_order=False, fiscal_position=False, date_planned=False,
- name=False, price_unit=False, notes=False):
+ name=False, price_unit=False, notes=False, context={}):
res = self.product_id_change(cr, uid, ids, pricelist, product, qty, uom,
partner_id, date_order=date_order, fiscal_position=fiscal_position, date_planned=date_planned,
- name=name, price_unit=price_unit, notes=notes)
+ name=name, price_unit=price_unit, notes=notes, context=context)
if 'product_uom' in res['value']:
if uom and (uom != res['value']['product_uom']) and res['value']['product_uom']:
seller_uom_name = self.pool.get('product.uom').read(cr, uid, [res['value']['product_uom']], ['name'])[0]['name']
@@ -818,8 +820,9 @@ class procurement_order(osv.osv):
price = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, partner_id, {'uom': uom_id})[pricelist_id]
- newdate = datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
- newdate = (newdate - relativedelta(days=company.po_lead)) - relativedelta(days=seller_delay)
+ order_date = datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
+ schedule_date = (order_date - relativedelta(days=company.po_lead))
+ order_dates = schedule_date - relativedelta(days=seller_delay)
#Passing partner_id to context for purchase order line integrity of Line name
context.update({'lang': partner.lang, 'partner_id': partner_id})
@@ -833,8 +836,8 @@ class procurement_order(osv.osv):
'product_qty': qty,
'product_id': procurement.product_id.id,
'product_uom': uom_id,
- 'price_unit': price,
- 'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
+ 'price_unit': price or 0.0,
+ 'date_planned': schedule_date.strftime('%Y-%m-%d %H:%M:%S'),
'move_dest_id': res_id,
'notes': product.description_purchase,
'taxes_id': [(6,0,taxes)],
@@ -846,6 +849,7 @@ class procurement_order(osv.osv):
'partner_address_id': address_id,
'location_id': procurement.location_id.id,
'pricelist_id': pricelist_id,
+ 'date_order': order_dates.strftime('%Y-%m-%d %H:%M:%S'),
'company_id': procurement.company_id.id,
'fiscal_position': partner.property_account_position and partner.property_account_position.id or False
}
diff --git a/addons/purchase/purchase_sequence.xml b/addons/purchase/purchase_sequence.xml
index 7f426b53be6..d5b4fc4bd3b 100644
--- a/addons/purchase/purchase_sequence.xml
+++ b/addons/purchase/purchase_sequence.xml
@@ -11,6 +11,7 @@
purchase.orderPO5
+
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 4cec0750345..cb7224faaf0 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -194,7 +194,7 @@
-
+
@@ -358,8 +358,8 @@
- [[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]Shipping address :
- [[ (addr.partner_id and addr.partner_id.title and addr.partner_id.title.name) or '' ]] [[ (addr.partner_id and addr.partner_id.name) or '' ]]
- [[ addr.street ]]
- [[ addr.street2 or removeParentNode('para') ]]
- [[ addr.zip or '' ]] [[ addr.city or '' ]]
- [[ addr.state_id and addr.state_id.name or removeParentNode('para') ]]
- [[ addr.country_id and addr.country_id.name or '' ]]
+ [[ (o.dest_address_id and o.dest_address_id.partner_id.name) or (o.warehouse_id and o.warehouse_id.name) or '']]
+ [[ (o.dest_address_id and o.dest_address_id and o.dest_address_id.street) or (o.warehouse_id and o.warehouse_id.partner_address_id and o.warehouse_id.partner_address_id.street) or '']]
+ [[ (o.dest_address_id and o.dest_address_id and o.dest_address_id.street2) or (o.warehouse_id and o.warehouse_id.partner_address_id and o.warehouse_id.partner_address_id.street2) or removeParentNode('para') ]]
+ [[ (o.dest_address_id and o.dest_address_id and o.dest_address_id.zip) or (o.warehouse_id and o.warehouse_id.partner_address_id and o.warehouse_id.partner_address_id.zip) or '' ]] [[ (o.dest_address_id and o.dest_address_id and o.dest_address_id.city) or (o.warehouse_id and o.warehouse_id.partner_address_id and o.warehouse_id.partner_address_id.city) or '' ]]
+ [[ (o.dest_address_id and o.dest_address_id.state_id and o.dest_address_id.state_id.name) or (o.warehouse_id and o.warehouse_id.partner_address_id and o.warehouse_id.partner_address_id.state_id and o.warehouse_id.partner_address_id.state_id.name) or removeParentNode('para') ]]
+ [[ (o.dest_address_id and o.dest_address_id.country_id and o.dest_address_id.country_id.name) or (o.warehouse_id and o.warehouse_id.partner_address_id and o.warehouse_id.partner_address_id.country_id and o.warehouse_id.partner_address_id.country_id.name) ]]
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index 6b68cecf1a5..4c59f9ea002 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -92,26 +92,23 @@ class purchase_report(osv.osv):
s.company_id as company_id,
l.product_id,
t.categ_id as category_id,
- (case when u.uom_type not in ('reference') then
- (select id from product_uom where uom_type='reference' and category_id = 1)
- else
- u.id
- end) as product_uom,
+ t.uom_id as product_uom,
s.location_id as location_id,
- sum(l.product_qty/u.factor) as quantity,
+ sum(l.product_qty/u.factor*u2.factor) as quantity,
extract(epoch from age(s.date_approve,s.date_order))/(24*60*60)::decimal(16,2) as delay,
extract(epoch from age(l.date_planned,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
count(*) as nbr,
- (l.price_unit*l.product_qty*u.factor)::decimal(16,2) as price_total,
- avg(100.0 * (l.price_unit*l.product_qty*u.factor) / NULLIF(t.standard_price*l.product_qty*u.factor, 0.0))::decimal(16,2) as negociation,
+ (l.price_unit*l.product_qty)::decimal(16,2) as price_total,
+ avg(100.0 * (l.price_unit*l.product_qty) / NULLIF(t.standard_price*l.product_qty/u.factor*u2.factor, 0.0))::decimal(16,2) as negociation,
- sum(t.standard_price*l.product_qty*u.factor)::decimal(16,2) as price_standard,
- (sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty*u.factor),0.0))::decimal(16,2) as price_average
+ sum(t.standard_price*l.product_qty/u.factor*u2.factor)::decimal(16,2) as price_standard,
+ (sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty/u.factor*u2.factor),0.0))::decimal(16,2) as price_average
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
left join product_product p on (l.product_id=p.id)
left join product_template t on (p.product_tmpl_id=t.id)
left join product_uom u on (u.id=l.product_uom)
+ left join product_uom u2 on (u2.id=t.uom_id)
where l.product_id is not null
group by
s.company_id,
@@ -139,7 +136,9 @@ class purchase_report(osv.osv):
s.warehouse_id,
u.uom_type,
u.category_id,
- u.id
+ t.uom_id,
+ u.id,
+ u2.factor
)
""")
purchase_report()
diff --git a/addons/purchase/wizard/purchase_installer.py b/addons/purchase/wizard/purchase_installer.py
index be99a41a3cc..c6d70947893 100644
--- a/addons/purchase/wizard/purchase_installer.py
+++ b/addons/purchase/wizard/purchase_installer.py
@@ -29,4 +29,28 @@ class purchase_installer(osv.osv_memory):
}
purchase_installer()
+class purchase_config_wizard(osv.osv_memory):
+ _name = 'purchase.config.wizard'
+
+ _columns = {
+ 'default_method' : fields.selection(
+ [('manual', 'Based on Purchase Orders'),
+ ('picking', 'Based on Receptions'),
+ ('order', 'Pre-Generate Draft Invoices on Purchase Orders'),
+ ],
+ 'Default Invoicing Control Method',
+ required=True,
+ ),
+ }
+
+ def validate_cb(self, cr, uid, ids, context=None):
+ wizard = self.browse(cr, uid, ids, context=context)[0]
+
+ proxy = self.pool.get('ir.values')
+ proxy.set(cr, uid, 'default', False, 'invoice_method', ['purchase.order'], wizard.default_method),
+
+ return {'type' : 'ir.actions.act_window_close'}
+
+purchase_config_wizard()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/wizard/purchase_installer.xml b/addons/purchase/wizard/purchase_installer.xml
index e296b14ca91..cf9b6a985db 100644
--- a/addons/purchase/wizard/purchase_installer.xml
+++ b/addons/purchase/wizard/purchase_installer.xml
@@ -17,5 +17,55 @@
+
+
+ Create or Import Suppliers
+ ir.actions.act_window
+ res.partner
+ form
+ tree,form
+ {'search_default_supplier': 1, 'default_supplier' : True, 'default_customer' : False}
+
+ Create or Import Suppliers and their contacts manually from this form or you can import your existing partners by CSV spreadsheet from "Import Data" wizard
+
+
+
+ Purchase Management
+ 5
+
+
+
+
+
+
+
+
+ purchase.view_purchase_config
+ form
+ purchase.config.wizard
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Set the Default Invoicing Control Method
+ purchase.config.wizard
+ form
+ form
+ new
+
+
+
+
+
diff --git a/addons/purchase_double_validation/purchase_double_validation_installer.xml b/addons/purchase_double_validation/purchase_double_validation_installer.xml
index bc39c837b6b..9a06f66164a 100644
--- a/addons/purchase_double_validation/purchase_double_validation_installer.xml
+++ b/addons/purchase_double_validation/purchase_double_validation_installer.xml
@@ -40,15 +40,10 @@
new
-
- Purchase Management
- 5
-
-
-
+
diff --git a/addons/purchase_requisition/i18n/fr.po b/addons/purchase_requisition/i18n/fr.po
index 58b7e9b9d25..41b8bde6141 100644
--- a/addons/purchase_requisition/i18n/fr.po
+++ b/addons/purchase_requisition/i18n/fr.po
@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2011-01-11 11:15+0000\n"
-"PO-Revision-Date: 2011-01-18 16:46+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2011-09-26 12:22+0000\n"
+"Last-Translator: lholivier \n"
"Language-Team: French \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-05 05:57+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
+"X-Generator: Launchpad (build 14028)\n"
#. module: purchase_requisition
#: view:purchase.requisition:0
@@ -193,11 +193,11 @@ msgid ""
"negotiation, once you have reviewed all the supplier's offers, you can "
"validate some and cancel others."
msgstr ""
-"Une demande d'achat est une étape avant la demande de devis. Dans une "
-"demande d'achat (ou appel d'offre), vous pouvez enregistrer les produits que "
-"vous avez besoin d'acheter et automatiser la création des demandes de devis "
-"à vos fournisseurs. Après la négociation, quand vous avez toutes les offres "
-"de vos fournisseurs, vous pouvez en valider certaines et en annuler d'autres."
+"La demande d'achat précède la demande de devis. La demande d'achat "
+"répertorie les produits dont on a besoin et on peut y déclencher des "
+"demandes de devis auprès des fournisseurs. Aprés la négociation, lorsque "
+"toutes les offres des fournisseurs ont été examinées, vous pouvez valider "
+"certaines offres et éliminer les autres."
#. module: purchase_requisition
#: field:purchase.requisition.line,product_qty:0
@@ -344,7 +344,7 @@ msgstr "Référence"
#. module: purchase_requisition
#: model:ir.model,name:purchase_requisition.model_procurement_order
msgid "Procurement"
-msgstr "Besoin"
+msgstr "Approvisionnement"
#. module: purchase_requisition
#: field:purchase.requisition,warehouse_id:0
@@ -434,3 +434,5 @@ msgid ""
"You have already one %s purchase order for this partner, you must cancel "
"this purchase order to create a new quotation."
msgstr ""
+"Il existe déjà une commande %s pour ce partenaire, vous devez annuler cette "
+"commande avant de faire un nouveau devis."
diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py
index cb31709b20e..00c449dfd7d 100644
--- a/addons/purchase_requisition/purchase_requisition.py
+++ b/addons/purchase_requisition/purchase_requisition.py
@@ -41,7 +41,7 @@ class purchase_requisition(osv.osv):
'purchase_ids' : fields.one2many('purchase.order','requisition_id','Purchase Orders',states={'done': [('readonly', True)]}),
'line_ids' : fields.one2many('purchase.requisition.line','requisition_id','Products to Purchase',states={'done': [('readonly', True)]}),
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'),
- 'state': fields.selection([('draft','Draft'),('in_progress','In Progress'),('cancel','Cancelled'),('done','Done')], 'State', required=True)
+ 'state': fields.selection([('draft','New'),('in_progress','In Progress'),('cancel','Cancelled'),('done','Done')], 'State', required=True)
}
_defaults = {
'date_start': time.strftime('%Y-%m-%d %H:%M:%S'),
diff --git a/addons/purchase_requisition/purchase_requisition_view.xml b/addons/purchase_requisition/purchase_requisition_view.xml
index 807c023d0de..06ee94c3941 100644
--- a/addons/purchase_requisition/purchase_requisition_view.xml
+++ b/addons/purchase_requisition/purchase_requisition_view.xml
@@ -75,9 +75,9 @@
-
+
-
+
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index e4f917ba063..b266b5b6391 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -38,7 +38,7 @@ class sale_report(osv.osv):
('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
- 'uom_name': fields.char('Reference UoM', size=128, readonly=True),
+ 'product_uom': fields.many2one('product.uom', 'UoM', readonly=True),
'product_uom_qty': fields.float('# of Qty', readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
@@ -67,51 +67,41 @@ class sale_report(osv.osv):
tools.drop_view_if_exists(cr, 'sale_report')
cr.execute("""
create or replace view sale_report as (
- select el.*,
- -- (select count(1) from sale_order_line where order_id = s.id) as nbr,
- (select 1) as nbr,
- s.date_order as date,
- s.date_confirm as date_confirm,
- to_char(s.date_order, 'YYYY') as year,
- to_char(s.date_order, 'MM') as month,
- to_char(s.date_order, 'YYYY-MM-DD') as day,
- s.partner_id as partner_id,
- s.user_id as user_id,
- s.shop_id as shop_id,
- s.company_id as company_id,
- extract(epoch from avg(date_trunc('day',s.date_confirm)-date_trunc('day',s.create_date)))/(24*60*60)::decimal(16,2) as delay,
- s.state,
- s.shipped,
- s.shipped::integer as shipped_qty_1,
- s.pricelist_id as pricelist_id,
- s.project_id as analytic_account_id
+ select
+ min(l.id) as id,
+ l.product_id as product_id,
+ t.uom_id as product_uom,
+ sum(l.product_uom_qty / u.factor * u2.factor) as product_uom_qty,
+ sum(l.product_uom_qty * l.price_unit * (100.0-l.discount) / 100.0) as price_total,
+ 1 as nbr,
+ s.date_order as date,
+ s.date_confirm as date_confirm,
+ to_char(s.date_order, 'MM') as month,
+ to_char(s.date_order, 'YYYY-MM-DD') as day,
+ s.partner_id as partner_id,
+ s.user_id as user_id,
+ s.shop_id as shop_id,
+ s.company_id as company_id,
+ extract(epoch from avg(date_trunc('day',s.date_confirm)-date_trunc('day',s.create_date)))/(24*60*60)::decimal(16,2) as delay,
+ s.state,
+ t.categ_id as categ_id,
+ s.shipped,
+ s.shipped::integer as shipped_qty_1,
+ s.pricelist_id as pricelist_id,
+ s.project_id as analytic_account_id
from
- sale_order s,
- (
- select l.id as id,
- l.product_id as product_id,
- (case when u.uom_type not in ('reference') then
- (select name from product_uom where uom_type='reference' and category_id=u.category_id)
- else
- u.name
- end) as uom_name,
- sum(l.product_uom_qty * u.factor) as product_uom_qty,
- sum(l.product_uom_qty * l.price_unit) as price_total,
- pt.categ_id, l.order_id
- from
- sale_order_line l ,product_uom u, product_product p, product_template pt
- where u.id = l.product_uom
- and pt.id = p.product_tmpl_id
- and p.id = l.product_id
- group by l.id, l.order_id, l.product_id, u.name, pt.categ_id, u.uom_type, u.category_id) el
- where s.id = el.order_id
- group by el.id,
- el.product_id,
- el.uom_name,
- el.product_uom_qty,
- el.price_total,
- el.categ_id,
- el.order_id,
+ sale_order s
+ left join sale_order_line l on (s.id=l.order_id)
+ left join product_product p on (l.product_id=p.id)
+ left join product_template t on (p.product_tmpl_id=t.id)
+ left join product_uom u on (u.id=l.product_uom)
+ left join product_uom u2 on (u2.id=t.uom_id)
+ group by
+ l.product_id,
+ l.product_uom_qty,
+ l.order_id,
+ t.uom_id,
+ t.categ_id,
s.date_order,
s.date_confirm,
s.partner_id,
diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml
index 6127c166f40..f9939190a7c 100644
--- a/addons/sale/report/sale_report_view.xml
+++ b/addons/sale/report/sale_report_view.xml
@@ -59,7 +59,7 @@
domain="[('date','<=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date','>=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
help="Sales order created in current month"/>
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 12c27c197ed..f2f953398a2 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -199,7 +199,7 @@ class sale_order(osv.osv):
'state': fields.selection([
('draft', 'Quotation'),
('waiting_date', 'Waiting Schedule'),
- ('manual', 'Manual In Progress'),
+ ('manual', 'To Invoice'),
('progress', 'In Progress'),
('shipping_except', 'Shipping Exception'),
('invoice_except', 'Invoice Exception'),
@@ -479,6 +479,7 @@ class sale_order(osv.osv):
picking_obj = self.pool.get('stock.picking')
invoice = self.pool.get('account.invoice')
obj_sale_order_line = self.pool.get('sale.order.line')
+ partner_currency = {}
if context is None:
context = {}
# If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the
@@ -486,6 +487,13 @@ class sale_order(osv.osv):
if date_inv:
context['date_inv'] = date_inv
for o in self.browse(cr, uid, ids, context=context):
+ currency_id = o.pricelist_id.currency_id.id
+ if (o.partner_id.id in partner_currency) and (partner_currency[o.partner_id.id] <> currency_id):
+ raise osv.except_osv(
+ _('Error !'),
+ _('You cannot group sales having different currencies for the same partner.'))
+
+ partner_currency[o.partner_id.id] = currency_id
lines = []
for line in o.order_line:
if line.invoiced:
diff --git a/addons/sale/sale_sequence.xml b/addons/sale/sale_sequence.xml
index dadd1942940..666f7b49720 100644
--- a/addons/sale/sale_sequence.xml
+++ b/addons/sale/sale_sequence.xml
@@ -13,6 +13,7 @@
sale.orderSO3
+
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index a12a4c566f5..b7f5d11e15f 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -180,7 +180,7 @@
-
+
diff --git a/addons/sale_layout/i18n/da.po b/addons/sale_layout/i18n/da.po
new file mode 100644
index 00000000000..230becf3b19
--- /dev/null
+++ b/addons/sale_layout/i18n/da.po
@@ -0,0 +1,292 @@
+# Danish translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:16+0000\n"
+"PO-Revision-Date: 2011-09-24 17:46+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Danish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2011-09-25 04:41+0000\n"
+"X-Generator: Launchpad (build 14012)\n"
+
+#. module: sale_layout
+#: selection:sale.order.line,layout_type:0
+msgid "Sub Total"
+msgstr "Sub total"
+
+#. module: sale_layout
+#: model:ir.module.module,description:sale_layout.module_meta_information
+msgid ""
+"\n"
+" This module provides features to improve the layout of the Sales Order.\n"
+"\n"
+" It gives you the possibility to\n"
+" * order all the lines of a sales order\n"
+" * add titles, comment lines, sub total lines\n"
+" * draw horizontal lines and put page breaks\n"
+"\n"
+" "
+msgstr ""
+
+#. module: sale_layout
+#: selection:sale.order.line,layout_type:0
+msgid "Title"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Disc. (%)"
+msgstr ""
+
+#. module: sale_layout
+#: selection:sale.order.line,layout_type:0
+msgid "Note"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Unit Price"
+msgstr "Enhedspris"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Order N°"
+msgstr "Ordre nummer"
+
+#. module: sale_layout
+#: field:sale.order,abstract_line_ids:0
+msgid "Order Lines"
+msgstr "Ordre linier"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Disc.(%)"
+msgstr ""
+
+#. module: sale_layout
+#: field:sale.order.line,layout_type:0
+msgid "Layout Type"
+msgstr ""
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Seq."
+msgstr ""
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "UoM"
+msgstr ""
+
+#. module: sale_layout
+#: selection:sale.order.line,layout_type:0
+msgid "Product"
+msgstr ""
+
+#. module: sale_layout
+#: sql_constraint:sale.order:0
+msgid "Order Reference must be unique !"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Description"
+msgstr "Beskrivelse"
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Manual Description"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Our Salesman"
+msgstr "Vores sælger"
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Automatic Declaration"
+msgstr ""
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Invoice Lines"
+msgstr "Faktura linier"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Quantity"
+msgstr "Antal"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Quotation N°"
+msgstr "Tilbud nummer"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "VAT"
+msgstr "Moms"
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Make Invoice"
+msgstr ""
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Properties"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Invoice address :"
+msgstr "Faktura adresse:"
+
+#. module: sale_layout
+#: model:ir.module.module,shortdesc:sale_layout.module_meta_information
+msgid "Sale Order Layout"
+msgstr "Salgsordre layout"
+
+#. module: sale_layout
+#: selection:sale.order.line,layout_type:0
+msgid "Page Break"
+msgstr ""
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Notes"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Date Ordered"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Shipping address :"
+msgstr "Leveringsadresse"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Taxes"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Net Total :"
+msgstr "Netto total:"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Tel. :"
+msgstr "Tel:"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Total :"
+msgstr "Total:"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Payment Terms"
+msgstr "Betalingsbetingelser"
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "History"
+msgstr ""
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Sale Order Lines"
+msgstr "Salgsordre linier"
+
+#. module: sale_layout
+#: selection:sale.order.line,layout_type:0
+msgid "Separator Line"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Your Reference"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Quotation Date"
+msgstr "Tilbudsdato"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "TVA :"
+msgstr ""
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Qty"
+msgstr "Antal"
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "States"
+msgstr "Stater"
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Sales order lines"
+msgstr ""
+
+#. module: sale_layout
+#: model:ir.actions.report.xml,name:sale_layout.sale_order_1
+msgid "Order with Layout"
+msgstr ""
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Extra Info"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Taxes :"
+msgstr ""
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Fax :"
+msgstr "Fax:"
+
+#. module: sale_layout
+#: model:ir.model,name:sale_layout.model_sale_order
+msgid "Sales Order"
+msgstr "Salgsordre"
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Order Line"
+msgstr "Ordre linie"
+
+#. module: sale_layout
+#: report:sale.order.layout:0
+msgid "Price"
+msgstr "Pris"
+
+#. module: sale_layout
+#: model:ir.model,name:sale_layout.model_sale_order_line
+msgid "Sales Order Line"
+msgstr "Salgsordrelinie"
+
+#. module: sale_layout
+#: view:sale.order:0
+msgid "Stock Moves"
+msgstr "Lagerflytninger"
diff --git a/addons/sale_margin/__init__.py b/addons/sale_margin/__init__.py
index 425dcf6352d..ad51e586046 100644
--- a/addons/sale_margin/__init__.py
+++ b/addons/sale_margin/__init__.py
@@ -19,7 +19,6 @@
##############################################################################
import sale_margin
-import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_margin/__openerp__.py b/addons/sale_margin/__openerp__.py
index 1121b178266..1170c72485c 100644
--- a/addons/sale_margin/__openerp__.py
+++ b/addons/sale_margin/__openerp__.py
@@ -33,7 +33,7 @@ This gives the profitability by calculating the difference between the Unit Pric
"depends":["sale"],
"demo_xml":[],
'test': ['test/sale_margin.yml'],
- "update_xml":["security/ir.model.access.csv","sale_margin_view.xml","report/report_margin_view.xml"],
+ "update_xml":["security/ir.model.access.csv","sale_margin_view.xml"],
"active": False,
"installable": True,
"certificate" : "001165700015525701661",
diff --git a/addons/sale_margin/report/report_margin.py b/addons/sale_margin/report/report_margin.py
deleted file mode 100644
index a318a6c17b8..00000000000
--- a/addons/sale_margin/report/report_margin.py
+++ /dev/null
@@ -1,90 +0,0 @@
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields,osv
-import pooler
-from tools import config
-import time
-import tools
-
-
-
-class report_account_invoice_product(osv.osv):
- _name = 'report.account.invoice.product'
- _auto = False
- _description = "Invoice Statistics"
- _columns = {
- 'date': fields.date('Date', readonly=True),
- 'year': fields.char('Year', size=4, readonly=True),
- 'day': fields.char('Day', size=128, readonly=True),
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
- ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
- ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
- 'type': fields.selection([
- ('out_invoice','Customer Invoice'),
- ('in_invoice','Supplier Invoice'),
- ('out_refund','Customer Refund'),
- ('in_refund','Supplier Refund'),
- ],'Type', readonly=True),
- 'state': fields.selection([
- ('draft','Draft'),
- ('proforma','Pro-forma'),
- ('open','Open'),
- ('paid','Paid'),
- ('cancel','Canceled')
- ],'State', readonly=True),
- 'product_id': fields.many2one('product.product', 'Product', readonly=True),
- 'amount': fields.float('Amount', readonly=True),
- 'cost_price': fields.float('Cost Price', readonly=True),
- 'margin': fields.float('Margin', readonly=True),
- 'categ_id': fields.many2one('product.category', 'Categories', readonly=True),
- 'quantity': fields.float('Quantity', readonly=True),
- 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
- }
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_account_invoice_product')
- cr.execute("""
- create or replace view report_account_invoice_product as (
- select
- min(l.id) as id,
- i.create_date as date,
- to_char(date_trunc('day',i.date_invoice), 'YYYY') as year,
- to_char(date_trunc('day',i.date_invoice), 'MM') as month,
- to_char(date_trunc('day',i.date_invoice), 'YYYY-MM-DD') as day,
- i.type,
- i.state,
- l.product_id,
- t.categ_id,
- i.partner_id,
- sum(l.quantity * l.price_unit * (1.0 - l.discount/100.0)) as amount,
- sum(l.quantity * l.cost_price) as cost_price,
- sum((l.quantity * l.price_unit * (1.0 - l.discount/100.0) - (l.quantity * l.cost_price))) as margin,
- sum(l.quantity) as quantity
- from account_invoice i
- left join account_invoice_line l on (i.id = l.invoice_id)
- left join product_product p on (p.id = l.product_id)
- left join product_template t on (t.id = p.product_tmpl_id)
- group by t.categ_id,i.partner_id,l.product_id, i.date_invoice, i.type, i.state,i.create_date
- )
- """)
-report_account_invoice_product()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sale_margin/report/report_margin_view.xml b/addons/sale_margin/report/report_margin_view.xml
deleted file mode 100644
index 6d18c8d1fd9..00000000000
--- a/addons/sale_margin/report/report_margin_view.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
- report.account.invoice.product.tree
- report.account.invoice.product
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- account.invoice.product.filter
- report.account.invoice.product
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.account.invoice.product.graph
- report.account.invoice.product
- graph
-
-
-
-
-
-
-
-
-
- Invoice Analysis
- report.account.invoice.product
- form
- tree,graph
- {"search_default_At Date":1,'group_by_no_leaf':1,'group_by':[]}
-
- This report gives you an overview of all the invoices generated by the system. You can sort and group your results by specific selection criteria to quickly find what you are looking for.
-
-
-
-
-
-
-
diff --git a/addons/sale_margin/security/ir.model.access.csv b/addons/sale_margin/security/ir.model.access.csv
index d7752fa1961..0343f29f43a 100644
--- a/addons/sale_margin/security/ir.model.access.csv
+++ b/addons/sale_margin/security/ir.model.access.csv
@@ -1,2 +1 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_report_account_invoice_product","report.account.invoice.product","model_report_account_invoice_product","account.group_account_manager",1,1,1,1
diff --git a/addons/share/i18n/da.po b/addons/share/i18n/da.po
new file mode 100644
index 00000000000..d4839ed6e84
--- /dev/null
+++ b/addons/share/i18n/da.po
@@ -0,0 +1,476 @@
+# Danish translation for openobject-addons
+# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2011-01-11 11:16+0000\n"
+"PO-Revision-Date: 2011-09-23 17:42+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Danish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2011-09-24 04:59+0000\n"
+"X-Generator: Launchpad (build 14012)\n"
+
+#. module: share
+#: code:addons/share/web/editors.py:15
+#, python-format
+msgid "Sharing"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:462
+#, python-format
+msgid ""
+"This additional data has been automatically added to your current access.\n"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Existing External Users"
+msgstr ""
+
+#. module: share
+#: help:res.groups,share:0
+msgid "Group created to set access rights for sharing data with some users."
+msgstr ""
+
+#. module: share
+#: model:ir.module.module,shortdesc:share.module_meta_information
+msgid "Share Management"
+msgstr ""
+
+#. module: share
+#: sql_constraint:res.users:0
+msgid "You can not have two users with the same login !"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:76
+#, python-format
+msgid "Sharing Wizard - Step 1"
+msgstr ""
+
+#. module: share
+#: model:ir.actions.act_window,name:share.action_share_wizard
+#: model:ir.ui.menu,name:share.menu_action_share_wizard
+msgid "Share Access Rules"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:453
+#, python-format
+msgid ""
+"Dear,\n"
+"\n"
+"%s\n"
+"\n"
+msgstr ""
+
+#. module: share
+#: constraint:res.users:0
+msgid "The chosen company is not in the allowed companies for this user"
+msgstr ""
+
+#. module: share
+#: model:ir.model,name:share.model_res_users
+msgid "res.users"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Next"
+msgstr ""
+
+#. module: share
+#: help:share.wizard,action_id:0
+msgid ""
+"The action that opens the screen containing the data you wish to share."
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:68
+#, python-format
+msgid "Please specify \"share_root_url\" in context"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Congratulations, you have successfully setup a new shared access!"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:275
+#, python-format
+msgid "(Copy for sharing)"
+msgstr ""
+
+#. module: share
+#: field:share.wizard.result.line,newly_created:0
+msgid "Newly created"
+msgstr ""
+
+#. module: share
+#: field:share.wizard,share_root_url:0
+msgid "Generic Share Access URL"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:457
+#, python-format
+msgid ""
+"You may use the following login and password to get access to this protected "
+"area:\n"
+msgstr ""
+
+#. module: share
+#: view:res.groups:0
+msgid "Regular groups only (no share groups"
+msgstr ""
+
+#. module: share
+#: selection:share.wizard,access_mode:0
+msgid "Read & Write"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Share wizard: step 2"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Share wizard: step 0"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Share wizard: step 1"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:458
+#: field:share.wizard.result.line,login:0
+#, python-format
+msgid "Username"
+msgstr ""
+
+#. module: share
+#: field:res.users,share:0
+msgid "Share User"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:452
+#, python-format
+msgid "%s has shared OpenERP %s information with you"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Finish"
+msgstr ""
+
+#. module: share
+#: field:share.wizard,user_ids:0
+#: field:share.wizard.user,user_id:0
+msgid "Users"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:103
+#, python-format
+msgid ""
+"This username (%s) already exists, perhaps data has already been shared with "
+"this person.\n"
+"You may want to try selecting existing shared users instead."
+msgstr ""
+
+#. module: share
+#: field:share.wizard,new_users:0
+msgid "New users"
+msgstr ""
+
+#. module: share
+#: model:ir.model,name:share.model_res_groups
+msgid "res.groups"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:149
+#, python-format
+msgid "%s (Shared)"
+msgstr ""
+
+#. module: share
+#: sql_constraint:res.groups:0
+msgid "The name of the group must be unique !"
+msgstr ""
+
+#. module: share
+#: selection:share.wizard,user_type:0
+msgid "New users (emails required)"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:418
+#, python-format
+msgid "Sharing filter created by user %s (%s) for group %s"
+msgstr ""
+
+#. module: share
+#: view:res.groups:0
+msgid "Groups"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Select the desired shared access mode:"
+msgstr ""
+
+#. module: share
+#: field:res.groups,share:0
+msgid "Share Group"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:459
+#: field:share.wizard.result.line,password:0
+#, python-format
+msgid "Password"
+msgstr "Adgangskode"
+
+#. module: share
+#: view:share.wizard:0
+msgid "Who would you want to share this data with?"
+msgstr ""
+
+#. module: share
+#: model:ir.module.module,description:share.module_meta_information
+msgid ""
+"The goal is to implement a generic sharing mechanism, where user of OpenERP\n"
+"can share data from OpenERP to their colleagues, customers, or friends.\n"
+"The system will work by creating new users and groups on the fly, and by\n"
+"combining the appropriate access rights and ir.rules to ensure that the "
+"/shared\n"
+"users/ will only have access to the correct data.\n"
+" "
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:102
+#, python-format
+msgid "User already exists"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Send Email Notification(s)"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:463
+#, python-format
+msgid ""
+"You may use your existing login and password to view it. As a reminder, your "
+"login is %s.\n"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:460
+#, python-format
+msgid "Database"
+msgstr "Database"
+
+#. module: share
+#: model:ir.model,name:share.model_share_wizard_user
+msgid "share.wizard.user"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid ""
+"Please select the action that opens the screen containing the data you want "
+"to share."
+msgstr ""
+
+#. module: share
+#: selection:share.wizard,user_type:0
+msgid "Existing external users"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+#: field:share.wizard,result_line_ids:0
+msgid "Summary"
+msgstr ""
+
+#. module: share
+#: field:share.wizard,user_type:0
+msgid "Users to share with"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:304
+#, python-format
+msgid "Indirect sharing filter created by user %s (%s) for group %s"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:448
+#, python-format
+msgid "Email required"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:240
+#, python-format
+msgid "Copied access for sharing"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid ""
+"Optionally, you may specify an additional domain restriction that will be "
+"applied to the shared data."
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "New Users (please provide one e-mail address per line below)"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:448
+#, python-format
+msgid ""
+"The current user must have an email address configured in User Preferences "
+"to be able to send outgoing emails."
+msgstr ""
+
+#. module: share
+#: view:res.users:0
+msgid "Regular users only (no share user)"
+msgstr ""
+
+#. module: share
+#: field:share.wizard.result.line,share_url:0
+msgid "Share URL"
+msgstr ""
+
+#. module: share
+#: field:share.wizard,domain:0
+msgid "Domain"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:314
+#, python-format
+msgid ""
+"Sorry, the current screen and filter you are trying to share are not "
+"supported at the moment.\n"
+"You may want to try a simpler filter."
+msgstr ""
+
+#. module: share
+#: field:share.wizard,access_mode:0
+msgid "Access Mode"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Access info"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:454
+#, python-format
+msgid ""
+"To access it, you can go to the following URL:\n"
+" %s"
+msgstr ""
+
+#. module: share
+#: field:share.wizard,action_id:0
+msgid "Action to share"
+msgstr ""
+
+#. module: share
+#: code:addons/share/web/editors.py:18
+#, python-format
+msgid "Share"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:434
+#, python-format
+msgid "Sharing Wizard - Step 2"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Here is a summary of the access points you have just created:"
+msgstr ""
+
+#. module: share
+#: model:ir.model,name:share.model_share_wizard_result_line
+msgid "share.wizard.result.line"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:313
+#, python-format
+msgid "Sharing access could not be setup"
+msgstr ""
+
+#. module: share
+#: model:ir.actions.act_window,name:share.action_share_wizard
+#: model:ir.actions.act_window,name:share.action_share_wizard_step1
+#: model:ir.model,name:share.model_share_wizard
+#: model:ir.ui.menu,name:share.menu_action_share_wizard
+#: field:share.wizard.result.line,share_wizard_id:0
+msgid "Share Wizard"
+msgstr ""
+
+#. module: share
+#: help:share.wizard,user_type:0
+msgid "Select the type of user(s) you would like to share data with."
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Cancel"
+msgstr ""
+
+#. module: share
+#: view:share.wizard:0
+msgid "Close"
+msgstr ""
+
+#. module: share
+#: help:res.users,share:0
+msgid ""
+"External user with limited access, created only for the purpose of sharing "
+"data."
+msgstr ""
+
+#. module: share
+#: help:share.wizard,domain:0
+msgid "Optional domain for further data filtering"
+msgstr ""
+
+#. module: share
+#: selection:share.wizard,access_mode:0
+msgid "Read-only"
+msgstr ""
+
+#. module: share
+#: code:addons/share/wizard/share_wizard.py:323
+#, python-format
+msgid "*usual password*"
+msgstr ""
diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py
index 70dc37ec2da..c6ea30db330 100644
--- a/addons/stock/__openerp__.py
+++ b/addons/stock/__openerp__.py
@@ -80,6 +80,7 @@ Thanks to the double entry management, the inventory controlling is powerful and
],
'test': ['test/stock_test.yml',
'test/stock_report.yml',
+ 'test/stock_test_wizard.yml',
],
'installable': True,
'active': False,
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index 226fa13b594..80d7ed6efa0 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -82,7 +82,7 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ES
-
- 1
-
-
- PP
-
-
-
-
-
diff --git a/addons/stock/report/__init__.py b/addons/stock/report/__init__.py
index 18bfe2609c2..412e77f3f17 100644
--- a/addons/stock/report/__init__.py
+++ b/addons/stock/report/__init__.py
@@ -20,7 +20,6 @@
##############################################################################
import product_stock
-import ups
import picking
import lot_overview_all
import report_stock
diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py
index 07289a4379a..d728cbf0e29 100644
--- a/addons/stock/report/report_stock_move.py
+++ b/addons/stock/report/report_stock_move.py
@@ -86,19 +86,19 @@ class report_stock_move(osv.osv):
sum(al.in_value - al.out_value) as value
FROM (SELECT
CASE WHEN sp.type in ('out') THEN
- sum(sm.product_qty * pu.factor)
+ sum(sm.product_qty * pu.factor / pu2.factor)
ELSE 0.0
END AS out_qty,
CASE WHEN sp.type in ('in') THEN
- sum(sm.product_qty * pu.factor)
+ sum(sm.product_qty * pu.factor / pu2.factor)
ELSE 0.0
END AS in_qty,
CASE WHEN sp.type in ('out') THEN
- sum(sm.product_qty * pu.factor) * pt.standard_price
+ sum(sm.product_qty * pu.factor / pu2.factor) * pt.standard_price
ELSE 0.0
END AS out_value,
CASE WHEN sp.type in ('in') THEN
- sum(sm.product_qty * pu.factor) * pt.standard_price
+ sum(sm.product_qty * pu.factor / pu2.factor) * pt.standard_price
ELSE 0.0
END AS in_value,
min(sm.id) as sm_id,
@@ -126,6 +126,7 @@ class report_stock_move(osv.osv):
LEFT JOIN stock_picking sp ON (sm.picking_id=sp.id)
LEFT JOIN product_product pp ON (sm.product_id=pp.id)
LEFT JOIN product_uom pu ON (sm.product_uom=pu.id)
+ LEFT JOIN product_uom pu2 ON (sm.product_uom=pu2.id)
LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id)
LEFT JOIN stock_location sl ON (sm.location_id = sl.id)
@@ -176,17 +177,16 @@ CREATE OR REPLACE view report_stock_inventory AS (
m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
m.company_id,
m.state as state, m.prodlot_id as prodlot_id,
- coalesce(sum(-pt.standard_price * m.product_qty)::decimal, 0.0) as value,
- CASE when pt.uom_id = m.product_uom THEN
- coalesce(sum(-m.product_qty)::decimal, 0.0)
- ELSE
- coalesce(sum(-m.product_qty * pu.factor)::decimal, 0.0) END as product_qty
+
+ coalesce(sum(-pt.standard_price * m.product_qty * pu.factor / pu2.factor)::decimal, 0.0) as value,
+ coalesce(sum(-m.product_qty * pu.factor / pu2.factor)::decimal, 0.0) as product_qty
FROM
stock_move m
LEFT JOIN stock_picking p ON (m.picking_id=p.id)
LEFT JOIN product_product pp ON (m.product_id=pp.id)
LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id)
LEFT JOIN product_uom pu ON (pt.uom_id=pu.id)
+ LEFT JOIN product_uom pu2 ON (m.product_uom=pu2.id)
LEFT JOIN product_uom u ON (m.product_uom=u.id)
LEFT JOIN stock_location l ON (m.location_id=l.id)
GROUP BY
@@ -199,17 +199,15 @@ CREATE OR REPLACE view report_stock_inventory AS (
m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
m.company_id,
m.state as state, m.prodlot_id as prodlot_id,
- coalesce(sum(pt.standard_price * m.product_qty )::decimal, 0.0) as value,
- CASE when pt.uom_id = m.product_uom THEN
- coalesce(sum(m.product_qty)::decimal, 0.0)
- ELSE
- coalesce(sum(m.product_qty * pu.factor)::decimal, 0.0) END as product_qty
+ coalesce(sum(pt.standard_price * m.product_qty * pu.factor / pu2.factor)::decimal, 0.0) as value,
+ coalesce(sum(m.product_qty * pu.factor / pu2.factor)::decimal, 0.0) as product_qty
FROM
stock_move m
LEFT JOIN stock_picking p ON (m.picking_id=p.id)
LEFT JOIN product_product pp ON (m.product_id=pp.id)
LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id)
LEFT JOIN product_uom pu ON (pt.uom_id=pu.id)
+ LEFT JOIN product_uom pu2 ON (m.product_uom=pu2.id)
LEFT JOIN product_uom u ON (m.product_uom=u.id)
LEFT JOIN stock_location l ON (m.location_dest_id=l.id)
GROUP BY
diff --git a/addons/stock/report/ups.py b/addons/stock/report/ups.py
deleted file mode 100644
index fb8483341ec..00000000000
--- a/addons/stock/report/ups.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from report.interface import report_rml
-
-class report_custom(report_rml):
- def create(self, uid, ids, datas, context):
- datas.setdefault('form', {})
- datas['form'].setdefault('weight', 3.0)
-
- datas['model'] = 'stock.move.lot'
- datas['ids'] = ids
- del datas['id']
-
- return (super(report_custom, self).create(uid, ids, datas, context), 'pdf')
-
-report_custom('report.stock.move.lot.ups_xml', 'stock.move.lot', 'addons/stock/report/UPS.xml', None)
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 6d86efa1d22..d9debe6641b 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -622,8 +622,8 @@ class stock_picking(osv.osv):
'location_dest_id': fields.many2one('stock.location', 'Dest. Location',help="Location where the system will stock the finished products.", select=True),
'move_type': fields.selection([('direct', 'Partial Delivery'), ('one', 'All at once')], 'Delivery Method', required=True, help="It specifies goods to be delivered all at once or by direct delivery"),
'state': fields.selection([
- ('draft', 'Draft'),
- ('auto', 'Waiting'),
+ ('draft', 'New'),
+ ('auto', 'Waiting Another Operation'),
('confirmed', 'Waiting Availability'),
('assigned', 'Ready to Process'),
('done', 'Done'),
@@ -848,7 +848,11 @@ class stock_picking(osv.osv):
for pick in self.browse(cr, uid, ids, context=context):
todo = []
for move in pick.move_lines:
- if move.state == 'assigned':
+ if move.state == 'draft':
+ self.pool.get('stock.move').action_confirm(cr, uid, [move.id],
+ context=context)
+ todo.append(move.id)
+ elif move.state in ('assigned','confirmed'):
todo.append(move.id)
if len(todo):
self.pool.get('stock.move').action_done(cr, uid, todo,
@@ -1530,13 +1534,13 @@ class stock_move(osv.osv):
'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM'), required=True,states={'done': [('readonly', True)]}),
'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True,states={'done': [('readonly', True)]}),
- 'product_uos_qty': fields.float('Quantity (UOS)', digits_compute=dp.get_precision('Product UoM')),
- 'product_uos': fields.many2one('product.uom', 'Product UOS'),
+ 'product_uos_qty': fields.float('Quantity (UOS)', digits_compute=dp.get_precision('Product UoM'), states={'done': [('readonly', True)]}),
+ 'product_uos': fields.many2one('product.uom', 'Product UOS', states={'done': [('readonly', True)]}),
'product_packaging': fields.many2one('product.packaging', 'Packaging', help="It specifies attributes of packaging like type, quantity of packaging,etc."),
'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True,states={'done': [('readonly', True)]}, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True,states={'done': [('readonly', True)]}, select=True, help="Location where the system will stock the finished products."),
- 'address_id': fields.many2one('res.partner.address', 'Destination Address', help="Optional address where goods are to be delivered, specifically used for allotment"),
+ 'address_id': fields.many2one('res.partner.address', 'Destination Address ', states={'done': [('readonly', True)]}, help="Optional address where goods are to be delivered, specifically used for allotment"),
'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', states={'done': [('readonly', True)]}, help="Production lot is used to put a serial number on the production", select=True),
'tracking_id': fields.many2one('stock.tracking', 'Pack', select=True, states={'done': [('readonly', True)]}, help="Logistical shipping unit: pallet, box, pack ..."),
@@ -1548,7 +1552,7 @@ class stock_move(osv.osv):
'move_history_ids2': fields.many2many('stock.move', 'stock_move_history_ids', 'child_id', 'parent_id', 'Move History (parent moves)'),
'picking_id': fields.many2one('stock.picking', 'Reference', select=True,states={'done': [('readonly', True)]}),
'note': fields.text('Notes'),
- 'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Not Available'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
+ 'state': fields.selection([('draft', 'New'), ('waiting', 'Waiting Another Move'), ('confirmed', 'Waiting Availability'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
help='When the stock move is created it is in the \'Draft\' state.\n After that, it is set to \'Not Available\' state if the scheduler did not find the products.\n When products are reserved it is set to \'Available\'.\n When the picking is done the state is \'Done\'.\
\nThe state is \'Waiting\' if the move is waiting for another one.'),
'price_unit': fields.float('Unit Price', digits_compute= dp.get_precision('Account'), help="Technical field used to record the product cost set by the user during a picking confirmation (when average price costing method is used)"),
@@ -2233,6 +2237,7 @@ class stock_move(osv.osv):
return super(stock_move, self).unlink(
cr, uid, ids, context=ctx)
+ # _create_lot function is not used anywhere
def _create_lot(self, cr, uid, ids, product_id, prefix=False):
""" Creates production lot
@return: Production lot id
@@ -2278,6 +2283,7 @@ class stock_move(osv.osv):
self.action_done(cr, uid, res)
return res
+ # action_split function is not used anywhere
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
""" Split Stock Move lines into production lot which specified split by quantity.
@param cr: the database cursor
diff --git a/addons/stock/stock_sequence.xml b/addons/stock/stock_sequence.xml
index cabf24dda5b..a8515c2f0df 100644
--- a/addons/stock/stock_sequence.xml
+++ b/addons/stock/stock_sequence.xml
@@ -29,6 +29,7 @@
stock.picking.inIN/5
+
@@ -36,6 +37,7 @@
stock.picking.outOUT/5
+
@@ -43,6 +45,7 @@
stock.picking.internalINT/5
+
diff --git a/addons/stock/wizard/stock_replacement.py b/addons/stock/wizard/stock_replacement.py
deleted file mode 100644
index 17f4d5a62ab..00000000000
--- a/addons/stock/wizard/stock_replacement.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields, osv
-from tools.translate import _
-import time
-
-class stock_replacement(osv.osv_memory):
- """
- This class has been defined for replacement wizard
- """
- _name = "stock.replacement"
- _description = "Stock Replacement"
-
- def get_composant(self, cr, uid, ids, context=None):
- return {}
-
- def replace_composant(self, cr, uid, ids, context=None):
- """ To open a new wizard that acknowledge, a replacement task
- @return: It returns the replacement acknowledgement form
- """
- return {
- 'name': False,
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'stock.replacement.result',
- 'type': 'ir.actions.act_window',
- 'target':'new',
- }
-
-stock_replacement()
-
-class stock_replacement_result(osv.osv_memory):
- """
- This class has been defined for replacement result
- """
- _name = "stock.replacement.result"
- _description = "Stock Replacement result"
-
-stock_replacement_result()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/stock_replacement_view.xml b/addons/stock/wizard/stock_replacement_view.xml
deleted file mode 100644
index cea5bfedbe8..00000000000
--- a/addons/stock/wizard/stock_replacement_view.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- Stock Replacement
- stock.replacement
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Stock Replacement result
- stock.replacement.result
- form
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock/wizard/stock_ups.py b/addons/stock/wizard/stock_ups.py
deleted file mode 100644
index fb47587f254..00000000000
--- a/addons/stock/wizard/stock_ups.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import netsvc
-from osv import fields, osv
-from tools.translate import _
-
-class stock_ups(osv.osv_memory):
- _name = "stock.ups"
- _description = "Stock ups"
-
- def ups_save(self, cr, uid, ids, context=None):
- return {
- 'name': False,
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'stock.ups.final',
- 'type': 'ir.actions.act_window',
- 'target':'new',
- }
-
- def ups_upload(self, cr, uid, ids, context=None):
- return {
- 'name': False,
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'stock.ups.upload',
- 'type': 'ir.actions.act_window',
- 'target':'new',
- }
-
- _columns = {
- 'weight': fields.float('Lot weight', required=True),
- }
-
- _defaults = {
- 'weight': lambda *a: 3.0,
- }
-stock_ups()
-
-class stock_ups_final(osv.osv_memory):
- _name = "stock.ups.final"
- _description = "Stock ups final"
-
- def create_xmlfile(self, cr, uid, ids, context=None):
- """ Creates xml report file.
- @return: xml file
- """
- data={}
- report = netsvc._group['report']['report.stock.move.lot.ups_xml']
- data['report_type'] = 'raw'
- return {'xmlfile' : report.create(uid, context['active_id'], ids, {})}
-
- _columns = {
- 'xmlfile': fields.binary('XML File'),
- }
-
-stock_ups_final()
-
-class stock_ups_upload(osv.osv_memory):
- _name = "stock.ups.upload"
- _description = "Stock ups upload"
-
- def upload_xmlfile(self, cr, uid, ids, context=None):
- """ Uploads xml report file.
- @return:
- """
- data={}
- report = netsvc._group['report']['report.stock.move.lot.ups_xml']
- data['report_type'] = 'raw'
- fp = file('/tmp/test.xml', 'w').write(report.create(uid, context['active_id'], ids, {}))
- return {'type': 'ir.actions.act_window_close'}
-
-stock_ups_upload()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/stock_ups_view.xml b/addons/stock/wizard/stock_ups_view.xml
deleted file mode 100644
index cbce721e1b9..00000000000
--- a/addons/stock/wizard/stock_ups_view.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
- Stock ups
- stock.ups
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
- Stock ups
- stock.ups.final
- form
-
-
-
-
-
-
-
-
-
-
-
- Stock ups
- stock.ups.upload
- form
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml
index 2e9e6d2cadc..795da509d04 100644
--- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml
+++ b/addons/stock_invoice_directly/test/stock_invoice_directly.yml
@@ -44,6 +44,7 @@
partial_id = self.create(cr, uid, {}, context={'active_model':'stock.picking',
'active_ids':[ref('stock_picking_out0')]})
self.do_partial(cr, uid, [partial_id])
+
-
As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order.
-
diff --git a/addons/stock_location/__openerp__.py b/addons/stock_location/__openerp__.py
index ba81a42de5a..d50bcc0cac4 100644
--- a/addons/stock_location/__openerp__.py
+++ b/addons/stock_location/__openerp__.py
@@ -96,8 +96,8 @@ You can use the demo data as follow:
],
'installable': True,
'test':[
-# 'test/stock_location_pull_flow.yml',
-# 'test/stock_location_push_flow.yml',
+ 'test/stock_location_pull_flow.yml',
+ 'test/stock_location_push_flow.yml',
],
'active': False,
'certificate': '0046505115101',
diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml
index 557162c725d..dec830b2d77 100644
--- a/addons/stock_location/test/stock_location_pull_flow.yml
+++ b/addons/stock_location/test/stock_location_pull_flow.yml
@@ -28,7 +28,7 @@
I create a account type Receivable.
-
!record {model: account.account.type, id: account_account_type_receivable0}:
- close_method: balance
+ close_method: unreconciled
code: receivable_test
name: Receivable For Tests
sign: 1
@@ -126,7 +126,7 @@
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}:
+ !record {model: product.product, id: product_product_hpcdwriters01}:
categ_id: product_category_computer0
cost_method: standard
list_price: 1000.0
@@ -179,7 +179,7 @@
name: Testing pulled flow
priority: '1'
procure_method: make_to_order
- product_id: product_product_hpcdwriters0
+ product_id: product_product_hpcdwriters01
product_qty: 5.0
product_uom: product.product_uom_unit
product_uos: product.product_uom_unit
@@ -194,15 +194,7 @@
!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 _
- procurement_ids=self.search(cr, uid, [('id', '=', ref('procurement_order_test0'))])
- if procurement_ids:
- order=self.browse(cr,uid,procurement_ids)[0]
- assert(order.state=='cancel')
+
-
I check the new procurement order has been created .
-
diff --git a/addons/stock_location/test/stock_location_push_flow.yml b/addons/stock_location/test/stock_location_push_flow.yml
index db2ae388317..b6a938e99e5 100644
--- a/addons/stock_location/test/stock_location_push_flow.yml
+++ b/addons/stock_location/test/stock_location_push_flow.yml
@@ -33,7 +33,7 @@
I set the chain location Supplier to stock Input
Stock Input to Quality test and Quality test -Stock .
-
- !record {model: product.product, id: product_product_hpcdwriters0}:
+ !record {model: product.product, id: product_product_hpcdwriters01}:
categ_id: product_category_computer0
cost_method: standard
list_price: 1000.0
@@ -72,7 +72,7 @@
location_dest_id: stock.stock_location_stock
location_id: stock.stock_location_suppliers
name: 'HP CD writers'
- product_id: product_product_hpcdwriters0
+ product_id: product_product_hpcdwriters01
product_qty: 6.0
product_uom: product.product_uom_unit
product_uos_qty: 6.0
diff --git a/addons/stock_planning/i18n/fr.po b/addons/stock_planning/i18n/fr.po
index 28e37d8934e..a5dd24c6c6b 100644
--- a/addons/stock_planning/i18n/fr.po
+++ b/addons/stock_planning/i18n/fr.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2011-01-11 11:16+0000\n"
-"PO-Revision-Date: 2011-01-13 22:58+0000\n"
-"Last-Translator: Quentin THEURET \n"
+"PO-Revision-Date: 2011-09-26 12:15+0000\n"
+"Last-Translator: lholivier \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-05 05:51+0000\n"
-"X-Generator: Launchpad (build 13830)\n"
+"X-Launchpad-Export-Date: 2011-09-27 04:47+0000\n"
+"X-Generator: Launchpad (build 14028)\n"
#. module: stock_planning
#: code:addons/stock_planning/wizard/stock_planning_createlines.py:73
@@ -473,7 +473,7 @@ msgstr "Erreur !"
#: code:addons/stock_planning/stock_planning.py:626
#, python-format
msgid "Manual planning for %s"
-msgstr ""
+msgstr "Planification manuelle pour %s"
#. module: stock_planning
#: field:stock.sale.forecast,analyzed_user_id:0
@@ -1648,7 +1648,7 @@ msgstr ""
#. module: stock_planning
#: field:stock.planning,history:0
msgid "Procurement History"
-msgstr "Historique du besoin"
+msgstr "Historique d'approvisionnement"
#. module: stock_planning
#: help:stock.period.createlines,date_start:0
diff --git a/addons/stock_planning/test/stock_planning.yml b/addons/stock_planning/test/stock_planning.yml
index 77f1d5a427d..df2f53dbb6e 100644
--- a/addons/stock_planning/test/stock_planning.yml
+++ b/addons/stock_planning/test/stock_planning.yml
@@ -38,6 +38,18 @@
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)"
+-
+ I validate in open state module stock.period
+-
+ !python {model: stock.period}: |
+ self.button_open(cr, uid, [ref("stock_period_01")], {"lang": 'en_GB', "tz": False, "active_model": 'ir.ui.menu', "active_id": ref("stock_planning.menu_stock_period_main"), "active_ids": [ref("stock_planning.menu_stock_period_main")], "department_id": False})
+
+-
+ I validate in close state module stock.period
+-
+ !python {model: stock.period}: |
+ self.button_close(cr, uid, [ref("stock_period_01")], {"lang": 'en_GB', "tz": False, "active_model": 'ir.ui.menu', "active_id": ref("stock_planning.menu_stock_period_main"), "active_ids": [ref("stock_planning.menu_stock_period_main")], "department_id": False})
+
-
Now I create the forecast for this period for all PCs.
-
@@ -54,6 +66,66 @@
'en_US', "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_sale_forecast_createlines")],
"tz": False, "active_id": ref("stock_planning.menu_stock_sale_forecast_createlines"),
})
+
+-
+ I create stock.period.createlines for the first week of august.
+-
+ !record {model: stock.period.createlines, id: stock_period_createlines_week01}:
+ date_start: !eval "'%s-08-01' %(datetime.now().year)"
+ date_stop: !eval "'%s-08-06' %(datetime.now().year)"
+ name: !eval "'%s, week 31' %(datetime.now().year)"
+
+-
+ Performing an osv_memory action create_stock_periods on module stock.period.createlines
+-
+ !python {model: stock.period.createlines}: |
+ self.create_stock_periods(cr, uid, [ref("stock_period_createlines_week01")], {"lang":
+ 'en_US', "name": 'Weekly', "interval": 6, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_period_creatlines")],
+ "tz": False, "active_id": ref("stock_planning.menu_stock_period_creatlines"),
+ })
+-
+ I create stock.period.createlines for the month of august - september
+-
+ !record {model: stock.period.createlines, id: stock_period_createlines_month01}:
+ date_start: !eval "'%s-08-01' %(datetime.now().year)"
+ date_stop: !eval "'%s-09-01' %(datetime.now().year)"
+ name: !eval "'%s, month 8' %(datetime.now().year)"
+
+-
+ Performing an osv_memory action create_stock_periods on module stock.period.createlines
+-
+ !python {model: stock.period.createlines}: |
+ self.create_stock_periods(cr, uid, [ref("stock_period_createlines_month01")], {"lang":
+ 'en_US', "name": 'Monthly', "interval": 6, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_period_creatlines")],
+ "tz": False, "active_id": ref("stock_planning.menu_stock_period_creatlines"),
+ })
+
+-
+ I create stock.period.createlines for the Day of august
+-
+ !record {model: stock.period.createlines, id: stock_period_createlines_day01}:
+ date_start: !eval "'%s-08-01' %(datetime.now().year)"
+ date_stop: !eval "'%s-08-01' %(datetime.now().year)"
+ name: !eval "'%s, day 01' %(datetime.now().year)"
+
+-
+ Performing an osv_memory action create_stock_periods on module stock.period.createlines
+-
+ !python {model: stock.period.createlines}: |
+ self.create_stock_periods(cr, uid, [ref("stock_period_createlines_day01")], {"lang":
+ 'en_US', "name": 'Daily', "interval": 6, "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_period_creatlines")],
+ "tz": False, "active_id": ref("stock_planning.menu_stock_period_creatlines"),
+ })
+
+-
+ I Read date_start on module stock.period.createlines.
+-
+ !python {model: stock.period.createlines }: |
+ self._get_new_period_start(cr, uid,{"lang":'en_US', "active_model": "ir.ui.menu",
+ "active_ids": [ref("stock_planning.menu_stock_period_creatlines")],
+ "tz": False, "active_id": ref("stock_planning.menu_stock_period_creatlines"),"department_id": False
+ })
+
-
I create a sale order for PC1-Basic PC and PC3-Medium PC.
-
@@ -100,11 +172,29 @@
'analyzed_period1_id': ref("stock_period_03"),
'analyzed_user_id': ref("base.user_root"),
'analyzed_warehouse_id': ref("stock.warehouse0")}
+ context = {"lang": "en_US", "tz":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"), }
self.write(cr, uid, forecast_ids, write_dict)
- self.calculate_sales_history(cr, uid, forecast_ids, {"lang": "en_US", "tz":
+ self.calculate_sales_history(cr, uid, forecast_ids, context)
+ self.action_validate(cr, uid, forecast_ids, context)
+
+-
+ Now I applying onchange and unlink forecast record for the product PC3
+-
+ !python {model: stock.sale.forecast}: |
+ forecast_ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_pc3'))])
+ self.unlink(cr, uid, forecast_ids, {"lang": "en_US", "tz":
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"), })
+ self.product_id_change(cr, uid, forecast_ids, ref('product.product_product_20'))
+ self.onchange_uom(cr, uid, forecast_ids, ref('product.product_uom_unit'), False, ref('product.product_uom_unit'), ref('product.product_product_20'))
+ self.product_amt_change(cr, uid, forecast_ids, 5.0, ref('product.product_uom_unit'), ref('product.product_product_20'))
+ self.product_amt_change(cr, uid, forecast_ids, 5.0, ref('product.product_uom_unit'), ref('product.product_product_20'))
+ self._to_default_uom_factor(cr, uid, ref('product.product_product_20'), ref('product.product_uom_unit'), {})
+ self.onchange_company(cr, uid, forecast_ids, ref('stock.res_company_tinyshop0'))
+
-
I create Master procurement schedule for the third week of July.
-
@@ -113,10 +203,22 @@
period_id: stock_period_03
product_categ_id: product.product_category_pc
warehouse_id: stock.warehouse0
+
+-
+ I create source warehouse for supply from another warehouse.
+-
+ !record {model: stock.warehouse, id: stock_warehouse_0}:
+ name: shop1
+ company_id: base.main_company
+ lot_input_id: stock.stock_location_stock
+ lot_stock_id: stock.stock_location_stock
+ lot_output_id: stock.stock_location_output
+
-
Performing an osv_memory action create_planning on module stock.planning.createlines
-
!python {model: stock.planning.createlines}: |
+ self.onchange_company(cr, uid, ref("stock_planning_createlines_0"), ref('stock.res_company_tinyshop0'))
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")],
"active_id": ref("stock_planning.menu_stock_planning_createlines"), "department_id":
@@ -126,11 +228,17 @@
-
!python {model: stock.planning}: |
planning_ids = self.search(cr, uid, [('product_id','=',ref('product.product_product_pc1')),('period_id','=',ref('stock_period_03'))])
- self.write(cr, uid, planning_ids, {'to_procure': 30.0,'planned_outgoing': 40.0})
- self.calculate_planning(cr, uid, planning_ids, {"lang": "en_US", "tz": False,
- "active_model": "ir.ui.menu", "active_ids": [ref("stock_planning.menu_stock_planning")],
+ self.write(cr, uid, planning_ids, {'to_procure': 30.0,'planned_outgoing': 40.0,'supply_warehouse_id': ref("stock_warehouse_0")})
+ self.onchange_company(cr, uid, planning_ids, ref('stock.res_company_tinyshop0'))
+ self.onchange_uom(cr, uid, planning_ids, ref('product.product_uom_unit'), ref('product.product_product_pc1'),ref('product.product_uom_unit'), False, False)
+ self.product_id_change(cr, uid, planning_ids, ref('product.product_product_20'))
+ context = {"lang": "en_US", "tz": False, "active_model": "ir.ui.menu",
+ "active_ids": [ref("stock_planning.menu_stock_planning")],
"active_id": ref("stock_planning.menu_stock_planning"), "department_id": False,
- })
+ }
+ self.calculate_planning(cr, uid, planning_ids, context)
+ self.internal_supply(cr, uid, planning_ids, context)
+
-
I create a procurement order for the incoming products left.
-
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index 78b824af004..8bce83380b6 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -58,7 +58,7 @@ class survey(osv.osv):
help="Set to one if survey is answerable only once"),
'response_user': fields.integer('Maximum Answer per User',
help="Set to one if you require only one Answer per user"),
- 'state': fields.selection([('draft', 'Draft'), ('open', 'Open'), ('close', 'Closed'), ('cancel', 'Cancelled')], 'Status', readonly=True),
+ 'state': fields.selection([('open', 'Open'), ('close', 'Closed'), ('cancel', 'Cancelled')], 'Status', readonly=True),
'responsible_id': fields.many2one('res.users', 'Responsible', help="User responsible for survey"),
'tot_start_survey': fields.integer("Total Started Survey", readonly=1),
'tot_comp_survey': fields.integer("Total Completed Survey", readonly=1),
@@ -70,17 +70,13 @@ class survey(osv.osv):
'invited_user_ids': fields.many2many('res.users', 'survey_invited_user_rel', 'sid', 'uid', 'Invited User'),
}
_defaults = {
- 'state': lambda * a: "draft",
+ 'state': lambda * a: "open",
'tot_start_survey': lambda * a: 0,
'tot_comp_survey': lambda * a: 0,
'send_response': lambda * a: 1,
'response_user': lambda * a:1,
}
- def survey_draft(self, cr, uid, ids, arg):
- self.write(cr, uid, ids, {'state': 'draft'})
- return True
-
def survey_open(self, cr, uid, ids, arg):
self.write(cr, uid, ids, {'state': 'open', 'date_open': strftime("%Y-%m-%d %H:%M:%S")})
return True
diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml
index 97e8daeb5b4..a351a3da9b4 100644
--- a/addons/survey/survey_demo.xml
+++ b/addons/survey/survey_demo.xml
@@ -2140,7 +2140,7 @@
Community SurveyPlease take a few minutes to complete this survey on the quality of service we provide. We welcome your feedback and appreciate your honesty. With your help, we hope to strengthen the bond between our clients.
- draft
+ open
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index 2345aaa8542..f92ce45a037 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -180,14 +180,12 @@
-
+
-
-
+
diff --git a/addons/thunderbird/thunderbird_installer.xml b/addons/thunderbird/thunderbird_installer.xml
index 2ab1d97fe46..cf23cdf45c1 100644
--- a/addons/thunderbird/thunderbird_installer.xml
+++ b/addons/thunderbird/thunderbird_installer.xml
@@ -75,8 +75,10 @@
{'menu':True}
-
-
+
+
+
+
diff --git a/addons/users_ldap/users_ldap.py b/addons/users_ldap/users_ldap.py
index bddaaeed6ae..7c3bd0d9c17 100644
--- a/addons/users_ldap/users_ldap.py
+++ b/addons/users_ldap/users_ldap.py
@@ -43,7 +43,7 @@ class CompanyLDAP(osv.osv):
'ldap_password': fields.char('LDAP password', size=64,
help=("The password of the user account on the LDAP server that is "
"used to query the directory.")),
- 'ldap_filter': fields.char('LDAP filter', size=64, required=True),
+ 'ldap_filter': fields.char('LDAP filter', size=256, required=True),
'ldap_base': fields.char('LDAP base', size=64, required=True),
'user': fields.many2one('res.users', 'Model User',
help="Model used for user creation"),