diff options
| author | Jigar Amin - OpenERP <jam@tinyerp.com> | 2011-09-30 13:49:38 +0530 |
|---|---|---|
| committer | Jigar Amin - OpenERP <jam@tinyerp.com> | 2011-09-30 13:49:38 +0530 |
| commit | 07d867c8ba7d00a86eea0fabc188679c6d735bcb (patch) | |
| tree | 49b2896d77104fb9ad67ebb5d648222faf54f713 | |
| parent | 1a4a2b4dd8feb0e7d861eae0656b60e0d6e4cdcf (diff) | |
| parent | 8507f7cc4a446da13a83abf5ff711a730bc60e8c (diff) | |
[MERGE] lp:openobject-addons
bzr revid: jam@tinyerp.com-20110930081938-038gqqc9km9u2l98
146 files changed, 5504 insertions, 4051 deletions
diff --git a/addons/account/account.py b/addons/account/account.py index 41d4673df0a..34306b703aa 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -722,8 +722,6 @@ class account_journal(osv.osv): name = rs.name if rs.currency: name = "%s (%s)" % (rs.name, rs.currency.name) - else: - name = "%s (%s)" % (rs.name, rs.company_id.currency_id.name) res += [(rs.id, name)] return res @@ -932,17 +930,10 @@ class account_period(osv.osv): return False def find(self, cr, uid, dt=None, context=None): - if context is None: context = {} if not dt: dt = time.strftime('%Y-%m-%d') #CHECKME: shouldn't we check the state of the period? - args = [('date_start', '<=' ,dt), ('date_stop', '>=', dt)] - if context.get('company_id', False): - args.append(('company_id', '=', context['company_id'])) - else: - company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id - args.append(('company_id', '=', company_id)) - ids = self.search(cr, uid, args, context=context) + ids = self.search(cr, uid, [('date_start','<=',dt),('date_stop','>=',dt)]) if not ids: raise osv.except_osv(_('Error !'), _('No period defined for this date: %s !\nPlease create one.')%dt) return ids @@ -1265,7 +1256,7 @@ class account_move(osv.osv): context = {} c = context.copy() c['novalidate'] = True - result = super(osv.osv, self).write(cr, uid, ids, vals, c) + result = super(account_move, self).write(cr, uid, ids, vals, c) self.validate(cr, uid, ids, context=context) return result diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 09a90b98686..11ec7d8360a 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -234,7 +234,6 @@ <field name="payment_ids" colspan="4" nolabel="1" > <tree string="Payments"> <field name="date" string="Payment Date"/> - <field name="move_id"/> <field name="ref"/> <field name="name" groups="base.group_extended"/> <field name="journal_id"/> @@ -333,7 +332,6 @@ <field name="payment_ids" colspan="4" nolabel="1"> <tree string="Payments"> <field name="date"/> - <field name="move_id"/> <field name="ref"/> <field name="name"/> <field name="journal_id" groups="base.group_user"/> diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index a7b2633504d..1322226bfb6 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -718,7 +718,7 @@ class account_move_line(osv.osv): ) return cr.fetchone() - def reconcile_partial(self, cr, uid, ids, type='auto', context=None): + def reconcile_partial(self, cr, uid, ids, type='auto', context=None, writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False): move_rec_obj = self.pool.get('account.move.reconcile') merges = [] unmerge = [] @@ -747,7 +747,7 @@ class account_move_line(osv.osv): unmerge.append(line.id) total += (line.debit or 0.0) - (line.credit or 0.0) if self.pool.get('res.currency').is_zero(cr, uid, company_currency_id, total): - res = self.reconcile(cr, uid, merges+unmerge, context=context) + res = self.reconcile(cr, uid, merges+unmerge, context=context, writeoff_acc_id=writeoff_acc_id, writeoff_period_id=writeoff_period_id, writeoff_journal_id=writeoff_journal_id) return res r_id = move_rec_obj.create(cr, uid, { 'type': type, @@ -812,7 +812,7 @@ class account_move_line(osv.osv): if (not currency_obj.is_zero(cr, uid, account.company_id.currency_id, writeoff)) or \ (account.currency_id and (not currency_obj.is_zero(cr, uid, account.currency_id, currency))): if not writeoff_acc_id: - raise osv.except_osv(_('Warning'), _('You have to provide an account for the write off entry !')) + raise osv.except_osv(_('Warning'), _('You have to provide an account for the write off/exchange difference entry !')) if writeoff > 0: debit = writeoff credit = 0.0 @@ -1249,7 +1249,7 @@ class account_move_line(osv.osv): break # Automatically convert in the account's secondary currency if there is one and # the provided values were not already multi-currency - if account.currency_id and 'amount_currency' not in vals and account.currency_id.id != account.company_id.currency_id.id: + if account.currency_id and not vals.get('ammount_currency') and account.currency_id.id != account.company_id.currency_id.id: vals['currency_id'] = account.currency_id.id ctx = {} if 'date' in vals: @@ -1273,7 +1273,7 @@ class account_move_line(osv.osv): 'user_id': uid })] - result = super(osv.osv, self).create(cr, uid, vals, context=context) + result = super(account_move_line, self).create(cr, uid, vals, context=context) # CREATE Taxes if vals.get('account_tax_id', False): tax_id = tax_obj.browse(cr, uid, vals['account_tax_id']) diff --git a/addons/account/company.py b/addons/account/company.py index bbbb8aa60c8..c903b6d4a71 100644 --- a/addons/account/company.py +++ b/addons/account/company.py @@ -32,7 +32,7 @@ class res_company(osv.osv): string="Reserve and Profit/Loss Account", view_load=True, domain="[('type', '=', 'other')]", - help="This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profit & Loss Report"), + help="This account is used for transferring Profit/Loss (If It is Profit: Amount will be added, Loss : Amount will be deducted.), as calculated in Profit & Loss Report"), } _defaults = { diff --git a/addons/account/configurable_account_chart.xml b/addons/account/configurable_account_chart.xml index d947a06dd0e..3ab6d3975a2 100644 --- a/addons/account/configurable_account_chart.xml +++ b/addons/account/configurable_account_chart.xml @@ -87,7 +87,7 @@ <record model="account.account.type" id="conf_account_type_equity"> <field name="name">Equity</field> <field name="code">equity</field> - <field name="report_type">asset</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index cadd590eb2d..8afb41f1e8d 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -49,7 +49,7 @@ <record id="account_type_cash_equity" model="account.account.type"> <field name="name">Equity</field> <field name="code">equity</field> - <field name="report_type">asset</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> <record id="account_type_cash_moves" model="account.account.type"> diff --git a/addons/account/i18n/et.po b/addons/account/i18n/et.po index 6c6a6385ec9..b671a24e720 100644 --- a/addons/account/i18n/et.po +++ b/addons/account/i18n/et.po @@ -7,24 +7,24 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2010-12-12 00:12+0000\n" -"Last-Translator: qdp (OpenERP) <qdp-launchpad@tinyerp.com>\n" +"PO-Revision-Date: 2011-09-28 14:57+0000\n" +"Last-Translator: Raiko Pajur <Unknown>\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-17 04:56+0000\n" -"X-Generator: Launchpad (build 13955)\n" +"X-Launchpad-Export-Date: 2011-09-30 04:40+0000\n" +"X-Generator: Launchpad (build 14071)\n" #. module: account #: model:process.transition,name:account.process_transition_supplierreconcilepaid0 msgid "System payment" -msgstr "" +msgstr "Süsteemi maksed" #. module: account #: view:account.journal:0 msgid "Other Configuration" -msgstr "" +msgstr "Muud konfiguratsioonid" #. module: account #: code:addons/account/wizard/account_open_closed_fiscalyear.py:40 @@ -39,6 +39,8 @@ msgid "" "You cannot remove/deactivate an account which is set as a property to any " "Partner." msgstr "" +"Sa ei saa kustutada / desaktiveerida kontot, mis on määratud mis tahes " +"\"Partner\" varaks." #. module: account #: view:account.move.reconcile:0 @@ -48,7 +50,7 @@ msgstr "" #. module: account #: field:account.installer.modules,account_voucher:0 msgid "Voucher Management" -msgstr "" +msgstr "Voucheri juhtimine" #. module: account #: view:account.account:0 @@ -133,13 +135,13 @@ msgstr "Raamatupidamise kirjed-" #: code:addons/account/account.py:1291 #, python-format msgid "You can not delete posted movement: \"%s\"!" -msgstr "" +msgstr "Sa ei saa kustutada postitatud liikumist: \"%s\"!" #. module: account #: report:account.invoice:0 #: field:account.invoice.line,origin:0 msgid "Origin" -msgstr "Päritolu" +msgstr "Allikas" #. module: account #: view:account.account:0 @@ -164,7 +166,7 @@ msgstr "Viide" #. module: account #: view:account.open.closed.fiscalyear:0 msgid "Choose Fiscal Year " -msgstr "" +msgstr "Vali eelarveaasta " #. module: account #: help:account.payment.term,active:0 @@ -172,12 +174,14 @@ msgid "" "If the active field is set to False, it will allow you to hide the payment " "term without removing it." msgstr "" +"Kui aktiivne ala on väärne ( False ), siis see võimaldab teil peita/varjata " +"maksetähtaeg seda kustutamata." #. module: account #: code:addons/account/invoice.py:1421 #, python-format msgid "Warning!" -msgstr "" +msgstr "Hoiatus!" #. module: account #: field:account.fiscal.position.account,account_src_id:0 @@ -204,7 +208,7 @@ msgstr "Negatiivne" #: code:addons/account/wizard/account_move_journal.py:95 #, python-format msgid "Journal: %s" -msgstr "" +msgstr "Päevik: %s" #. module: account #: help:account.analytic.journal,type:0 @@ -231,7 +235,7 @@ msgstr "konto.maks" msgid "" "No period defined for this date: %s !\n" "Please create a fiscal year." -msgstr "" +msgstr "Periood ei ole defineeritud sellele kuupäevale: %s" #. module: account #: model:ir.model,name:account.model_account_move_line_reconcile_select @@ -259,7 +263,7 @@ msgstr "" #: code:addons/account/invoice.py:1210 #, python-format msgid "Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)" -msgstr "" +msgstr "Arve '%s' on makstud osaliselt: %s%s on tasutud %s%s (%s%s maksmata)" #. module: account #: model:process.transition,note:account.process_transition_supplierentriesreconcile0 @@ -280,7 +284,7 @@ msgstr "Teie ei saa lisada/muuta suletud päeviku kirjeid." #. module: account #: view:account.bank.statement:0 msgid "Calculated Balance" -msgstr "" +msgstr "Välja arvutatud tasakaal (Calculated Balance)" #. module: account #: model:ir.actions.act_window,name:account.action_account_use_model_create_entry @@ -352,7 +356,7 @@ msgstr "Ostu omadused" #: view:account.installer:0 #: view:account.installer.modules:0 msgid "Configure" -msgstr "" +msgstr "Seadista" #. module: account #: selection:account.entries.report,month:0 @@ -361,7 +365,7 @@ msgstr "" #: selection:report.account.sales,month:0 #: selection:report.account_type.sales,month:0 msgid "June" -msgstr "" +msgstr "Juuni" #. module: account #: model:ir.actions.act_window,help:account.action_account_moves_bank @@ -395,12 +399,12 @@ msgstr "" #. module: account #: selection:account.journal,type:0 msgid "Opening/Closing Situation" -msgstr "" +msgstr "Avamise/Sulgemise situatsioon" #. module: account #: help:account.journal,currency:0 msgid "The currency used to enter statement" -msgstr "" +msgstr "Valuuta väite sisestamiseks" #. module: account #: field:account.open.closed.fiscalyear,fyear_id:0 @@ -498,17 +502,17 @@ msgstr "Päevik" #. module: account #: model:ir.model,name:account.model_account_invoice_confirm msgid "Confirm the selected invoices" -msgstr "" +msgstr "Kinnita valitud arved" #. module: account #: field:account.addtmpl.wizard,cparent_id:0 msgid "Parent target" -msgstr "" +msgstr "Lapsevanema sihtmärk" #. module: account #: field:account.bank.statement,account_id:0 msgid "Account used in this journal" -msgstr "" +msgstr "Konto kasutatud selles arveraamatus" #. module: account #: help:account.aged.trial.balance,chart_account_id:0 @@ -527,7 +531,7 @@ msgstr "" #: help:account.report.general.ledger,chart_account_id:0 #: help:account.vat.declaration,chart_account_id:0 msgid "Select Charts of Accounts" -msgstr "" +msgstr "Vali Kontode graafikud" #. module: account #: view:product.product:0 @@ -537,7 +541,7 @@ msgstr "Ostumaksud" #. module: account #: model:ir.model,name:account.model_account_invoice_refund msgid "Invoice Refund" -msgstr "" +msgstr "Arveraamatu tagasimakse" #. module: account #: report:account.overdue:0 @@ -560,7 +564,7 @@ msgstr "" #: field:account.fiscal.position,tax_ids:0 #: field:account.fiscal.position.template,tax_ids:0 msgid "Tax Mapping" -msgstr "" +msgstr "Maksude kaardistamine" #. module: account #: model:ir.actions.act_window,name:account.action_account_fiscalyear_close_state @@ -571,7 +575,7 @@ msgstr "Sule majandusaasta" #. module: account #: model:process.transition,note:account.process_transition_confirmstatementfromdraft0 msgid "The accountant confirms the statement." -msgstr "" +msgstr "Raamatupidaja kinnitab selle avalduse" #. module: account #: selection:account.balance.report,display_account:0 @@ -587,12 +591,12 @@ msgstr "Kõik" #. module: account #: field:account.invoice.report,address_invoice_id:0 msgid "Invoice Address Name" -msgstr "" +msgstr "Arveraamatu Aadressi Nimi" #. module: account #: selection:account.installer,period:0 msgid "3 Monthly" -msgstr "" +msgstr "Iga 3 kuu tagant" #. module: account #: view:account.unreconcile.reconcile:0 @@ -604,7 +608,7 @@ msgstr "" #. module: account #: view:analytic.entries.report:0 msgid " 30 Days " -msgstr "" +msgstr " 30 päeva " #. module: account #: field:ir.sequence,fiscal_ids:0 @@ -624,7 +628,7 @@ msgstr "" #. module: account #: sql_constraint:account.sequence.fiscalyear:0 msgid "Main Sequence must be different from current !" -msgstr "" +msgstr "Pea" #. module: account #: field:account.invoice.tax,tax_amount:0 @@ -652,12 +656,12 @@ msgstr "Sulge periood" #. module: account #: model:ir.model,name:account.model_account_common_partner_report msgid "Account Common Partner Report" -msgstr "" +msgstr "Konto tava \"Partner\" aruanne" #. module: account #: field:account.fiscalyear.close,period_id:0 msgid "Opening Entries Period" -msgstr "" +msgstr "Avatud sissekanete periood" #. module: account #: model:ir.model,name:account.model_account_journal_period @@ -791,7 +795,7 @@ msgstr "J.C./liiguta nime" #: selection:report.account.sales,month:0 #: selection:report.account_type.sales,month:0 msgid "September" -msgstr "" +msgstr "September" #. module: account #: selection:account.subscription,period_type:0 @@ -802,7 +806,7 @@ msgstr "päevad" #: help:account.account.template,nocreate:0 msgid "" "If checked, the new chart of accounts will not contain this by default." -msgstr "" +msgstr "Kui märgitud, siis uus kontode graafik ei sisalda seda puudujääki." #. module: account #: code:addons/account/wizard/account_invoice_refund.py:102 @@ -825,7 +829,7 @@ msgstr "Arvutus" #. module: account #: view:account.move.line:0 msgid "Next Partner to reconcile" -msgstr "" +msgstr "Kooskõlastama järgmise \"Partner\"-iga" #. module: account #: code:addons/account/account_move_line.py:1191 @@ -834,12 +838,14 @@ msgid "" "You can not do this modification on a confirmed entry ! Please note that you " "can just change some non important fields !" msgstr "" +"Teie ei saa teha see muudatus kinnitatud kirjel ! Teie saate muuta ainult " +"mõned vähetähtsad väljad !" #. module: account #: view:account.invoice.report:0 #: field:account.invoice.report,delay_to_pay:0 msgid "Avg. Delay To Pay" -msgstr "" +msgstr "Keskmine viivitus maksete tegemisel" #. module: account #: model:ir.actions.act_window,name:account.action_account_tax_chart @@ -862,7 +868,7 @@ msgstr "Tähtaeg" #: view:account.invoice.report:0 #: field:account.invoice.report,price_total_tax:0 msgid "Total With Tax" -msgstr "" +msgstr "Kokku koos maksudega" #. module: account #: view:account.invoice:0 @@ -870,7 +876,7 @@ msgstr "" #: view:validate.account.move:0 #: view:validate.account.move.lines:0 msgid "Approve" -msgstr "" +msgstr "Nõustu" #. module: account #: view:account.invoice:0 @@ -925,7 +931,7 @@ msgstr "" #. module: account #: view:account.analytic.line:0 msgid "Purchases" -msgstr "" +msgstr "Ostud" #. module: account #: field:account.model,lines_id:0 @@ -972,7 +978,7 @@ msgstr "Partneri bilanss" #. module: account #: field:account.bank.accounts.wizard,acc_name:0 msgid "Account Name." -msgstr "" +msgstr "Konto nimi." #. module: account #: field:account.chart.template,property_reserve_and_surplus_account:0 @@ -983,7 +989,7 @@ msgstr "" #. module: account #: field:report.account.receivable,name:0 msgid "Week of Year" -msgstr "" +msgstr "Nädal" #. module: account #: field:account.bs.report,display_type:0 @@ -995,12 +1001,12 @@ msgstr "Rõhtpaigutus" #. module: account #: view:board.board:0 msgid "Customer Invoices to Approve" -msgstr "" +msgstr "Kliendi arved kinnitamiseks" #. module: account #: help:account.fiscalyear.close,fy_id:0 msgid "Select a Fiscal year to close" -msgstr "" +msgstr "Vali eelarve aasta mida sulgeda" #. module: account #: help:account.account,user_type:0 @@ -1018,13 +1024,13 @@ msgstr "" #. module: account #: report:account.partner.balance:0 msgid "In dispute" -msgstr "" +msgstr "Vaidlustatav" #. module: account #: model:ir.actions.act_window,name:account.action_view_bank_statement_tree #: model:ir.ui.menu,name:account.journal_cash_move_lines msgid "Cash Registers" -msgstr "" +msgstr "Raha register" #. module: account #: selection:account.account.type,report_type:0 @@ -1042,7 +1048,7 @@ msgstr "-" #. module: account #: view:account.analytic.account:0 msgid "Manager" -msgstr "" +msgstr "Juhataja" #. module: account #: view:account.subscription.generate:0 @@ -1052,7 +1058,7 @@ msgstr "" #. module: account #: selection:account.bank.accounts.wizard,account_type:0 msgid "Bank" -msgstr "" +msgstr "Pank" #. module: account #: field:account.period,date_start:0 @@ -1062,13 +1068,13 @@ msgstr "Perioodi algus" #. module: account #: model:process.transition,name:account.process_transition_confirmstatementfromdraft0 msgid "Confirm statement" -msgstr "" +msgstr "Kinnita avaldus" #. module: account #: field:account.fiscal.position.tax,tax_dest_id:0 #: field:account.fiscal.position.tax.template,tax_dest_id:0 msgid "Replacement Tax" -msgstr "" +msgstr "Vahetus maks" #. module: account #: selection:account.move.line,centralisation:0 @@ -1087,12 +1093,12 @@ msgstr "" #. module: account #: view:account.invoice.cancel:0 msgid "Cancel Invoices" -msgstr "" +msgstr "Peata arved" #. module: account #: view:account.unreconcile.reconcile:0 msgid "Unreconciliation transactions" -msgstr "" +msgstr "Mittesobivad tehingud" #. module: account #: field:account.invoice.tax,tax_code_id:0 @@ -1110,7 +1116,7 @@ msgstr "" #. module: account #: help:account.move.line,move_id:0 msgid "The move of this entry line." -msgstr "" +msgstr "Selle rea liigutus." #. module: account #: field:account.move.line.reconcile,trans_nbr:0 @@ -1174,7 +1180,7 @@ msgstr "Konto" #. module: account #: field:account.tax,include_base_amount:0 msgid "Included in base amount" -msgstr "" +msgstr "Lisa baas osa" #. module: account #: view:account.entries.report:0 @@ -1186,7 +1192,7 @@ msgstr "" #. module: account #: field:account.account,level:0 msgid "Level" -msgstr "" +msgstr "Tase" #. module: account #: report:account.invoice:0 @@ -1207,7 +1213,7 @@ msgstr "Maksud" #: code:addons/account/wizard/account_report_common.py:120 #, python-format msgid "Select a starting and an ending period" -msgstr "" +msgstr "Vali algus ja lõpp periood" #. module: account #: model:ir.model,name:account.model_account_account_template @@ -1217,12 +1223,12 @@ msgstr "Mallid kontodele" #. module: account #: view:account.tax.code.template:0 msgid "Search tax template" -msgstr "" +msgstr "Otsi maksu templati" #. module: account #: report:account.invoice:0 msgid "Your Reference" -msgstr "" +msgstr "Teie viide" #. module: account #: view:account.move.reconcile:0 @@ -1246,7 +1252,7 @@ msgstr "" #. module: account #: view:account.invoice:0 msgid "Reset to Draft" -msgstr "" +msgstr "Lähtesta mustandiks" #. module: account #: view:wizard.multi.charts.accounts:0 @@ -1268,7 +1274,7 @@ msgstr "" #: model:ir.actions.act_window,name:account.action_partner_all #: model:ir.ui.menu,name:account.next_id_22 msgid "Partners" -msgstr "" +msgstr "Partnerid" #. module: account #: view:account.bank.statement:0 @@ -1323,7 +1329,7 @@ msgstr "Bilanss pole 0" #. module: account #: view:account.tax:0 msgid "Search Taxes" -msgstr "" +msgstr "Otsi maksu" #. module: account #: model:ir.model,name:account.model_account_analytic_cost_ledger @@ -1338,7 +1344,7 @@ msgstr "Loo sissekanded" #. module: account #: field:account.entries.report,nbr:0 msgid "# of Items" -msgstr "" +msgstr "# detaile" #. module: account #: field:account.automatic.reconcile,max_amount:0 @@ -1353,7 +1359,7 @@ msgstr "Arvuta maksud" #. module: account #: field:wizard.multi.charts.accounts,code_digits:0 msgid "# of Digits" -msgstr "" +msgstr "# numbrit" #. module: account #: field:account.journal,entry_posted:0 @@ -1364,7 +1370,7 @@ msgstr "" #: view:account.invoice.report:0 #: field:account.invoice.report,price_total:0 msgid "Total Without Tax" -msgstr "" +msgstr "Kokku ilma maksudeta" #. module: account #: model:ir.actions.act_window,help:account.action_move_journal_line @@ -1378,7 +1384,7 @@ msgstr "" #. module: account #: view:account.entries.report:0 msgid "# of Entries " -msgstr "" +msgstr "# sisestusi " #. module: account #: model:ir.model,name:account.model_temp_range @@ -1435,7 +1441,7 @@ msgstr "Mall finantspositsioonile" #. module: account #: model:account.tax.code,name:account.account_tax_code_0 msgid "Tax Code Test" -msgstr "" +msgstr "Maksu koodi test" #. module: account #: field:account.automatic.reconcile,reconciled:0 @@ -1445,22 +1451,22 @@ msgstr "" #. module: account #: field:account.journal.view,columns_id:0 msgid "Columns" -msgstr "" +msgstr "Veerud" #. module: account #: report:account.overdue:0 msgid "." -msgstr "" +msgstr "." #. module: account #: view:account.analytic.cost.ledger.journal.report:0 msgid "and Journals" -msgstr "" +msgstr "ja arveraamatud" #. module: account #: field:account.journal,groups_id:0 msgid "Groups" -msgstr "" +msgstr "Grupid" #. module: account #: field:account.invoice,amount_untaxed:0 @@ -1471,18 +1477,20 @@ msgstr "Maksuvaba" #. module: account #: view:account.partner.reconcile.process:0 msgid "Go to next partner" -msgstr "" +msgstr "Mine järgmise \"Partner\"-ile" #. module: account #: view:account.bank.statement:0 msgid "Search Bank Statements" -msgstr "" +msgstr "Otsi panga avaldust" #. module: account #: sql_constraint:account.model.line:0 msgid "" "Wrong credit or debit value in model (Credit + Debit Must Be greater \"0\")!" msgstr "" +"Vale krediidi või deebeti arv mudelis ( Krediit + Deebet Peab olema suurem " +"kui \"0\" ) !" #. module: account #: view:account.chart.template:0 @@ -1516,14 +1524,14 @@ msgstr "" #. module: account #: report:account.analytic.account.cost_ledger:0 msgid "Date/Code" -msgstr "" +msgstr "Kuupäev/Kood" #. module: account #: field:account.analytic.line,general_account_id:0 #: view:analytic.entries.report:0 #: field:analytic.entries.report,general_account_id:0 msgid "General Account" -msgstr "" +msgstr "Üldine konto" #. module: account #: field:res.partner,debit_limit:0 @@ -1554,13 +1562,13 @@ msgstr "" #. module: account #: field:wizard.multi.charts.accounts,seq_journal:0 msgid "Separated Journal Sequences" -msgstr "" +msgstr "Eraldatud päeviku järjekorrad" #. module: account #: field:account.bank.statement,user_id:0 #: view:account.invoice:0 msgid "Responsible" -msgstr "" +msgstr "Vastutav" #. module: account #: report:account.overdue:0 @@ -1570,7 +1578,7 @@ msgstr "Vahesumma:" #. module: account #: model:ir.actions.act_window,name:account.action_report_account_type_sales_tree_all msgid "Sales by Account Type" -msgstr "" +msgstr "Müügid konto järgi" #. module: account #: view:account.invoice.refund:0 @@ -1582,7 +1590,7 @@ msgstr "" #. module: account #: model:ir.ui.menu,name:account.periodical_processing_invoicing msgid "Invoicing" -msgstr "" +msgstr "Arveldamine" #. module: account #: field:account.chart.template,tax_code_root_id:0 @@ -1598,17 +1606,17 @@ msgstr "Kaasa algsed" #. module: account #: field:account.tax.code,sum:0 msgid "Year Sum" -msgstr "" +msgstr "Aasta kokkuvõtte" #. module: account #: model:ir.actions.report.xml,name:account.report_account_voucher_new msgid "Print Voucher" -msgstr "" +msgstr "Prindi voucher" #. module: account #: view:account.change.currency:0 msgid "This wizard will change the currency of the invoice" -msgstr "" +msgstr "See wizard muudab valuuta arvelduses" #. module: account #: model:ir.actions.act_window,help:account.action_account_chart @@ -1632,7 +1640,7 @@ msgstr "" #. module: account #: field:account.cashbox.line,pieces:0 msgid "Values" -msgstr "" +msgstr "Väärtused" #. module: account #: help:account.journal.period,active:0 @@ -1675,7 +1683,7 @@ msgstr "" #. module: account #: report:account.move.voucher:0 msgid "Ref. :" -msgstr "" +msgstr "Viide:" #. module: account #: view:account.analytic.chart:0 @@ -1685,7 +1693,7 @@ msgstr "Analüütilised kontoplaanid" #. module: account #: view:account.analytic.line:0 msgid "My Entries" -msgstr "" +msgstr "Minu sisestused" #. module: account #: report:account.overdue:0 @@ -1696,7 +1704,7 @@ msgstr "Kliendi viide:" #: code:addons/account/account_cash_statement.py:328 #, python-format msgid "User %s does not have rights to access %s journal !" -msgstr "" +msgstr "Kasutajal %s ei ole õigusi et siseneda %s arveraamatusse !" #. module: account #: help:account.period,special:0 @@ -1717,12 +1725,12 @@ msgstr "" #: code:addons/account/account.py:499 #, python-format msgid "You cannot deactivate an account that contains account moves." -msgstr "" +msgstr "Sa ei saa deaktiveerida kontot mis sisaldab konto liikumisi." #. module: account #: field:account.move.line.reconcile,credit:0 msgid "Credit amount" -msgstr "" +msgstr "Kreedidi kogus" #. module: account #: constraint:account.move.line:0 @@ -1745,7 +1753,7 @@ msgstr "" #. module: account #: sql_constraint:account.move.line:0 msgid "Wrong credit or debit value in accounting entry !" -msgstr "" +msgstr "Vale kreedit või deebeti raamatupidamise sisend !" #. module: account #: view:account.invoice.report:0 @@ -1757,7 +1765,7 @@ msgstr "" #. module: account #: model:ir.model,name:account.model_account_period_close msgid "period close" -msgstr "" +msgstr "Periood suletud" #. module: account #: view:account.installer:0 @@ -1767,18 +1775,18 @@ msgstr "" #. module: account #: model:ir.actions.act_window,name:account.action_project_account_analytic_line_form msgid "Entries By Line" -msgstr "" +msgstr "SIsestused ridade kaupa" #. module: account #: report:account.tax.code.entries:0 msgid "A/c Code" -msgstr "" +msgstr "A/c kood" #. module: account #: field:account.invoice,move_id:0 #: field:account.invoice,move_name:0 msgid "Journal Entry" -msgstr "" +msgstr "Päevaraamatu kanne" #. module: account #: view:account.tax:0 @@ -1788,7 +1796,7 @@ msgstr "" #. module: account #: field:account.cashbox.line,subtotal:0 msgid "Sub Total" -msgstr "" +msgstr "Vahesumma" #. module: account #: view:account.account:0 @@ -1798,7 +1806,7 @@ msgstr "" #. module: account #: constraint:res.company:0 msgid "Error! You can not create recursive companies." -msgstr "" +msgstr "Viga! Sa ei saa luua rekursiivseid ettevõtteid." #. module: account #: view:account.analytic.account:0 @@ -1821,12 +1829,12 @@ msgstr "Kehtiv" #: model:ir.actions.act_window,name:account.action_account_print_journal #: model:ir.model,name:account.model_account_print_journal msgid "Account Print Journal" -msgstr "" +msgstr "Prindi konto arveraamat" #. module: account #: model:ir.model,name:account.model_product_category msgid "Product Category" -msgstr "" +msgstr "Toote kategooria" #. module: account #: selection:account.account.type,report_type:0 @@ -1836,7 +1844,7 @@ msgstr "/" #. module: account #: field:account.bs.report,reserve_account_id:0 msgid "Reserve & Profit/Loss Account" -msgstr "" +msgstr "Reservi & kasumi/kahjumi konto" #. module: account #: help:account.bank.statement,balance_end:0 diff --git a/addons/account/i18n/zh_TW.po b/addons/account/i18n/zh_TW.po index e054121df59..21498f1c100 100644 --- a/addons/account/i18n/zh_TW.po +++ b/addons/account/i18n/zh_TW.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:14+0000\n" -"PO-Revision-Date: 2010-12-11 23:34+0000\n" -"Last-Translator: BlueT - Matthew Lien - 練喆明 <bluet@ubuntu-tw.org>\n" +"PO-Revision-Date: 2011-09-27 10:01+0000\n" +"Last-Translator: Walter Cheuk <wwycheuk@gmail.com>\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-17 05:02+0000\n" -"X-Generator: Launchpad (build 13955)\n" +"X-Launchpad-Export-Date: 2011-09-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" #. module: account #: model:process.transition,name:account.process_transition_supplierreconcilepaid0 @@ -48,7 +48,7 @@ msgstr "" #. module: account #: field:account.installer.modules,account_voucher:0 msgid "Voucher Management" -msgstr "" +msgstr "換票券管理" #. module: account #: view:account.account:0 @@ -3550,7 +3550,7 @@ msgstr "" #: view:product.template:0 #: view:res.partner:0 msgid "Accounting" -msgstr "账号" +msgstr "會計" #. module: account #: help:account.central.journal,amount_currency:0 @@ -6779,7 +6779,7 @@ msgstr "" #: field:account.invoice.tax,invoice_id:0 #: model:ir.model,name:account.model_account_invoice_line msgid "Invoice Line" -msgstr "发票行" +msgstr "發票明細" #. module: account #: field:account.balance.report,display_account:0 @@ -6788,7 +6788,7 @@ msgstr "发票行" #: field:account.pl.report,display_account:0 #: field:account.report.general.ledger,display_account:0 msgid "Display accounts" -msgstr "" +msgstr "顯示帳號" #. module: account #: field:account.account.type,sign:0 @@ -9305,7 +9305,7 @@ msgstr "" #. module: account #: field:account.invoice,invoice_line:0 msgid "Invoice Lines" -msgstr "发票行" +msgstr "發票明細" #. module: account #: constraint:account.account.template:0 diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 3747ef978a8..834da02d1b4 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -209,7 +209,7 @@ class account_invoice(osv.osv): \n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \ \n* The \'Paid\' state is set automatically when invoice is paid.\ \n* The \'Cancelled\' state is used when user cancel invoice.'), - 'date_invoice': fields.date('Invoice Date', readonly=True, states={'draft':[('readonly',False)]}, select=True, help="Keep empty to use the current date"), + 'date_invoice': fields.date('Invoice Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, help="Keep empty to use the current date"), 'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, help="If you use payment terms, the due date will be computed automatically at the generation "\ "of accounting entries. If you keep the payment term and the due date empty, it means direct payment. The payment term may compute several due dates, for example 50% now, 50% in one month."), diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py index 93208532e45..186d39c4859 100644 --- a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py +++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py @@ -29,7 +29,7 @@ class account_analytic_cost_ledger_journal_report(osv.osv_memory): _columns = { 'date1': fields.date('Start of period', required=True), 'date2': fields.date('End of period', required=True), - 'journal': fields.many2many('account.analytic.journal', 'ledger_journal_rel', 'ledger_id', 'Journal_id', 'Journals'), + 'journal': fields.many2many('account.analytic.journal', 'ledger_journal_rel', 'ledger_id', 'journal_id', 'Journals'), } _defaults = { diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml index d5bb6bada65..40ba7ea7127 100644 --- a/addons/account/test/account_report.yml +++ b/addons/account/test/account_report.yml @@ -147,7 +147,7 @@ !python {model: account.account}: | ctx={} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) - data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False} + data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all'} from tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account') - @@ -156,7 +156,7 @@ !python {model: account.account}: | ctx={} ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]}) - data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True} + data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True,'target_move': 'all'} from tools import test_reports test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account') - diff --git a/addons/account/wizard/account_report_account_balance.py b/addons/account/wizard/account_report_account_balance.py index a72d58dd904..4e52066b49e 100644 --- a/addons/account/wizard/account_report_account_balance.py +++ b/addons/account/wizard/account_report_account_balance.py @@ -19,13 +19,17 @@ # ############################################################################## -from osv import osv +from osv import osv, fields class account_balance_report(osv.osv_memory): _inherit = "account.common.account.report" _name = 'account.balance.report' _description = 'Trial Balance Report' + _columns = { + 'journal_ids': fields.many2many('account.journal', 'account_balance_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), + } + _defaults = { 'journal_ids': [], } diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py index 4e6c6dea752..9b89b30c93b 100644 --- a/addons/account/wizard/account_report_aged_partner_balance.py +++ b/addons/account/wizard/account_report_aged_partner_balance.py @@ -35,6 +35,7 @@ class account_aged_trial_balance(osv.osv_memory): 'direction_selection': fields.selection([('past','Past'), ('future','Future')], 'Analysis Direction', required=True), + 'journal_ids': fields.many2many('account.journal', 'account_aged_trial_balance_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), } _defaults = { 'period_length': 30, diff --git a/addons/account/wizard/account_report_balance_sheet.py b/addons/account/wizard/account_report_balance_sheet.py index 873ede3832c..01a89168a43 100644 --- a/addons/account/wizard/account_report_balance_sheet.py +++ b/addons/account/wizard/account_report_balance_sheet.py @@ -40,11 +40,9 @@ class account_bs_report(osv.osv_memory): _columns = { 'display_type': fields.boolean("Landscape Mode"), 'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account', - required=True, - help='This Account is used for transfering Profit/Loss ' \ - '(Profit: Amount will be added, Loss: Amount will be duducted), ' \ - 'which is calculated from Profilt & Loss Report', + help='This account is used for transferring Profit/Loss (If It is Profit: Amount will be added, Loss : Amount will be deducted.), as calculated in Profit & Loss Report', domain = [('type','=','other')]), + 'journal_ids': fields.many2many('account.journal', 'account_bs_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), } _defaults={ diff --git a/addons/account/wizard/account_report_balance_sheet_view.xml b/addons/account/wizard/account_report_balance_sheet_view.xml index 22a6e0608b2..faac52388a1 100644 --- a/addons/account/wizard/account_report_balance_sheet_view.xml +++ b/addons/account/wizard/account_report_balance_sheet_view.xml @@ -21,7 +21,7 @@ </xpath> <xpath expr="//field[@name='target_move']" position="after"> <field name="display_account"/> - <field name="reserve_account_id" required="1"/> + <field name="reserve_account_id"/> <field name="display_type"/> <newline/> </xpath> diff --git a/addons/account/wizard/account_report_central_journal.py b/addons/account/wizard/account_report_central_journal.py index d66be0a70e4..eed21f976a5 100644 --- a/addons/account/wizard/account_report_central_journal.py +++ b/addons/account/wizard/account_report_central_journal.py @@ -19,13 +19,17 @@ # ############################################################################## -from osv import osv +from osv import osv, fields class account_central_journal(osv.osv_memory): _name = 'account.central.journal' _description = 'Account Central Journal' _inherit = "account.common.journal.report" + _columns = { + 'journal_ids': fields.many2many('account.journal', 'account_central_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), + } + def _print_report(self, cr, uid, ids, data, context=None): data = self.pre_print_report(cr, uid, ids, data, context=context) return { diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 0d0b69ce132..48130b041d0 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -35,7 +35,7 @@ class account_common_report(osv.osv_memory): 'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True), 'period_from': fields.many2one('account.period', 'Start Period'), 'period_to': fields.many2one('account.period', 'End Period'), - 'journal_ids': fields.many2many('account.journal', 'account_common_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), + 'journal_ids': fields.many2many('account.journal', string='Journals', required=True), 'date_from': fields.date("Start Date"), 'date_to': fields.date("End Date"), 'target_move': fields.selection([('posted', 'All Posted Entries'), diff --git a/addons/account/wizard/account_report_general_journal.py b/addons/account/wizard/account_report_general_journal.py index af091d9bc08..521c4667a80 100644 --- a/addons/account/wizard/account_report_general_journal.py +++ b/addons/account/wizard/account_report_general_journal.py @@ -19,17 +19,21 @@ # ############################################################################## -from osv import osv +from osv import osv, fields class account_general_journal(osv.osv_memory): _inherit = "account.common.journal.report" _name = 'account.general.journal' _description = 'Account General Journal' + _columns = { + 'journal_ids': fields.many2many('account.journal', 'account_general_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), + } + def _print_report(self, cr, uid, ids, data, context=None): data = self.pre_print_report(cr, uid, ids, data, context=context) return {'type': 'ir.actions.report.xml', 'report_name': 'account.general.journal', 'datas': data} account_general_journal() -#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/account/wizard/account_report_general_ledger.py b/addons/account/wizard/account_report_general_ledger.py index ed75b3c1dce..d0b3c0fa3d3 100644 --- a/addons/account/wizard/account_report_general_ledger.py +++ b/addons/account/wizard/account_report_general_ledger.py @@ -32,6 +32,7 @@ class account_report_general_ledger(osv.osv_memory): help='If you selected to filter by date or period, this field allow you to add a row to display the amount of debit/credit/balance that precedes the filter you\'ve set.'), 'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"), 'sortby': fields.selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], 'Sort by', required=True), + 'journal_ids': fields.many2many('account.journal', 'account_report_general_ledger_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), } _defaults = { 'landscape': True, diff --git a/addons/account/wizard/account_report_partner_balance.py b/addons/account/wizard/account_report_partner_balance.py index eff9e71cb72..80ee455456c 100644 --- a/addons/account/wizard/account_report_partner_balance.py +++ b/addons/account/wizard/account_report_partner_balance.py @@ -31,6 +31,7 @@ class account_partner_balance(osv.osv_memory): _columns = { 'display_partner': fields.selection([('non-zero_balance', 'With balance is not equal to 0'), ('all', 'All Partners')] ,'Display Partners'), + 'journal_ids': fields.many2many('account.journal', 'account_partner_balance_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), } _defaults = { @@ -51,4 +52,4 @@ class account_partner_balance(osv.osv_memory): account_partner_balance() -# 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/account/wizard/account_report_partner_ledger.py b/addons/account/wizard/account_report_partner_ledger.py index 8a2b6c7bacb..7a3f3932f1b 100644 --- a/addons/account/wizard/account_report_partner_ledger.py +++ b/addons/account/wizard/account_report_partner_ledger.py @@ -35,6 +35,7 @@ class account_partner_ledger(osv.osv_memory): 'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods'), ('unreconciled', 'Unreconciled Entries')], "Filter by", required=True), 'page_split': fields.boolean('One Partner Per Page', help='Display Ledger Report with One partner per page'), 'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"), + 'journal_ids': fields.many2many('account.journal', 'account_partner_ledger_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), } _defaults = { 'initial_balance': False, diff --git a/addons/account/wizard/account_report_print_journal.py b/addons/account/wizard/account_report_print_journal.py index f4a5fcaf9f9..d7e8f11a7f8 100644 --- a/addons/account/wizard/account_report_print_journal.py +++ b/addons/account/wizard/account_report_print_journal.py @@ -30,6 +30,7 @@ class account_print_journal(osv.osv_memory): 'sort_selection': fields.selection([('date', 'Date'), ('ref', 'Reference Number'),], 'Entries Sorted by', required=True), + 'journal_ids': fields.many2many('account.journal', 'account_print_journal_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), } _defaults = { 'sort_selection': 'date', @@ -44,4 +45,4 @@ class account_print_journal(osv.osv_memory): account_print_journal() -#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/account/wizard/account_report_profit_loss.py b/addons/account/wizard/account_report_profit_loss.py index 6372539c056..f4c2897bfe0 100644 --- a/addons/account/wizard/account_report_profit_loss.py +++ b/addons/account/wizard/account_report_profit_loss.py @@ -28,14 +28,15 @@ class account_pl_report(osv.osv_memory): _inherit = "account.common.account.report" _name = "account.pl.report" _description = "Account Profit And Loss Report" + _columns = { 'display_type': fields.boolean("Landscape Mode"), + 'journal_ids': fields.many2many('account.journal', 'account_pl_report_journal_rel', 'account_id', 'journal_id', 'Journals', required=True), } _defaults = { 'display_type': False, 'journal_ids': [], - 'target_move': False } def _print_report(self, cr, uid, ids, data, context=None): diff --git a/addons/account/wizard/account_report_profit_loss_view.xml b/addons/account/wizard/account_report_profit_loss_view.xml index d9876f57454..75b6766ff87 100644 --- a/addons/account/wizard/account_report_profit_loss_view.xml +++ b/addons/account/wizard/account_report_profit_loss_view.xml @@ -9,9 +9,6 @@ <field name="inherit_id" ref="account.account_common_report_view" /> <field name="arch" type="xml"> <data> - <xpath expr="//field[@name='target_move']" position="replace"> - <field name="target_move" required="0" readonly="1"/> - </xpath> <xpath expr="//field[@name='journal_ids']" position="replace"> <field name="journal_ids" required="0" colspan="4" nolabel="1" readonly="1"/> </xpath> diff --git a/addons/account_accountant/i18n/zh_TW.po b/addons/account_accountant/i18n/zh_TW.po new file mode 100644 index 00000000000..b338ecd1fdc --- /dev/null +++ b/addons/account_accountant/i18n/zh_TW.po @@ -0,0 +1,33 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 09:57+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: account_accountant +#: model:ir.module.module,description:account_accountant.module_meta_information +msgid "" +"\n" +"This module gives the admin user the access to all the accounting features " +"like the journal\n" +"items and the chart of accounts.\n" +" " +msgstr "" + +#. module: account_accountant +#: model:ir.module.module,shortdesc:account_accountant.module_meta_information +msgid "Accountant" +msgstr "會計師" diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index c8ab5334d8a..c62e6ea98d0 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -366,7 +366,7 @@ class account_move_line(osv.osv): def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): if context is None: context = {} - result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) + result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) return result account_move_line() @@ -496,4 +496,4 @@ class account_bank_statement_line(osv.osv): } account_bank_statement_line() -# 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/account_anglo_saxon/i18n/zh_TW.po b/addons/account_anglo_saxon/i18n/zh_TW.po new file mode 100644 index 00000000000..c8e5d49a3e4 --- /dev/null +++ b/addons/account_anglo_saxon/i18n/zh_TW.po @@ -0,0 +1,107 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 10:28+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: account_anglo_saxon +#: view:product.category:0 +msgid " Accounting Property" +msgstr "" + +#. module: account_anglo_saxon +#: sql_constraint:purchase.order:0 +msgid "Order Reference must be unique !" +msgstr "訂單參考不能重覆!" + +#. module: account_anglo_saxon +#: constraint:product.category:0 +msgid "Error ! You can not create recursive categories." +msgstr "" + +#. module: account_anglo_saxon +#: constraint:product.template:0 +msgid "" +"Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_account_invoice_line +msgid "Invoice Line" +msgstr "發票明細" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_purchase_order +msgid "Purchase Order" +msgstr "購貨單" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_product_template +msgid "Product Template" +msgstr "產品範本" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_product_category +msgid "Product Category" +msgstr "產品分類" + +#. module: account_anglo_saxon +#: model:ir.module.module,shortdesc:account_anglo_saxon.module_meta_information +msgid "Stock Accounting for Anglo Saxon countries" +msgstr "" + +#. module: account_anglo_saxon +#: field:product.category,property_account_creditor_price_difference_categ:0 +#: field:product.template,property_account_creditor_price_difference:0 +msgid "Price Difference Account" +msgstr "" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_account_invoice +msgid "Invoice" +msgstr "發票" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_stock_picking +msgid "Picking List" +msgstr "提貨清單" + +#. module: account_anglo_saxon +#: model:ir.module.module,description:account_anglo_saxon.module_meta_information +msgid "" +"This module will support the Anglo-Saxons accounting methodology by\n" +" changing the accounting logic with stock transactions. The difference " +"between the Anglo-Saxon accounting countries\n" +" and the Rhine or also called Continental accounting countries is the " +"moment of taking the Cost of Goods Sold versus Cost of Sales.\n" +" Anglo-Saxons accounting does take the cost when sales invoice is " +"created, Continental accounting will take the cost at the moment the goods " +"are shipped.\n" +" This module will add this functionality by using a interim account, to " +"store the value of shipped goods and will contra book this interim account\n" +" when the invoice is created to transfer this amount to the debtor or " +"creditor account.\n" +" Secondly, price differences between actual purchase price and fixed " +"product standard price are booked on a separate account" +msgstr "" + +#. module: account_anglo_saxon +#: help:product.category,property_account_creditor_price_difference_categ:0 +#: help:product.template,property_account_creditor_price_difference:0 +msgid "" +"This account will be used to value price difference between purchase price " +"and cost price." +msgstr "" diff --git a/addons/account_coda/i18n/zh_TW.po b/addons/account_coda/i18n/zh_TW.po new file mode 100644 index 00000000000..bc4288a4c3c --- /dev/null +++ b/addons/account_coda/i18n/zh_TW.po @@ -0,0 +1,259 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 10:40+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: account_coda +#: help:account.coda,journal_id:0 +#: field:account.coda.import,journal_id:0 +msgid "Bank Journal" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +#: field:account.coda.import,note:0 +msgid "Log" +msgstr "" + +#. module: account_coda +#: model:ir.model,name:account_coda.model_account_coda_import +msgid "Account Coda Import" +msgstr "" + +#. module: account_coda +#: field:account.coda,name:0 +msgid "Coda file" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +msgid "Group By..." +msgstr "" + +#. module: account_coda +#: field:account.coda.import,awaiting_account:0 +msgid "Default Account for Unrecognized Movement" +msgstr "" + +#. module: account_coda +#: help:account.coda,date:0 +msgid "Import Date" +msgstr "匯入日期" + +#. module: account_coda +#: field:account.coda,note:0 +msgid "Import log" +msgstr "" + +#. module: account_coda +#: view:account.coda.import:0 +msgid "Import" +msgstr "匯入" + +#. module: account_coda +#: view:account.coda:0 +msgid "Coda import" +msgstr "" + +#. module: account_coda +#: code:addons/account_coda/account_coda.py:51 +#, python-format +msgid "Coda file not found for bank statement !!" +msgstr "" + +#. module: account_coda +#: help:account.coda.import,awaiting_account:0 +msgid "" +"Set here the default account that will be used, if the partner is found but " +"does not have the bank account, or if he is domiciled" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +#: field:account.coda,company_id:0 +msgid "Company" +msgstr "公司" + +#. module: account_coda +#: help:account.coda.import,def_payable:0 +msgid "" +"Set here the payable account that will be used, by default, if the partner " +"is not found" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +msgid "Search Coda" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +#: field:account.coda,user_id:0 +msgid "User" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +#: field:account.coda,date:0 +msgid "Date" +msgstr "日期" + +#. module: account_coda +#: model:ir.ui.menu,name:account_coda.menu_account_coda_statement +msgid "Coda Import Logs" +msgstr "" + +#. module: account_coda +#: model:ir.model,name:account_coda.model_account_coda +msgid "coda for an Account" +msgstr "" + +#. module: account_coda +#: field:account.coda.import,def_payable:0 +msgid "Default Payable Account" +msgstr "" + +#. module: account_coda +#: help:account.coda,name:0 +msgid "Store the detail of bank statements" +msgstr "" + +#. module: account_coda +#: view:account.coda.import:0 +msgid "Cancel" +msgstr "取消" + +#. module: account_coda +#: view:account.coda.import:0 +msgid "Open Statements" +msgstr "" + +#. module: account_coda +#: code:addons/account_coda/wizard/account_coda_import.py:167 +#, python-format +msgid "The bank account %s is not defined for the partner %s.\n" +msgstr "" + +#. module: account_coda +#: model:ir.ui.menu,name:account_coda.menu_account_coda_import +msgid "Import Coda Statements" +msgstr "" + +#. module: account_coda +#: view:account.coda.import:0 +#: model:ir.actions.act_window,name:account_coda.action_account_coda_import +msgid "Import Coda Statement" +msgstr "" + +#. module: account_coda +#: model:ir.module.module,description:account_coda.module_meta_information +msgid "" +"\n" +" Module provides functionality to import\n" +" bank statements from coda files.\n" +" " +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +msgid "Statements" +msgstr "" + +#. module: account_coda +#: field:account.bank.statement,coda_id:0 +msgid "Coda" +msgstr "" + +#. module: account_coda +#: view:account.coda.import:0 +msgid "Results :" +msgstr "" + +#. module: account_coda +#: view:account.coda.import:0 +msgid "Result of Imported Coda Statements" +msgstr "" + +#. module: account_coda +#: help:account.coda.import,def_receivable:0 +msgid "" +"Set here the receivable account that will be used, by default, if the " +"partner is not found" +msgstr "" + +#. module: account_coda +#: field:account.coda.import,coda:0 +#: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement +msgid "Coda File" +msgstr "" + +#. module: account_coda +#: model:ir.model,name:account_coda.model_account_bank_statement +msgid "Bank Statement" +msgstr "" + +#. module: account_coda +#: model:ir.actions.act_window,name:account_coda.action_account_coda +msgid "Coda Logs" +msgstr "" + +#. module: account_coda +#: code:addons/account_coda/wizard/account_coda_import.py:311 +#, python-format +msgid "Result" +msgstr "" + +#. module: account_coda +#: view:account.coda.import:0 +msgid "Click on 'New' to select your file :" +msgstr "" + +#. module: account_coda +#: field:account.coda.import,def_receivable:0 +msgid "Default Receivable Account" +msgstr "" + +#. module: account_coda +#: view:account.coda.import:0 +msgid "Close" +msgstr "關閉" + +#. module: account_coda +#: field:account.coda,statement_ids:0 +msgid "Generated Bank Statements" +msgstr "" + +#. module: account_coda +#: model:ir.module.module,shortdesc:account_coda.module_meta_information +msgid "Account CODA - import bank statements from coda file" +msgstr "" + +#. module: account_coda +#: view:account.coda.import:0 +msgid "Configure Your Journal and Account :" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +msgid "Coda Import" +msgstr "" + +#. module: account_coda +#: view:account.coda:0 +#: field:account.coda,journal_id:0 +msgid "Journal" +msgstr "" diff --git a/addons/account_sequence/i18n/zh_TW.po b/addons/account_sequence/i18n/zh_TW.po new file mode 100644 index 00000000000..809c641a883 --- /dev/null +++ b/addons/account_sequence/i18n/zh_TW.po @@ -0,0 +1,221 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 11:32+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: account_sequence +#: view:account.sequence.installer:0 +#: model:ir.actions.act_window,name:account_sequence.action_account_seq_installer +msgid "Account Sequence Application Configuration" +msgstr "" + +#. module: account_sequence +#: constraint:account.move:0 +msgid "" +"You cannot create entries on different periods/journals in the same move" +msgstr "" + +#. module: account_sequence +#: help:account.move,internal_sequence_number:0 +#: help:account.move.line,internal_sequence_number:0 +msgid "Internal Sequence Number" +msgstr "內部序列號碼" + +#. module: account_sequence +#: help:account.sequence.installer,number_next:0 +msgid "Next number of this sequence" +msgstr "本序列下個號碼" + +#. module: account_sequence +#: field:account.sequence.installer,number_next:0 +msgid "Next Number" +msgstr "下個號碼" + +#. module: account_sequence +#: field:account.sequence.installer,number_increment:0 +msgid "Increment Number" +msgstr "編號增量" + +#. module: account_sequence +#: model:ir.module.module,description:account_sequence.module_meta_information +msgid "" +"\n" +" This module maintains internal sequence number for accounting entries.\n" +" " +msgstr "" + +#. module: account_sequence +#: model:ir.module.module,shortdesc:account_sequence.module_meta_information +msgid "Entries Sequence Numbering" +msgstr "" + +#. module: account_sequence +#: help:account.sequence.installer,number_increment:0 +msgid "The next number of the sequence will be incremented by this number" +msgstr "序列下個號碼按此數字遞增" + +#. module: account_sequence +#: view:account.sequence.installer:0 +msgid "Configure Your Account Sequence Application" +msgstr "" + +#. module: account_sequence +#: field:account.sequence.installer,progress:0 +msgid "Configuration Progress" +msgstr "配置進度" + +#. module: account_sequence +#: help:account.sequence.installer,suffix:0 +msgid "Suffix value of the record for the sequence" +msgstr "" + +#. module: account_sequence +#: field:account.sequence.installer,company_id:0 +msgid "Company" +msgstr "公司" + +#. module: account_sequence +#: help:account.journal,internal_sequence_id:0 +msgid "" +"This sequence will be used to maintain the internal number for the journal " +"entries related to this journal." +msgstr "" + +#. module: account_sequence +#: field:account.sequence.installer,padding:0 +msgid "Number padding" +msgstr "數字位數" + +#. module: account_sequence +#: model:ir.model,name:account_sequence.model_account_move_line +msgid "Journal Items" +msgstr "" + +#. module: account_sequence +#: field:account.move,internal_sequence_number:0 +#: field:account.move.line,internal_sequence_number:0 +msgid "Internal Number" +msgstr "內部號碼" + +#. module: account_sequence +#: constraint:account.move.line:0 +msgid "Company must be same for its related account and period." +msgstr "" + +#. module: account_sequence +#: help:account.sequence.installer,padding:0 +msgid "" +"OpenERP will automatically adds some '0' on the left of the 'Next Number' to " +"get the required padding size." +msgstr "" + +#. module: account_sequence +#: field:account.sequence.installer,name:0 +msgid "Name" +msgstr "名稱" + +#. module: account_sequence +#: constraint:account.move.line:0 +msgid "You can not create move line on closed account." +msgstr "" + +#. module: account_sequence +#: constraint:account.move:0 +msgid "" +"You cannot create more than one move per period on centralized journal" +msgstr "" + +#. module: account_sequence +#: sql_constraint:account.move.line:0 +msgid "Wrong credit or debit value in accounting entry !" +msgstr "" + +#. module: account_sequence +#: field:account.journal,internal_sequence_id:0 +msgid "Internal Sequence" +msgstr "內部序列" + +#. module: account_sequence +#: model:ir.model,name:account_sequence.model_account_sequence_installer +msgid "account.sequence.installer" +msgstr "" + +#. module: account_sequence +#: view:account.sequence.installer:0 +msgid "Configure" +msgstr "設定" + +#. module: account_sequence +#: help:account.sequence.installer,prefix:0 +msgid "Prefix value of the record for the sequence" +msgstr "" + +#. module: account_sequence +#: model:ir.model,name:account_sequence.model_account_move +msgid "Account Entry" +msgstr "" + +#. module: account_sequence +#: field:account.sequence.installer,suffix:0 +msgid "Suffix" +msgstr "" + +#. module: account_sequence +#: field:account.sequence.installer,config_logo:0 +msgid "Image" +msgstr "圖像" + +#. module: account_sequence +#: view:account.sequence.installer:0 +msgid "title" +msgstr "" + +#. module: account_sequence +#: sql_constraint:account.journal:0 +msgid "The name of the journal must be unique per company !" +msgstr "" + +#. module: account_sequence +#: field:account.sequence.installer,prefix:0 +msgid "Prefix" +msgstr "" + +#. module: account_sequence +#: sql_constraint:account.journal:0 +msgid "The code of the journal must be unique per company !" +msgstr "" + +#. module: account_sequence +#: constraint:account.move.line:0 +msgid "" +"You can not create move line on receivable/payable account without partner" +msgstr "" + +#. module: account_sequence +#: model:ir.model,name:account_sequence.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_sequence +#: view:account.sequence.installer:0 +msgid "You can enhance the Account Sequence Application by installing ." +msgstr "" + +#. module: account_sequence +#: constraint:account.move.line:0 +msgid "You can not create move line on view account." +msgstr "" 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 6e325a2c87e..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 - - def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_date, context=None): + credit += l['amount'] + return abs(amount - abs(credit - debit)) + + 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') + res = {} + debit = credit = 0.0 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) + debit += l.amount 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 = {} - 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} + 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,13 +204,11 @@ 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','New'), + [('draft','Draft'), ('proforma','Pro-forma'), ('posted','Posted'), ('cancel','Cancelled') @@ -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) + + 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': voucher_currency_id}, + 'value':{'line_ids':[], 'line_dr_ids':[], 'line_cr_ids':[], 'pre_line': False, 'currency_id':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) + 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 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 + + 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 - 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 = {} - 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, - } - - return res - - 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}} + rs_data = {} 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}} + 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 + + 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 _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 @@ <?xml version="1.0" encoding="UTF-8"?> <openerp> <data> - <record id="view_invoice_customer" model="ir.ui.view"> - <field name="name">account.invoice.customer.pay</field> - <field name="model">account.invoice</field> - <field name="type">form</field> - <field name="inherit_id" ref="account.invoice_form"/> - <field name="arch" type="xml"> - <button name="invoice_open" position="after"> - <button name="invoice_pay_customer" type="object" string="Payment" states="open" icon="gtk-go-forward"/> - </button> - </field> - </record> - - <record id="view_invoice_supplier" model="ir.ui.view"> - <field name="name">account.invoice.supplier.pay</field> - <field name="model">account.invoice</field> - <field name="type">form</field> - <field name="inherit_id" ref="account.invoice_supplier_form"/> - <field name="arch" type="xml"> - <button name="invoice_open" position="after"> - <button name="invoice_pay_customer" type="object" string="Pay Invoice" states="open" icon="gtk-go-forward"/> - </button> - </field> - </record> + <record id="view_invoice_customer" model="ir.ui.view"> + <field name="name">account.invoice.customer.pay</field> + <field name="model">account.invoice</field> + <field name="type">form</field> + <field name="inherit_id" ref="account.invoice_form"/> + <field name="arch" type="xml"> + <button name="invoice_open" position="after"> + <button name="invoice_pay_customer" type="object" string="Payment" states="open" icon="gtk-go-forward"/> + </button> + </field> + </record> + <record id="view_invoice_supplier" model="ir.ui.view"> + <field name="name">account.invoice.supplier.pay</field> + <field name="model">account.invoice</field> + <field name="type">form</field> + <field name="inherit_id" ref="account.invoice_supplier_form"/> + <field name="arch" type="xml"> + <button name="invoice_open" position="after"> + <button name="invoice_pay_customer" type="object" string="Pay Invoice" states="open" icon="gtk-go-forward"/> + </button> + </field> + </record> </data> </openerp> diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index a545781b4f2..8f8a0d0854a 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -43,7 +43,7 @@ <form string="Accounting Voucher"> <group col="6" colspan="4"> <field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/> - <field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date, context)"/> + <field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="journal_id" widget="selection" select="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/> <field name="type" required="1"/> <field name="name" colspan="2"/> 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 (<http://tiny.be>). -# -# 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 <http://www.gnu.org/licenses/>. -# -############################################################################## - -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 @@ -<?xml version="1.0" encoding="utf-8"?> -<openerp> - <data> - <record model="ir.ui.view" id="view_company_inherit_currency_xchange_form"> - <field name="name">res.company.form.inherit</field> - <field name="inherit_id" ref="base.view_company_form"/> - <field name="model">res.company</field> - <field name="type">form</field> - <field name="arch" type="xml"> - <field name="currency_id" position="after"> - <field name="property_income_currency_exchange" colspan="2"/> - <field name="property_expense_currency_exchange" colspan="2"/> - </field> - </field> - </record> - - </data> -</openerp> 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 - <create with values 240 USD, journal USD, and fill amounts 180 for the invoice of 200$ and 70 for the invoice of 100$> -- - !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 - <create with values 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$> - -- - !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 - <create with values 240 EUR, journal EUR, and fills amount 180 for the invoice of 200$ and 70 for the invoice of 100$> -- - !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 - <create with values 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$> -- - !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 - <create with values 240 EUR, journal EUR, and fills amount 180 for the invoice of 200$ and 70 for the invoice of 100$> -- - !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 - <create with values 45 USD, journal USD, and fill amounts 20 for the invoice of 200$ and 30 for the invoice of 100$> -- - !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 - <create with values 120 EUR, journal EUR, and fill amounts 100 for the invoice of 150 EUR and 20 for the invoice of 80 EUR> -- - !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. - <create with values 120 EUR, journal EUR, and fill amounts 50 for the invoice of 150 EUR and 70 for the invoice of 80 EUR> -- - !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 - <create with values 300 CHF, journal CHF, and fill amounts 200 for the invoice of 200 CAD> -- - !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 2c496933a16..9c8bdffb35d 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -74,24 +74,14 @@ <field name="arch" type="xml"> <form string="Bill Payment"> <group col="6" colspan="4"> - <field name="partner_id" - required="1" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)" - string="Supplier"/> + <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/> + <field name="amount" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="journal_id" domain="[('type','in',['bank', 'cash'])]" widget="selection" select="1" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)" + on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Payment Method"/> - <field name="amount" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)"/> - <field name="date" - select="1" - on_change="onchange_date(partner_id, journal_id, amount, - currency_id, type, date, context)"/> + <field name="date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="reference" select="1" string="Payment Ref"/> <field name="name" colspan="2"/> <field name="account_id" @@ -104,37 +94,25 @@ <page string="Payment Information"> <field name="line_dr_ids" attrs="{'invisible': [('type', '=', 'receipt')]}" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)"> <tree string="Open Supplier Journal Entries" editable="bottom"> - <field name="move_line_id" required="1" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" + <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" on_change="onchange_move_line_id(move_line_id)" domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]" /> - <field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]" invisible="1"/> + <field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]"/> <field name="date_original" readonly="1"/> <field name="date_due" readonly="1"/> - <field name="currency_id" readonly="1"/> - <field name="amount_original" readonly="1" invisible="1"/> - <field name="amount_unreconciled" readonly="1"/> - <field name="amount" on_change="onchange_amount(amount)"/> - <field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/> - <field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/> - <field name="amount_in_company_currency" readonly="1" invisible="1"/> - <field name="company_currency_id" readonly="1" invisible="1"/> + <field name="amount_original" readonly="1"/> + <field name="amount_unreconciled" sum="Open Balance" readonly="1"/> + <field name="amount" sum="Payment"/> </tree> </field> <field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('type', '=', 'payment')]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)"> <tree string="Open Customer Journal Entries" editable="bottom"> - <field name="move_line_id" required="1"/> + <field name="move_line_id"/> <field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/> - <field name="date_original" readonly="1"/> - <field name="date_due" readonly="1"/> - <field name="currency_id" readonly="1"/> - <field name="amount_original" readonly="1" invisible="1"/> - <field name="amount_unreconciled" readonly="1"/> - <field name="amount" on_change="onchange_amount(amount)"/> - <field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/> - <field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/> - <field name="amount_in_company_currency" readonly="1" invisible="1"/> - <field name="company_currency_id" readonly="1" invisible="1"/> + <field name="date_original"/> + <field name="amount_original"/> + <field name="amount" sum="Payment"/> </tree> </field> <group col="2" colspan="3"> @@ -159,28 +137,15 @@ <field name="arch" type="xml"> <form string="Bill Payment"> <group col="6" colspan="4"> - <field name="partner_id" - domain="[('supplier','=',True)]" - required="1" - invisible="context.get('line_type', False)" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)" - string="Supplier"/> + <field name="partner_id" domain="[('supplier','=',True)]" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" context="{'invoice_currency':currency_id}" string="Supplier"/> + <field name="amount" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="journal_id" domain="[('type','in',['bank', 'cash'])]" invisible="context.get('line_type', False)" widget="selection" select="1" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)" + on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Payment Method"/> - <field name="amount" - invisible="context.get('line_type', False)" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)"/> - <field name="date" - invisible="context.get('line_type', False)" - on_change="onchange_date(partner_id, journal_id, amount, - currency_id, type, date, context)"/> + <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/> <field name="name" colspan="2" invisible="context.get('line_type', False)"/> <field name="company_id" widget="selection" groups="base.group_multi_company"/> @@ -194,37 +159,26 @@ <page string="Payment Information"> <field name="line_dr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140"> <tree string="Supplier Invoices and Outstanding transactions" editable="bottom"> - <field name="move_line_id" required="1" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" + <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" on_change="onchange_move_line_id(move_line_id)" domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]" + required="1" /> - <field name="account_id" groups="base.group_extended" domain="[('type','=','payable')]"/> + <field name="account_id" groups="base.group_no_one" domain="[('type','=','payable')]"/> <field name="date_original" readonly="1"/> <field name="date_due" readonly="1"/> - <field name="currency_id" readonly="1"/> - <field name="amount_original" readonly="1" invisible="1"/> - <field name="amount_unreconciled" readonly="1"/> - <field name="amount" on_change="onchange_amount(amount)"/> - <field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/> - <field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/> - <field name="amount_in_company_currency" readonly="1" invisible="1"/> - <field name="company_currency_id" readonly="1" invisible="1"/> + <field name="amount_original" readonly="1"/> + <field name="amount_unreconciled" sum="Open Balance" readonly="1"/> + <field name="amount" sum="Payment"/> </tree> </field> <field name="line_cr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}"> <tree string="Credits" editable="bottom"> - <field name="move_line_id" required="1"/> + <field name="move_line_id"/> <field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/> - <field name="date_original" readonly="1"/> - <field name="date_due" readonly="1"/> - <field name="currency_id" readonly="1"/> - <field name="amount_original" readonly="1" invisible="1"/> - <field name="amount_unreconciled" readonly="1"/> - <field name="amount" on_change="onchange_amount(amount)"/> - <field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/> - <field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/> - <field name="amount_in_company_currency" readonly="1" invisible="1"/> - <field name="company_currency_id" readonly="1" invisible="1"/> + <field name="date_original"/> + <field name="amount_original"/> + <field name="amount" sum="Payment"/> </tree> </field> <group col="2" colspan="3"> @@ -232,26 +186,27 @@ <field name="narration" colspan="2" nolabel="1"/> </group> <group col="2" colspan="1"> - <group col="4" colspan="1"> - <separator string="Payment Options" colspan="4"/> - <field name="payment_option" required="1" colspan="4"/> - <field name="currency_rate_difference" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> - <field name="company_currency" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" nolabel="1"/><newline/> + <group col="2" colspan="1"> + <field name="exchange_acc_id" + attrs="{'invisible':[('currency_id','=',False)]}" + domain="[('type','=','other')]"/> + <field name="analytic_id" + groups="analytic.group_analytic_accounting"/> + <separator string="Payment Options" colspan="2"/> + <field name="payment_option" required="1"/> <field name="writeoff_amount" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> - <field name="currency_id2" nolabel="1" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/><newline/> <field name="writeoff_acc_id" attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}" - domain="[('type','=','other')]" colspan="4"/> + domain="[('type','=','other')]"/> <field name="comment" - attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" colspan="4"/> - <field name="analytic_id" - attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" - groups="analytic.group_analytic_accounting" colspan="4"/> + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> + </group> <separator string="Other Information" colspan="2"/> - <group col="4" colspan="1"> + <group col="2" colspan="1"> <field name="number"/> + <field name="currency_id" invisible="1"/> </group> </group> </page> @@ -318,88 +273,58 @@ id="menu_action_vendor_payment" parent="account.menu_finance_payables"/> <record model="ir.ui.view" id="view_vendor_receipt_form"> - <field name="name">voucher.form.customer.payment</field> + <field name="name">account.voucher.receipt.form</field> <field name="model">account.voucher</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="Customer Payment"> - <group col="12" colspan="4"> - <field name="partner_id" - colspan="4" - required="1" - invisible="context.get('line_type', False)" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)" - string="Customer"/> - <field name="journal_id" - domain="[('type','in',['bank', 'cash'])]" - invisible="context.get('line_type', False)" - widget="selection" - select="1" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)" - string="Payment Method" - colspan="4"/> + <group col="6" colspan="4"> + <field name="partner_id" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Customer"/> + <field name="currency_id" invisible="1"/> <field name="amount" - colspan="1" invisible="context.get('line_type', False)" string="Paid Amount" - on_change="onchange_partner_id(partner_id, journal_id, amount, - currency_id, type, date, context)"/> - <field name="currency_id" nolabel="1" invisible="1"/> - <field name="date" - colspan="4" - select="1" - invisible="context.get('line_type', False)" - on_change="onchange_date(partner_id, journal_id, amount, - currency_id, type, date, context)"/> - <field name="reference" colspan="4" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/> - <field name="name" colspan="4" invisible="context.get('line_type', False)"/> - <field name="company_id" colspan="4" widget="selection" groups="base.group_multi_company"/> - <field name="account_id" colspan="4" + on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/> + <field name="journal_id" + domain="[('type','in',['bank', 'cash'])]" + invisible="context.get('line_type', False)" + widget="selection" select="1" + on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" + string="Payment Method"/> + <field name="date" select="1" invisible="context.get('line_type', False)" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> + <field name="reference" select="1" invisible="context.get('line_type', False)" string="Payment Ref"/> + <field name="name" colspan="2" invisible="context.get('line_type', False)"/> + <field name="company_id" widget="selection" groups="base.group_multi_company"/> + <field name="account_id" widget="selection" invisible="True"/> - <field name="pre_line" colspan="4" invisible="1"/> - <field name="type" colspan="4" invisible="True"/> + <field name="pre_line" invisible="1"/> + <field name="type" invisible="True"/> </group> <notebook colspan="4"> <page string="Payment Information"> - <field name="line_cr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, date, context)"> + <field name="line_cr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)"> <tree string="Invoices and outstanding transactions" editable="bottom"> - <field name="move_line_id" required="1" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" + <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" on_change="onchange_move_line_id(move_line_id)" domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]" + required="1" /> - <field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]" invisible="1"/> + <field name="account_id" groups="base.group_no_one" domain="[('type','=','receivable')]"/> <field name="date_original" readonly="1"/> <field name="date_due" readonly="1"/> - <field name="currency_id" readonly="1"/> - <field name="amount_original" readonly="1" invisible="1"/> - <field name="amount_unreconciled" readonly="1"/> - <field name="amount" on_change="onchange_amount(amount)"/> - <field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/> - <field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/> - <field name="amount_in_company_currency" readonly="1" invisible="1"/> - <field name="company_currency_id" readonly="1" invisible="1"/> + <field name="amount_original" readonly="1"/> + <field name="amount_unreconciled" sum="Open Balance" readonly="1"/> + <field name="amount" sum="Payment"/> </tree> </field> - <field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, date, context)"> + <field name="line_dr_ids" colspan="4" nolabel="1" attrs="{'invisible': [('pre_line','=',False)]}" default_get="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount)"> <tree string="Credits" editable="bottom"> - <field name="move_line_id" required="1" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" - on_change="onchange_move_line_id(move_line_id)" - domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]" - /> - <field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]" invisible="1"/> - <field name="date_original" readonly="1"/> - <field name="date_due" readonly="1"/> - <field name="currency_id" readonly="1"/> - <field name="amount_original" readonly="1" invisible="1"/> - <field name="amount_unreconciled" readonly="1"/> - <field name="amount" on_change="onchange_amount(amount)"/> - <field name="amount_in_voucher_currency" readonly="1" groups="base.group_no_one"/> - <field name="voucher_currency_id" readonly="1" groups="base.group_no_one"/> - <field name="amount_in_company_currency" readonly="1" invisible="1"/> - <field name="company_currency_id" readonly="1" invisible="1"/> + <field name="move_line_id"/> + <field name="account_id" groups="base.group_extended" domain="[('type','=','receivable')]"/> + <field name="date_original"/> + <field name="amount_original"/> + <field name="amount" sum="Payment"/> </tree> </field> <group col="2" colspan="3"> @@ -407,22 +332,21 @@ <field name="narration" colspan="2" nolabel="1"/> </group> <group col="2" colspan="1"> - <group col="4" colspan="1"> - <separator string="Payment Options" colspan="4"/> - <field name="payment_option" required="1" colspan="4"/> - <field name="currency_rate_difference" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> - <field name="company_currency" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" nolabel="1"/><newline/> + <group col="2" colspan="1"> + <separator string="Payment Options" colspan="2"/> + <field name="analytic_id" + groups="analytic.group_analytic_accounting"/> + <field name="exchange_acc_id" + attrs="{'invisible':[('currency_id','=',False)]}" + domain="[('type','=','other')]"/> + <field name="payment_option" required="1"/> <field name="writeoff_amount" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> - <field name="currency_id2" nolabel="1" attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/><newline/> <field name="writeoff_acc_id" attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}" - domain="[('type','=','other')]" colspan="4"/> + domain="[('type','=','other')]"/> <field name="comment" - attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" colspan="4"/> - <field name="analytic_id" - attrs="{'invisible':[('payment_option','!=','with_writeoff')]}" - groups="analytic.group_analytic_accounting" colspan="4"/> + attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/> </group> <separator string="Other Information" colspan="2"/> <group col="4" colspan="1"> diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index 6ed381de209..170f8fbcfe0 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -83,7 +83,7 @@ <form string="Sales Receipt"> <group col="6" colspan="4"> <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)" string="Customer"/> - <field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date, context)"/> + <field name="date" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id)"/> <field name="number"/> <field name="name" colspan="2"/> @@ -210,7 +210,7 @@ <form string="Supplier Voucher"> <group col="6" colspan="4"> <field name="partner_id" domain="[('supplier','=',True)]" required="1" string="Supplier" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date)"/> - <field name="date" string="Bill Date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date, context)"/> + <field name="date" string="Bill Date" select="1" on_change="onchange_date(partner_id, journal_id, amount, currency_id, type, date)"/> <field name="journal_id" domain="[('type','in',['purchase','purchase_refund'])]" widget="selection" select="1" on_change="onchange_journal(journal_id, line_dr_ids, tax_id, partner_id)"/> <field name="number"/> <field name="name" colspan="2"/> diff --git a/addons/account_voucher/wizard/account_statement_from_invoice.py b/addons/account_voucher/wizard/account_statement_from_invoice.py index 3509ac846b5..e4d728c8867 100644 --- a/addons/account_voucher/wizard/account_statement_from_invoice.py +++ b/addons/account_voucher/wizard/account_statement_from_invoice.py @@ -75,7 +75,7 @@ class account_statement_from_invoice_lines(osv.osv_memory): statement.currency.id, amount, context=ctx) context.update({'move_line_ids': [line.id]}) - result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), voucher_currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), date=line_date, context=context) + result = voucher_obj.onchange_partner_id(cr, uid, [], partner_id=line.partner_id.id, journal_id=statement.journal_id.id, price=abs(amount), currency_id= statement.currency.id, ttype=(amount < 0 and 'payment' or 'receipt'), date=line_date, context=context) voucher_res = { 'type':(amount < 0 and 'payment' or 'receipt'), 'name': line.name, 'partner_id': line.partner_id.id, diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py index 5d1f8a76e1c..4af387a5c02 100644 --- a/addons/anonymization/anonymization.py +++ b/addons/anonymization/anonymization.py @@ -239,7 +239,7 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): return res _columns = { - 'name': fields.char(size='64', string='File Name'), + 'name': fields.char(size=64, string='File Name'), 'summary': fields.function(_get_summary, type='text', string='Summary'), 'file_export': fields.binary(string='Export'), 'file_import': fields.binary(string='Import'), diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 4eded2f299d..80af2e7ea3a 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -123,9 +123,6 @@ class audittrail_rule(osv.osv): #End Loop return True -audittrail_rule() - - class audittrail_log(osv.osv): """ For Audittrail Log @@ -161,9 +158,6 @@ class audittrail_log(osv.osv): } _order = "timestamp desc" -audittrail_log() - - class audittrail_log_line(osv.osv): """ Audittrail Log Line. @@ -181,9 +175,6 @@ class audittrail_log_line(osv.osv): 'field_description': fields.char('Field Description', size=64), } -audittrail_log_line() - - class audittrail_objects_proxy(object_proxy): """ Uses Object proxy for auditing changes on object of subscribed Rules""" @@ -289,8 +280,7 @@ class audittrail_objects_proxy(object_proxy): #End Loop return True - - def log_fct(self, db, uid, model, method, fct_src, *args): + def log_fct(self, cr, uid, model, method, fct_src, *args): """ Logging function: This function is performs logging oprations according to method @param db: the current database @@ -304,8 +294,7 @@ class audittrail_objects_proxy(object_proxy): uid_orig = uid uid = 1 res2 = args - pool = pooler.get_pool(db) - cr = pooler.get_db(db).cursor() + pool = pooler.get_pool(cr.dbname) resource_pool = pool.get(model) log_pool = pool.get('audittrail.log') model_pool = pool.get('ir.model') @@ -316,8 +305,7 @@ class audittrail_objects_proxy(object_proxy): model = model_pool.browse(cr, uid, model_id) if method in ('create'): - res_id = fct_src(db, uid_orig, model.model, method, *args) - cr.commit() + res_id = fct_src(cr, uid_orig, model.model, method, *args) resource = resource_pool.read(cr, uid, res_id, args[0].keys()) vals = { "method": method, @@ -338,14 +326,12 @@ class audittrail_objects_proxy(object_proxy): lines.append(line) self.create_log_line(cr, uid, log_id, model, lines) - cr.commit() - cr.close() return res_id elif method in ('read'): res_ids = args[0] old_values = {} - res = fct_src(db, uid_orig, model.model, method, *args) + res = fct_src(cr, uid_orig, model.model, method, *args) if type(res) == list: for v in res: old_values[v['id']] = v @@ -370,8 +356,6 @@ class audittrail_objects_proxy(object_proxy): lines.append(line) self.create_log_line(cr, uid, log_id, model, lines) - cr.commit() - cr.close() return res elif method in ('unlink'): @@ -401,9 +385,7 @@ class audittrail_objects_proxy(object_proxy): lines.append(line) self.create_log_line(cr, uid, log_id, model, lines) - res = fct_src(db, uid_orig, model.model, method, *args) - cr.commit() - cr.close() + res = fct_src(cr, uid_orig, model.model, method, *args) return res else: res_ids = [] @@ -428,8 +410,7 @@ class audittrail_objects_proxy(object_proxy): old_values_text[field] = self.get_value_text(cr, uid, field, resource[field], model) old_values[resource_id] = {'text':old_values_text, 'value': old_value} - res = fct_src(db, uid_orig, model.model, method, *args) - cr.commit() + res = fct_src(cr, uid_orig, model.model, method, *args) if res_ids: for resource in resource_pool.read(cr, uid, res_ids): @@ -457,107 +438,40 @@ class audittrail_objects_proxy(object_proxy): lines.append(line) self.create_log_line(cr, uid, log_id, model, lines) - cr.commit() - cr.close() return res return True - - - def execute(self, db, uid, model, method, *args, **kw): - """ - Overrides Object Proxy execute method - @param db: the current database - @param uid: the current user's ID for security checks, - @param object: Object who's values are being changed - @param method: get any method and create log - - @return: Returns result as per method of Object proxy - """ - uid_orig = uid - uid = 1 - pool = pooler.get_pool(db) - model_pool = pool.get('ir.model') - rule_pool = pool.get('audittrail.rule') - cr = pooler.get_db(db).cursor() - cr.autocommit(True) - logged_uids = [] - fct_src = super(audittrail_objects_proxy, self).execute - - def my_fct(db, uid, model, method, *args): - rule = False - model_ids = model_pool.search(cr, uid, [('model', '=', model)]) + def check_rules(self, cr, uid, model, method): + pool = pooler.get_pool(cr.dbname) + # Check if auditrails is installed for that db and then if one rule match + if 'audittrail.rule' in pool.models: + model_ids = pool.get('ir.model').search(cr, 1, [('model', '=', model)]) model_id = model_ids and model_ids[0] or False + if model_id: + rule_ids = pool.get('audittrail.rule').search(cr, 1, [('object_id', '=', model_id), ('state', '=', 'subscribed')]) + for rule in pool.get('audittrail.rule').read(cr, 1, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']): + if len(rule['user_id'])==0 or uid in rule['user_id']: + if rule.get('log_'+method,0): + return True + elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create'): + if rule['log_action']: + return True + + def execute_cr(self, cr, uid, model, method, *args, **kw): + fct_src = super(audittrail_objects_proxy, self).execute_cr + if self.check_rules(cr,uid,model,method): + res = self.log_fct(cr, uid, model, method, fct_src, *args) + else: + res = fct_src(cr, uid, model, method, *args) + return res - for model_name in pool.obj_list(): - if model_name == 'audittrail.rule': - rule = True - if not rule: - return fct_src(db, uid_orig, model, method, *args) - if not model_id: - return fct_src(db, uid_orig, model, method, *args) - - rule_ids = rule_pool.search(cr, uid, [('object_id', '=', model_id), ('state', '=', 'subscribed')]) - if not rule_ids: - return fct_src(db, uid_orig, model, method, *args) - - for thisrule in rule_pool.browse(cr, uid, rule_ids): - for user in thisrule.user_id: - logged_uids.append(user.id) - if not logged_uids or uid in logged_uids: - if method in ('read', 'write', 'create', 'unlink'): - if getattr(thisrule, 'log_' + method): - return self.log_fct(db, uid_orig, model, method, fct_src, *args) - - elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create'): - if thisrule.log_action: - return self.log_fct(db, uid_orig, model, method, fct_src, *args) - - return fct_src(db, uid_orig, model, method, *args) - try: - res = my_fct(db, uid, model, method, *args) - return res - finally: - cr.close() - - def exec_workflow(self, db, uid, model, method, *args, **argv): - uid_orig = uid - uid = 1 - - pool = pooler.get_pool(db) - logged_uids = [] - fct_src = super(audittrail_objects_proxy, self).exec_workflow - field = method - rule = False - model_pool = pool.get('ir.model') - rule_pool = pool.get('audittrail.rule') - cr = pooler.get_db(db).cursor() - cr.autocommit(True) - try: - model_ids = model_pool.search(cr, uid, [('model', '=', model)]) - for obj_name in pool.obj_list(): - if obj_name == 'audittrail.rule': - rule = True - if not rule: - return super(audittrail_objects_proxy, self).exec_workflow(db, uid_orig, model, method, *args, **argv) - if not model_ids: - return super(audittrail_objects_proxy, self).exec_workflow(db, uid_orig, model, method, *args, **argv) - - rule_ids = rule_pool.search(cr, uid, [('object_id', 'in', model_ids), ('state', '=', 'subscribed')]) - if not rule_ids: - return super(audittrail_objects_proxy, self).exec_workflow(db, uid_orig, model, method, *args, **argv) - - for thisrule in rule_pool.browse(cr, uid, rule_ids): - for user in thisrule.user_id: - logged_uids.append(user.id) - if not logged_uids or uid in logged_uids: - if thisrule.log_workflow: - return self.log_fct(db, uid_orig, model, method, fct_src, *args) - return super(audittrail_objects_proxy, self).exec_workflow(db, uid_orig, model, method, *args, **argv) - - return True - finally: - cr.close() + def exec_workflow_cr(self, cr, uid, model, method, *args, **argv): + fct_src = super(audittrail_objects_proxy, self).exec_workflow_cr + if self.check_rules(cr,uid,model,'workflow'): + res = self.log_fct(cr, uid, model, method, fct_src, *args) + else: + res = fct_src(cr, uid, model, method, *args) + return res audittrail_objects_proxy() diff --git a/addons/base_action_rule/i18n/zh_TW.po b/addons/base_action_rule/i18n/zh_TW.po new file mode 100644 index 00000000000..843ebd43833 --- /dev/null +++ b/addons/base_action_rule/i18n/zh_TW.po @@ -0,0 +1,502 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 12:38+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: base_action_rule +#: help:base.action.rule,act_mail_to_user:0 +msgid "" +"Check this if you want the rule to send an email to the responsible person." +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_remind_partner:0 +msgid "Remind Partner" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,trg_partner_categ_id:0 +msgid "Partner Category" +msgstr "伙伴分類" + +#. module: base_action_rule +#: field:base.action.rule,act_mail_to_watchers:0 +msgid "Mail to Watchers (CC)" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,trg_state_to:0 +msgid "Button Pressed" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,model_id:0 +msgid "Object" +msgstr "物件" + +#. module: base_action_rule +#: field:base.action.rule,act_mail_to_email:0 +msgid "Mail to these Emails" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_state:0 +msgid "Set State to" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_email_from:0 +msgid "Email From" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Email Body" +msgstr "" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_range_type:0 +msgid "Days" +msgstr "日" + +#. module: base_action_rule +#: field:base.action.rule,last_run:0 +msgid "Last Run" +msgstr "" + +#. module: base_action_rule +#: code:addons/base_action_rule/base_action_rule.py:313 +#, python-format +msgid "Error!" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_reply_to:0 +msgid "Reply-To" +msgstr "" + +#. module: base_action_rule +#: help:base.action.rule,act_email_cc:0 +msgid "" +"These people will receive a copy of the future communication between partner " +"and users by email" +msgstr "" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_range_type:0 +msgid "Minutes" +msgstr "分鐘" + +#. module: base_action_rule +#: field:base.action.rule,name:0 +msgid "Rule Name" +msgstr "規則名稱" + +#. module: base_action_rule +#: help:base.action.rule,act_remind_partner:0 +msgid "" +"Check this if you want the rule to send a reminder by email to the partner." +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Conditions on Model Partner" +msgstr "" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_type:0 +msgid "Deadline" +msgstr "最後限期" + +#. module: base_action_rule +#: field:base.action.rule,trg_partner_id:0 +msgid "Partner" +msgstr "伙伴" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(object_subject)s = Object subject" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Email Reminders" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Special Keywords to Be Used in The Body" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,trg_state_from:0 +msgid "State" +msgstr "" + +#. module: base_action_rule +#: model:ir.actions.act_window,help:base_action_rule.base_action_rule_act +msgid "" +"Use automated actions to automatically trigger actions for various screens. " +"Example: a lead created by a specific user may be automatically set to a " +"specific sales team, or an opportunity which still has status pending after " +"14 days might trigger an automatic reminder email." +msgstr "" + +#. module: base_action_rule +#: help:base.action.rule,act_mail_to_email:0 +msgid "Email-id of the persons whom mail is to be sent" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +#: model:ir.module.module,shortdesc:base_action_rule.module_meta_information +msgid "Action Rule" +msgstr "動作規則" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Fields to Change" +msgstr "要變更欄位" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_type:0 +msgid "Creation Date" +msgstr "建立日期" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_type:0 +msgid "Last Action Date" +msgstr "最後動作日期" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_range_type:0 +msgid "Hours" +msgstr "小時" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(object_id)s = Object ID" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Delay After Trigger Date" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_remind_attach:0 +msgid "Remind with Attachment" +msgstr "" + +#. module: base_action_rule +#: constraint:ir.cron:0 +msgid "Invalid arguments" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_user_id:0 +msgid "Set Responsible to" +msgstr "" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_type:0 +msgid "None" +msgstr "無" + +#. module: base_action_rule +#: help:base.action.rule,act_email_to:0 +msgid "" +"Use a python expression to specify the right field on which one than we will " +"use for the 'To' field of the header" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(object_user_phone)s = Responsible phone" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "" +"The rule uses the AND operator. The model must match all non-empty fields so " +"that the rule executes the action described in the 'Actions' tab." +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,trg_date_range_type:0 +msgid "Delay type" +msgstr "延遲類型" + +#. module: base_action_rule +#: help:base.action.rule,regex_name:0 +msgid "" +"Regular expression for matching name of the resource\n" +"e.g.: 'urgent.*' will search for records having name starting with the " +"string 'urgent'\n" +"Note: This is case sensitive search." +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_method:0 +msgid "Call Object Method" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_email_to:0 +msgid "Email To" +msgstr "電郵至" + +#. module: base_action_rule +#: help:base.action.rule,act_mail_to_watchers:0 +msgid "" +"Check this if you want the rule to mark CC(mail to any other person defined " +"in actions)." +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(partner)s = Partner name" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Note" +msgstr "備註" + +#. module: base_action_rule +#: help:base.action.rule,act_email_from:0 +msgid "" +"Use a python expression to specify the right field on which one than we will " +"use for the 'From' field of the header" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,trg_date_range:0 +msgid "Delay after trigger date" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Conditions" +msgstr "條件" + +#. module: base_action_rule +#: help:base.action.rule,trg_date_range:0 +msgid "" +"Delay After Trigger Date,specifies you can put a negative number. If you " +"need a delay before the trigger date, like sending a reminder 15 minutes " +"before a meeting." +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,active:0 +msgid "Active" +msgstr "活躍" + +#. module: base_action_rule +#: code:addons/base_action_rule/base_action_rule.py:314 +#, python-format +msgid "No E-Mail ID Found for your Company address!" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_remind_user:0 +msgid "Remind Responsible" +msgstr "" + +#. module: base_action_rule +#: model:ir.module.module,description:base_action_rule.module_meta_information +msgid "This module allows to implement action rules for any object." +msgstr "" + +#. module: base_action_rule +#: help:base.action.rule,sequence:0 +msgid "Gives the sequence order when displaying a list of rules." +msgstr "" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_range_type:0 +msgid "Months" +msgstr "月" + +#. module: base_action_rule +#: field:base.action.rule,filter_id:0 +msgid "Filter" +msgstr "" + +#. module: base_action_rule +#: selection:base.action.rule,trg_date_type:0 +msgid "Date" +msgstr "日期" + +#. module: base_action_rule +#: help:base.action.rule,server_action_id:0 +msgid "" +"Describes the action name.\n" +"eg:on which object which action to be taken on basis of which condition" +msgstr "" + +#. module: base_action_rule +#: model:ir.model,name:base_action_rule.model_ir_cron +msgid "ir.cron" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(object_description)s = Object description" +msgstr "" + +#. module: base_action_rule +#: constraint:base.action.rule:0 +msgid "Error: The mail is not well formated" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Email Actions" +msgstr "電郵動作" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Email Information" +msgstr "電郵資料" + +#. module: base_action_rule +#: model:ir.model,name:base_action_rule.model_base_action_rule +msgid "Action Rules" +msgstr "動作規則" + +#. module: base_action_rule +#: help:base.action.rule,act_mail_body:0 +msgid "Content of mail" +msgstr "郵件內容" + +#. module: base_action_rule +#: field:base.action.rule,trg_user_id:0 +msgid "Responsible" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(partner_email)s = Partner Email" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(object_date)s = Creation date" +msgstr "%(object_date)s = 建立日期" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(object_user_email)s = Responsible Email" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_mail_body:0 +msgid "Mail body" +msgstr "郵件內文" + +#. module: base_action_rule +#: help:base.action.rule,act_remind_user:0 +msgid "" +"Check this if you want the rule to send a reminder by email to the user." +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Server Action to be Triggered" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_mail_to_user:0 +msgid "Mail to Responsible" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,act_email_cc:0 +msgid "Add Watchers (Cc)" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Conditions on Model Fields" +msgstr "" + +#. module: base_action_rule +#: model:ir.actions.act_window,name:base_action_rule.base_action_rule_act +#: model:ir.ui.menu,name:base_action_rule.menu_base_action_rule_form +msgid "Automated Actions" +msgstr "自動化動作" + +#. module: base_action_rule +#: field:base.action.rule,server_action_id:0 +msgid "Server Action" +msgstr "伺服器動作" + +#. module: base_action_rule +#: field:base.action.rule,regex_name:0 +msgid "Regex on Resource Name" +msgstr "" + +#. module: base_action_rule +#: help:base.action.rule,act_remind_attach:0 +msgid "" +"Check this if you want that all documents attached to the object be attached " +"to the reminder email sent." +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Conditions on Timing" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,sequence:0 +msgid "Sequence" +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Actions" +msgstr "動作" + +#. module: base_action_rule +#: help:base.action.rule,active:0 +msgid "" +"If the active field is set to False, it will allow you to hide the rule " +"without removing it." +msgstr "" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "%(object_user)s = Responsible name" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,create_date:0 +msgid "Create Date" +msgstr "建立日期" + +#. module: base_action_rule +#: view:base.action.rule:0 +msgid "Conditions on States" +msgstr "" + +#. module: base_action_rule +#: field:base.action.rule,trg_date_type:0 +msgid "Trigger Date" +msgstr "" diff --git a/addons/base_crypt/i18n/zh_TW.po b/addons/base_crypt/i18n/zh_TW.po new file mode 100644 index 00000000000..05f2159e5fa --- /dev/null +++ b/addons/base_crypt/i18n/zh_TW.po @@ -0,0 +1,71 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 13:07+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: base_crypt +#: sql_constraint:res.users:0 +msgid "You can not have two users with the same login !" +msgstr "" + +#. module: base_crypt +#: model:ir.model,name:base_crypt.model_res_users +msgid "res.users" +msgstr "" + +#. module: base_crypt +#: constraint:res.users:0 +msgid "The chosen company is not in the allowed companies for this user" +msgstr "" + +#. module: base_crypt +#: code:addons/base_crypt/crypt.py:132 +#, python-format +msgid "Please specify the password !" +msgstr "請指定密碼 !" + +#. module: base_crypt +#: model:ir.module.module,shortdesc:base_crypt.module_meta_information +msgid "Base - Password Encryption" +msgstr "基礎 - 密碼加密" + +#. module: base_crypt +#: code:addons/base_crypt/crypt.py:132 +#, python-format +msgid "Error" +msgstr "" + +#. module: base_crypt +#: model:ir.module.module,description:base_crypt.module_meta_information +msgid "" +"This module replaces the cleartext password in the database with a password " +"hash,\n" +"preventing anyone from reading the original password.\n" +"For your existing user base, the removal of the cleartext passwords occurs " +"the first time\n" +"a user logs into the database, after installing base_crypt.\n" +"After installing this module it won't be possible to recover a forgotten " +"password for your\n" +"users, the only solution is for an admin to set a new password.\n" +"\n" +"Note: installing this module does not mean you can ignore basic security " +"measures,\n" +"as the password is still transmitted unencrypted on the network (by the " +"client),\n" +"unless you are using a secure protocol such as XML-RPCS.\n" +" " +msgstr "" diff --git a/addons/base_report_creator/i18n/zh_HK.po b/addons/base_report_creator/i18n/zh_HK.po new file mode 100644 index 00000000000..3fd9b173e63 --- /dev/null +++ b/addons/base_report_creator/i18n/zh_HK.po @@ -0,0 +1,518 @@ +# Chinese (Hong Kong) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 13:44+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Hong Kong) <zh_HK@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: base_report_creator +#: help:base_report_creator.report.filter,expression:0 +msgid "" +"Provide an expression for the field based on which you want to filter the " +"records.\n" +" e.g. res_partner.id=3" +msgstr "" + +#. module: base_report_creator +#: model:ir.model,name:base_report_creator.model_report_menu_create +msgid "Menu Create" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,view_graph_type:0 +msgid "Graph Type" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Used View" +msgstr "" + +#. module: base_report_creator +#: wizard_view:base_report_creator.report_filter.fields,set_value_select_field:0 +msgid "Filter Values" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report.fields,graph_mode:0 +msgid "Graph Mode" +msgstr "" + +#. module: base_report_creator +#: code:addons/base_report_creator/base_report_creator.py:310 +#, python-format +msgid "" +"These is/are model(s) (%s) in selection which is/are not related to any " +"other model" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Legend" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Graph View" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report.filter,expression:0 +msgid "Value" +msgstr "" + +#. module: base_report_creator +#: model:ir.actions.wizard,name:base_report_creator.wizard_set_filter_fields +msgid "Set Filter Fields" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,calendar_mode:0 +msgid "Ending Date" +msgstr "" + +#. module: base_report_creator +#: model:ir.model,name:base_report_creator.model_base_report_creator_report_filter +msgid "Report Filters" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +#: field:base_report_creator.report,sql_query:0 +msgid "SQL Query" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +#: view:report.menu.create:0 +msgid "Create Menu" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,group_method:0 +msgid "Minimum" +msgstr "" + +#. module: base_report_creator +#: wizard_field:base_report_creator.report_filter.fields,set_value_select_field,operator:0 +msgid "Operator" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.filter,condition:0 +#: selection:base_report_creator.report_filter.fields,set_value_select_field,condition:0 +msgid "OR" +msgstr "" + +#. module: base_report_creator +#: model:ir.actions.act_window,name:base_report_creator.base_report_creator_action +msgid "Custom Reports" +msgstr "" + +#. module: base_report_creator +#: code:addons/base_report_creator/base_report_creator.py:310 +#, python-format +msgid "No Related Models!!" +msgstr "" + +#. module: base_report_creator +#: view:report.menu.create:0 +msgid "Menu Information" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,group_method:0 +msgid "Sum" +msgstr "" + +#. module: base_report_creator +#: constraint:base_report_creator.report:0 +msgid "You must have to give calendar view's color,start date and delay." +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,model_ids:0 +msgid "Reported Objects" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Field List" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,type:0 +msgid "Report Type" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Add filter" +msgstr "" + +#. module: base_report_creator +#: model:ir.actions.act_window,name:base_report_creator.action_report_menu_create +msgid "Create Menu for Report" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_type1:0 +#: selection:base_report_creator.report,view_type2:0 +#: selection:base_report_creator.report,view_type3:0 +msgid "Form" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_type2:0 +#: selection:base_report_creator.report,view_type3:0 +#: selection:base_report_creator.report.fields,calendar_mode:0 +#: selection:base_report_creator.report.fields,graph_mode:0 +msgid "/" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +#: field:base_report_creator.report.fields,report_id:0 +#: field:base_report_creator.report.filter,report_id:0 +#: model:ir.model,name:base_report_creator.model_base_report_creator_report +#: model:ir.model,name:base_report_creator.model_base_report_creator_report_result +msgid "Report" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,calendar_mode:0 +msgid "Starting Date" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Filters on Fields" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,group_ids:0 +msgid "Authorized Groups" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_type1:0 +#: selection:base_report_creator.report,view_type2:0 +#: selection:base_report_creator.report,view_type3:0 +msgid "Tree" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,view_graph_orientation:0 +msgid "Graph Orientation" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Authorized Groups (empty for all)" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Security" +msgstr "保安" + +#. module: base_report_creator +#: field:report.menu.create,menu_name:0 +msgid "Menu Name" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.filter,condition:0 +#: selection:base_report_creator.report_filter.fields,set_value_select_field,condition:0 +msgid "AND" +msgstr "" + +#. module: base_report_creator +#: constraint:base_report_creator.report:0 +msgid "You can not display field which are not stored in Database." +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report.fields,calendar_mode:0 +msgid "Calendar Mode" +msgstr "" + +#. module: base_report_creator +#: model:ir.model,name:base_report_creator.model_base_report_creator_report_fields +msgid "Display Fields" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,graph_mode:0 +msgid "Y Axis" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_type1:0 +#: selection:base_report_creator.report,view_type2:0 +#: selection:base_report_creator.report,view_type3:0 +msgid "Calendar" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_type1:0 +#: selection:base_report_creator.report,view_type2:0 +#: selection:base_report_creator.report,view_type3:0 +msgid "Graph" +msgstr "" + +#. module: base_report_creator +#: wizard_field:base_report_creator.report_filter.fields,set_value_select_field,field_id:0 +msgid "Field Name" +msgstr "" + +#. module: base_report_creator +#: wizard_view:base_report_creator.report_filter.fields,set_value_select_field:0 +msgid "Set Filter Values" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_graph_orientation:0 +msgid "Vertical" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,type:0 +msgid "Rows And Columns Report" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "General Configuration" +msgstr "" + +#. module: base_report_creator +#: help:base_report_creator.report.fields,sequence:0 +msgid "Gives the sequence order when displaying a list of fields." +msgstr "" + +#. module: base_report_creator +#: wizard_view:base_report_creator.report_filter.fields,init:0 +msgid "Select Field to filter" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,active:0 +msgid "Active" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_graph_orientation:0 +msgid "Horizontal" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report.fields,group_method:0 +msgid "Grouping Method" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report.filter,condition:0 +#: wizard_field:base_report_creator.report_filter.fields,set_value_select_field,condition:0 +msgid "Condition" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,group_method:0 +msgid "Count" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,graph_mode:0 +msgid "X Axis" +msgstr "" + +#. module: base_report_creator +#: field:report.menu.create,menu_parent_id:0 +msgid "Parent Menu" +msgstr "" + +#. module: base_report_creator +#: wizard_button:base_report_creator.report_filter.fields,set_value_select_field,set_value:0 +msgid "Confirm Filter" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report.filter,name:0 +msgid "Filter Name" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Open Report" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,group_method:0 +msgid "Grouped" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +#: model:ir.module.module,shortdesc:base_report_creator.module_meta_information +msgid "Report Creator" +msgstr "" + +#. module: base_report_creator +#: wizard_button:base_report_creator.report_filter.fields,init,end:0 +#: wizard_button:base_report_creator.report_filter.fields,set_value_select_field,end:0 +#: view:report.menu.create:0 +msgid "Cancel" +msgstr "" + +#. module: base_report_creator +#: constraint:base_report_creator.report:0 +msgid "You can apply aggregate function to the non calculated field." +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,menu_id:0 +msgid "Menu" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,view_type1:0 +msgid "First View" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,calendar_mode:0 +msgid "Delay" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report.fields,field_id:0 +msgid "Field" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,calendar_mode:0 +msgid "Unique Colors" +msgstr "" + +#. module: base_report_creator +#: help:base_report_creator.report,active:0 +msgid "" +"If the active field is set to False, it will allow you to hide the report " +"without removing it." +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_graph_type:0 +msgid "Pie Chart" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,view_type3:0 +msgid "Third View" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,calendar_mode:0 +msgid "End Date" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,name:0 +msgid "Report Name" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Fields" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,group_method:0 +msgid "Average" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "Use %(uid)s to filter by the connected user" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report.fields,group_method:0 +msgid "Maximum" +msgstr "" + +#. module: base_report_creator +#: wizard_button:base_report_creator.report_filter.fields,init,set_value_select_field:0 +msgid "Continue" +msgstr "" + +#. module: base_report_creator +#: wizard_field:base_report_creator.report_filter.fields,set_value_select_field,value:0 +msgid "Values" +msgstr "" + +#. module: base_report_creator +#: selection:base_report_creator.report,view_graph_type:0 +msgid "Bar Chart" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report,view_type2:0 +msgid "Second View" +msgstr "" + +#. module: base_report_creator +#: view:report.menu.create:0 +msgid "Create Menu For This Report" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +msgid "View parameters" +msgstr "" + +#. module: base_report_creator +#: field:base_report_creator.report.fields,sequence:0 +msgid "Sequence" +msgstr "" + +#. module: base_report_creator +#: wizard_field:base_report_creator.report_filter.fields,init,field_id:0 +msgid "Filter Field" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +#: field:base_report_creator.report,field_ids:0 +msgid "Fields to Display" +msgstr "" + +#. module: base_report_creator +#: view:base_report_creator.report:0 +#: field:base_report_creator.report,filter_ids:0 +msgid "Filters" +msgstr "" + +#. module: base_report_creator +#: model:ir.module.module,description:base_report_creator.module_meta_information +msgid "" +"This module allows you to create any statistic\n" +"report on several objects. It's a SQL query builder and browser\n" +"for and users.\n" +"\n" +"After installing the module, it adds a menu to define custom report in\n" +"the \"Dashboard\" menu.\n" +msgstr "" diff --git a/addons/base_report_designer/i18n/zh_TW.po b/addons/base_report_designer/i18n/zh_TW.po index 1808e5426b9..70d2982f5f8 100644 --- a/addons/base_report_designer/i18n/zh_TW.po +++ b/addons/base_report_designer/i18n/zh_TW.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:14+0000\n" -"PO-Revision-Date: 2009-01-30 12:44+0000\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2011-09-27 14:38+0000\n" +"Last-Translator: Walter Cheuk <wwycheuk@gmail.com>\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:28+0000\n" -"X-Generator: Launchpad (build 13830)\n" +"X-Launchpad-Export-Date: 2011-09-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" #. module: base_report_designer #: model:ir.model,name:base_report_designer.model_base_report_sxw @@ -24,12 +24,12 @@ msgstr "" #. module: base_report_designer #: view:base_report_designer.installer:0 msgid "OpenERP Report Designer Configuration" -msgstr "" +msgstr "OpenERP 報表設計師配置" #. module: base_report_designer #: model:ir.module.module,shortdesc:base_report_designer.module_meta_information msgid "Report designer interface module" -msgstr "" +msgstr "報表設計師介面模組" #. module: base_report_designer #: view:base_report_designer.installer:0 @@ -41,7 +41,7 @@ msgstr "" #. module: base_report_designer #: view:base.report.file.sxw:0 msgid "Upload the modified report" -msgstr "" +msgstr "上載已修改報表" #. module: base_report_designer #: model:ir.module.module,description:base_report_designer.module_meta_information @@ -59,7 +59,7 @@ msgstr "" #. module: base_report_designer #: view:base.report.file.sxw:0 msgid "The .SXW report" -msgstr "" +msgstr ".SXW 報表" #. module: base_report_designer #: model:ir.model,name:base_report_designer.model_base_report_designer_installer @@ -69,33 +69,33 @@ msgstr "" #. module: base_report_designer #: field:base_report_designer.installer,description:0 msgid "Description" -msgstr "" +msgstr "說明" #. module: base_report_designer #: view:base_report_designer.installer:0 msgid "_Close" -msgstr "" +msgstr "關閉(_C)" #. module: base_report_designer #: view:base.report.rml.save:0 msgid "The RML report" -msgstr "" +msgstr "RML 報表" #. module: base_report_designer #: view:base_report_designer.installer:0 msgid "Configure" -msgstr "" +msgstr "配置" #. module: base_report_designer #: view:base_report_designer.installer:0 msgid "title" -msgstr "" +msgstr "標題" #. module: base_report_designer #: field:base.report.file.sxw,report_id:0 #: field:base.report.sxw,report_id:0 msgid "Report" -msgstr "" +msgstr "報表" #. module: base_report_designer #: model:ir.model,name:base_report_designer.model_base_report_rml_save @@ -105,62 +105,62 @@ msgstr "" #. module: base_report_designer #: model:ir.ui.menu,name:base_report_designer.menu_action_report_designer_wizard msgid "Report Designer" -msgstr "" +msgstr "報表設計師" #. module: base_report_designer #: field:base_report_designer.installer,name:0 msgid "File name" -msgstr "" +msgstr "檔案名稱" #. module: base_report_designer #: view:base.report.file.sxw:0 #: view:base.report.sxw:0 msgid "Get a report" -msgstr "" +msgstr "取得報表" #. module: base_report_designer #: view:base_report_designer.installer:0 #: model:ir.actions.act_window,name:base_report_designer.action_report_designer_wizard msgid "OpenERP Report Designer" -msgstr "" +msgstr "OpenERP 報表設計師" #. module: base_report_designer #: view:base.report.sxw:0 msgid "Continue" -msgstr "" +msgstr "繼續" #. module: base_report_designer #: field:base.report.rml.save,file_rml:0 msgid "Save As" -msgstr "" +msgstr "另存為..." #. module: base_report_designer #: help:base_report_designer.installer,plugin_file:0 msgid "" "OpenObject Report Designer plug-in file. Save as this file and install this " "plug-in in OpenOffice." -msgstr "" +msgstr "OpenObject 報表設計師插件檔。儲存此檔並於 OpenOffice 安裝此插件。" #. module: base_report_designer #: view:base.report.rml.save:0 msgid "Save RML FIle" -msgstr "" +msgstr "儲存 RML 檔案" #. module: base_report_designer #: field:base.report.file.sxw,file_sxw:0 #: field:base.report.file.sxw,file_sxw_upload:0 msgid "Your .SXW file" -msgstr "" +msgstr "您的 .SXW 檔案" #. module: base_report_designer #: view:base_report_designer.installer:0 msgid "Installation and Configuration Steps" -msgstr "" +msgstr "安裝及配置步驟" #. module: base_report_designer #: field:base_report_designer.installer,progress:0 msgid "Configuration Progress" -msgstr "" +msgstr "配置進度" #. module: base_report_designer #: view:base.report.file.sxw:0 @@ -174,17 +174,17 @@ msgstr "" #. module: base_report_designer #: view:base_report_designer.installer:0 msgid "Skip" -msgstr "" +msgstr "略過" #. module: base_report_designer #: field:base_report_designer.installer,config_logo:0 msgid "Image" -msgstr "" +msgstr "圖像" #. module: base_report_designer #: model:ir.actions.act_window,name:base_report_designer.action_view_base_report_sxw msgid "Base Report sxw" -msgstr "" +msgstr "基礎報表 sxw" #. module: base_report_designer #: model:ir.model,name:base_report_designer.model_base_report_file_sxw @@ -194,19 +194,19 @@ msgstr "" #. module: base_report_designer #: field:base_report_designer.installer,plugin_file:0 msgid "OpenObject Report Designer Plug-in" -msgstr "" +msgstr "OpenObject 報表設計師插件" #. module: base_report_designer #: model:ir.actions.act_window,name:base_report_designer.action_report_designer_installer msgid "OpenERP Report Designer Installation" -msgstr "" +msgstr "OpenERP 報表設計師安裝" #. module: base_report_designer #: view:base.report.file.sxw:0 #: view:base.report.rml.save:0 #: view:base.report.sxw:0 msgid "Cancel" -msgstr "" +msgstr "取消" #. module: base_report_designer #: model:ir.model,name:base_report_designer.model_ir_actions_report_xml @@ -216,4 +216,4 @@ msgstr "" #. module: base_report_designer #: view:base.report.sxw:0 msgid "Select your report" -msgstr "" +msgstr "選取您的報表" diff --git a/addons/base_setup/base_setup.py b/addons/base_setup/base_setup.py index 340c2f93044..5717df8681f 100644 --- a/addons/base_setup/base_setup.py +++ b/addons/base_setup/base_setup.py @@ -289,7 +289,7 @@ class specify_partner_terminology(osv.osv_memory): field_ref = f_id.model_id.model + ',' + f_id.name self.make_translations(cr, uid, ids, field_ref, 'field', f_id.field_description, _case_insensitive_replace(f_id.field_description,'Customer',o.partner), context=context) #translate help tooltip of field - for obj in self.pool.obj_pool.values(): + for obj in self.pool.models.values(): for field_name, field_rec in obj._columns.items(): if field_rec.help.lower().count('customer'): field_ref = obj._name + ',' + field_name diff --git a/addons/base_synchro/i18n/zh_TW.po b/addons/base_synchro/i18n/zh_TW.po new file mode 100644 index 00000000000..a4fc9db7d81 --- /dev/null +++ b/addons/base_synchro/i18n/zh_TW.po @@ -0,0 +1,289 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 14:38+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: base_synchro +#: model:ir.actions.act_window,name:base_synchro.action_view_base_synchro +msgid "Base Synchronization" +msgstr "基礎同步化" + +#. module: base_synchro +#: field:base.synchro.server,server_db:0 +msgid "Server Database" +msgstr "伺服器資料庫" + +#. module: base_synchro +#: view:base.synchro.server:0 +#: model:ir.model,name:base_synchro.model_base_synchro_server +msgid "Synchronized server" +msgstr "同步化伺服器" + +#. module: base_synchro +#: field:base.synchro.obj.avoid,name:0 +msgid "Field Name" +msgstr "欄位名稱" + +#. module: base_synchro +#: field:base.synchro.obj,synchronize_date:0 +msgid "Latest Synchronization" +msgstr "最新同步化" + +#. module: base_synchro +#: field:base.synchro,user_id:0 +msgid "Send Result To" +msgstr "將結果發送至" + +#. module: base_synchro +#: model:ir.model,name:base_synchro.model_base_synchro_obj_avoid +msgid "Fields to not synchronize" +msgstr "不同步化之欄位" + +#. module: base_synchro +#: view:base.synchro:0 +msgid "_Close" +msgstr "關閉(_C)" + +#. module: base_synchro +#: view:base.synchro:0 +msgid "Transfer Data To Server" +msgstr "將資料轉至伺服器" + +#. module: base_synchro +#: model:ir.model,name:base_synchro.model_base_synchro_obj +msgid "Register Class" +msgstr "" + +#. module: base_synchro +#: view:base.synchro.obj:0 +#: model:ir.actions.act_window,name:base_synchro.action_transfer_tree +#: model:ir.ui.menu,name:base_synchro.transfer_menu_id +msgid "Synchronized objects" +msgstr "同步化物件" + +#. module: base_synchro +#: field:base.synchro.server,obj_ids:0 +msgid "Models" +msgstr "模型" + +#. module: base_synchro +#: field:base.synchro.obj.avoid,obj_id:0 +#: view:base.synchro.obj.line:0 +#: field:base.synchro.obj.line,obj_id:0 +msgid "Object" +msgstr "物件" + +#. module: base_synchro +#: field:base.synchro.server,login:0 +msgid "User Name" +msgstr "" + +#. module: base_synchro +#: view:base.synchro.obj:0 +#: view:base.synchro.obj.line:0 +msgid "Group By" +msgstr "" + +#. module: base_synchro +#: selection:base.synchro.obj,action:0 +msgid "Upload" +msgstr "上載" + +#. module: base_synchro +#: view:base.synchro.obj:0 +msgid "Latest synchronization" +msgstr "最新同步化" + +#. module: base_synchro +#: model:ir.module.module,description:base_synchro.module_meta_information +msgid "Synchronization with all objects." +msgstr "與所有物件同步化。" + +#. module: base_synchro +#: view:base.synchro.obj.line:0 +#: field:base.synchro.obj.line,name:0 +msgid "Date" +msgstr "日期" + +#. module: base_synchro +#: field:base.synchro.server,password:0 +msgid "Password" +msgstr "密碼" + +#. module: base_synchro +#: field:base.synchro.obj,avoid_ids:0 +msgid "Fields Not Sync." +msgstr "無同步化欄位" + +#. module: base_synchro +#: selection:base.synchro.obj,action:0 +msgid "Both" +msgstr "兩者" + +#. module: base_synchro +#: field:base.synchro.obj,name:0 +msgid "Name" +msgstr "名稱" + +#. module: base_synchro +#: view:base.synchro.obj:0 +msgid "Fields" +msgstr "欄位" + +#. module: base_synchro +#: view:base.synchro.obj.line:0 +msgid "Transfered Ids Details" +msgstr "已傳送 Ids 詳情" + +#. module: base_synchro +#: field:base.synchro.obj,action:0 +msgid "Synchronisation direction" +msgstr "同步化方向" + +#. module: base_synchro +#: field:base.synchro.obj,server_id:0 +msgid "Server" +msgstr "伺服器" + +#. module: base_synchro +#: model:ir.actions.act_window,name:base_synchro.action_base_synchro_obj_line_tree +#: model:ir.model,name:base_synchro.model_base_synchro_obj_line +#: model:ir.ui.menu,name:base_synchro.menu_action_base_synchro_obj_line_tree +msgid "Synchronized instances" +msgstr "" + +#. module: base_synchro +#: field:base.synchro.obj,active:0 +msgid "Active" +msgstr "作用中" + +#. module: base_synchro +#: view:base.synchro.obj:0 +#: field:base.synchro.obj,model_id:0 +msgid "Object to synchronize" +msgstr "要同步化物件" + +#. module: base_synchro +#: model:ir.module.module,shortdesc:base_synchro.module_meta_information +msgid "Base Synchro" +msgstr "" + +#. module: base_synchro +#: model:ir.actions.act_window,name:base_synchro.action_base_synchro_server_tree +#: model:ir.ui.menu,name:base_synchro.synchro_server_tree_menu_id +msgid "Servers to be synchronized" +msgstr "要同步化伺服器" + +#. module: base_synchro +#: view:base.synchro.obj:0 +msgid "Transfer Details" +msgstr "傳送詳情" + +#. module: base_synchro +#: field:base.synchro.obj.line,remote_id:0 +msgid "Remote Id" +msgstr "遠端 Id" + +#. module: base_synchro +#: field:base.synchro.obj,line_id:0 +msgid "Ids Affected" +msgstr "受影響 Ids" + +#. module: base_synchro +#: model:ir.ui.menu,name:base_synchro.next_id_63 +msgid "History" +msgstr "歷史紀錄" + +#. module: base_synchro +#: model:ir.ui.menu,name:base_synchro.next_id_62 +#: model:ir.ui.menu,name:base_synchro.synch_config +msgid "Synchronization" +msgstr "同步化" + +#. module: base_synchro +#: field:base.synchro.obj,domain:0 +msgid "Domain" +msgstr "領域" + +#. module: base_synchro +#: view:base.synchro:0 +msgid "_Synchronize" +msgstr "同步化(_S)" + +#. module: base_synchro +#: view:base.synchro:0 +msgid "OK" +msgstr "" + +#. module: base_synchro +#: field:base.synchro.server,name:0 +msgid "Server name" +msgstr "伺服器名稱" + +#. module: base_synchro +#: field:base.synchro.obj,sequence:0 +msgid "Sequence" +msgstr "次序" + +#. module: base_synchro +#: view:base.synchro:0 +msgid "" +"The synchronisation has been started.You will receive a request when it's " +"done." +msgstr "同步化已開始。完成時會收到要求。" + +#. module: base_synchro +#: field:base.synchro.server,server_port:0 +msgid "Server Port" +msgstr "伺服器連接埠" + +#. module: base_synchro +#: model:ir.ui.menu,name:base_synchro.menu_action_view_base_synchro +msgid "Synchronize objects" +msgstr "同步化物件" + +#. module: base_synchro +#: view:base.synchro:0 +msgid "Synchronization Complited!" +msgstr "同步化完成!" + +#. module: base_synchro +#: model:ir.model,name:base_synchro.model_base_synchro +msgid "base.synchro" +msgstr "" + +#. module: base_synchro +#: field:base.synchro.obj.line,local_id:0 +msgid "Local Id" +msgstr "本機 Id" + +#. module: base_synchro +#: model:ir.actions.act_window,name:base_synchro.actions_regclass_tree +#: model:ir.actions.act_window,name:base_synchro.actions_transfer_line_form +msgid "Filters" +msgstr "" + +#. module: base_synchro +#: selection:base.synchro.obj,action:0 +msgid "Download" +msgstr "下載" + +#. module: base_synchro +#: field:base.synchro,server_url:0 +#: field:base.synchro.server,server_url:0 +msgid "Server URL" +msgstr "伺服器 URL" diff --git a/addons/base_tools/i18n/zh_TW.po b/addons/base_tools/i18n/zh_TW.po new file mode 100644 index 00000000000..b38f10132cf --- /dev/null +++ b/addons/base_tools/i18n/zh_TW.po @@ -0,0 +1,32 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2011-09-27 14:45+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\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/crm.py b/addons/crm/crm.py index 512192ddce7..4031f3d9868 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -381,7 +381,7 @@ class crm_case(crm_base): default.update({ 'date_closed': False, }) if self._columns.get('date_open'): default.update({ 'date_open': False }) - return super(osv.osv, self).copy(cr, uid, id, default, context=context) + return super(crm_case, self).copy(cr, uid, id, default, context=context) def case_open(self, cr, uid, ids, *args): 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 @@ <field name="domain">['|', ('type','=','lead'), ('type','=',False)]</field> <field name="view_id" ref="crm_case_tree_view_leads"/> <field name="search_view_id" ref="crm.view_crm_case_leads_filter"/> - <field name="context">{'search_default_current':1, 'default_type': 'lead', 'search_default_section_id': section_id, 'stage_type': 'lead'}</field> + <field name="context">{'search_default_new':1, 'default_type': 'lead', 'search_default_section_id': section_id, 'stage_type': 'lead'}</field> <field name="help">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.</field> </record> @@ -62,7 +62,7 @@ <field name="res_model">crm.lead</field> <field name="view_mode">tree,form,graph,calendar,kanban</field> <field name="domain">[('type','=','opportunity')]</field> - <field name="context">{'search_default_user_id':uid,'search_default_current':1, 'search_default_section_id':section_id, 'stage_type': 'opportunity', 'default_type': 'opportunity'}</field> + <field name="context">{'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'}</field> <field name="view_id" ref="crm_case_tree_view_oppor"/> <field name="search_view_id" ref="crm.view_crm_case_opportunities_filter"/> <field name="help">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 12a3428236d..42587eea2b0 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -372,13 +372,15 @@ <search string="Search Leads"> <filter icon="terp-check" string="New" - name="current" help="New Leads" + name="new" help="New Leads" domain="[('state','=','draft')]"/> <filter icon="terp-camera_test" string="Open" + name="open" domain="[('state','=','open')]"/> <filter icon="terp-gtk-media-pause" string="Pending" + name="pending" domain="[('state','=','pending')]"/> <separator orientation="vertical"/> @@ -675,13 +677,15 @@ <search string="Search Opportunities"> <filter icon="terp-check" string="New" help="New Opportunities" - name="current" + name="new" domain="[('state','=','draft')]"/> <filter icon="terp-camera_test" string="Open" help="Open Opportunities" + name="open" domain="[('state','=','open')]"/> <filter icon="terp-gtk-media-pause" string="Pending" help="Pending Opportunities" + name="pending" domain="[('state','=','pending')]"/> <separator orientation="vertical"/> <field name="name" string="Opportunity"/> diff --git a/addons/crm/i18n/zh_TW.po b/addons/crm/i18n/zh_TW.po index 896a92d76a0..cb7df534f37 100644 --- a/addons/crm/i18n/zh_TW.po +++ b/addons/crm/i18n/zh_TW.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:15+0000\n" -"PO-Revision-Date: 2011-01-27 05:08+0000\n" +"PO-Revision-Date: 2011-09-27 07:26+0000\n" "Last-Translator: Walter Cheuk <wwycheuk@gmail.com>\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:08+0000\n" -"X-Generator: Launchpad (build 13830)\n" +"X-Launchpad-Export-Date: 2011-09-28 05:19+0000\n" +"X-Generator: Launchpad (build 14049)\n" #. module: crm #: view:crm.lead.report:0 @@ -78,7 +78,7 @@ msgstr "今日" #. module: crm #: view:crm.merge.opportunity:0 msgid "Select Opportunities" -msgstr "選取機會" +msgstr "選擇機會" #. module: crm #: view:crm.meeting:0 @@ -184,7 +184,7 @@ msgstr "搜尋機會" #, python-format msgid "" "Opportunity must have Partner assigned before merging with other Opportunity." -msgstr "機會要先安排伙伴才可合併。" +msgstr "機會要先安排伙伴才可與其他機會合併。" #. module: crm #: code:addons/crm/wizard/crm_merge_opportunities.py:46 @@ -249,7 +249,7 @@ msgstr "" #: view:res.partner:0 #, python-format msgid "Phone Call" -msgstr "打電話" +msgstr "致電" #. module: crm #: field:crm.lead,optout:0 @@ -260,7 +260,7 @@ msgstr "" #: code:addons/crm/crm_opportunity.py:108 #, python-format msgid "The opportunity '%s' has been marked as lost." -msgstr "" +msgstr "「%s」機會已標為丟失。" #. module: crm #: model:ir.actions.act_window,help:crm.action_report_crm_lead @@ -309,7 +309,7 @@ msgid "" "If you select Merge with existing Opportunity, the lead details(with the " "communication history) will be merged with existing Opportunity of Selected " "partner." -msgstr "" +msgstr "如選擇與現有機會合併,潛在客戶之詳情(包括通訊記錄)會與選取之伙伴的現有機會合併。" #. module: crm #: selection:crm.meeting,class:0 @@ -389,7 +389,7 @@ msgstr "" #. module: crm #: model:process.transition,name:crm.process_transition_opportunitymeeting0 msgid "Opportunity Meeting" -msgstr "" +msgstr "商機會談" #. module: crm #: help:crm.lead.report,delay_close:0 @@ -400,7 +400,7 @@ msgstr "" #. module: crm #: model:process.node,note:crm.process_node_opportunities0 msgid "When a real project/opportunity is detected" -msgstr "" +msgstr "當偵測到真正專案/機會" #. module: crm #: field:crm.installer,crm_fundraising:0 @@ -446,7 +446,7 @@ msgstr "" #. module: crm #: model:ir.model,name:crm.model_crm_lead2opportunity_action msgid "Convert/Merge Opportunity" -msgstr "" +msgstr "轉變/合併機會" #. module: crm #: field:crm.lead,write_date:0 @@ -457,7 +457,7 @@ msgstr "更新日期" #: view:crm.lead2opportunity.action:0 #: field:crm.lead2opportunity.action,name:0 msgid "Select Action" -msgstr "" +msgstr "選擇動作" #. module: crm #: field:base.action.rule,trg_categ_id:0 @@ -475,7 +475,7 @@ msgstr "分類" #. module: crm #: view:crm.lead.report:0 msgid "#Opportunities" -msgstr "" +msgstr "#機會" #. module: crm #: model:crm.case.resource.type,name:crm.type_oppor2 @@ -495,7 +495,7 @@ msgstr "" #. module: crm #: view:crm.lead.report:0 msgid "Opportunity Analysis" -msgstr "" +msgstr "機會分析" #. module: crm #: help:crm.meeting,location:0 @@ -525,7 +525,7 @@ msgstr "" #. module: crm #: model:process.transition,note:crm.process_transition_opportunitymeeting0 msgid "Normal or phone meeting for opportunity" -msgstr "" +msgstr "與機會的正常或電話會談" #. module: crm #: model:process.node,note:crm.process_node_leads0 @@ -544,7 +544,7 @@ msgstr "" #: model:ir.actions.act_window,name:crm.crm_partner2opportunity #, python-format msgid "Create Opportunity" -msgstr "" +msgstr "建立機會" #. module: crm #: view:crm.installer:0 @@ -631,7 +631,7 @@ msgstr "滿意度調查" msgid "" "Thick this box if you want that on escalation, the responsible of this sale " "team automatically becomes responsible of the lead/opportunity escaladed" -msgstr "" +msgstr "如想提升注意級別,勾選此項;此銷售隊伍之負責人會自動成為已提升注意潛在客戶/機會之負責人" #. module: crm #: help:crm.installer,outlook:0 @@ -671,7 +671,7 @@ msgstr "" #. module: crm #: view:crm.phonecall.report:0 msgid "#Phone calls" -msgstr "" +msgstr "致電數" #. module: crm #: help:crm.segmentation,categ_id:0 @@ -691,7 +691,7 @@ msgid "" "The channels represent the different communication " "modes available with the customer. With each commercial opportunity, you can " "indicate the canall which is this opportunity source." -msgstr "" +msgstr "渠道代表該顧客之不同通訊模式。對於每個商機,您可指明此機會來源之管道。" #. module: crm #: code:addons/crm/crm_meeting.py:93 @@ -720,7 +720,7 @@ msgstr "" #. module: crm #: view:res.users:0 msgid "Current Activity" -msgstr "目前活動" +msgstr "當前動態" #. module: crm #: help:crm.meeting,exrule:0 @@ -835,7 +835,7 @@ msgstr "停止處理" #. module: crm #: view:crm.phonecall:0 msgid "Search Phonecalls" -msgstr "" +msgstr "搜尋致電" #. module: crm #: view:crm.lead2opportunity.partner:0 @@ -953,7 +953,7 @@ msgstr "" #. module: crm #: view:crm.phonecall2opportunity:0 msgid "Convert To Opportunity " -msgstr "" +msgstr "轉變為機會 " #. module: crm #: help:crm.case.stage,sequence:0 @@ -1016,7 +1016,7 @@ msgstr "三月" #: code:addons/crm/crm_lead.py:230 #, python-format msgid "The opportunity '%s' has been closed." -msgstr "" +msgstr "「%s」機會已結束。" #. module: crm #: field:crm.lead,day_open:0 @@ -1033,7 +1033,7 @@ msgstr "將時間顯示為" #: view:crm.phonecall2partner:0 #, python-format msgid "Create Partner" -msgstr "" +msgstr "建立伙伴" #. module: crm #: selection:crm.segmentation.line,expr_operator:0 @@ -1056,7 +1056,7 @@ msgstr "" #, python-format msgid "" "There are no other 'Open' or 'Pending' Opportunities for the partner '%s'." -msgstr "" +msgstr "「%s」伙伴並無「開放」或「待處理」之機會。" #. module: crm #: view:crm.lead:0 @@ -1105,7 +1105,7 @@ msgstr "" #: field:crm.meeting,date_action_next:0 #: field:crm.phonecall,date_action_next:0 msgid "Next Action" -msgstr "" +msgstr "下個動作" #. module: crm #: field:crm.meeting,end_date:0 @@ -1128,7 +1128,7 @@ msgstr "" #: code:addons/crm/wizard/crm_phonecall_to_opportunity.py:57 #, python-format msgid "Closed/Cancelled Phone Call Could not convert into Opportunity" -msgstr "" +msgstr "已結束/已取消之致電不能轉為機會" #. module: crm #: view:crm.segmentation:0 @@ -1353,7 +1353,7 @@ msgstr "已處理最大伙伴ID" #: model:ir.actions.act_window,name:crm.action_report_crm_phonecall #: model:ir.ui.menu,name:crm.menu_report_crm_phonecalls_tree msgid "Phone Calls Analysis" -msgstr "" +msgstr "致電分析" #. module: crm #: field:crm.lead.report,opening_date:0 @@ -1493,7 +1493,7 @@ msgstr "" #. module: crm #: field:crm.phonecall2opportunity,name:0 msgid "Opportunity Summary" -msgstr "" +msgstr "機會摘要" #. module: crm #: view:crm.phonecall.report:0 @@ -1584,7 +1584,7 @@ msgstr "" #. module: crm #: model:ir.model,name:crm.model_crm_merge_opportunity msgid "Merge two Opportunities" -msgstr "" +msgstr "合併兩個機會" #. module: crm #: selection:crm.meeting,end_type:0 @@ -1611,7 +1611,7 @@ msgstr "" #. module: crm #: model:ir.actions.act_window,name:crm.crm_phonecall_categ_action msgid "Phonecall Categories" -msgstr "" +msgstr "致電分類" #. module: crm #: view:crm.meeting:0 @@ -1804,7 +1804,7 @@ msgstr "上級團隊" #. module: crm #: field:crm.lead,date_action:0 msgid "Next Action Date" -msgstr "" +msgstr "下個動作日期" #. module: crm #: selection:crm.segmentation,state:0 @@ -1850,7 +1850,7 @@ msgstr "" #: view:crm.phonecall.report:0 #: model:ir.actions.act_window,name:crm.act_crm_opportunity_crm_phonecall_new msgid "Phone calls" -msgstr "" +msgstr "致電" #. module: crm #: view:crm.lead:0 @@ -2070,7 +2070,7 @@ msgstr "" #. module: crm #: model:process.node,note:crm.process_node_meeting0 msgid "Schedule a normal or phone meeting" -msgstr "" +msgstr "安排正常或電話會談" #. module: crm #: code:addons/crm/crm.py:375 @@ -2331,7 +2331,7 @@ msgstr "" #: model:ir.ui.menu,name:crm.menu_crm_case_phone #: view:res.partner:0 msgid "Phone Calls" -msgstr "" +msgstr "致電" #. module: crm #: help:crm.lead.report,delay_open:0 @@ -2358,7 +2358,7 @@ msgstr "活躍" #: code:addons/crm/crm_lead.py:306 #, python-format msgid "The stage of opportunity '%s' has been changed to '%s'." -msgstr "" +msgstr "機會階段已由「%s」變為「%s」。" #. module: crm #: code:addons/crm/crm_lead.py:282 @@ -2414,7 +2414,7 @@ msgstr "" #: field:crm.lead2partner,action:0 #: field:crm.phonecall2partner,action:0 msgid "Action" -msgstr "" +msgstr "動作" #. module: crm #: field:crm.installer,crm_claim:0 @@ -2544,7 +2544,7 @@ msgstr "" #: view:board.board:0 #: model:ir.actions.act_window,name:crm.act_my_oppor msgid "My Open Opportunities" -msgstr "" +msgstr "我的開放機會" #. module: crm #: model:ir.actions.act_window,name:crm.open_board_statistical_dash @@ -2585,7 +2585,7 @@ msgstr "會議類型" #: code:addons/crm/wizard/crm_lead_to_opportunity.py:314 #, python-format msgid "Merge with Existing Opportunity" -msgstr "與既有機會合併" +msgstr "與現有機會合併" #. module: crm #: help:crm.lead,state:0 @@ -2714,7 +2714,7 @@ msgstr "" #: field:crm.meeting,date_action_last:0 #: field:crm.phonecall,date_action_last:0 msgid "Last Action" -msgstr "" +msgstr "最後動作" #. module: crm #: field:crm.meeting,duration:0 @@ -3485,7 +3485,7 @@ msgstr "各階段機會" #. module: crm #: model:ir.actions.act_window,name:crm.crm_case_categ_phone_create_partner msgid "Schedule Phone Call" -msgstr "" +msgstr "安排致電" #. module: crm #: selection:crm.lead.report,month:0 @@ -3564,7 +3564,7 @@ msgstr "" #: code:addons/crm/wizard/crm_merge_opportunities.py:100 #, python-format msgid "Merged into Opportunity: %s" -msgstr "合併至機會:%s" +msgstr "已合併至機會: %s" #. module: crm #: code:addons/crm/crm.py:347 @@ -3584,7 +3584,7 @@ msgstr "分類化" #. module: crm #: model:ir.model,name:crm.model_base_action_rule msgid "Action Rules" -msgstr "" +msgstr "動作規則" #. module: crm #: field:crm.meeting,rrule_type:0 @@ -3594,7 +3594,7 @@ msgstr "" #. module: crm #: field:crm.meeting,phonecall_id:0 msgid "Phonecall" -msgstr "" +msgstr "致電" #. module: crm #: selection:crm.meeting,week_list:0 @@ -3763,7 +3763,7 @@ msgstr "" #. module: crm #: selection:crm.lead2opportunity.action,name:0 msgid "Merge with existing Opportunity" -msgstr "" +msgstr "與現有機會合併" #. module: crm #: field:crm.meeting,select1:0 @@ -3816,7 +3816,7 @@ msgstr "" #. module: crm #: field:res.partner,phonecall_ids:0 msgid "Phonecalls" -msgstr "" +msgstr "致電" #. module: crm #: view:crm.lead.report:0 diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index 6a954939e04..5e9b7a5cfca 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -92,7 +92,6 @@ - !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_1}: action: 'exist' - name: 'existing partner' - Then, Click on "Create Opportunity" button. - @@ -104,7 +103,6 @@ - !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. - diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index 8200dbd1675..87ab9229d26 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -37,7 +37,7 @@ class crm_lead2opportunity_partner(osv.osv_memory): ('nothing', 'Do not link to a partner')], \ 'Action', required=True), 'name': fields.selection([('convert', 'Convert to Opportunity'), ('merge', 'Merge with existing Opportunity')],'Select Action', required=True), - 'opportunity_ids': fields.many2many('crm.lead', 'merge_opportunity_rel', 'merge_id', 'opportunity_id', 'Opportunities', domain=[('type', '=', 'opportunity')]), + 'opportunity_ids': fields.many2many('crm.lead', string='Opportunities', domain=[('type', '=', 'opportunity')]), } def default_get(self, cr, uid, fields, context=None): @@ -236,7 +236,7 @@ class crm_lead2opportunity_mass_convert(osv.osv_memory): _columns = { - 'user_ids': fields.many2many('res.users', 'mass_convert_rel', 'user_id', 'wizard_id', 'Salesmans'), + 'user_ids': fields.many2many('res.users', string='Salesmans'), 'section_id': fields.many2one('crm.case.section', 'Sales Team'), } diff --git a/addons/crm/wizard/crm_merge_opportunities.py b/addons/crm/wizard/crm_merge_opportunities.py index d2d46749746..f092d6ad0b6 100644 --- a/addons/crm/wizard/crm_merge_opportunities.py +++ b/addons/crm/wizard/crm_merge_opportunities.py @@ -142,7 +142,7 @@ class crm_merge_opportunity(osv.osv_memory): count+=1 for history in opp.message_ids: - message_obj.write(cr, uid, history.id, {'res_id': first_opportunity.id, 'name' : _("From %s : %s") % (opp.name, history.name) }, context=context) + message_obj.write(cr, uid, history.id, {'res_id': first_opportunity.id, 'subject' : _("From %s : %s") % (opp.name, history.subject) }, context=context) #Notification about loss of information details = [] 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 b214f535275..359fa8454f6 100644 --- a/addons/crm_partner_assign/test/test_crm_partner_assign.yml +++ b/addons/crm_partner_assign/test/test_crm_partner_assign.yml @@ -108,6 +108,7 @@ 'email_to': 'info@axelor.com', 'email_from': 'Administrator <admin@openerp.com>', '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'}) diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml b/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml index d3ecddb1aa3..8bdb03cf962 100644 --- a/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml +++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner_view.xml @@ -25,7 +25,6 @@ </group> <separator string="" colspan="4" /> <group col="6" colspan="4"> - <field name="smtp_server_id" widget="selection" colspan="4"/> <field name="email_from" colspan="4" required="1"/> <field name="email_to" colspan="4" required="1"/> <field name="email_cc" colspan="4"/> diff --git a/addons/crm_profiling/crm_profiling.py b/addons/crm_profiling/crm_profiling.py index 90dc0818743..59137966da0 100644 --- a/addons/crm_profiling/crm_profiling.py +++ b/addons/crm_profiling/crm_profiling.py @@ -264,7 +264,7 @@ class crm_segmentation(osv.osv): } _constraints = [ - (orm.orm._check_recursion, 'Error ! You can not create recursive profiles.', ['parent_id']) + (osv.osv._check_recursion, 'Error ! You can not create recursive profiles.', ['parent_id']) ] def process_continue(self, cr, uid, ids, start=False): diff --git a/addons/decimal_precision/i18n/zh_TW.po b/addons/decimal_precision/i18n/zh_TW.po new file mode 100644 index 00000000000..0350112585d --- /dev/null +++ b/addons/decimal_precision/i18n/zh_TW.po @@ -0,0 +1,72 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:15+0000\n" +"PO-Revision-Date: 2011-09-27 08:06+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: decimal_precision +#: field:decimal.precision,digits:0 +msgid "Digits" +msgstr "數字" + +#. module: decimal_precision +#: view:decimal.precision:0 +msgid "Decimal Precision" +msgstr "小數精確度" + +#. module: decimal_precision +#: model:ir.actions.act_window,name:decimal_precision.action_decimal_precision_form +#: model:ir.ui.menu,name:decimal_precision.menu_decimal_precision_form +msgid "Decimal Accuracy Definitions" +msgstr "" + +#. module: decimal_precision +#: model:ir.module.module,description:decimal_precision.module_meta_information +msgid "" +"\n" +"This module allows to configure the price accuracy you need for different " +"kind\n" +"of usage: accounting, sales, purchases, ...\n" +"\n" +"The decimal precision is configured per company.\n" +msgstr "" +"\n" +"此模組讓您為會計、銷售、採購...等不同用途設定價錢準確度。\n" +"\n" +"每間公司之小數精確度可以不同。\n" + +#. module: decimal_precision +#: field:decimal.precision,name:0 +msgid "Usage" +msgstr "用途" + +#. module: decimal_precision +#: sql_constraint:decimal.precision:0 +msgid "Only one value can be defined for each given usage!" +msgstr "每種用途只可定義一個值!" + +#. module: decimal_precision +#: model:ir.module.module,shortdesc:decimal_precision.module_meta_information +msgid "Decimal Precision Configuration" +msgstr "小數精確度設定" + +#. module: decimal_precision +#: model:ir.model,name:decimal_precision.model_decimal_precision +msgid "decimal.precision" +msgstr "" + +#~ msgid "Decimal Accuracy" +#~ msgstr "小數準確度" diff --git a/addons/delivery/i18n/zh_TW.po b/addons/delivery/i18n/zh_TW.po index 6a09d0860d7..91f4e8816a5 100644 --- a/addons/delivery/i18n/zh_TW.po +++ b/addons/delivery/i18n/zh_TW.po @@ -7,19 +7,19 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:15+0000\n" -"PO-Revision-Date: 2011-01-28 03:29+0000\n" +"PO-Revision-Date: 2011-09-27 10:27+0000\n" "Last-Translator: Walter Cheuk <wwycheuk@gmail.com>\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:01+0000\n" -"X-Generator: Launchpad (build 13830)\n" +"X-Launchpad-Export-Date: 2011-09-28 05:19+0000\n" +"X-Generator: Launchpad (build 14049)\n" #. module: delivery #: report:sale.shipping:0 msgid "Order Ref." -msgstr "單號參照" +msgstr "訂單參考" #. module: delivery #: model:product.template,name:delivery.delivery_product_product_template @@ -67,7 +67,7 @@ msgstr "體積" #. module: delivery #: sql_constraint:sale.order:0 msgid "Order Reference must be unique !" -msgstr "交貨參照不能重覆!" +msgstr "訂單參考不能重覆!" #. module: delivery #: field:delivery.grid,line_ids:0 @@ -82,17 +82,17 @@ msgstr "交貨單" #. module: delivery #: view:res.partner:0 msgid "Deliveries Properties" -msgstr "" +msgstr "交貨性質" #. module: delivery #: model:ir.actions.act_window,name:delivery.action_picking_tree4 msgid "Picking to be invoiced" -msgstr "" +msgstr "要開立發票的提貨" #. module: delivery #: help:delivery.grid,sequence:0 msgid "Gives the sequence order when displaying a list of delivery grid." -msgstr "" +msgstr "提供顯示交貨格線清單的次序。" #. module: delivery #: view:delivery.grid:0 @@ -103,12 +103,12 @@ msgstr "國家" #. module: delivery #: report:sale.shipping:0 msgid "Delivery Order :" -msgstr "交貨單:" +msgstr "交貨單 :" #. module: delivery #: field:delivery.grid.line,variable_factor:0 msgid "Variable Factor" -msgstr "" +msgstr "可變因子" #. module: delivery #: model:ir.actions.act_window,help:delivery.action_delivery_grid_form @@ -132,7 +132,7 @@ msgstr "固定" #: field:res.partner,property_delivery_carrier:0 #: field:sale.order,carrier_id:0 msgid "Delivery Method" -msgstr "交貨方式" +msgstr "交貨方法" #. module: delivery #: model:ir.model,name:delivery.model_stock_move @@ -143,12 +143,12 @@ msgstr "庫存調動" #: code:addons/delivery/delivery.py:141 #, python-format msgid "No line matched this order in the choosed delivery grids !" -msgstr "" +msgstr "選擇的交貨格無一行符合此訂單 !" #. module: delivery #: field:stock.picking,carrier_tracking_ref:0 msgid "Carrier Tracking Ref" -msgstr "運輸公司追蹤編號" +msgstr "運輸公司追蹤參考" #. module: delivery #: field:stock.picking,weight_net:0 @@ -172,7 +172,7 @@ msgstr "警告" #. module: delivery #: view:delivery.grid:0 msgid "Grid definition" -msgstr "" +msgstr "格線定義" #. module: delivery #: view:delivery.sale.order:0 @@ -197,12 +197,12 @@ msgstr "銷貨單" #. module: delivery #: model:ir.model,name:delivery.model_delivery_grid msgid "Delivery Grid" -msgstr "" +msgstr "交貨格線" #. module: delivery #: report:sale.shipping:0 msgid "Invoiced to" -msgstr "發票交至" +msgstr "發票開立對象:" #. module: delivery #: model:ir.model,name:delivery.model_stock_picking @@ -212,7 +212,7 @@ msgstr "提貨清單" #. module: delivery #: model:ir.model,name:delivery.model_delivery_sale_order msgid "Make Delievery" -msgstr "" +msgstr "進行交貨" #. module: delivery #: model:ir.module.module,description:delivery.module_meta_information @@ -228,12 +228,12 @@ msgstr "" #. module: delivery #: view:delivery.grid.line:0 msgid "Grid Lines" -msgstr "" +msgstr "格線" #. module: delivery #: field:delivery.grid.line,grid_id:0 msgid "Grid" -msgstr "" +msgstr "網格" #. module: delivery #: help:delivery.grid,active:0 @@ -245,17 +245,17 @@ msgstr "" #. module: delivery #: field:delivery.grid,zip_to:0 msgid "To Zip" -msgstr "" +msgstr "至郵遞區號" #. module: delivery #: report:sale.shipping:0 msgid "Order Date" -msgstr "單子日期" +msgstr "訂單日期" #. module: delivery #: field:delivery.grid,name:0 msgid "Grid Name" -msgstr "" +msgstr "網格名稱" #. module: delivery #: view:stock.move:0 @@ -287,7 +287,7 @@ msgstr "" #: code:addons/delivery/wizard/delivery_sale_order.py:95 #, python-format msgid "No grid available !" -msgstr "" +msgstr "無可用網格 !" #. module: delivery #: selection:delivery.grid.line,operator:0 @@ -299,7 +299,7 @@ msgstr "" #: code:addons/delivery/wizard/delivery_sale_order.py:98 #, python-format msgid "Order not in draft state !" -msgstr "" +msgstr "訂單不在草稿階段 !" #. module: delivery #: constraint:res.partner:0 @@ -314,7 +314,7 @@ msgstr "批次" #. module: delivery #: constraint:stock.move:0 msgid "You try to assign a lot which is not from the same product" -msgstr "" +msgstr "指定了不同產品的批次" #. module: delivery #: field:delivery.carrier,active:0 @@ -325,7 +325,7 @@ msgstr "活躍" #. module: delivery #: report:sale.shipping:0 msgid "Shipping Date" -msgstr "" +msgstr "貨運日期" #. module: delivery #: field:delivery.carrier,product_id:0 @@ -382,7 +382,7 @@ msgstr "運輸公司伙伴" #. module: delivery #: view:res.partner:0 msgid "Sales & Purchases" -msgstr "銷售&採購" +msgstr "銷售 及 購貨" #. module: delivery #: selection:delivery.grid.line,operator:0 @@ -392,12 +392,12 @@ msgstr "" #. module: delivery #: constraint:stock.move:0 msgid "You must assign a production lot for this product" -msgstr "須為此產品分配生產批次" +msgstr "須為此產品指定生產批次" #. module: delivery #: view:delivery.sale.order:0 msgid "Create Deliveries" -msgstr "" +msgstr "進行交貨" #. module: delivery #: model:ir.actions.act_window,name:delivery.action_delivery_cost @@ -481,7 +481,7 @@ msgstr "" #: code:addons/delivery/wizard/delivery_sale_order.py:98 #, python-format msgid "The order state have to be draft to add delivery lines." -msgstr "" +msgstr "訂單狀態要是草稿才能添加交貨明細。" #. module: delivery #: model:ir.module.module,shortdesc:delivery.module_meta_information @@ -491,12 +491,12 @@ msgstr "運輸公司與交貨" #. module: delivery #: field:delivery.carrier,grids_id:0 msgid "Delivery Grids" -msgstr "" +msgstr "交貨網格" #. module: delivery #: field:delivery.grid,sequence:0 msgid "Sequence" -msgstr "" +msgstr "次序" #. module: delivery #: field:delivery.grid.line,list_price:0 @@ -507,7 +507,7 @@ msgstr "銷售價" #: view:delivery.grid:0 #: field:delivery.grid,state_ids:0 msgid "States" -msgstr "" +msgstr "狀態" #. module: delivery #: field:delivery.grid.line,price_type:0 diff --git a/addons/document/i18n/zh_HK.po b/addons/document/i18n/zh_HK.po new file mode 100644 index 00000000000..d0e38ae37d2 --- /dev/null +++ b/addons/document/i18n/zh_HK.po @@ -0,0 +1,1030 @@ +# Chinese (Hong Kong) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:15+0000\n" +"PO-Revision-Date: 2011-09-27 13:46+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Hong Kong) <zh_HK@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: document +#: field:document.directory,parent_id:0 +msgid "Parent Directory" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_configuration +msgid "Auto Directory Configuration" +msgstr "" + +#. module: document +#: field:document.directory,resource_field:0 +msgid "Name field" +msgstr "" + +#. module: document +#: view:board.board:0 +msgid "Document board" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_process_node +msgid "Process Node" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Search Document Directory" +msgstr "" + +#. module: document +#: help:document.directory,resource_field:0 +msgid "" +"Field to be used as name on resource directories. If empty, the \"name\" " +"will be used." +msgstr "" + +#. module: document +#: code:addons/document/document_directory.py:276 +#, python-format +msgid "Directory name contains special characters!" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: view:document.storage:0 +msgid "Group By..." +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_directory_content_type +msgid "Directory Content Type" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Resources" +msgstr "" + +#. module: document +#: field:document.directory,file_ids:0 +#: view:report.document.user:0 +msgid "Files" +msgstr "" + +#. module: document +#: view:report.files.partner:0 +msgid "Files per Month" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "March" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "title" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:document.directory,company_id:0 +msgid "Company" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_directory_content +msgid "Directory Content" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Dynamic context" +msgstr "" + +#. module: document +#: model:ir.ui.menu,name:document.menu_document_management_configuration +msgid "Document Management" +msgstr "" + +#. module: document +#: help:document.directory.dctx,expr:0 +msgid "" +"A python expression used to evaluate the field.\n" +"You can use 'dir_id' for current dir, 'res_id', 'res_model' as a reference " +"to the current record, in dynamic folders" +msgstr "" + +#. module: document +#: view:report.document.user:0 +msgid "This Year" +msgstr "" + +#. module: document +#: field:document.storage,path:0 +msgid "Path" +msgstr "" + +#. module: document +#: code:addons/document/document_directory.py:266 +#: code:addons/document/document_directory.py:271 +#, python-format +msgid "Directory name must be unique!" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +#: field:ir.attachment,index_content:0 +msgid "Indexed Content" +msgstr "" + +#. module: document +#: help:document.directory,resource_find_all:0 +msgid "" +"If true, all attachments that match this resource will be located. If " +"false, only ones that have this as parent." +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:document.storage,dir_ids:0 +#: model:ir.actions.act_window,name:document.action_document_directory_form +#: model:ir.ui.menu,name:document.menu_document_directories +msgid "Directories" +msgstr "" + +#. module: document +#: field:document.configuration,sale_order:0 +msgid "Sale Order" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_report_document_user +msgid "Files details by Users" +msgstr "" + +#. module: document +#: field:document.configuration,project:0 +msgid "Project" +msgstr "" + +#. module: document +#: code:addons/document/document_storage.py:573 +#: code:addons/document/document_storage.py:601 +#, python-format +msgid "Error!" +msgstr "" + +#. module: document +#: help:document.configuration,product:0 +msgid "Auto directory configuration for Products." +msgstr "" + +#. module: document +#: field:document.directory,resource_find_all:0 +msgid "Find all resources" +msgstr "" + +#. module: document +#: selection:document.directory,type:0 +msgid "Folders per resource" +msgstr "" + +#. module: document +#: field:document.directory.content,suffix:0 +msgid "Suffix" +msgstr "" + +#. module: document +#: field:report.document.user,change_date:0 +msgid "Modified Date" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "Knowledge Application Configuration" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +#: field:ir.attachment,partner_id:0 +#: field:report.files.partner,partner:0 +msgid "Partner" +msgstr "" + +#. module: document +#: view:board.board:0 +msgid "Files by Users" +msgstr "" + +#. module: document +#: field:process.node,directory_id:0 +msgid "Document directory" +msgstr "" + +#. module: document +#: code:addons/document/document.py:226 +#: code:addons/document/document.py:294 +#: code:addons/document/document_directory.py:266 +#: code:addons/document/document_directory.py:271 +#: code:addons/document/document_directory.py:276 +#, python-format +msgid "ValidateError" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_ir_actions_report_xml +msgid "ir.actions.report.xml" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_document_file_form +#: view:ir.attachment:0 +#: model:ir.ui.menu,name:document.menu_document_doc +#: model:ir.ui.menu,name:document.menu_document_files +msgid "Documents" +msgstr "" + +#. module: document +#: constraint:document.directory:0 +msgid "Error! You can not create recursive Directories." +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:document.directory,storage_id:0 +msgid "Storage" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "Configure Resource Directory" +msgstr "" + +#. module: document +#: field:ir.attachment,file_size:0 +#: field:report.document.file,file_size:0 +#: field:report.document.user,file_size:0 +#: field:report.files.partner,file_size:0 +msgid "File Size" +msgstr "" + +#. module: document +#: field:document.directory.content.type,name:0 +#: field:ir.attachment,file_type:0 +msgid "Content Type" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:document.directory,type:0 +#: view:document.storage:0 +#: field:document.storage,type:0 +msgid "Type" +msgstr "" + +#. module: document +#: help:document.directory,ressource_type_id:0 +msgid "" +"Select an object here and there will be one folder per record of that " +"resource." +msgstr "" + +#. module: document +#: help:document.directory,domain:0 +msgid "" +"Use a domain if you want to apply an automatic filter on visible resources." +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_view_files_by_partner +msgid "Files Per Partner" +msgstr "" + +#. module: document +#: field:document.directory,dctx_ids:0 +msgid "Context fields" +msgstr "" + +#. module: document +#: field:ir.attachment,store_fname:0 +msgid "Stored Filename" +msgstr "" + +#. module: document +#: field:document.directory,ressource_type_id:0 +msgid "Resource model" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:report.document.user,type:0 +msgid "Directory Type" +msgstr "" + +#. module: document +#: field:document.directory.content,report_id:0 +msgid "Report" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "July" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.open_board_document_manager +#: model:ir.ui.menu,name:document.menu_reports_document_manager +msgid "Document Dashboard" +msgstr "" + +#. module: document +#: field:document.directory.content.type,code:0 +msgid "Extension" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Created" +msgstr "" + +#. module: document +#: field:document.directory,content_ids:0 +msgid "Virtual Files" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Modified" +msgstr "" + +#. module: document +#: code:addons/document/document_storage.py:639 +#, python-format +msgid "Error at doc write!" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Generated Files" +msgstr "" + +#. module: document +#: field:document.directory.content,directory_id:0 +#: field:document.directory.dctx,dir_id:0 +#: model:ir.actions.act_window,name:document.action_document_file_directory_form +#: view:ir.attachment:0 +#: field:ir.attachment,parent_id:0 +#: model:ir.model,name:document.model_document_directory +#: field:report.document.user,directory:0 +msgid "Directory" +msgstr "" + +#. module: document +#: view:board.board:0 +msgid "Files by Partner" +msgstr "" + +#. module: document +#: field:document.directory,write_uid:0 +#: field:document.storage,write_uid:0 +#: field:ir.attachment,write_uid:0 +msgid "Last Modification User" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.act_res_partner_document +#: model:ir.actions.act_window,name:document.zoom_directory +msgid "Related Documents" +msgstr "" + +#. module: document +#: field:document.configuration,progress:0 +msgid "Configuration Progress" +msgstr "" + +#. module: document +#: field:document.directory,domain:0 +msgid "Domain" +msgstr "" + +#. module: document +#: field:document.directory,write_date:0 +#: field:document.storage,write_date:0 +#: field:ir.attachment,write_date:0 +msgid "Date Modified" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_report_document_file +msgid "Files details by Directory" +msgstr "" + +#. module: document +#: view:report.document.user:0 +msgid "All users files" +msgstr "" + +#. module: document +#: view:board.board:0 +#: model:ir.actions.act_window,name:document.action_view_size_month +#: view:report.document.file:0 +msgid "File Size by Month" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "December" +msgstr "" + +#. module: document +#: field:document.configuration,config_logo:0 +msgid "Image" +msgstr "" + +#. module: document +#: selection:document.directory,type:0 +msgid "Static Directory" +msgstr "" + +#. module: document +#: field:document.directory,child_ids:0 +msgid "Children" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Define words in the context, for all child directories and files" +msgstr "" + +#. module: document +#: model:ir.module.module,description:document.module_meta_information +msgid "" +"This is a complete document management system:\n" +" * User Authentication\n" +" * Document Indexation :- .pptx and .docx files are not support in " +"windows platform.\n" +" * Dashboard for Document that includes:\n" +" * New Files (list)\n" +" * Files by Resource Type (graph)\n" +" * Files by Partner (graph)\n" +" * Files by Month (graph)\n" +" ATTENTION:\n" +" - When you install this module in a running company that have already " +"PDF files stored into the database,\n" +" you will lose them all.\n" +" - After installing this module PDF's are no longer stored into the " +"database,\n" +" but in the servers rootpad like /server/bin/filestore.\n" +msgstr "" + +#. module: document +#: help:document.storage,online:0 +msgid "" +"If not checked, media is currently offline and its contents not available" +msgstr "" + +#. module: document +#: view:document.directory:0 +#: field:document.directory,user_id:0 +#: field:document.storage,user_id:0 +#: view:ir.attachment:0 +#: field:ir.attachment,user_id:0 +#: field:report.document.user,user_id:0 +#: field:report.document.wall,user_id:0 +msgid "Owner" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "PDF Report" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Contents" +msgstr "" + +#. module: document +#: field:document.directory,create_date:0 +#: field:document.storage,create_date:0 +#: field:report.document.user,create_date:0 +msgid "Date Created" +msgstr "" + +#. module: document +#: help:document.directory.content,include_name:0 +msgid "" +"Check this field if you want that the name of the file to contain the record " +"name.\n" +"If set, the directory will have to be a resource one." +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_config_auto_directory +msgid "Auto Configure Directory" +msgstr "" + +#. module: document +#: field:document.directory.content,include_name:0 +msgid "Include Record Name" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Attachment" +msgstr "" + +#. module: document +#: field:ir.actions.report.xml,model_id:0 +msgid "Model Id" +msgstr "" + +#. module: document +#: field:document.storage,online:0 +msgid "Online" +msgstr "" + +#. module: document +#: help:document.directory,ressource_tree:0 +msgid "" +"Check this if you want to use the same tree structure as the object selected " +"in the system." +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Security" +msgstr "保安" + +#. module: document +#: help:document.directory,ressource_id:0 +msgid "" +"Along with Parent Model, this ID attaches this folder to a specific record " +"of Parent Model." +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "August" +msgstr "" + +#. module: document +#: sql_constraint:document.directory:0 +msgid "Directory cannot be parent of itself!" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "June" +msgstr "" + +#. module: document +#: field:report.document.user,user:0 +#: field:report.document.wall,user:0 +msgid "User" +msgstr "" + +#. module: document +#: field:document.directory,group_ids:0 +#: field:document.storage,group_ids:0 +msgid "Groups" +msgstr "" + +#. module: document +#: field:document.directory.content.type,active:0 +msgid "Active" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "November" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +#: field:ir.attachment,db_datas:0 +msgid "Data" +msgstr "" + +#. module: document +#: help:document.directory,ressource_parent_type_id:0 +msgid "" +"If you put an object here, this directory template will appear bellow all of " +"these objects. Such directories are \"attached\" to the specific model or " +"record, just like attachments. Don't put a parent directory if you select a " +"parent model." +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Definition" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "October" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Seq." +msgstr "" + +#. module: document +#: selection:document.storage,type:0 +msgid "Database" +msgstr "" + +#. module: document +#: help:document.configuration,project:0 +msgid "Auto directory configuration for Projects." +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Related to" +msgstr "" + +#. module: document +#: model:ir.module.module,shortdesc:document.module_meta_information +msgid "Integrated Document Management System" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "Choose the following Resouces to auto directory configuration." +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Attached To" +msgstr "" + +#. module: document +#: model:ir.ui.menu,name:document.menu_reports_document +msgid "Dashboard" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_view_user_graph +msgid "Files By Users" +msgstr "" + +#. module: document +#: field:document.storage,readonly:0 +msgid "Read Only" +msgstr "" + +#. module: document +#: field:document.directory.dctx,expr:0 +msgid "Expression" +msgstr "" + +#. module: document +#: sql_constraint:document.directory:0 +msgid "The directory name must be unique !" +msgstr "" + +#. module: document +#: field:document.directory,create_uid:0 +#: field:document.storage,create_uid:0 +msgid "Creator" +msgstr "" + +#. module: document +#: view:board.board:0 +#: model:ir.actions.act_window,name:document.action_view_files_by_month_graph +#: view:report.document.user:0 +msgid "Files by Month" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "September" +msgstr "" + +#. module: document +#: field:document.directory.content,prefix:0 +msgid "Prefix" +msgstr "" + +#. module: document +#: field:report.document.wall,last:0 +msgid "Last Posted Time" +msgstr "" + +#. module: document +#: field:report.document.user,datas_fname:0 +msgid "File Name" +msgstr "" + +#. module: document +#: view:document.configuration:0 +msgid "res_config_contents" +msgstr "" + +#. module: document +#: field:document.directory,ressource_id:0 +msgid "Resource ID" +msgstr "" + +#. module: document +#: selection:document.storage,type:0 +msgid "External file storage" +msgstr "" + +#. module: document +#: view:board.board:0 +#: model:ir.actions.act_window,name:document.action_view_wall +#: view:report.document.wall:0 +msgid "Wall of Shame" +msgstr "" + +#. module: document +#: help:document.storage,path:0 +msgid "For file storage, the root path of the storage" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_report_files_partner +msgid "Files details by Partners" +msgstr "" + +#. module: document +#: field:document.directory.dctx,field:0 +msgid "Field" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_document_directory_dctx +msgid "Directory Dynamic Context" +msgstr "" + +#. module: document +#: field:document.directory,ressource_parent_type_id:0 +msgid "Parent Model" +msgstr "" + +#. module: document +#: view:report.document.user:0 +msgid "Files by users" +msgstr "" + +#. module: document +#: field:report.document.file,month:0 +#: field:report.document.user,month:0 +#: field:report.document.wall,month:0 +#: field:report.document.wall,name:0 +#: field:report.files.partner,month:0 +msgid "Month" +msgstr "" + +#. module: document +#: model:ir.ui.menu,name:document.menu_reporting +msgid "Reporting" +msgstr "" + +#. module: document +#: field:document.configuration,product:0 +msgid "Product" +msgstr "" + +#. module: document +#: field:document.directory,ressource_tree:0 +msgid "Tree Structure" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "May" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_view_all_document_tree1 +msgid "All Users files" +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_report_document_wall +msgid "Users that did not inserted documents since one month" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,help:document.action_document_file_form +msgid "" +"The Documents repository gives you access to all attachments, such as mails, " +"project documents, invoices etc." +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "For each entry here, virtual files will appear in this folder." +msgstr "" + +#. module: document +#: model:ir.model,name:document.model_ir_attachment +msgid "ir.attachment" +msgstr "" + +#. module: document +#: view:board.board:0 +msgid "New Files" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "January" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Static" +msgstr "" + +#. module: document +#: view:report.files.partner:0 +msgid "Files By Partner" +msgstr "" + +#. module: document +#: help:document.directory.dctx,field:0 +msgid "" +"The name of the field. Note that the prefix \"dctx_\" will be prepended to " +"what is typed here." +msgstr "" + +#. module: document +#: view:report.document.user:0 +msgid "This Month" +msgstr "" + +#. module: document +#: view:ir.attachment:0 +msgid "Notes" +msgstr "" + +#. module: document +#: help:document.configuration,sale_order:0 +msgid "" +"Auto directory configuration for Sale Orders and Quotation with report." +msgstr "" + +#. module: document +#: help:document.directory,type:0 +msgid "" +"Each directory can either have the type Static or be linked to another " +"resource. A static directory, as with Operating Systems, is the classic " +"directory that can contain a set of files. The directories linked to systems " +"resources automatically possess sub-directories for each of resource types " +"defined in the parent directory." +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "February" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.open_board_document_manager1 +#: model:ir.ui.menu,name:document.menu_reports_document_manager1 +msgid "Statistics by User" +msgstr "" + +#. module: document +#: field:document.directory,name:0 +#: field:document.storage,name:0 +msgid "Name" +msgstr "" + +#. module: document +#: sql_constraint:document.storage:0 +msgid "The storage path must be unique!" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "Fields" +msgstr "" + +#. module: document +#: help:document.storage,readonly:0 +msgid "If set, media is for reading only" +msgstr "" + +#. module: document +#: selection:report.document.user,month:0 +#: selection:report.files.partner,month:0 +msgid "April" +msgstr "" + +#. module: document +#: field:report.document.file,nbr:0 +#: field:report.document.user,nbr:0 +#: field:report.files.partner,nbr:0 +msgid "# of Files" +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "" +"Only members of these groups will have access to this directory and its " +"files." +msgstr "" + +#. module: document +#: view:document.directory:0 +msgid "" +"These groups, however, do NOT apply to children directories, which must " +"define their own groups." +msgstr "" + +#. module: document +#: field:document.directory.content.type,mimetype:0 +msgid "Mime Type" +msgstr "" + +#. module: document +#: field:document.directory.content,sequence:0 +msgid "Sequence" +msgstr "" + +#. module: document +#: field:document.directory.content,name:0 +msgid "Content Name" +msgstr "" + +#. module: document +#: code:addons/document/document.py:226 +#: code:addons/document/document.py:294 +#, python-format +msgid "File name must be unique!" +msgstr "" + +#. module: document +#: selection:document.storage,type:0 +msgid "Internal File storage" +msgstr "" + +#. module: document +#: sql_constraint:document.directory:0 +msgid "Directory must have a parent or a storage" +msgstr "" + +#. module: document +#: model:ir.actions.act_window,name:document.action_document_directory_tree +#: model:ir.ui.menu,name:document.menu_document_directories_tree +msgid "Directories' Structure" +msgstr "" + +#. module: document +#: view:board.board:0 +#: model:ir.actions.act_window,name:document.action_view_document_by_resourcetype_graph +#: view:report.document.user:0 +msgid "Files by Resource Type" +msgstr "" + +#. module: document +#: field:report.document.user,name:0 +#: field:report.files.partner,name:0 +msgid "Year" +msgstr "" + +#. module: document +#: view:document.storage:0 +#: model:ir.model,name:document.model_document_storage +#: model:ir.ui.menu,name:document.menu_document_storage_media +msgid "Storage Media" +msgstr "" + +#. module: document +#: view:document.storage:0 +msgid "Search Document storage" +msgstr "" + +#. module: document +#: field:document.directory.content,extension:0 +msgid "Document Type" +msgstr "" diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index d40f9541b01..61006f96782 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -65,7 +65,9 @@ class mail_compose_message(osv.osv_memory): _columns = { 'use_template': fields.boolean('Use Template'), - 'template_id': fields.selection(_get_templates, 'Template'), + 'template_id': fields.selection(_get_templates, 'Template', + size=-1 # means we want an int db column + ), } def on_change_template(self, cr, uid, ids, use_template, template_id, email_from=None, email_to=None, context=None): diff --git a/addons/event/i18n/zh_TW.po b/addons/event/i18n/zh_TW.po index 7e94f517008..ba4b1d3655b 100644 --- a/addons/event/i18n/zh_TW.po +++ b/addons/event/i18n/zh_TW.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:15+0000\n" -"PO-Revision-Date: 2011-01-28 15:50+0000\n" +"PO-Revision-Date: 2011-09-27 07:58+0000\n" "Last-Translator: Walter Cheuk <wwycheuk@gmail.com>\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:04+0000\n" -"X-Generator: Launchpad (build 13830)\n" +"X-Launchpad-Export-Date: 2011-09-28 05:19+0000\n" +"X-Generator: Launchpad (build 14049)\n" #. module: event #: view:event.event:0 @@ -717,7 +717,7 @@ msgstr "八月" #: field:res.partner,event_ids:0 #: field:res.partner,event_registration_ids:0 msgid "unknown" -msgstr "不明" +msgstr "不詳" #. module: event #: selection:report.event.registration,month:0 diff --git a/addons/hr/__openerp__.py b/addons/hr/__openerp__.py index 598b49a725e..bca65c54cb2 100644 --- a/addons/hr/__openerp__.py +++ b/addons/hr/__openerp__.py @@ -38,7 +38,7 @@ You can manage: 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', 'images': ['images/hr_department.jpeg', 'images/hr_employee.jpeg','images/hr_job_position.jpeg'], - 'depends': ['base_setup', 'resource', 'board'], + 'depends': ['base_setup','mail', 'resource', 'board'], 'init_xml': [], 'update_xml': [ 'security/hr_security.xml', diff --git a/addons/hr/hr.py b/addons/hr/hr.py index e5551060362..7a704de78d0 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -154,7 +154,9 @@ class hr_employee(osv.osv): 'coach_id': fields.many2one('hr.employee', 'Coach'), 'job_id': fields.many2one('hr.job', 'Job'), 'photo': fields.binary('Photo'), - 'passport_id':fields.char('Passport No', size=64) + 'passport_id':fields.char('Passport No', size=64), + 'color': fields.integer('Color Index'), + 'city': fields.related('address_id', 'city', type='char', string='City'), } def unlink(self, cr, uid, ids, context=None): @@ -203,6 +205,7 @@ class hr_employee(osv.osv): 'active': 1, 'photo': _get_photo, 'marital': 'single', + 'color': 0, } def _check_recursion(self, cr, uid, ids, context=None): diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 87a9da2cc6e..7afa379bf8b 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -125,7 +125,70 @@ </search> </field> </record> - + <!-- HR Kanban View --> + <record model="ir.ui.view" id="hr_kanban_view_employees"> + <field name="name">HR - Employess Kanban</field> + <field name="model">hr.employee</field> + <field name="type">kanban</field> + <field name="arch" type="xml"> + <kanban default_group_by="department_id"> + <templates> + <t t-name="kanban-box"> + <t t-set="color" t-value="kanban_color(record.color.raw_value || record.name.raw_value)"/> + <div t-att-class="color + (record.color.raw_value == 1 ? ' oe_kanban_color_alert' : '')"> + <div class="oe_kanban_box oe_kanban_color_border"> + <div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle"> + <table class="oe_kanban_table"> + <tr> + <td class="oe_kanban_title1" align="left" valign="middle"><field name="name"/></td> + <td valign="top" width="22"> + <img t-att-src="kanban_gravatar(record.user_id.value, 22)" class="oe_kanban_gravatar"/> + </td> + </tr> + </table> + </div> + <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger oe_kanban_color_border"> + <table class="oe_kanban_table"> + <tr> + <td valign="top" width="22"> + <t t-if="record.photo.raw_value"> + <img t-att-src="'data:image/png;base64,'+record.photo.raw_value" width='48' height='48'/> + </t> + <t t-if="!record.photo.raw_value"> + <img src="/web/static/src/img/employee.png"/> + </t> + </td> + <td> + <div class="oe_kanban_title2"><field name="job_id"/></div> + <div class="oe_kanban_title3"> + <field name="department_id"/> + <t t-if="record.department_id.raw_value && record.city.raw_value">,</t> + <field name="city"/> + </div> + <div class="oe_kanban_title3"> + <i><field name="work_email"/> + <t t-if="record.work_phone.raw_value && record.work_email.raw_value">,</t> + <field name="work_phone"/></i> + </div> + </td> + </tr> + </table> + </div> + <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick"> + <div class="oe_kanban_left"> + <a string="Edit" icon="gtk-edit" type="edit"/> + <a string="Change Color" icon="color-picker" type="color" name="color"/> + <a string="Send New Email" name="%(mail.action_email_compose_message_wizard)d" icon="terp-mail-message-new" type="action"/> + </div> + <br class="oe_kanban_clear"/> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> <record id="open_view_employee_tree" model="ir.actions.act_window"> <field name="name">Employees Structure</field> <field name="res_model">hr.employee</field> @@ -149,13 +212,27 @@ <field name="name">Employees</field> <field name="res_model">hr.employee</field> <field name="view_type">form</field> - <field name="view_mode">tree,form</field> + <field name="view_mode">tree,form,kanban</field> <field name="domain">[]</field> <field name="context">{"search_default_department_id": department_id,"search_default_active":eval('True')}</field> <field name="view_id" ref="view_employee_tree"/> <field name="search_view_id" ref="view_employee_filter"/> <field name="help">Here you can manage your work force by creating employees and assigning them specific properties in the system. Maintain all employee related information and keep track of anything that needs to be recorded for them. The personal information tab will help you maintain their identity data. The Categories tab gives you the opportunity to assign them related employee categories depending on their position and activities within the company. A category can be a seniority level within the company or a department. The Timesheets tab allows to assign them a specific timesheet and analytic journal where they will be able to enter time through the system. In the note tab, you can enter text data that should be recorded for a specific employee.</field> </record> + + <record id="open_view_employee_list_my_tree2" model="ir.actions.act_window.view"> + <field name="sequence" eval="1"/> + <field name="view_mode">tree</field> + <field name="view_id" ref="view_employee_tree"/> + <field name="act_window_id" ref="open_view_employee_list_my"/> + </record> + + <record id="open_view_employee_list_my_form2" model="ir.actions.act_window.view"> + <field name="sequence" eval="2"/> + <field name="view_mode">form</field> + <field name="view_id" ref="view_employee_form"/> + <field name="act_window_id" ref="open_view_employee_list_my"/> + </record> <menuitem action="open_view_employee_list_my" id="menu_open_view_employee_list_my" sequence="3" parent="menu_hr_main"/> diff --git a/addons/hr_attendance/report/attendance_by_month.py b/addons/hr_attendance/report/attendance_by_month.py index 2b708434317..80646be85f4 100644 --- a/addons/hr_attendance/report/attendance_by_month.py +++ b/addons/hr_attendance/report/attendance_by_month.py @@ -30,9 +30,10 @@ from report.interface import toxml from report import report_sxw from tools import ustr +from tools.translate import _ one_day = relativedelta(days=1) -month2name = [0, 'January', 'February', 'March', 'April', 'May', 'Jun', 'July', 'August', 'September', 'October', 'November', 'December'] +month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] def hour2str(h): hours = int(h) @@ -52,7 +53,7 @@ class report_custom(report_rml): context = {} month = datetime(datas['form']['year'], datas['form']['month'], 1) emp_ids = context.get('active_ids', []) - user_xml = ['<month>%s</month>' % month2name[month.month], '<year>%s</year>' % month.year] + user_xml = ['<month>%s</month>' % _(month2name[month.month]), '<year>%s</year>' % month.year] if emp_ids: for emp in obj_emp.read(cr, uid, emp_ids, ['name']): stop, days_xml = False, [] @@ -95,7 +96,7 @@ class report_custom(report_rml): days_xml.append(today_xml) today, tomor = tomor, tomor + one_day user_xml.append(user_repr % '\n'.join(days_xml)) - + rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee') rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context) header_xml = ''' @@ -104,7 +105,7 @@ class report_custom(report_rml): <company>%s</company> </header> ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name) - + first_date = str(month) som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S') eom = som + timedelta(int(dy)-1) @@ -113,12 +114,12 @@ class report_custom(report_rml): cell=1 date_xml.append('<days>') if day_diff.days>=30: - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] else: if day_diff.days>=(lengthmonth(som.year, som.month)-som.day): - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] else: - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, eom.day+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, eom.day+1)] cell=x-som.day+1 day_diff1=day_diff.days-cell+1 width_dict={} @@ -129,12 +130,12 @@ class report_custom(report_rml): month=som.month month_dict[j]=som.strftime('%B') width_dict[j]=cell - + while day_diff1>0: if month+i<=12: if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example som1=datetime.date(year,month+i,1) - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] i=i+1 j=j+1 month_dict[j]=som1.strftime('%B') @@ -142,7 +143,7 @@ class report_custom(report_rml): width_dict[j]=x else: som1=datetime.date(year,month+i,1) - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, eom.day+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)] i=i+1 j=j+1 month_dict[j]=som1.strftime('%B') @@ -156,7 +157,7 @@ class report_custom(report_rml): i=1 if day_diff1>=30: som1=datetime.date(years,i,1) - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(years,i)+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(years,i)+1)] i=i+1 j=j+1 month_dict[j]=som1.strftime('%B') @@ -167,7 +168,7 @@ class report_custom(report_rml): i=i+1 j=j+1 month_dict[j]=som1.strftime('%B') - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, eom.day+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)] cell=cell+x width_dict[j]=x day_diff1=day_diff1-x @@ -176,10 +177,11 @@ class report_custom(report_rml): xml = '''<?xml version="1.0" encoding="UTF-8" ?> <report> %s + <title>%s</title> %s %s </report> - ''' % (header_xml,'\n'.join(user_xml),date_xml) + ''' % (header_xml,_('Attendances By Month'),'\n'.join(user_xml),date_xml) return xml report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl') diff --git a/addons/hr_attendance/report/bymonth.xsl b/addons/hr_attendance/report/bymonth.xsl index 23e7fb14b3d..0ec0a23cc8d 100644 --- a/addons/hr_attendance/report/bymonth.xsl +++ b/addons/hr_attendance/report/bymonth.xsl @@ -12,6 +12,7 @@ <xsl:template name="stylesheet"> + <paraStyle name="title" fontName="Helvetica-Bold" fontSize="15.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/> <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/> <paraStyle name="name" fontName="Helvetica" textColor="green" fontSize="7"/> <paraStyle name="normal" fontName="Helvetica" fontSize="6"/> @@ -29,7 +30,7 @@ <xsl:template name="story"> <spacer length="1cm" /> - <para style="terp_header_Centre" t="1">Attendances By Month</para> + <xsl:apply-templates select="report/title"/> <spacer length="1cm" /> <blockTable> <xsl:attribute name="style">week</xsl:attribute> @@ -53,7 +54,14 @@ <xsl:apply-templates select="report/user"/> </blockTable> </xsl:template> - + + <xsl:template match="title"> + <para style="title"> + <xsl:value-of select="."/> + </para> + <spacer length="1cm"/> + </xsl:template> + <xsl:template match="user"> <!-- <tr></tr>--> <tr> diff --git a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py index 7a51c2b9e1e..2631139b38d 100644 --- a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py +++ b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py @@ -29,7 +29,7 @@ class hr_si_so_ask(osv.osv_memory): _columns = { 'name': fields.char('Employees name', size=32, required=True, readonly=True), 'last_time': fields.datetime('Your last sign out', required=True), - 'emp_id': fields.char('Empoyee ID', size=32, required=True, readonly=True), + 'emp_id': fields.many2one('hr.employee', 'Empoyee ID', readonly=True), } def _get_empname(self, cr, uid, context=None): @@ -52,10 +52,12 @@ class hr_si_so_ask(osv.osv_memory): def sign_in(self, cr, uid, ids, context=None): data = self.read(cr, uid, ids, [], context=context)[0] + data['emp_id'] = data['emp_id'] and data['emp_id'][0] return self.pool.get('hr.sign.in.out').sign_in(cr, uid, data, context) def sign_out(self, cr, uid, ids, context=None): data = self.read(cr, uid, ids, [], context=context)[0] + data['emp_id'] = data['emp_id'] and data['emp_id'][0] return self.pool.get('hr.sign.in.out').sign_out(cr, uid, data, context) hr_si_so_ask() @@ -68,7 +70,7 @@ class hr_sign_in_out(osv.osv_memory): _columns = { 'name': fields.char('Employees name', size=32, required=True, readonly=True), 'state': fields.char('Current state', size=32, required=True, readonly=True), - 'emp_id': fields.char('Employee ID', size=32, required=True, readonly=True), + 'emp_id': fields.many2one('hr.employee', 'Empoyee ID', readonly=True), } def _get_empid(self, cr, uid, context=None): @@ -88,6 +90,7 @@ class hr_sign_in_out(osv.osv_memory): obj_model = self.pool.get('ir.model.data') att_obj = self.pool.get('hr.attendance') data = self.read(cr, uid, ids, [], context=context)[0] + data['emp_id'] = data['emp_id'] and data['emp_id'][0] emp_id = data['emp_id'] att_id = att_obj.search(cr, uid, [('employee_id', '=', emp_id)], limit=1, order='name desc') last_att = att_obj.browse(cr, uid, att_id, context=context) @@ -113,6 +116,7 @@ class hr_sign_in_out(osv.osv_memory): obj_model = self.pool.get('ir.model.data') att_obj = self.pool.get('hr.attendance') data = self.read(cr, uid, ids, [], context=context)[0] + data['emp_id'] = data['emp_id'] and data['emp_id'][0] emp_id = data['emp_id'] att_id = att_obj.search(cr, uid, [('employee_id', '=', emp_id),('action', '!=', 'action')], limit=1, order='name desc') last_att = att_obj.browse(cr, uid, att_id, context=context) diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index dd0bd91a0d0..d756dfe6dfd 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -30,6 +30,7 @@ import pooler import time from report import report_sxw from tools import ustr +from tools.translate import _ def lengthmonth(year, month): if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))): @@ -69,9 +70,9 @@ def emp_create_xml(self, cr, uid, dept, holiday_type, row_id, empid, name, som, for index in range(1,61): display[index]=' ' count='' - + data_xml=['<info id="%d" number="%d" val="%s" />' % (row_id,x,display[x]) for x in range(1,len(display)+1) ] - + # Computing the xml xml = ''' %s @@ -120,18 +121,17 @@ class report_custom(report_rml): # date_xml=[] for l in range(0,len(legend)): - date_xml += ['<legend row="%d" id="%d" name="%s" color="%s" />' % (l+1,legend[l][0],legend[l][1],legend[l][2])] - + date_xml += ['<legend row="%d" id="%d" name="%s" color="%s" />' % (l+1,legend[l][0],_(legend[l][1]),legend[l][2])] date_xml += ['<date month="%s" year="%d" />' % (som.strftime('%B'), som.year),'<days>'] cell=1 if day_diff.days>=30: - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] else: if day_diff.days>=(lengthmonth(som.year, som.month)-som.day): - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)] else: - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som.replace(day=x).strftime('%a'),x-som.day+1) for x in range(som.day, eom.day+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, eom.day+1)] cell=x-som.day+1 day_diff1=day_diff.days-cell+1 @@ -150,7 +150,7 @@ class report_custom(report_rml): if month+i<=12: if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example som1=datetime.date(year,month+i,1) - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(year,i+month)+1)] i=i+1 j=j+1 month_dict[j]=som1.strftime('%B') @@ -159,7 +159,7 @@ class report_custom(report_rml): else: som1=datetime.date(year,month+i,1) - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, eom.day+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)] i=i+1 j=j+1 month_dict[j]=som1.strftime('%B') @@ -174,7 +174,7 @@ class report_custom(report_rml): i=1 if day_diff1>=30: som1=datetime.date(years,i,1) - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, lengthmonth(years,i)+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(years,i)+1)] i=i+1 j=j+1 month_dict[j]=som1.strftime('%B') @@ -186,7 +186,7 @@ class report_custom(report_rml): i=i+1 j=j+1 month_dict[j]=som1.strftime('%B') - date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, som1.replace(day=x).strftime('%a'),cell+x) for x in range(1, eom.day+1)] + date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)] cell=cell+x width_dict[j]=x @@ -200,16 +200,16 @@ class report_custom(report_rml): st+=',' + str(0.4 *width_dict[m])+'cm' st+=',0.4cm</cols_months>\n' - months_xml =['<months number="%d" name="%s" />' % (x,month_dict[x]) for x in range(1,len(month_dict)+1) ] + months_xml =['<months number="%d" name="%s"/>' % (x, _(month_dict[x])) for x in range(1,len(month_dict)+1) ] months_xml.append(st) - + emp_xml='' row_id=1 - + if data['model']=='hr.employee': for id in data['form']['emp']: items = obj_emp.read(cr, uid, id, ['id','name']) - + emp_xml += emp_create_xml(self, cr, uid, 0, holiday_type, row_id, items['id'], items['name'], som, eom) row_id = row_id +1 @@ -229,7 +229,7 @@ class report_custom(report_rml): dept_done=1 emp_xml += emp_create_xml(self, cr, uid, 0, holiday_type, row_id, item['id'], item['name'], som, eom) row_id = row_id +1 - + header_xml = ''' <header> <date>%s</date> diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 77a1bcb7b8f..e2ecf522cae 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -180,6 +180,7 @@ class hr_applicant(crm.crm_case, osv.osv): multi='day_open', type="float", store=True), 'day_close': fields.function(_compute_day, string='Days to Close', \ multi='day_close', type="float", store=True), + 'color': fields.integer('Color Index'), } def _get_stage(self, cr, uid, context=None): @@ -194,6 +195,7 @@ class hr_applicant(crm.crm_case, osv.osv): 'priority': lambda *a: '', 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c), 'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0], + 'color': 0, } def onchange_job(self,cr, uid, ids, job, context=None): @@ -442,6 +444,21 @@ class hr_applicant(crm.crm_case, osv.osv): res = super(hr_applicant, self).case_reset(cr, uid, ids, *args) self.write(cr, uid, ids, {'date_open': False, 'date_closed': False}) return res + + def set_priority(self, cr, uid, ids, priority): + """Set lead priority + """ + return self.write(cr, uid, ids, {'priority' : priority}) + + def set_high_priority(self, cr, uid, ids, *args): + """Set lead priority to high + """ + return self.set_priority(cr, uid, ids, '1') + + def set_normal_priority(self, cr, uid, ids, *args): + """Set lead priority to normal + """ + return self.set_priority(cr, uid, ids, '3') def write(self, cr, uid, ids, vals, context=None): if 'stage_id' in vals and vals['stage_id']: diff --git a/addons/hr_recruitment/hr_recruitment_menu.xml b/addons/hr_recruitment/hr_recruitment_menu.xml index 9883e311fba..0bac3f8615a 100644 --- a/addons/hr_recruitment/hr_recruitment_menu.xml +++ b/addons/hr_recruitment/hr_recruitment_menu.xml @@ -6,7 +6,7 @@ <record model="ir.actions.act_window" id="crm_case_categ0_act_job"> <field name="name">Applicants</field> <field name="res_model">hr.applicant</field> - <field name="view_mode">tree,form,graph,calendar</field> + <field name="view_mode">tree,form,graph,calendar,kanban</field> <field name="view_id" ref="crm_case_tree_view_job"/> <field name="context">{"search_default_user_id":uid, 'search_default_current': 1,"search_default_department_id": department_id}</field> <field name="search_view_id" ref="view_crm_case_jobs_filter"/> diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 8dd5e171206..e5905b16a77 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -277,7 +277,81 @@ </field> </record> + <!-- hr Applicant Kanban View --> + <record model="ir.ui.view" id="hr_kanban_view_applicant"> + <field name="name">Hr Applicants kanban</field> + <field name="model">hr.applicant</field> + <field name="type">kanban</field> + <field name="arch" type="xml"> + <kanban default_group_by="stage_id"> + <templates> + <t t-name="kanban-box"> + <t t-set="color" t-value="kanban_color(record.color.raw_value || record.state.raw_value)"/> + <div t-att-class="color + (record.priority.raw_value == 1 ? ' oe_kanban_color_alert' : '')"> + <div class="oe_kanban_box oe_kanban_color_border"> + <div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle"> + <table class="oe_kanban_table"> + <tr> + <td class="oe_kanban_title1" align="left" valign="middle"> + <a t-if="record.priority.raw_value == 1" icon="star-on" type="object" name="set_normal_priority" /> + <a t-if="record.priority.raw_value != 1" icon="star-off" type="object" name="set_high_priority" style="opacity:0.6; filter:alpha(opacity=60);"/> + <field name="partner_name"/> + </td> + <td valign="top" width="22"> + <img t-att-src="kanban_gravatar(record.user_id.value, 22)" class="oe_kanban_gravatar"/> + </td> + </tr> + </table> + </div> + <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger oe_kanban_color_border"> + <table class="oe_kanban_table"> + <tr> + <td> + <div class="oe_kanban_right oe_kanban_small"> + <field name="user_id"/> + </div> + <div class="oe_kanban_title2"> + <field name="job_id"/> + <t t-if="record.priority.raw_value == 0"></t> + <t t-if="record.priority.raw_value == 5">(Not Good)</t> + <t t-if="record.priority.raw_value == 4">(On Average)</t> + <t t-if="record.priority.raw_value == 3">(Good)</t> + <t t-if="record.priority.raw_value == 2">(Very Good)</t> + <t t-if="record.priority.raw_value == 1">(Excellent)</t> + </div> + <div class="oe_kanban_title3"> + <field name="type_id"/> + </div> + <div class="oe_kanban_title3"> + <i><field name="date_action"/><field name="title_action"/></i> + </div> + </td> + </tr> + </table> + </div> + <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick"> + <div class="oe_kanban_left"> + <a string="Edit" icon="gtk-edit" type="edit"/> + <a string="Change Color" icon="color-picker" type="color" name="color"/> + <a string="Send New Email" name="%(mail.action_email_compose_message_wizard)d" icon="terp-mail-message-new" type="action"/> + <a string="Add Internal Note" name="%(crm.action_crm_add_note)d" context="{'model': 'crm.lead' }" icon="terp-document-new" type="action"/> + <a name="action_makeMeeting" type="object" string="Schedule Meeting" icon="gtk-redo" /> + <a t-if="record.survey.raw_value" name="action_print_survey" type="object" string="Print Interview" icon="gtk-print" /> + </div> + <div class="oe_kanban_right"> + <a name="case_open" string="Mark Won" states="pending,draft" type="object" icon="lead-stage-won" /> + <a name="case_pending" string="Mark Lost" states="draft,open" type="object" icon="lead-stage-lost" /> + </div> + <br class="oe_kanban_clear"/> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> # ------------------------------------------------------ # HR Job # ------------------------------------------------------ diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml index b0edacd7272..2ce309e0df4 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_view.xml @@ -18,7 +18,7 @@ <group col="9" colspan="8"> <field name="state" readonly="1"/> <button name="set_cancel" string="Cancel" type="object" states="open,pending" icon="gtk-cancel"/> - <button name="set_open" string="Reactivate Account" type="object" states="pending,cancelled,close" icon="gtk-ok"/> + <button name="set_open" string="Reactivate Account" type="object" states="pending,cancelled,close,draft" icon="gtk-ok"/> <button name="set_pending" string="Pending" type="object" states="open" icon="gtk-media-pause"/> <button name="set_close" string="Close" type="object" states="open,pending" icon="terp-dialog-close"/> </group> diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml index 402f93f4817..4ce9d706e69 100644 --- a/addons/idea/test/test_idea.yml +++ b/addons/idea/test/test_idea.yml @@ -56,7 +56,7 @@ - !python {model: idea.post.vote}: | uid2 = ref('test_idea_user1') - new_id = self.create(cr, uid2, {'vote': 50}, {"active_ids": [ref("idea_idea_0")]}) + new_id = self.create(cr, uid2, {'vote': "50"}, {"active_ids": [ref("idea_idea_0")]}) self.do_vote(cr, uid2, [new_id], {"active_ids": [ref("idea_idea_0")]}) - | @@ -69,7 +69,7 @@ - !python {model: idea.post.vote}: | uid2 = ref('test_idea_user2') - new_id = self.create(cr, uid2, {'vote': 100, 'note': 'We can learn many things from technical presentation'}, {"active_ids": [ref("idea_idea_0")]}) + new_id = self.create(cr, uid2, {'vote': "100", 'note': 'We can learn many things from technical presentation'}, {"active_ids": [ref("idea_idea_0")]}) self.do_vote(cr, uid2, [new_id], {'active_ids': [ref('idea_idea_0')]}) - | diff --git a/addons/l10n_at/account_chart.xml b/addons/l10n_at/account_chart.xml index fdebb42ec3b..6e49ef357e4 100644 --- a/addons/l10n_at/account_chart.xml +++ b/addons/l10n_at/account_chart.xml @@ -61,6 +61,7 @@ <record model="account.account.type" id="account_type_equity"> <field name="name">Eigenkapital</field> <field name="code">equity</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index 2ab26d66439..e43dbfecf2b 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -117,7 +117,8 @@ class partner_vat_list_13(osv.osv_memory): """ Partner Vat Listing """ _name = "partner.vat.list_13" _columns = { - 'partner_ids': fields.many2many('vat.listing.clients', 'vat_partner_rel', 'vat_id', 'partner_id', 'Clients', required=False, help='You can remove clients/partners which you do not want to show in xml file'), + # TODO the referenced model has been deleted at revno 4672.1.2. + #'partner_ids': fields.many2many('vat.listing.clients', 'vat_partner_rel', 'vat_id', 'partner_id', 'Clients', required=False, help='You can remove clients/partners which you do not want to show in xml file'), 'name': fields.char('File Name', size=32), 'msg': fields.text('File created', size=64, readonly=True), 'file_save' : fields.binary('Save File', readonly=True), @@ -127,7 +128,8 @@ class partner_vat_list_13(osv.osv_memory): return context.get('partner_ids', []) _defaults={ - 'partner_ids': _get_partners + # TODO the referenced model has been deleted at revno 4672.1.2. + # 'partner_ids': _get_partners } def create_xml(self, cursor, user, ids, context=None): diff --git a/addons/l10n_be/wizard/l10n_be_vat_intra.py b/addons/l10n_be/wizard/l10n_be_vat_intra.py index 2596076c048..84093cbe066 100644 --- a/addons/l10n_be/wizard/l10n_be_vat_intra.py +++ b/addons/l10n_be/wizard/l10n_be_vat_intra.py @@ -83,9 +83,10 @@ class partner_vat_intra(osv.osv_memory): else: data_cmpny = obj_user.browse(cursor, user, user).company_id data = self.read(cursor, user, ids)[0] - company_vat = data_cmpny.partner_id.vat.replace(' ','').upper() + company_vat = data_cmpny.partner_id.vat if not company_vat: raise osv.except_osv(_('Data Insufficient'),_('No VAT Number Associated with Main Company!')) + company_vat = company_vat.replace(' ','').upper() seq_controlref = obj_sequence.get(cursor, user, 'controlref') seq_declarantnum = obj_sequence.get(cursor, user, 'declarantnum') diff --git a/addons/l10n_ca/account_types_en.xml b/addons/l10n_ca/account_types_en.xml index 0c507fba98b..1af3fd92205 100644 --- a/addons/l10n_ca/account_types_en.xml +++ b/addons/l10n_ca/account_types_en.xml @@ -56,6 +56,7 @@ <record model="account.account.type" id="user_type_equity_en"> <field name="name">Equity</field> <field name="code">equity</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> diff --git a/addons/l10n_cr/data/account_account_type.xml b/addons/l10n_cr/data/account_account_type.xml index 76e6c0bdf65..7961f6422a2 100644 --- a/addons/l10n_cr/data/account_account_type.xml +++ b/addons/l10n_cr/data/account_account_type.xml @@ -27,6 +27,7 @@ <field name="code">Eq</field> <field name="name">Equity</field> <field name="sign" eval="-1"/> + <field name="report_type">liability</field> <field name="close_method">detail</field> </record> <record id="account_account_type_expense" model="account.account.type"> diff --git a/addons/l10n_fr/plan_comptable_general_demo.xml b/addons/l10n_fr/plan_comptable_general_demo.xml index e3684eb3d34..b78e1821720 100644 --- a/addons/l10n_fr/plan_comptable_general_demo.xml +++ b/addons/l10n_fr/plan_comptable_general_demo.xml @@ -94,7 +94,7 @@ <record model="account.account.type" id="account_type_equity"> <field name="name">Equity</field> <field name="code">equity</field> - <field name="report_type">asset</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> diff --git a/addons/l10n_lu/l10n_lu_data.xml b/addons/l10n_lu/l10n_lu_data.xml index 940da2177e5..36403f383b0 100644 --- a/addons/l10n_lu/l10n_lu_data.xml +++ b/addons/l10n_lu/l10n_lu_data.xml @@ -32,7 +32,7 @@ <record id="account_type_cash_equity" model="account.account.type"> <field name="name">Equity</field> <field name="code">equity</field> - <field name="report_type">asset</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> <record id="account_type_income" model="account.account.type"> diff --git a/addons/l10n_ma/account_type.xml b/addons/l10n_ma/account_type.xml index 7d747a68886..d8e688b0b0f 100644 --- a/addons/l10n_ma/account_type.xml +++ b/addons/l10n_ma/account_type.xml @@ -5,7 +5,7 @@ <record id="cpt_type_cp" model="account.account.type"> <field name="name">Capitaux Propres</field> <field name="code">equity</field> - <field name="report_type">asset</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> <record id="cpt_type_dlt" model="account.account.type"> diff --git a/addons/l10n_mx/account_chart.xml b/addons/l10n_mx/account_chart.xml index ea7b534d503..9a86600101f 100644 --- a/addons/l10n_mx/account_chart.xml +++ b/addons/l10n_mx/account_chart.xml @@ -56,6 +56,7 @@ <record model="account.account.type" id="account_type_equity"> <field name="name">Equity</field> <field name="code">equity</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> diff --git a/addons/l10n_ro/account_chart.xml b/addons/l10n_ro/account_chart.xml index f48cc0de7e4..aae1ca9faf8 100644 --- a/addons/l10n_ro/account_chart.xml +++ b/addons/l10n_ro/account_chart.xml @@ -61,6 +61,7 @@ <record model="account.account.type" id="account_type_equity"> <!-- de capital --> <field name="name">Equity</field> <field name="code">equity</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> diff --git a/addons/l10n_syscohada/l10n_syscohada_data.xml b/addons/l10n_syscohada/l10n_syscohada_data.xml index 1d8a1564348..c5a28dd95da 100644 --- a/addons/l10n_syscohada/l10n_syscohada_data.xml +++ b/addons/l10n_syscohada/l10n_syscohada_data.xml @@ -74,7 +74,7 @@ <record model="account.account.type" id="account_type_equity">
<field name="name">Equity</field>
<field name="code">equity</field>
- <field name="report_type">asset</field>
+ <field name="report_type">liability</field>
<field name="close_method">balance</field>
</record>
<record model="account.account.type" id="account_type_provision">
diff --git a/addons/l10n_ve/account_chart.xml b/addons/l10n_ve/account_chart.xml index b46ff29ef8a..aaa4fe91b08 100644 --- a/addons/l10n_ve/account_chart.xml +++ b/addons/l10n_ve/account_chart.xml @@ -56,6 +56,7 @@ <record model="account.account.type" id="account_type_equity"> <field name="name">Equity</field> <field name="code">equity</field> + <field name="report_type">liability</field> <field name="close_method">balance</field> </record> diff --git a/addons/lunch/i18n/zh_TW.po b/addons/lunch/i18n/zh_TW.po new file mode 100644 index 00000000000..c29ab2a1fb1 --- /dev/null +++ b/addons/lunch/i18n/zh_TW.po @@ -0,0 +1,540 @@ +# Chinese (Traditional) 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 <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" +"POT-Creation-Date: 2011-01-11 11:15+0000\n" +"PO-Revision-Date: 2011-09-27 08:10+0000\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: Chinese (Traditional) <zh_TW@li.org>\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-28 05:20+0000\n" +"X-Generator: Launchpad (build 14049)\n" + +#. module: lunch +#: wizard_view:lunch.cashbox.clean,init:0 +msgid "Reset cashbox" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_order_form +#: model:ir.ui.menu,name:lunch.menu_lunch_reporting_order +msgid "Lunch Orders" +msgstr "午膳訂單" + +#. module: lunch +#: wizard_view:lunch.order.cancel,init:0 +msgid "Are you sure you want to cancel this order ?" +msgstr "是否取消此訂單?" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashmove_form +msgid "Cash Moves" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:lunch.order:0 +#: view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Group By..." +msgstr "分組根據..." + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_order_confirm +msgid "confirm Order" +msgstr "確認訂單" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 7 Days " +msgstr " 7 天 " + +#. module: lunch +#: model:ir.module.module,description:lunch.module_meta_information +msgid "" +"\n" +" The base module to manage lunch\n" +"\n" +" keep track for the Lunch Order ,Cash Moves ,CashBox ,Product.\n" +" Apply Different Category for the product.\n" +" " +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:lunch.order:0 +msgid "Today" +msgstr "今日" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "March" +msgstr "三月" + +#. module: lunch +#: report:lunch.order:0 +msgid "Total :" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,day:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,day:0 +msgid "Day" +msgstr "" + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.wizard_id_cancel +#: wizard_view:lunch.order.cancel,init:0 +msgid "Cancel Order" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,amount:0 +#: field:report.lunch.amount,amount:0 +msgid "Amount" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_product_form +#: view:lunch.product:0 +msgid "Products" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_amount +msgid "Amount available by user and box" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month " +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_report_lunch_order +msgid "Lunch Orders Statistics" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashmove_form +#: view:lunch.cashmove:0 +#: field:lunch.order,cashmove:0 +msgid "CashMove" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "Confirmed" +msgstr "" + +#. module: lunch +#: view:lunch.order.confirm:0 +msgid "Confirm" +msgstr "" + +#. module: lunch +#: model:ir.module.module,shortdesc:lunch.module_meta_information +msgid "Lunch Module" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Search Lunch Order" +msgstr "" + +#. module: lunch +#: field:lunch.order,state:0 +msgid "State" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,price_total:0 +msgid "Total Price" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +#: view:report.lunch.amount:0 +msgid "Box Amount by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,create_date:0 +msgid "Creation Date" +msgstr "" + +#. module: lunch +#: report:lunch.order:0 +msgid "Name/Date" +msgstr "" + +#. module: lunch +#: field:lunch.order,descript:0 +msgid "Description Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.lunch_order_confirm +#: wizard_button:lunch.order.confirm,init,go:0 +msgid "Confirm Order" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "July" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:report.lunch.amount:0 +#: view:report.lunch.order:0 +msgid "Box" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 365 Days " +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Month-1 " +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,date:0 +msgid "Created Date" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_category_form +msgid " Product Categories " +msgstr "" + +#. module: lunch +#: wizard_button:lunch.cashbox.clean,init,zero:0 +msgid "Set to Zero" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashmove +msgid "Cash Move" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "April" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "September" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "December" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,month:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,month:0 +msgid "Month" +msgstr "" + +#. module: lunch +#: wizard_field:lunch.order.confirm,init,confirm_cashbox:0 +msgid "Name of box" +msgstr "" + +#. module: lunch +#: wizard_button:lunch.order.cancel,init,cancel:0 +msgid "Yes" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_category +#: view:lunch.category:0 +#: field:lunch.product,category_id:0 +msgid "Category" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid " Year " +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_category_form +msgid "Product Categories" +msgstr "" + +#. module: lunch +#: wizard_button:lunch.order.cancel,init,end:0 +msgid "No" +msgstr "" + +#. module: lunch +#: wizard_view:lunch.order.confirm,init:0 +msgid "Orders Confirmation" +msgstr "" + +#. module: lunch +#: wizard_view:lunch.cashbox.clean,init:0 +msgid "Are you sure you want to reset this cashbox ?" +msgstr "" + +#. module: lunch +#: selection:lunch.order,state:0 +msgid "Draft" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "August" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_order_all +#: view:report.lunch.order:0 +msgid "Lunch Order Analysis" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "June" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,user_cashmove:0 +#: field:lunch.order,user_id:0 +#: field:report.lunch.amount,user_id:0 +msgid "User Name" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid "Sales Analysis" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch +msgid "Lunch" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +#: view:report.lunch.order:0 +msgid "User" +msgstr "" + +#. module: lunch +#: field:lunch.order,date:0 +msgid "Date" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "November" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "October" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "January" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox_clean +msgid "clean cashbox" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,active:0 +#: field:lunch.product,active:0 +msgid "Active" +msgstr "" + +#. module: lunch +#: field:report.lunch.order,date:0 +msgid "Date Order" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_cashbox +msgid "Cashbox for Lunch " +msgstr "" + +#. module: lunch +#: model:ir.actions.wizard,name:lunch.wizard_clean_cashbox +msgid "Set CashBox to Zero" +msgstr "" + +#. module: lunch +#: field:lunch.cashmove,box:0 +#: field:report.lunch.amount,box:0 +msgid "Box Name" +msgstr "" + +#. module: lunch +#: wizard_button:lunch.cashbox.clean,init,end:0 +#: wizard_button:lunch.order.confirm,init,end:0 +msgid "Cancel" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_cashbox_form +msgid " Cashboxes " +msgstr "" + +#. module: lunch +#: rml:lunch.order:0 +msgid "Unit Price" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_lunch_product_form +#: field:lunch.order,product:0 +msgid "Product" +msgstr "" + +#. module: lunch +#: rml:lunch.order:0 +#: field:lunch.product,description:0 +msgid "Description" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "May" +msgstr "" + +#. module: lunch +#: field:lunch.order,price:0 +#: field:lunch.product,price:0 +msgid "Price" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Search CashMove" +msgstr "" + +#. module: lunch +#: view:report.lunch.amount:0 +msgid "Total box" +msgstr "" + +#. module: lunch +#: model:ir.model,name:lunch.model_lunch_product +msgid "Lunch Product" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,sum_remain:0 +msgid "Total Remaining" +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "Total price" +msgstr "" + +#. module: lunch +#: selection:report.lunch.amount,month:0 +#: selection:report.lunch.order,month:0 +msgid "February" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,name:0 +#: field:lunch.cashmove,name:0 +#: field:lunch.category,name:0 +#: rml:lunch.order:0 +#: field:lunch.product,name:0 +msgid "Name" +msgstr "" + +#. module: lunch +#: view:lunch.cashmove:0 +msgid "Total amount" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +msgid "Category related to Products" +msgstr "" + +#. module: lunch +#: model:ir.ui.menu,name:lunch.menu_lunch_cashbox_form +#: view:lunch.cashbox:0 +msgid "Cashboxes" +msgstr "" + +#. module: lunch +#: view:lunch.category:0 +#: rml:lunch.order:0 +#: view:lunch.order:0 +msgid "Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.report.xml,name:lunch.report_lunch_order +#: model:ir.model,name:lunch.model_lunch_order +#: model:ir.ui.menu,name:lunch.menu_lunch +#: report:lunch.order:0 +msgid "Lunch Order" +msgstr "" + +#. module: lunch +#: model:ir.actions.act_window,name:lunch.action_report_lunch_amount_tree +#: model:ir.ui.menu,name:lunch.menu_lunch_report_amount_tree +msgid "Cash Position by User" +msgstr "" + +#. module: lunch +#: field:lunch.cashbox,manager:0 +msgid "Manager" +msgstr "" + +#. module: lunch +#: view:report.lunch.order:0 +msgid " 30 Days " +msgstr "" + +#. module: lunch +#: view:lunch.order:0 +msgid "To Confirm" +msgstr "" + +#. module: lunch +#: field:report.lunch.amount,year:0 +#: view:report.lunch.order:0 +#: field:report.lunch.order,year:0 +msgid "Year" +msgstr "" diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py index 0bfaf06890a..93bf0b004d8 100644 --- a/addons/mail/wizard/mail_compose_message.py +++ b/addons/mail/wizard/mail_compose_message.py @@ -82,9 +82,9 @@ class mail_compose_message(osv.osv_memory): else: # default mode result['model'] = context.get('active_model', False) - if vals: - for field in fields: - result.update({field : vals.get(field, False)}) + for field in vals: + if field in fields: + result.update({field : vals[field]}) # link to model and record if not done yet if not result.get('model') or not result.get('res_id'): diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index 733312ba799..5027bd372ea 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -19,6 +19,7 @@ # ############################################################################## +import time import pooler from report.interface import report_rml #from report.interface import toxml @@ -39,6 +40,7 @@ class report_custom(report_rml): workcenter_pool = pool.get('mrp.workcenter') user_pool = pool.get('res.users') bom_pool = pool.get('mrp.bom') + pricelist_pool = pool.get('product.pricelist') rml_obj=report_sxw.rml_parse(cr, uid, product_pool._name,context) rml_obj.localcontext.update({'lang':context.get('lang',False)}) company_currency = user_pool.browse(cr, uid, uid).company_id.currency_id @@ -56,8 +58,12 @@ class report_custom(report_rml): if prod.seller_id: main_sp_name = "<b>%s</b>\r\n" %(prod.seller_id.name) - price = supplier_info_pool.price_get(cr, uid, prod.seller_id.id, prod.id, number*prod_qtty)[prod.seller_id.id] - price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, price, to_uom_id=product_uom.id) + pricelist = prod.seller_id.property_product_pricelist_purchase + price = pricelist_pool.price_get(cr,uid,[pricelist.id], + prod.id, number*prod_qtty or 1.0, prod.seller_id.id, { + 'uom': prod.uom_po_id.id, + 'date': time.strftime('%Y-%m-%d'), + })[pricelist.id] main_sp_price = """<b>"""+rml_obj.formatLang(price)+' '+ company_currency.symbol+"""</b>\r\n""" sum += prod_qtty*price std_price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, prod.standard_price, to_uom_id=product_uom.id) @@ -65,8 +71,12 @@ class report_custom(report_rml): sum_strd = prod_qtty*std_price for seller_id in prod.seller_ids: sellers += '- <i>'+ seller_id.name.name +'</i>\r\n' - price = supplier_info_pool.price_get(cr, uid, seller_id.name.id, prod.id, number*prod_qtty)[seller_id.name.id] - price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, price, to_uom_id=product_uom.id) + pricelist = seller_id.name.property_product_pricelist_purchase + price = pricelist_pool.price_get(cr,uid,[pricelist.id], + prod.id, number*prod_qtty or 1.0, seller_id.name.id, { + 'uom': prod.uom_po_id.id, + 'date': time.strftime('%Y-%m-%d'), + })[pricelist.id] sellers_price += """<i>"""+rml_obj.formatLang(price) +' '+ company_currency.symbol +"""</i>\r\n""" xml += """<col para='yes'> """+ prod_name +""" </col> <col para='yes'> """+ main_sp_name + sellers + """ </col> diff --git a/addons/mrp/test/mrp_phantom_bom.yml b/addons/mrp/test/mrp_phantom_bom.yml index 6bb297fbcfb..1f499a5fb7f 100644 --- a/addons/mrp/test/mrp_phantom_bom.yml +++ b/addons/mrp/test/mrp_phantom_bom.yml @@ -205,9 +205,8 @@ I am checking Procurement orders. There are 3 orders generated for Oranges, Sugar and Water. - !python {model: procurement.order}: | - from tools.translate import _ proc_ids = self.search(cr, uid, [('product_id','in',[ref('product_product_orange0'),ref('product_product_sugar0'),ref('product_product_water0')])]) - assert proc_ids, _('No Procurements!') + assert proc_ids, 'No Procurements!' - The scheduler runs. - @@ -219,9 +218,8 @@ stock moves for Oranges, Sugar and Water made correctly. - !python {model: stock.picking}: | - from tools.translate import _ pick_ids = self.search(cr, uid, [('type','=','internal')]) - assert pick_ids, _('No Internal Pickings!') + assert pick_ids, 'No Internal Pickings!' - According to minimum stock rules. I have 2 purchase orders for Sugar with 6 Kg from Axelor and Orange 60 Kg from ASUStek. @@ -229,50 +227,24 @@ I confirm the purchase order of Sugar and Orange. - !python {model: purchase.order}: | - from tools.translate import _ import netsvc purch_ids = self.search(cr, uid, [('state','=','draft')]) - assert purch_ids, _('No Purchase Orders were made!') + assert purch_ids, 'No Purchase Orders were made!' wf_service = netsvc.LocalService("workflow") for p_id in purch_ids: wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_confirm', cr) - - I see two incoming pickings for Orange and Sugar. + I see two incoming pickings for Orange and Sugar, and receive them. - !python {model: stock.picking}: | - from tools.translate import _ pick_ids = self.search(cr, uid, [('type','=','in')]) - assert pick_ids, _('No Incoming Shipments found!') -- - I receive both the products. My incoming pickings are done. -- - I create record for the incoming picking wizard. -- - !record {model: stock.partial.picking, id: stock_partial_picking0}: - date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S") -- - I make my pickings done. -- - !python {model: stock.partial.picking}: | - pick_obj = self.pool.get('stock.picking') - picking_ids = pick_obj.search(cr, uid, [('type','=','in'),('state','=','assigned')]) - partial = self.browse(cr, uid, 1, context) - partial_datas = { - 'delivery_date': partial.date - } - for pick in pick_obj.browse(cr, uid, picking_ids): - for m in pick.move_lines: - partial_datas['move%s'%(m.id)] = { - 'product_id': m.product_id.id, - 'product_qty': m.product_qty, - 'product_uom': m.product_uom.id - } - if (pick.type == 'in') and (m.product_id.cost_method == 'average'): - partial_datas['move%s'%(m.id)].update({ - 'product_price': m.product_price, - 'product_currency': m.product_currency - }) - pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context) + assert pick_ids, 'No Incoming Shipments found!' + stock_partial_picking = self.pool.get('stock.partial.picking') + for pick_id in pick_ids: + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick_id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - Again the scheduler runs. - @@ -283,19 +255,15 @@ I check my internal picking of "Orange Juice" is done. - !python {model: stock.picking}: | - from tools.translate import _ pick_ids = self.search(cr, uid, [('type','=','internal'),('state','=','done')]) - assert pick_ids, _('Internal Picking is not done yet!') + assert pick_ids, 'Internal Picking is not done yet!' - I check my manufacturing order for "Orange Juice" is ready or not. - !python {model: mrp.production}: | - from tools.translate import _ - pick_ids = self.search(cr, uid, [('state','=','ready'),('id','=',ref('mrp_production_mo0'))]) - assert pick_ids, _('Manufacturing order is not ready!') + prod_ids = self.search(cr, uid, [('state','=','ready'),('id','=',ref('mrp_production_mo0'))]) + assert prod_ids, 'Manufacturing order is not ready!' - I start the production order. - !workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0} - - diff --git a/addons/mrp/test/mrp_procurement.yml b/addons/mrp/test/mrp_procurement.yml index 568a5f0b0e8..4aaf1560432 100644 --- a/addons/mrp/test/mrp_procurement.yml +++ b/addons/mrp/test/mrp_procurement.yml @@ -195,74 +195,26 @@ I Check incoming shipments for cloth. And receive products. - !python {model: stock.picking}: | - from tools.translate import _ pick_ids = self.search(cr, uid, [('address_id.name','=','Wong'),('state','=','assigned')]) - assert pick_ids, _('No Incoming Shipments found!') -- - I create record for partial picking. -- - !record {model: stock.partial.picking, id: stock_partial_picking0}: - date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S") - -- - I make my picking done. -- - !python {model: stock.partial.picking}: | - pick_obj = self.pool.get('stock.picking') - picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Wong'),('state','=','assigned')]) - partial = self.browse(cr, uid, 1, context) - partial_datas = { - 'delivery_date' : partial.date - } - for pick in pick_obj.browse(cr, uid, picking_ids): - for m in pick.move_lines: - partial_datas['move%s'%(m.id)] = { - 'product_id' : m.product_id.id, - 'product_qty' : m.product_qty, - 'product_uom' : m.product_uom.id - } - if (pick.type == 'in') and (m.product_id.cost_method == 'average'): - partial_datas['move%s'%(m.id)].update({ - 'product_price' : m.product_price, - 'product_currency': m.product_currency - }) - pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context) + assert pick_ids, 'No Incoming Shipments found!' + stock_partial_picking = self.pool.get('stock.partial.picking') + for pick_id in pick_ids: + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick_id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I Check incoming shipments for buttons and receive products. - !python {model: stock.picking}: | - from tools.translate import _ pick_ids = self.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')]) - assert pick_ids, _('No Incoming Shipments found!') -- - I create record for partial picking. -- - !record {model: stock.partial.picking, id: stock_partial_picking0}: - date: !eval datetime.today().strftime("%Y-%m-%d %H:%M:%S") - -- - I make my picking done. -- - !python {model: stock.partial.picking}: | - pick_obj = self.pool.get('stock.picking') - picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')]) - partial = self.browse(cr, uid, 1, context) - partial_datas = { - 'delivery_date': partial.date - } - for pick in pick_obj.browse(cr, uid, picking_ids): - for m in pick.move_lines: - partial_datas['move%s'%(m.id)] = { - 'product_id': m.product_id.id, - 'product_qty': m.product_qty, - 'product_uom': m.product_uom.id - } - if (pick.type == 'in') and (m.product_id.cost_method == 'average'): - partial_datas['move%s'%(m.id)].update({ - 'product_price': m.product_price, - 'product_currency': m.product_currency - }) - pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context) + assert pick_ids, 'No Incoming Shipments found!' + stock_partial_picking = self.pool.get('stock.partial.picking') + for pick_id in pick_ids: + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick_id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - Run scheduler again. - @@ -297,7 +249,6 @@ I produce 2 products with 5.00 quantities each. - !python {model: mrp.product.produce}: | - from tools.translate import _ prod_obj = self.pool.get('mrp.production') prod_ids = prod_obj.search(cr, uid, [('product_id.name','=','Shirt')]) self.do_produce(cr, uid, [ref('mrp_product_produce0')], context={'active_ids': prod_ids}) @@ -321,8 +272,7 @@ And finally production order is done. - !python {model: mrp.product.produce}: | - from tools.translate import _ prod_obj = self.pool.get('mrp.production') prod_ids = prod_obj.search(cr, uid, [('product_id.name','=','Shirt')]) - self.do_produce(cr, uid, [1], context={'active_ids': prod_ids}) + self.do_produce(cr, uid, [ref('mrp_product_produce0')], context={'active_ids': prod_ids}) diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 4e665b3f9dc..7dc93731b03 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -235,6 +235,8 @@ class mrp_production(osv.osv): obj = self.browse(cr, uid, ids)[0] wf_service = netsvc.LocalService("workflow") for workcenter_line in obj.workcenter_lines: + if workcenter_line.state == 'draft': + wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr) wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_done', cr) return super(mrp_production,self).action_production_end(cr, uid, ids) @@ -243,9 +245,11 @@ class mrp_production(osv.osv): @return: True """ obj = self.browse(cr, uid, ids)[0] + workcenter_pool = self.pool.get('mrp.production.workcenter.line') wf_service = netsvc.LocalService("workflow") - for workcenter_line in obj.workcenter_lines: - wf_service.trg_validate(uid, 'mrp.production.workcenter.line', workcenter_line.id, 'button_start_working', cr) + for prod in self.browse(cr, uid, ids): + if prod.workcenter_lines: + wf_service.trg_validate(uid, 'mrp.production.workcenter.line', prod.workcenter_lines[0].id, 'button_start_working', cr) return super(mrp_production,self).action_in_production(cr, uid, ids) def action_cancel(self, cr, uid, ids, context=None): diff --git a/addons/outlook/installer.py b/addons/outlook/installer.py index 4d0ac1e1971..2be0c243037 100644 --- a/addons/outlook/installer.py +++ b/addons/outlook/installer.py @@ -41,7 +41,7 @@ class outlook_installer(osv.osv_memory): 'doc_name':fields.char('File name', size=64), 'outlook':fields.boolean('Outlook Plug-in ', help="Allows you to select an object that you would like to add to your email and its attachments."), 'plugin_file':fields.binary('Outlook Plug-in', readonly=True, help="outlook plug-in file. Save as this file and install this plug-in in outlook."), - 'doc_file':fields.char('Installation Manual',size="264",help="The documentation file :- how to install Outlook Plug-in.", readonly=True), + 'doc_file':fields.char('Installation Manual',size=264,help="The documentation file :- how to install Outlook Plug-in.", readonly=True), 'description':fields.text('Description', readonly=True) } diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 19f18d92dd6..ee2173dcd49 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -264,7 +264,7 @@ class pos_order(osv.osv): args['partner_id'] = order.partner_id and order.partner_id.id or None statement_id = statement_obj.search(cr,uid, [ - ('journal_id', '=', data['journal']), + ('journal_id', '=', int(data['journal'])), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')], context=context) @@ -274,7 +274,7 @@ class pos_order(osv.osv): statement_id = statement_id[0] args['statement_id'] = statement_id args['pos_statement_id'] = order_id - args['journal_id'] = data['journal'] + args['journal_id'] = int(data['journal']) args['type'] = 'customer' args['ref'] = order.name statement_line_obj.create(cr, uid, args, context=context) 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 f31f9ec0f49..f3ea5995b9e 100644 --- a/addons/point_of_sale/test/point_of_sale_report.yml +++ b/addons/point_of_sale/test/point_of_sale_report.yml @@ -35,6 +35,11 @@ file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data) - + Create a record for the root user in pos.payment.report.user (used by the next python block). +- + !record {model: pos.payment.report.user, id: pos_payment_report_user_1}: + user_id: [] +- Print the POS Payment Report through the wizard - !python {model: ir.ui.menu}: | diff --git a/addons/product/pricelist_view.xml b/addons/product/pricelist_view.xml index f284dcbc47b..79e6773980c 100644 --- a/addons/product/pricelist_view.xml +++ b/addons/product/pricelist_view.xml @@ -56,6 +56,7 @@ <tree string="Products Listprices Items"> <field name="sequence"/> <field colspan="4" name="name" select="1"/> + <field name="product_id"/> <field name="product_tmpl_id" select="1"/> <field name="categ_id" select="1"/> <field name="min_quantity"/> diff --git a/addons/product/product.py b/addons/product/product.py index 78fc05fe7e7..b055e704785 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -460,6 +460,7 @@ class product_product(osv.osv): 'active': lambda *a: 1, 'price_extra': lambda *a: 0.0, 'price_margin': lambda *a: 1.0, + 'color': 0, } _name = "product.product" @@ -486,8 +487,10 @@ class product_product(osv.osv): 'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Sale Price')), 'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'), 'name_template': fields.related('product_tmpl_id', 'name', string="Name", type='char', size=128, store=True), + 'color': fields.integer('Color Index'), + 'product_image': fields.binary('Image'), } - + def unlink(self, cr, uid, ids, context=None): unlink_ids = [] unlink_product_tmpl_ids = [] diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index a50a7b404e2..35798ce939d 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -69,7 +69,7 @@ <field eval="7" name="priority"/> <field name="arch" type="xml"> <form string="Product"> - <group colspan="4" col="6"> + <group colspan="4" col="8"> <group colspan="4" col="2"> <separator string="Name" colspan="2"/> <field name="name"/> @@ -85,6 +85,9 @@ <field name="sale_ok"/> <field name="purchase_ok"/> </group> + <group colspan="1" col="1"> + <field name="product_image" widget='image' nolabel="1"/> + </group> </group> <notebook colspan="4"> @@ -191,6 +194,68 @@ </form> </field> </record> + + <!-- Product Kanban View --> + <record model="ir.ui.view" id="product_kanban_view"> + <field name="name">Product Kanban</field> + <field name="model">product.product</field> + <field name="type">kanban</field> + <field name="arch" type="xml"> + <kanban default_group_by="type"> + <templates> + <t t-name="kanban-box"> + <t t-set="color" t-value="kanban_color(record.color.raw_value || record.type.raw_value)"/> + <div t-att-class="color + (record.color.raw_value == 1 ? ' oe_kanban_color_alert' : '')"> + <div class="oe_kanban_box oe_kanban_color_border"> + <table class="oe_kanban_table oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle"> + <tr> + <td class="oe_kanban_title1" align="left" valign="middle"> + <t t-if="record.default_code.raw_value">[<field name="default_code"/>]</t> + <field name="name"/> + </td> + <td align="right" valign="top" width="22"> + <img t-att-src="kanban_gravatar(record.product_manager.raw_value, 22)" class="oe_kanban_gravatar"/> + </td> + </tr> + </table> + <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger"> + <table class="oe_kanban_table"> + <tr> + <td valign="top" width="22"> + <t t-if="record.product_image.raw_value"> + <img t-att-src="'data:image/png;base64,'+record.product_image.raw_value" width='48' height='48'/> + </t> + <t t-if="!record.product_image.raw_value"> + <img src="/web/static/src/img/product_default.png"/> + </t> + </td> + <td> + <div class="oe_kanban_title2"> + <t t-if="record.type.raw_value=='service'">No Stock</t> + <t t-if="record.type.raw_value!='service'"> + <div><field name="qty_available"/> On Hand , <field name="virtual_available"/> Available</div> + <div><t t-if="record.list_price.raw_value!=0">Public Price : <field name="lst_price"/> ,</t> Cost : <field name="standard_price"/></div> + </t> + </div> + </td> + </tr> + </table> + </div> + <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick"> + <div class="oe_kanban_left"> + <a string="Edit" icon="gtk-edit" type="edit"/> + <a string="Change Color" icon="color-picker" type="color" name="color"/> + </div> + <br class="oe_kanban_clear"/> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + <record id="product_normal_action" model="ir.actions.act_window"> <field name="name">Products</field> <field name="type">ir.actions.act_window</field> @@ -204,12 +269,27 @@ <field name="name">Products</field> <field name="type">ir.actions.act_window</field> <field name="res_model">product.product</field> + <field name="view_mode">tree,form,kanban</field> <field name="view_type">form</field> <field name="context">{"search_default_filter_to_sell":1}</field> <field name="view_id" ref="product_product_tree_view"/> <field name="search_view_id" ref="product_search_form_view"/> <field name="help">You must define a Product for everything you buy or sell. Products can be raw materials, stockable products, consumables or services. The Product form contains detailed information about your products related to procurement logistics, sales price, product category, suppliers and so on.</field> </record> + + <record id="open_view_product_tree1" model="ir.actions.act_window.view"> + <field name="sequence" eval="1"/> + <field name="view_mode">tree</field> + <field name="view_id" ref="product_product_tree_view"/> + <field name="act_window_id" ref="product_normal_action_sell"/> + </record> + + <record id="open_view_product_form1" model="ir.actions.act_window.view"> + <field name="sequence" eval="2"/> + <field name="view_mode">form</field> + <field name="view_id" ref="product_normal_form_view"/> + <field name="act_window_id" ref="product_normal_action_sell"/> + </record> <menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/> <menuitem action="product.product_normal_action_sell" id="product.menu_products" parent="base.menu_product" sequence="1"/> diff --git a/addons/project/i18n/zh_TW.po b/addons/project/i18n/zh_TW.po index dc38347e9a5..c22e242a41d 100644 --- a/addons/project/i18n/zh_TW.po +++ b/addons/project/i18n/zh_TW.po @@ -7,19 +7,19 @@ 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-28 16:28+0000\n" +"PO-Revision-Date: 2011-09-27 10:35+0000\n" "Last-Translator: Walter Cheuk <wwycheuk@gmail.com>\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:54+0000\n" -"X-Generator: Launchpad (build 13830)\n" +"X-Launchpad-Export-Date: 2011-09-28 05:19+0000\n" +"X-Generator: Launchpad (build 14049)\n" #. module: project #: model:ir.actions.act_window,name:project.act_res_users_2_project_task_opened msgid "Assigned tasks" -msgstr "任務指派" +msgstr "已分派任務" #. module: project #: help:project.task.delegate,new_task_description:0 @@ -30,7 +30,7 @@ msgstr "" #: code:addons/project/project.py:671 #, python-format msgid "The task '%s' has been delegated to %s." -msgstr "「%s」任務委派予 %s" +msgstr "已將「%s」任務委派予 %s。" #. module: project #: help:res.company,project_time_mode_id:0 @@ -254,7 +254,7 @@ msgstr "專案結束任務" #. module: project #: model:process.node,name:project.process_node_drafttask0 msgid "Draft task" -msgstr "草案任務" +msgstr "任務草案" #. module: project #: model:ir.model,name:project.model_project_task @@ -273,7 +273,7 @@ msgstr "成員" msgid "" "Estimated time to do the task, usually set by the project manager when the " "task is in draft state." -msgstr "完成任務估計時間,通常由專案經理(PM)於草案階段設定" +msgstr "完成任務估計時間,通常由專案經理(PM)於草案階段設定。" #. module: project #: model:ir.model,name:project.model_project_task_work @@ -553,7 +553,7 @@ msgstr "下一個" #. module: project #: model:process.transition,note:project.process_transition_draftopentask0 msgid "From draft state, it will come into the open state." -msgstr "「草案」階段會轉為「進行中」階段" +msgstr "會由「草案」階段轉為「開放」階段。" #. module: project #: view:report.project.task.user:0 @@ -770,7 +770,7 @@ msgstr "" #. module: project #: model:process.transition,name:project.process_transition_draftopentask0 msgid "Draft Open task" -msgstr "草案進行任務" +msgstr "開啟任務草案" #. module: project #: view:project.project:0 @@ -917,6 +917,10 @@ msgid "" " \n" " If the task is over, the states is set to 'Done'." msgstr "" +"當建立任務時會處於「草案(Draft)」階段。\n" +" 開始後會處於「進行中(In Progress)」階段。\n" +" 如需評估,會處於「待通過(Pending)」階段。 \n" +" 任務完成,處於「完成(Done)」階段。" #. module: project #: help:project.task,progress:0 diff --git a/addons/project/project.py b/addons/project/project.py index 99ec9df8db5..e8c1d96be89 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -529,6 +529,7 @@ class task(osv.osv): 'manager_id': fields.related('project_id', 'analytic_account_id', 'user_id', type='many2one', relation='res.users', string='Project Manager'), 'company_id': fields.many2one('res.company', 'Company'), 'id': fields.integer('ID'), + 'color': fields.integer('Color Index'), } _defaults = { @@ -544,6 +545,21 @@ class task(osv.osv): _order = "sequence,priority, date_start, name, id" + def set_priority(self, cr, uid, ids, priority): + """Set task priority + """ + return self.write(cr, uid, ids, {'priority' : priority}) + + def set_high_priority(self, cr, uid, ids, *args): + """Set task priority to high + """ + return self.set_priority(cr, uid, ids, '1') + + def set_normal_priority(self, cr, uid, ids, *args): + """Set task priority to normal + """ + return self.set_priority(cr, uid, ids, '3') + def _check_recursion(self, cr, uid, ids, context=None): for id in ids: visited_branch = set() diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index b49241de996..b19bfaa9797 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -313,62 +313,71 @@ </field> </record> - - - <record id="view_task_kanban" model="ir.ui.view"> + + <!-- Project Task Kanban View --> + <record model="ir.ui.view" id="view_task_kanban"> <field name="name">project.task.kanban</field> <field name="model">project.task</field> <field name="type">kanban</field> <field name="arch" type="xml"> - <kanban> - <field name="state"/> + <kanban default_group_by="type_id" > <templates> <t t-name="kanban-box"> - <t t-set="color">#fff</t> - <t t-if="state.raw_value == 'done'" t-set="color">#dfd</t> - <t t-if="state.raw_value == 'open'" t-set="color">lightcyan</t> - <t t-if="state.raw_value == 'cancel' and total_hours.raw_value gt 0" t-set="color">red</t> - <div t-attf-style="background: #{color}"> - <table> - <tr> - <td>Title :</td> - <td><field name="name"/></td> - </tr> - <tr> - <td>Progress :</td> - <td><field name="progress"/></td> - </tr> - <tr> - <td><button data-type="action" data-name="%(action_project_task_reevaluate)d">Reevaluate</button><button data-type="edit" >Edit</button></td> - <td><button data-type="object" data-name="prev_type">Previous phase</button></td> - </tr> - <tr> - <td>Project name:</td> - <td colspan="2"><field name="project_id"/></td> - </tr> - <tr> - <td>Phase</td> - <td colspan="2"><field name="type_id"/></td> - </tr> - <tr> - <td>Remain Time :</td> - <td colspan="2"><field name="remaining_hours"/></td> - </tr> - <tr> - <td>Spent Time :</td> - <td colspan="2"><field name="remaining_hours"/></td> - </tr> - <tr> - <td>Remain Time :</td> - <td colspan="2"><field name="remaining_hours"/></td> - </tr> - </table> + <t t-set="color" t-value="kanban_color(record.color.raw_value || record.type_id.raw_value)"/> + <div t-att-class="color + (record.priority.raw_value == 1 ? ' oe_kanban_color_alert' : '')"> + <div class="oe_kanban_box oe_kanban_color_border"> + <table class="oe_kanban_table oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle"> + <tr> + <td class="oe_kanban_title1" align="left" valign="middle"> + <a t-if="record.priority.raw_value == 1" icon="star-on" type="object" name="set_normal_priority"/> + <a t-if="record.priority.raw_value != 1" icon="star-off" type="object" name="set_high_priority" style="opacity:0.6; filter:alpha(opacity=60);"/> + <field name="name"/> + </td> + <td valign="top" width="22"> + <img t-att-src="kanban_gravatar(record.user_id.value, 22)" class="oe_kanban_gravatar"/> + </td> + </tr> + </table> + <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger"> + <div class="oe_kanban_right oe_kanban_small"> + <field name="user_id"/> + </div> + <div class="oe_kanban_title2"> + <field name="project_id"/> + </div> + <div class="oe_kanban_small"> + <a target="_blank" t-att-href="'http://pad.openerp.com/'+record.name.raw_value.toLowerCase().replace(' ','-')"> + http://pad.openerp.com/<t t-esc="record.name.raw_value.toLowerCase().replace(' ','-')"/> + </a> + </div> + <div class="oe_kanban_small"> + <i><field name="date_deadline"/></i> + </div> + </div> + <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick"> + <div class="oe_kanban_left"> + <a string="Edit" icon="gtk-edit" type="edit"/> + <a string="Change Color" icon="color-picker" type="color" name="color"/> + <a string="" /> + <a title="OpenERP Pad" icon="pad-openerp" target="_blank" t-att-href="'http://pad.openerp.com/'+record.name.value" style="text-decoration: none;" > + <img src="/web/static/src/img/icons/pad-openerp.png" border="0" width="16" height="16"/> + </a> + <a name="%(action_project_task_delegate)d" string="Delegate" states="pending,open,draft" type="action" icon="gtk-sort-descending" /> + </div> + <div class="oe_kanban_right"> + <a name="do_cancel" string="Mark Lost" states="draft,open,pending" type="object" icon="lead-stage-lost"/> + <a name="do_pending" string="Pending" states="open" type="object" icon="gtk-media-pause"/> + <a name="action_close" string="Mark Won" states="pending,open" type="object" icon="lead-stage-won"/> + </div> + <br class="oe_kanban_clear"/> + </div> + </div> </div> </t> </templates> </kanban> </field> - </record> + </record> <record id="view_task_tree2" model="ir.ui.view"> <field name="name">project.task.tree</field> @@ -502,6 +511,21 @@ <field name="search_view_id" ref="view_task_search_form"/> <field name="help">A task represents a work that has to be done. Each user works in his own list of tasks where he can record his task work in hours. He can work and close the task itself or delegate it to another user. If you delegate a task to another user, you get a new task in pending state, which will be reopened when you have to review the work achieved. If you install the project_timesheet module, task work can be invoiced based on the project configuration. With the project_mrp module, sales orders can create tasks automatically when they are confirmed.</field> </record> + + <record id="action_view_task_tree" model="ir.actions.act_window.view"> + <field name="sequence" eval="1"/> + <field name="view_mode">tree</field> + <field name="view_id" ref="view_task_tree2"/> + <field name="act_window_id" ref="action_view_task"/> + </record> + + <record id="action_view_task_form" model="ir.actions.act_window.view"> + <field name="sequence" eval="2"/> + <field name="view_mode">form</field> + <field name="view_id" ref="view_task_form2"/> + <field name="act_window_id" ref="action_view_task"/> + </record> + <menuitem action="action_view_task" id="menu_action_view_task" parent="project.menu_project_management" sequence="3"/> <record id="action_view_task_overpassed_draft" model="ir.actions.act_window"> diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 302000950a1..74a78a9808a 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -226,6 +226,7 @@ class project_issue(crm.crm_case, osv.osv): multi='compute_day', type="float", store=True), 'inactivity_days': fields.function(_compute_day, string='Days since last action', \ multi='compute_day', type="integer", help="Difference in days between last action and current date"), + 'color': fields.integer('Color Index'), 'message_ids': fields.one2many('mail.message', 'res_id', 'Messages', domain=[('model','=',_name)]), 'date_action_last': fields.datetime('Last Action', readonly=1), 'date_action_next': fields.datetime('Next Action', readonly=1), @@ -258,7 +259,22 @@ class project_issue(crm.crm_case, osv.osv): 'priority': crm.AVAILABLE_PRIORITIES[2][0], 'project_id':_get_project, 'categ_id' : lambda *a: False, - } + } + + def set_priority(self, cr, uid, ids, priority): + """Set lead priority + """ + return self.write(cr, uid, ids, {'priority' : priority}) + + def set_high_priority(self, cr, uid, ids, *args): + """Set lead priority to high + """ + return self.set_priority(cr, uid, ids, '1') + + def set_normal_priority(self, cr, uid, ids, *args): + """Set lead priority to normal + """ + return self.set_priority(cr, uid, ids, '3') def convert_issue_task(self, cr, uid, ids, context=None): case_obj = self.pool.get('project.issue') diff --git a/addons/project_issue/project_issue_menu.xml b/addons/project_issue/project_issue_menu.xml index d404ed7f03f..b3be3d2c663 100644 --- a/addons/project_issue/project_issue_menu.xml +++ b/addons/project_issue/project_issue_menu.xml @@ -8,7 +8,7 @@ <field name="name">Issues</field> <field name="res_model">project.issue</field> <field name="view_type">form</field> - <field name="view_mode">tree,calendar</field> + <field name="view_mode">tree,calendar,kanban</field> <field name="view_id" ref="project_issue_tree_view"/> <field name="domain" eval=""/> <field name="context">{"search_default_user_id": uid, "search_default_draft": 1, "search_default_project_id":project_id}</field> diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 544606acb5d..916c67b15d4 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -260,6 +260,83 @@ </field> </record> + + <!-- Project Issue Karban View--> + + <record model="ir.ui.view" id="project_issue_kanban_view"> + <field name="name">Project Issue Kanban</field> + <field name="model">project.issue</field> + <field name="type">kanban</field> + <field name="arch" type="xml"> + <kanban default_group_by="type_id"> + <templates> + <t t-name="kanban-box"> + <t t-set="color" t-value="kanban_color(record.color.raw_value || record.state.raw_value)"/> + <div t-att-class="color + (record.priority.raw_value == 1 ? ' oe_kanban_color_alert' : '')"> + <div class="oe_kanban_box oe_kanban_color_border"> + <div class="oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle"> + <table class="oe_kanban_table"> + <tr> + <td class="oe_kanban_title1" align="left" valign="middle"> + <a t-if="record.priority.raw_value == 1" icon="star-on" type="object" name="set_normal_priority" /> + <a t-if="record.priority.raw_value != 1" icon="star-off" type="object" name="set_high_priority" style="opacity:0.6; filter:alpha(opacity=60);"/> + <field name="name"/> + </td> + <td valign="top" width="22"> + <img t-att-src="kanban_gravatar(record.user_id.value, 22)" class="oe_kanban_gravatar"/> + </td> + </tr> + </table> + </div> + <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger oe_kanban_color_border"> + <table class="oe_kanban_table"> + <tr> + <td> + <div class="oe_kanban_right oe_kanban_small"> + <field name="user_id"/> + </div> + <div class="oe_kanban_title2"> + <field name="partner_id"/> + </div> + <div class="oe_kanban_title3"> + <field name="project_id"/> + </div> + <div class="oe_kanban_title3"> + <i><field name="version_id"/></i> + </div> + </td> + </tr> + </table> + </div> + <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick"> + <div class="oe_kanban_left"> + <a string="Edit" icon="gtk-edit" type="edit"/> + <a string="Change Color" icon="color-picker" type="color" name="color"/> + <a string="Send New Email" name="%(mail.action_email_compose_message_wizard)d" icon="terp-mail-message-new" type="action"/> + <a string="Add Internal Note" name="%(crm.action_crm_add_note)d" context="{'model': 'crm.lead' }" icon="terp-document-new" type="action"/> + <a string="Escalate" name="case_escalate" icon="gtk-go-up" type="object"/> + <a string="Convert To Task" name="convert_issue_task" icon="gtk-index" type="object"/> + </div> + <div class="oe_kanban_right"> + <a name="case_open" string="Open" states="draft,pending" type="object" icon="lead-stage-won" /> + <a name="case_pending" string="Pending" states="draft,open" type="object" icon="lead-stage-pending"/> + <a name="case_close" string="Close" states="open,draft,pending" type="object" icon="lead-stage-lost"/> + </div> + <br class="oe_kanban_clear"/> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + + + + + # ------------------------------------------------------ # Feature Requests # ------------------------------------------------------ diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index 696c4d708fe..29b4aa29318 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -124,68 +124,15 @@ class stock_picking(osv.osv): purchase_obj.write(cursor, user, [picking.purchase_id.id], {'invoice_id': invoice_id,}) return super(stock_picking, self)._invoice_hook(cursor, user, picking, invoice_id) -stock_picking() - class stock_partial_picking(osv.osv_memory): _inherit = 'stock.partial.picking' - 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 = {} - pick_obj = self.pool.get('stock.picking') - res = super(stock_partial_picking, self).default_get(cr, uid, fields, context=context) - for pick in pick_obj.browse(cr, uid, context.get('active_ids', []), context=context): - has_product_cost = (pick.type == 'in' and pick.purchase_id) - for m in pick.move_lines: - if m.state in ('done','cancel') : - continue - if has_product_cost and m.product_id.cost_method == 'average' and m.purchase_line_id: - # We use the original PO unit purchase price as the basis for the cost, expressed - # in the currency of the PO (i.e the PO's pricelist currency) - list_index = 0 - for item in res['product_moves_in']: - if item['move_id'] == m.id: - res['product_moves_in'][list_index]['cost'] = m.purchase_line_id.price_unit - res['product_moves_in'][list_index]['currency'] = m.picking_id.purchase_id.pricelist_id.currency_id.id - list_index += 1 - return res -stock_partial_picking() - -class stock_partial_move(osv.osv_memory): - _inherit = "stock.partial.move" - 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 = {} - res = super(stock_partial_move, self).default_get(cr, uid, fields, context=context) - move_obj = self.pool.get('stock.move') - for m in move_obj.browse(cr, uid, context.get('active_ids', []), context=context): - if m.picking_id.type == 'in' and m.product_id.cost_method == 'average' \ - and m.purchase_line_id and m.picking_id.purchase_id: - # We use the original PO unit purchase price as the basis for the cost, expressed - # in the currency of the PO (i.e the PO's pricelist currency) - list_index = 0 - for item in res['product_moves_in']: - if item['move_id'] == m.id: - res['product_moves_in'][list_index]['cost'] = m.purchase_line_id.price_unit - res['product_moves_in'][list_index]['currency'] = m.picking_id.purchase_id.pricelist_id.currency_id.id - list_index += 1 - return res -stock_partial_move() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + # Overridden to inject the purchase price as true 'cost price' when processing + # incoming pickings. + def _product_cost_for_average_update(self, cr, uid, move): + if move.picking_id.purchase_id: + return {'cost': move.purchase_line_id.price_unit, + 'currency': move.picking_id.purchase_id.pricelist_id.currency_id.id} + return super(stock_partial_picking, self)._product_cost_for_average_update(cr, uid, move) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase/test/purchase_from_picking.yml b/addons/purchase/test/purchase_from_picking.yml index 9425ad94812..8d63aa3e02c 100644 --- a/addons/purchase/test/purchase_from_picking.yml +++ b/addons/purchase/test/purchase_from_picking.yml @@ -137,7 +137,7 @@ pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2")) pick_ids = [x.id for x in pur_id1.picking_ids] id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.expenses_journal')}, - {'active_ids': pick_ids}) + {'active_ids': pick_ids, 'active_model': 'stock.picking'}) self.create_invoice(cr, uid, [id], {"active_ids": pick_ids, "active_id": pick_ids[0]}) - I check that an invoice_ids field of Delivery&Invoices gets bind with the value. diff --git a/addons/sale/sale.py b/addons/sale/sale.py index f2f953398a2..16cb5faf065 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -728,6 +728,7 @@ class sale_order(osv.osv): #'state': 'waiting', 'note': line.notes, 'company_id': order.company_id.id, + 'price_unit': line.product_id.standard_price or 0.0 }) if line.product_id: diff --git a/addons/sale/test/invoice_on_ordered_qty.yml b/addons/sale/test/invoice_on_ordered_qty.yml index 785b2d8835e..313aa3a0d63 100644 --- a/addons/sale/test/invoice_on_ordered_qty.yml +++ b/addons/sale/test/invoice_on_ordered_qty.yml @@ -31,39 +31,17 @@ - !workflow {model: sale.order, action: order_confirm, ref: sale_order_so9} - - I verify that the picking has been generated for the sale order + I verify that the picking has been generated for the sale order and I process it - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so9")) assert so.picking_ids,"Picking has not been generated for sale_order_so9" -- - Then I confirm the picking -- - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') -- - Then I done the picking -- - !python {model: stock.picking }: | - import time - sale_order_obj = self.pool.get('sale.order') - so = sale_order_obj.browse(cr, uid, ref("sale_order_so9")) - picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')]) - if picking_id: - pick=self.browse(cr,uid,picking_id[0]) - pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': '100', - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + picking, = so.picking_ids + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [picking.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I click on Create Invoice button to create the invoice. - diff --git a/addons/sale/test/invoice_on_shipped_qty.yml b/addons/sale/test/invoice_on_shipped_qty.yml index bf2795e0f5b..c6ac86471be 100644 --- a/addons/sale/test/invoice_on_shipped_qty.yml +++ b/addons/sale/test/invoice_on_shipped_qty.yml @@ -30,41 +30,21 @@ - !workflow {model: sale.order, action: order_confirm, ref: sale_order_so6} - - I verify that the picking has been generated for the sale order + I verify that the picking has been generated for the sale order and I process it - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so6")) assert so.picking_ids,"Picking has not been generated for sale_order_so6" -- - Then I click on the "Product Sent" button of Outgoing Shipments -- - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') -- - I change the quantity on the picking to 199, and confirm partially 100 PCE. -- - !python {model: stock.picking }: | - import time - sale_order_obj = self.pool.get('sale.order') - so = sale_order_obj.browse(cr, uid, ref("sale_order_so6")) - picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')]) - if picking_id: - pick=self.browse(cr,uid,picking_id[0]) - self.pool.get('stock.move').write(cr, uid, [pick.move_lines[0].id], {'product_qty': 199, 'product_uos_qty': 199}) - pick=self.browse(cr,uid,picking_id[0]) - pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': '100', - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + picking, = so.picking_ids + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [picking.id]}) + # I change the qty to 100 for a partial delivery + partial = stock_partial_picking.browse(cr,uid,partial_id) + line_id = partial.move_ids[0].id + partial.write({'move_ids': [(1,line_id,{'quantity':100})]}) + partial.do_partial() - Then I click on 'Create Invoices' button - @@ -72,9 +52,9 @@ import time sale_obj = self.pool.get('sale.order') sale_id = sale_obj.browse(cr, uid, ref("sale_order_so6")) - ids = [x.id for x in sale_id.picking_ids] + ids = [x.id for x in sale_id.picking_ids if x.state == 'done'] wiz_id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.sales_journal')}, - {'active_ids': ids}) + {'active_ids': ids, 'active_model': 'stock.picking'}) self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]}) - I verify whether the invoice has been generated for SO @@ -98,7 +78,7 @@ inv_brw = self.browse(cr,uid,inv_id)[0] for inv_lines in inv_brw.invoice_line: qty1=inv_lines.quantity - assert (qty1 == qty), "Quantities are not the same" + assert (qty1 == qty), "Quantities are not the same: invoiced: %s, shipped: %s" % (qty1,qty) - I open the Invoice for the SO. - diff --git a/addons/sale/test/manual_order_policy.yml b/addons/sale/test/manual_order_policy.yml index c1535402f9b..af515b2d4e4 100644 --- a/addons/sale/test/manual_order_policy.yml +++ b/addons/sale/test/manual_order_policy.yml @@ -136,15 +136,11 @@ I verify that a procurement state is "running" - !python {model: procurement.order}: | - from tools.translate import _ - modules = self.pool.get('ir.module.module') - mod_pur = modules.search(cr, uid, [('name','=','purchase')]) - mod_brw = modules.browse(cr,uid,mod_pur)[0] - if (mod_brw.state == 'installed'): - sale_order_obj = self.pool.get('sale.order') - so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) - proc_ids = self.search(cr, uid, [('origin','=',so.name),('state','=','running')]) - assert(proc_ids),"Procurement is not in the running state!" + sale_order_obj = self.pool.get('sale.order') + so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) + proc_ids = self.search(cr, uid, [('origin','=',so.name),('state','in',['running','ready'])]) + # should be running is 'purchase' is installed, else 'ready' + assert(proc_ids),"Procurement is not in running/ready state!" - I verify that a purchase order has been generated - @@ -192,7 +188,7 @@ for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr) - - I verify that a picking related to purchase order has been generated. + I verify that a picking related to purchase order has been generated and I process it - !python {model: sale.order}: | modules = self.pool.get('ir.module.module') @@ -204,29 +200,12 @@ pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) po = pur_obj.browse(cr, uid, pur_id)[0] assert(po.picking_ids),"Picking for purchase order has not been generated" -- - Then I click on the "Products Received" button of Incoming Shipments -- - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') -- - I click on the "Validate" button -- - !python {model: stock.picking}: | - modules = self.pool.get('ir.module.module') - sale_order_obj = self.pool.get('sale.order') - pur_obj = self.pool.get('purchase.order') - mod_pur = modules.search(cr, uid, [('name','=','purchase')]) - mod_brw = modules.browse(cr,uid,mod_pur)[0] - if (mod_brw.state == 'installed'): - so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) - pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) - po = pur_obj.browse(cr, uid, pur_id)[0] - pick_ser_id = self.search(cr, uid, [('purchase_id', '=', po.id )]) - import netsvc - wf_service = netsvc.LocalService("workflow") - for pick in pick_ser_id: - wf_service.trg_validate(uid, 'stock.picking',pick,'button_done', cr) + picking, = po.picking_ids + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [picking.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I verify that picking for purchase order has been done. - @@ -244,7 +223,7 @@ ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')]) assert(ids),"Picking is not in the done state!" - - Then I done the picking + Then I process the picking - !python {model: stock.picking }: | import time @@ -254,18 +233,11 @@ if picking_id: pick=self.browse(cr,uid,picking_id[0]) pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': move.product_qty, - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I verify that picking for sale order is in done state. - @@ -276,38 +248,6 @@ pick = self.browse(cr,uid,picking_id[0]) assert (pick.state) =='done', "Picking for SO is not in done state." - - Then I done the delivery order -- - !python {model: stock.picking }: | - import time - sale_order_obj = self.pool.get('sale.order') - so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) - picking_id = self.search(cr, uid, [('origin','=',so.name)]) - if picking_id: - pick=self.browse(cr,uid,picking_id[0]) - pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': move.product_qty, - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) -- - I verify that delivery state is done -- - !python {model: stock.picking }: | - sale_order_obj = self.pool.get('sale.order') - so = sale_order_obj.browse(cr, uid, ref("sale_order_so0")) - picking_id = self.search(cr, uid, [('origin','=',so.name)]) - pick = self.browse(cr,uid,picking_id[0]) - assert (pick.state) =='done', "Picking for SO is not in done state." -- I verify that a "Picked" has been set to true - !python {model: sale.order}: | diff --git a/addons/sale/test/picking_order_policy.yml b/addons/sale/test/picking_order_policy.yml index 4381c78f010..1dcbf980da4 100644 --- a/addons/sale/test/picking_order_policy.yml +++ b/addons/sale/test/picking_order_policy.yml @@ -46,18 +46,11 @@ if picking_id: pick=self.browse(cr,uid,picking_id[0]) pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': move.product_qty, - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - Then I click on 'Create Invoices' button - @@ -67,7 +60,7 @@ sale_id=sale_obj.browse(cr, uid, ref("sale_order_so7")) ids = [x.id for x in sale_id.picking_ids] wiz_id = self.create(cr, uid, {'invoice_date': time.strftime('%Y-%m-%d'), 'journal_id': ref('account.sales_journal')}, - {'active_ids': ids}) + {'active_ids': ids, 'active_model': 'stock.picking'}) self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]}) - I check that an invoice has been created. @@ -197,7 +190,7 @@ for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr) - - I verify that a picking related to purchase order has been generated. + I verify that a picking related to purchase order has been generated and I process it - !python {model: sale.order}: | modules = self.pool.get('ir.module.module') @@ -209,29 +202,12 @@ pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) po = pur_obj.browse(cr, uid, pur_id)[0] assert(po.picking_ids),"Picking for purchase order has not been generated" -- - Then I click on the "Products Received" button of Incoming Shipments -- - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') -- - I click on the "Validate" button -- - !python {model: stock.picking}: | - modules = self.pool.get('ir.module.module') - mod_pur = modules.search(cr, uid, [('name','=','purchase')]) - mod_brw = modules.browse(cr,uid,mod_pur)[0] - if (mod_brw.state == 'installed'): - sale_order_obj = self.pool.get('sale.order') - pur_obj = self.pool.get('purchase.order') - so = sale_order_obj.browse(cr, uid, ref("sale_order_so7")) - pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) - po = pur_obj.browse(cr, uid, pur_id)[0] - pick_ser_id = self.search(cr, uid, [('purchase_id', '=', po.id )]) - import netsvc - wf_service = netsvc.LocalService("workflow") - for pick in pick_ser_id: - wf_service.trg_validate(uid, 'stock.picking',pick,'button_done', cr) + picking, = po.picking_ids + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [picking.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I verify that picking for purchase order has been done. - @@ -249,36 +225,20 @@ ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')]) assert ids, _('Picking is not in the done state!') - - I verify that delivery order has been generated for sale order + I verify that delivery order has been generated for sale order, and process it - !python {model: stock.picking }: | sale_order_obj = self.pool.get('sale.order') so = sale_order_obj.browse(cr, uid, ref("sale_order_so7")) picking_id = self.search(cr, uid, [('origin','=',so.name)]) assert (picking_id),"Delivery order has not been generated" -- - I verify that delivery has been done -- - !python {model: stock.picking }: | - import time - sale_order_obj = self.pool.get('sale.order') - so = sale_order_obj.browse(cr, uid, ref("sale_order_so7")) - picking_id = self.search(cr, uid, [('origin','=',so.name)]) - if picking_id: - pick=self.browse(cr,uid,picking_id[0]) - pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': move.product_qty, - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + pick=self.browse(cr,uid,picking_id[0]) + pick.force_assign(cr, uid) + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I verify that delivery state is done - @@ -290,7 +250,7 @@ pick = self.browse(cr,uid,picking_id[0]) assert (pick.state) =='done', "Picking for SO is not in done state." - - I verify that a "Picked" has been set to true + I verify that the sale order is marked as delivered - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so7")) diff --git a/addons/sale/test/postpaid_order_policy.yml b/addons/sale/test/postpaid_order_policy.yml index 330c6d17308..a0d5a8e1928 100644 --- a/addons/sale/test/postpaid_order_policy.yml +++ b/addons/sale/test/postpaid_order_policy.yml @@ -45,18 +45,11 @@ if picking_id: pick=self.browse(cr,uid,picking_id[0]) pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': move.product_qty, - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I verify that picking order is in done state. - @@ -76,7 +69,7 @@ picking_id = self.search(cr, uid, [('origin','=',so.name)]) assert (picking_id),"Delivery order has not been generated" - - I click on the Products Sent button and then on the Validate button + I process the delivery order - !python {model: stock.picking }: | import time @@ -86,20 +79,13 @@ if picking_id: pick=self.browse(cr,uid,picking_id[0]) pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': move.product_qty, - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) -- - I verify that delivery state is done + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) +- + I verify that delivery order is marked done - !python {model: stock.picking }: | sale_order_obj = self.pool.get('sale.order') @@ -187,7 +173,7 @@ for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr) - - I verify that a picking related to purchase order has been generated. + I verify that a picking related to purchase order has been generated and I process it - !python {model: sale.order}: | modules = self.pool.get('ir.module.module') @@ -199,31 +185,14 @@ pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) po = pur_obj.browse(cr, uid, pur_id)[0] assert(po.picking_ids),"Picking for purchase order has not been generated" + picking, = po.picking_ids + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [picking.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - - Then I click on the "Products Received" button of Incoming Shipments -- - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') -- - I click on the "Validate" button -- - !python {model: stock.picking}: | - modules = self.pool.get('ir.module.module') - mod_pur = modules.search(cr, uid, [('name','=','purchase')]) - mod_brw = modules.browse(cr,uid,mod_pur)[0] - if (mod_brw.state == 'installed'): - sale_order_obj = self.pool.get('sale.order') - pur_obj = self.pool.get('purchase.order') - so = sale_order_obj.browse(cr, uid, ref("sale_order_so8")) - pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) - po = pur_obj.browse(cr, uid, pur_id)[0] - pick_ser_id = self.search(cr, uid, [('purchase_id', '=', po.id )]) - import netsvc - wf_service = netsvc.LocalService("workflow") - for pick in pick_ser_id: - wf_service.trg_validate(uid, 'stock.picking',pick,'button_done', cr) -- - I verify that picking for purchase order has been done. + I verify that picking for purchase order has been marked done. - !python {model: sale.order}: | from tools.translate import _ @@ -239,7 +208,7 @@ ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')]) assert ids, _('Picking is not in the done state!') - - I verify that a "Picked" has been set to true + I verify that the sale order is marked as delivered - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so8")) diff --git a/addons/sale/test/prepaid_order_policy.yml b/addons/sale/test/prepaid_order_policy.yml index 4bf132e5bee..d6f3da64a2c 100644 --- a/addons/sale/test/prepaid_order_policy.yml +++ b/addons/sale/test/prepaid_order_policy.yml @@ -101,18 +101,11 @@ if picking_id: pick=self.browse(cr,uid,picking_id[0]) pick.force_assign(cr, uid) - partial_datas = { - 'partner_id':pick.address_id.partner_id.id, - 'address_id': pick.address_id.id, - 'delivery_date' : time.strftime('%Y-%m-%d'), - } - move = pick.move_lines[0] - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id.id, - 'product_qty': move.product_qty, - 'product_uom': move.product_uom.id, - } - self.do_partial(cr, uid, [pick.id],partial_datas) + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [pick.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I verify that picking order is in done state. - @@ -201,7 +194,7 @@ for pur in pur_ids: wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr) - - I verify that a picking related to purchase order has been generated. + I verify that a picking related to purchase order has been generated and I process it - !python {model: sale.order}: | modules = self.pool.get('ir.module.module') @@ -213,51 +206,21 @@ pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) po = pur_obj.browse(cr, uid, pur_id)[0] assert(po.picking_ids),"Picking for purchase order has not been generated" -- - Then I click on the "Products Received" button of Incoming Shipments -- - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') -- - I click on the "Validate" button -- - !python {model: stock.picking}: | - modules = self.pool.get('ir.module.module') - sale_order_obj = self.pool.get('sale.order') - pur_obj = self.pool.get('purchase.order') - mod_pur = modules.search(cr, uid, [('name','=','purchase')]) - mod_brw = modules.browse(cr,uid,mod_pur)[0] - if (mod_brw.state == 'installed'): - so = sale_order_obj.browse(cr, uid, ref("sale_order_so1")) - pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) - po = pur_obj.browse(cr, uid, pur_id)[0] - pick_ser_id = self.search(cr, uid, [('purchase_id', '=', po.id )]) - import netsvc - wf_service = netsvc.LocalService("workflow") - for pick in pick_ser_id: - wf_service.trg_validate(uid, 'stock.picking',pick,'button_done', cr) -- - I verify that picking for purchase order has been done. -- - !python {model: sale.order}: | - from tools.translate import _ - modules = self.pool.get('ir.module.module') - mod_pur = modules.search(cr, uid, [('name','=','purchase')]) - mod_brw = modules.browse(cr,uid,mod_pur)[0] - if(mod_brw.state == 'installed'): - pur_obj = self.pool.get('purchase.order') - so = self.browse(cr, uid, ref("sale_order_so1")) - pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)]) - po = pur_obj.browse(cr, uid, pur_id)[0] + picking, = po.picking_ids + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [picking.id]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) picking_obj = self.pool.get('stock.picking') - ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')]) - assert ids, _('Picking is not in the done state!') + ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id),('state', '=', 'done')]) + assert ids, 'Picking should be marked done!' - - I verify that a "Picked" has been set to true + I verify that the sale order is marked as delivered - !python {model: sale.order}: | so = self.browse(cr, uid, ref("sale_order_so1")) - assert (so.shipped == True), "Picking is not done." + assert (so.shipped == True), "Sale order is not marked as delivered" - I verify that a sale order is in done state - diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 4b1e4511021..4d9e0058e94 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -27,8 +27,8 @@ class sale_advance_payment_inv(osv.osv_memory): _columns = { 'product_id': fields.many2one('product.product', 'Advance Product', required=True, help="Select a product of type service which is called 'Advance Product'. You may have to create it and set it as a default value on this field."), - 'amount': fields.float('Advance Amount', size=(16, 2), required=True, help="The amount to be invoiced in advance."), - 'qtty': fields.float('Quantity', size=(16, 2), required=True), + 'amount': fields.float('Advance Amount', digits=(16, 2), required=True, help="The amount to be invoiced in advance."), + 'qtty': fields.float('Quantity', digits=(16, 2), required=True), } _defaults = { 'qtty': 1.0 @@ -173,4 +173,4 @@ class sale_open_invoice(osv.osv_memory): sale_open_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/stock/i18n/zh_TW.po b/addons/stock/i18n/zh_TW.po index b59cc94b1b2..93cab1256ae 100644 --- a/addons/stock/i18n/zh_TW.po +++ b/addons/stock/i18n/zh_TW.po @@ -7,14 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:16+0000\n" -"PO-Revision-Date: 2011-01-28 03:06+0000\n" +"PO-Revision-Date: 2011-09-27 10:25+0000\n" "Last-Translator: Walter Cheuk <wwycheuk@gmail.com>\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:57+0000\n" -"X-Generator: Launchpad (build 13830)\n" +"X-Launchpad-Export-Date: 2011-09-28 05:19+0000\n" +"X-Generator: Launchpad (build 14049)\n" #. module: stock #: field:product.product,track_outgoing:0 @@ -163,7 +163,7 @@ msgstr "" #: view:report.stock.move:0 #: field:stock.change.standard.price,stock_journal:0 msgid "Stock journal" -msgstr "" +msgstr "庫存日誌" #. module: stock #: view:report.stock.move:0 @@ -475,7 +475,7 @@ msgstr "調動統計" #. module: stock #: view:stock.production.lot:0 msgid "Product Lots Filter" -msgstr "" +msgstr "生產批次篩選" #. module: stock #: report:lot.stock.overview:0 @@ -636,7 +636,7 @@ msgstr "" #. module: stock #: constraint:stock.move:0 msgid "You try to assign a lot which is not from the same product" -msgstr "" +msgstr "指定了不同產品的批次" #. module: stock #: view:res.partner:0 @@ -1152,7 +1152,7 @@ msgstr "" #: code:addons/stock/stock.py:1319 #, python-format msgid "is in draft state." -msgstr "尚在草案階段" +msgstr "尚在草案階段。" #. module: stock #: model:ir.actions.act_window,help:stock.action_tracking_form @@ -1402,6 +1402,12 @@ msgid "" "* Done: has been processed, can't be modified or cancelled anymore\n" "* Cancelled: has been cancelled, can't be confirmed anymore" msgstr "" +"* 草案(Draft): 未確認,不會安排處理直至確認\n" +"* 確認(Confirmed): 仍等候產品有貨供應\n" +"* 供貨(Available): 已預留產品,只等候確認\n" +"* 等待(Waiting): 自動供貨前要再等候下一步 (如於「接單生產(Make-To-Order)」流程)\n" +"* 完成(Done): 已處理,無法再修改或取消\n" +"* 取消(Cancelled): 已取消,無法再確認" #. module: stock #: help:stock.location,company_id:0 @@ -1440,6 +1446,11 @@ msgid "" " When the picking is done the state is 'Done'. \n" "The state is 'Waiting' if the move is waiting for another one." msgstr "" +"建立調動時先處於「草案(Draft)」狀態。\n" +" 然後,如安排者找不到貨,設為「無貨(Not Available)」狀態。\n" +" 當已預留貨物,變成「供貨(Available)」。\n" +" 完成提貨後狀態為「完成(Done)」。 \n" +"如調動正等候其他工作完成,狀態為「等待(Waiting)」。" #. module: stock #: selection:report.stock.inventory,location_type:0 @@ -1486,7 +1497,7 @@ msgstr "貨幣" #. module: stock #: field:product.product,track_production:0 msgid "Track Manufacturing Lots" -msgstr "" +msgstr "追蹤生產批次" #. module: stock #: code:addons/stock/wizard/stock_inventory_merge.py:44 @@ -1537,7 +1548,7 @@ msgstr "貨架 2" #. module: stock #: field:stock.report.tracklots,tracking_id:0 msgid "Tracking lot" -msgstr "" +msgstr "追蹤批次" #. module: stock #: view:stock.picking:0 @@ -1558,7 +1569,7 @@ msgstr "本地化" #. module: stock #: model:ir.model,name:stock.model_stock_report_tracklots msgid "Stock report by tracking lots" -msgstr "" +msgstr "按追蹤批次庫存報告" #. module: stock #: code:addons/stock/product.py:370 @@ -2119,7 +2130,7 @@ msgstr "" #: code:addons/stock/stock.py:2210 #, python-format msgid "You can only delete draft moves." -msgstr "不能刪除調動草案" +msgstr "只能刪除調動草案。" #. module: stock #: code:addons/stock/wizard/stock_partial_picking.py:97 @@ -2542,7 +2553,7 @@ msgstr "數量(量度單位)" #, python-format msgid "" "You are moving %.2f %s products but only %.2f %s available in this lot." -msgstr "" +msgstr "您正移動%.2f件 %s 產品,但此批次只有%.2f件 %s。" #. module: stock #: view:stock.move:0 @@ -3032,7 +3043,7 @@ msgstr "" #. module: stock #: view:stock.inventory:0 msgid "Lot Inventory" -msgstr "" +msgstr "批次存貨" #. module: stock #: view:stock.move:0 @@ -3501,6 +3512,11 @@ msgid "" " When the picking it done the state is 'Done'. \n" "The state is 'Waiting' if the move is waiting for another one." msgstr "" +"建立調動時先處於「草案(Draft)」狀態。\n" +" 然後設為「確認(Confirmed)」狀態。\n" +" 如庫存有貨,變成「供貨(Available)」。\n" +" 完成提貨後狀態為「完成(Done)」。 \n" +"如調動正等候其他工作完成,狀態為「等待(Waiting)」。" #. module: stock #: view:board.board:0 @@ -3720,7 +3736,7 @@ msgstr "" #. module: stock #: constraint:stock.move:0 msgid "You must assign a production lot for this product" -msgstr "須為此產品分配生產批次" +msgstr "須為此產品指定生產批次" #. module: stock #: view:stock.move:0 @@ -3817,7 +3833,7 @@ msgstr "" #. module: stock #: model:ir.model,name:stock.model_stock_report_prodlots msgid "Stock report by production lots" -msgstr "生產批次回報之庫存" +msgstr "按生產批次庫存報告" #. module: stock #: view:stock.location:0 @@ -3878,7 +3894,7 @@ msgstr "輸出" #. module: stock #: selection:stock.move.split.lines,action:0 msgid "Keep in one lot" -msgstr "" +msgstr "保持為同一批次" #. module: stock #: view:product.product:0 diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index 80d7ed6efa0..a0059ce60d3 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -120,6 +120,67 @@ </group> </field> </record> + + <record model="ir.ui.view" id="product.product_kanban_view"> + <field name="name">Product Kanban</field> + <field name="model">product.product</field> + <field name="type">kanban</field> + <field name="arch" type="xml"> + <kanban default_group_by="type"> + <templates> + <t t-name="kanban-box"> + <t t-set="color" t-value="kanban_color(record.color.raw_value || record.type.raw_value)"/> + <div t-att-class="color + (record.color.raw_value == 1 ? ' oe_kanban_color_alert' : '')"> + <div class="oe_kanban_box oe_kanban_color_border"> + <table class="oe_kanban_table oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle"> + <tr> + <td class="oe_kanban_title1" align="left" valign="middle"> + <t t-if="record.default_code.raw_value">[<field name="default_code"/>]</t> + <field name="name"/> + </td> + <td align="right" valign="top" width="22"> + <img t-att-src="kanban_gravatar(record.product_manager.raw_value, 22)" class="oe_kanban_gravatar"/> + </td> + </tr> + </table> + <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger"> + <table class="oe_kanban_table"> + <tr> + <td valign="top" width="22"> + <t t-if="record.product_image.raw_value"> + <img t-att-src="'data:image/png;base64,'+record.product_image.raw_value" width='48' height='48'/> + </t> + <t t-if="!record.product_image.raw_value"> + <img src="/web/static/src/img/product_default.png"/> + </t> + </td> + <td> + <div class="oe_kanban_title2"> + <t t-if="record.type.raw_value=='service'">No Stock</t> + <t t-if="record.type.raw_value!='service'"> + <div><field name="qty_available"/> On Hand , <field name="virtual_available"/> Available</div> + <div><t t-if="record.list_price.raw_value!=0">Public Price : <field name="lst_price"/> ,</t> Cost : <field name="standard_price"/></div> + </t> + </div> + </td> + </tr> + </table> + </div> + <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick"> + <div class="oe_kanban_left"> + <a string="Edit" icon="gtk-edit" type="edit"/> + <a string="Change Color" icon="color-picker" type="color" name="color"/> + <a string="Update Stock" name="%(stock.action_view_change_product_quantity)d" icon="gtk-execute" type="action"/> + </div> + <br class="oe_kanban_clear"/> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> <record id="view_normal_property_form" model="ir.ui.view"> <field name="name">product.normal.stock.property.form.inherit</field> diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 2dbfc5105c1..d9debe6641b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -664,8 +664,8 @@ class stock_picking(osv.osv): def action_process(self, cr, uid, ids, context=None): if context is None: context = {} - partial_id = self.pool.get("stock.partial.picking").create( - cr, uid, {}, context=dict(context, active_ids=ids)) + context = dict(context, active_ids=ids, active_model=self._name) + partial_id = self.pool.get("stock.partial.picking").create(cr, uid, {}, context=context) return { 'name':_("Products to Process"), 'view_mode': 'form', @@ -677,7 +677,7 @@ class stock_picking(osv.osv): 'nodestroy': True, 'target': 'new', 'domain': '[]', - 'context': dict(context, active_ids=ids) + 'context': context, } def copy(self, cr, uid, id, default=None, context=None): @@ -1474,6 +1474,8 @@ class stock_move(osv.osv): def action_partial_move(self, cr, uid, ids, context=None): if context is None: context = {} + if context.get('active_model') != self._name: + context.update(active_ids=ids, active_model=self._name) partial_id = self.pool.get("stock.partial.move").create( cr, uid, {}, context=context) return { @@ -2127,14 +2129,9 @@ class stock_move(osv.osv): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ - partial_datas='' picking_ids = [] move_ids = [] - partial_obj=self.pool.get('stock.partial.picking') wf_service = netsvc.LocalService("workflow") - partial_id=partial_obj.search(cr,uid,[]) - if partial_id: - partial_datas = partial_obj.read(cr, uid, partial_id, context=context)[0] if context is None: context = {} @@ -2164,9 +2161,6 @@ class stock_move(osv.osv): self.action_done(cr, uid, [move.move_dest_id.id], context=context) self._create_product_valuation_moves(cr, uid, move, context=context) - prodlot_id = partial_datas and partial_datas.get('move%s_prodlot_id' % (move.id), False) - if prodlot_id: - self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id}, context=context) if move.state not in ('confirmed','done','assigned'): todo.append(move.id) diff --git a/addons/stock/test/stock_test.yml b/addons/stock/test/stock_test.yml index ebd3c6670b4..63650ffeb38 100644 --- a/addons/stock/test/stock_test.yml +++ b/addons/stock/test/stock_test.yml @@ -184,37 +184,32 @@ self.fill_inventory(cr, uid, [ref("stock_fill_inventory_0")], context) - - I create stock.inventory.line.split record. + I split the PC3 inventory line to create 5 PC3 with production lot 00002-stock-test - !record {model: stock.inventory.line.split, id: stock_inventory_line_0}: line_ids: - name: '00002-stock-test' quantity: 5 - line_exist_ids: - - name: '00003-stock-test' - quantity: 5 product_id: product.product_product_pc1 product_uom: product.product_uom_unit use_exist: False qty: 10 - - - I Split stock.inventory.line into production line. + I confirm the split operation - - !python {model: stock.inventory.line.split}: | - context = {"lang": 'en_US', "active_model": "stock.inventory.line", - "active_ids": [ref("stock_inventory_line_0")], "tz": False, "active_id": ref("stock_inventory_line_0")} - self.default_get(cr, uid, ["product_id", "product_uom", "line_exist_ids", "qty", - "line_ids", "use_exist"], context) - self.split_lot(cr, uid, [ref("stock_inventory_line_0")], context) - + !python {model: stock.inventory.line}: | + line_ids = self.search(cr, uid, [('inventory_id','=',ref('stock_inventory_physicalinventoy0')), + ('product_id','=',ref('product.product_product_pc1'))]) + assert line_ids, 'Inventory lines are missing' + self.pool.get('stock.inventory.line.split').split_lot(cr, uid, [ref("stock_inventory_line_0")], + {'active_model': 'stock.inventory.line', + 'active_ids': [line_ids[0]]}) - I confirm the Inventory for PC3. - !python {model: stock.inventory}: | self.action_confirm(cr,uid,[ref('stock_inventory_physicalinventoy0')]) self.action_done(cr,uid,[ref('stock_inventory_physicalinventoy0')]) - - I cancel the Inventory for PC3. - @@ -251,7 +246,7 @@ type: out - - I Performing an osv_memory action split on module stock.split.into + I split the picking with a first batch of 20 PCs - !python {model: stock.picking }: | pick=self.browse(cr,uid,ref('stock_picking_0')) @@ -285,31 +280,15 @@ ref("stock.menu_action_picking_tree6"), }) - - I create a record for stock.partial.move. -- - !record {model: stock.partial.move, id: stock_partial_move_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - -- - I done stock.partial.move record. + I process the partial picking with 20 PCE - - !python {model: stock.partial.move }: | - pick_obj = self.pool.get('stock.picking') - move_obj = self.pool.get('stock.move') - pick=pick_obj.browse(cr,uid,ref('stock_picking_0')) - search_id = move_obj.search(cr, uid, [('picking_id', '=', pick.id)]) - partial_datas={} - for move in pick.move_lines: - partial_datas['move%s'%(move.id)]= { - 'quantity': 20, - 'product_uom': move.product_uom.id, - 'prodlot_id': move.prodlot_id and move.prodlot_id.id or False, - 'wizard_id': ref('stock_partial_move_0'), - } - context = {"lang": 'en_US', "active_model": "stock.move", "active_ids": search_id, "tz": False, "active_id":search_id[0]} - self.fields_view_get(cr, uid, False,"form", context) - self.do_partial(cr, uid, [ref('stock_partial_move_0')], context) - + !python {model: stock.picking }: | + pick = self.browse(cr,uid,ref('stock_picking_0')) + stock_partial_move = self.pool.get('stock.partial.move') + partial_id = stock_partial_move.create(cr, uid, {}, + context={'active_model': 'stock.move', + 'active_ids': [x.id for x in pick.move_lines]}) + stock_partial_move.do_partial(cr, uid, [partial_id]) - I Performing an osv_memory action split_lot on module stock.move.split - @@ -384,34 +363,14 @@ consume_obj.do_move_consume(cr, uid, [consume_id], context) - - I create a record for stock partial picking. + I process the picking with the 80 remaining PCs - - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') - -- - I make stock partial picking order Done. -- - !python {model: stock.partial.picking}: | - pick_obj = self.pool.get('stock.picking') - partial = self.browse(cr, uid, ref('stock_partial_picking_0'), context) - partial_datas = { - 'delivery_date' : partial.date - } - for pick in pick_obj.browse(cr, uid, [ref('stock_picking_0')]): - for m in pick.move_lines: - partial_datas['move%s'%(m.id)] = { - 'product_id' : m.product_id.id, - 'product_qty' : 80, - 'product_uom' : m.product_uom.id - } - context = {"lang": "en_US", "search_default_available": - 1, "tz": False, "active_model": "ir.ui.menu", - "active_ids": [ref('stock_picking_0')], "active_id": ref("stock_picking_0"), - } - self.fields_view_get(cr, uid, False,"form", context) - self.do_partial(cr, uid, [ref('stock_partial_picking_0')], context) - + !python {model: stock.picking}: | + stock_partial_picking = self.pool.get('stock.partial.picking') + partial_id = stock_partial_picking.create(cr, uid, {}, + context={'active_model': 'stock.picking', + 'active_ids': [ref('stock_picking_0')]}) + stock_partial_picking.do_partial(cr, uid, [partial_id]) - I Performing an osv_memory action create_invoice on module stock.invoice.onshipping - @@ -447,35 +406,20 @@ 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner_address", "active_ids": [ref("stock.menu_action_picking_tree4")], "active_id": ref("stock.menu_action_picking_tree4"), }) - pick=self.browse(cr,uid,copy_id) self.allow_cancel(cr, uid, [copy_id], context= None) - - I create a record of stock.picking and I reaturn the picking + I process a copy of the picking and I return it - !python {model: stock.picking}: | copy_id = self.copy(cr, uid, (ref("stock_picking_0"))) - ctx = {"lang": "en_US", "active_model": - "ir.ui.menu", "tz": False, "search_default_confirmed": 1, "contact_display": - "partner", "active_ids": [ref("stock.menu_action_picking_tree6")], "active_id": - ref("stock.menu_action_picking_tree6")} - self.draft_force_assign(cr, uid, [copy_id], ctx) - self.force_assign(cr, uid, [copy_id], ctx) - pick=self.browse(cr,uid,copy_id) - partial_datas={} - for move in pick.move_lines: - partial_datas['move%s'%(move.id)]= { - 'product_id': move.product_id, - 'product_qty': move.product_qty, - } - self.do_partial(cr, uid, [pick.id],partial_datas) - reurn_datas={} - context = {"lang": 'en_US', "active_model": - "stock.picking", "active_ids": [pick.id], "tz": False, "active_id":pick.id} + self.draft_force_assign(cr, uid, [copy_id]) + self.force_assign(cr, uid, [copy_id]) + stock_partial_picking = self.pool.get('stock.partial.picking') + context = {'active_model': 'stock.picking', + 'active_ids': [copy_id], + 'active_id': copy_id} + partial_id = stock_partial_picking.create(cr, uid, {}, context=context) + stock_partial_picking.do_partial(cr, uid, [partial_id], context) return_pick_id = self.pool.get('stock.return.picking').create(cr, uid,{}, context) - for move in pick.move_lines: - reurn_datas= { - 'product_id': move.product_id.id, - 'quantity': move.product_qty, - } self.pool.get('stock.return.picking').create_returns(cr, uid, [return_pick_id], context) diff --git a/addons/stock/wizard/stock_inventory_line_split.py b/addons/stock/wizard/stock_inventory_line_split.py index 2e8b93ad52b..ae4ce54ab9b 100644 --- a/addons/stock/wizard/stock_inventory_line_split.py +++ b/addons/stock/wizard/stock_inventory_line_split.py @@ -21,24 +21,17 @@ from osv import fields, osv -from tools.translate import _ -import time - class stock_inventory_line_split(osv.osv_memory): _inherit = "stock.move.split" _name = "stock.inventory.line.split" _description = "Split inventory lines" + _columns = { + 'line_ids': fields.one2many('stock.inventory.line.split.lines', 'wizard_id', 'Production Lots'), + 'line_exist_ids': fields.one2many('stock.inventory.line.split.lines', 'wizard_exist_id', 'Production Lots'), + } def default_get(self, cr, uid, fields, context=None): - """ To check the availability of production lot. - @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 = {} record_id = context and context.get('active_id',False) @@ -54,14 +47,13 @@ class stock_inventory_line_split(osv.osv_memory): def split(self, cr, uid, ids, line_ids, context=None): """ To split stock inventory lines according to production lot. - @param self: The object pointer. - @param cr: A database cursor - @param uid: ID of the user currently logged in - @param ids: the ID or list of IDs if we want more than one - @param line_ids: the ID or list of IDs of inventory lines we want to split - @param context: A standard dictionary - @return: + + :param line_ids: the ID or list of IDs of inventory lines we want to split """ + if context is None: + context = {} + assert context.get('active_model') == 'stock.inventory.line',\ + 'Incorrect use of the inventory line split wizard' prodlot_obj = self.pool.get('stock.production.lot') ir_sequence_obj = self.pool.get('ir.sequence') line_obj = self.pool.get('stock.inventory.line') @@ -108,7 +100,14 @@ class stock_inventory_line_split(osv.osv_memory): line_obj.write(cr, uid, [inv_line.id], update_val) return new_line -stock_inventory_line_split() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +class stock_inventory_split_lines(osv.osv_memory): + _inherit = "stock.move.split.lines" + _name = "stock.inventory.line.split.lines" + _description = "Inventory Split lines" + _columns = { + 'wizard_id': fields.many2one('stock.inventory.line.split', 'Parent Wizard'), + 'wizard_exist_id': fields.many2one('stock.inventory.line.split', 'Parent Wizard'), + } +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file diff --git a/addons/stock/wizard/stock_invoice_onshipping.py b/addons/stock/wizard/stock_invoice_onshipping.py index 66256509c7b..f4618249e37 100644 --- a/addons/stock/wizard/stock_invoice_onshipping.py +++ b/addons/stock/wizard/stock_invoice_onshipping.py @@ -28,7 +28,7 @@ class stock_invoice_onshipping(osv.osv_memory): def _get_journal(self, cr, uid, context=None): res = self._get_journal_id(cr, uid, context=context) if res: - return res[0] + return res[0][0] return False def _get_journal_id(self, cr, uid, context=None): diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py index 0e84997db85..1a655878d8a 100644 --- a/addons/stock/wizard/stock_move.py +++ b/addons/stock/wizard/stock_move.py @@ -20,7 +20,7 @@ ############################################################################## from osv import fields, osv - +from tools.translate import _ import decimal_precision as dp class stock_move_consume(osv.osv_memory): @@ -146,14 +146,6 @@ class split_in_production_lot(osv.osv_memory): _description = "Split in Production lots" def default_get(self, cr, uid, fields, context=None): - """ Get default values - @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 default value - @param context: A standard dictionary - @return: Default values of fields - """ if context is None: context = {} res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context) @@ -175,38 +167,28 @@ class split_in_production_lot(osv.osv_memory): 'qty': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM')), 'product_id': fields.many2one('product.product', 'Product', required=True, select=True), 'product_uom': fields.many2one('product.uom', 'UoM'), - 'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Production Lots'), - 'line_exist_ids': fields.one2many('stock.move.split.lines.exist', 'lot_id', 'Production Lots'), + 'line_ids': fields.one2many('stock.move.split.lines', 'wizard_id', 'Production Lots'), + 'line_exist_ids': fields.one2many('stock.move.split.lines', 'wizard_exist_id', 'Production Lots'), 'use_exist' : fields.boolean('Existing Lots', help="Check this option to select existing lots in the list below, otherwise you should enter new ones line by line."), 'location_id': fields.many2one('stock.location', 'Source Location') } def split_lot(self, cr, uid, ids, context=None): - """ To split a lot - @param self: The object pointer. - @param cr: A database cursor - @param uid: ID of the user currently logged in - @param ids: An ID or list of IDs if we want more than one - @param context: A standard dictionary - @return: - """ + """ To split a lot""" if context is None: context = {} - self.split(cr, uid, ids, context.get('active_ids'), context=context) + res = self.split(cr, uid, ids, context.get('active_ids'), context=context) return {'type': 'ir.actions.act_window_close'} def split(self, cr, uid, ids, move_ids, context=None): """ To split stock moves into production lot - @param self: The object pointer. - @param cr: A database cursor - @param uid: ID of the user currently logged in - @param ids: the ID or list of IDs if we want more than one - @param move_ids: the ID or list of IDs of stock move we want to split - @param context: A standard dictionary - @return: + + :param move_ids: the ID or list of IDs of stock move we want to split """ if context is None: context = {} + assert context.get('active_model') == 'stock.move',\ + 'Incorrect use of the stock move split wizard' inventory_id = context.get('inventory_id', False) prodlot_obj = self.pool.get('stock.production.lot') inventory_obj = self.pool.get('stock.inventory') @@ -231,7 +213,8 @@ class split_in_production_lot(osv.osv_memory): uos_qty_rest = quantity_rest / move_qty * move.product_uos_qty if quantity_rest < 0: quantity_rest = quantity - break + self.pool.get('stock.move').log(cr, uid, move.id, _('Unable to assign all lots to this move!')) + return False default_val = { 'product_qty': quantity, 'product_uos_qty': uos_qty, @@ -268,12 +251,13 @@ class split_in_production_lot(osv.osv_memory): split_in_production_lot() class stock_move_split_lines_exist(osv.osv_memory): - _name = "stock.move.split.lines.exist" - _description = "Exist Split lines" + _name = "stock.move.split.lines" + _description = "Stock move Split lines" _columns = { 'name': fields.char('Tracking serial', size=64), 'quantity': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM')), - 'lot_id': fields.many2one('stock.move.split', 'Lot'), + 'wizard_id': fields.many2one('stock.move.split', 'Parent Wizard'), + 'wizard_exist_id': fields.many2one('stock.move.split', 'Parent Wizard (for existing lines)'), 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot'), } _defaults = { @@ -284,21 +268,3 @@ class stock_move_split_lines_exist(osv.osv_memory): loc_id=False, product_id=False, uom_id=False): return self.pool.get('stock.move').onchange_lot_id(cr, uid, [], prodlot_id, product_qty, loc_id, product_id, uom_id) - -stock_move_split_lines_exist() - -class stock_move_split_lines(osv.osv_memory): - _name = "stock.move.split.lines" - _description = "Split lines" - _columns = { - 'name': fields.char('Tracking serial', size=64), - 'quantity': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM')), - 'use_exist' : fields.boolean('Existing Lot'), - 'lot_id': fields.many2one('stock.move.split', 'Lot'), - 'action': fields.selection([('split','Split'),('keepinone','Keep in one lot')],'Action'), - } - _defaults = { - 'quantity': 1.00, - 'action' : 'split', - } -stock_move_split_lines() diff --git a/addons/stock/wizard/stock_partial_move.py b/addons/stock/wizard/stock_partial_move.py index 2c593e811c5..ec348656ce0 100644 --- a/addons/stock/wizard/stock_partial_move.py +++ b/addons/stock/wizard/stock_partial_move.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# Copyright (C) 2004-TODAY OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -20,210 +20,65 @@ ############################################################################## from osv import fields, osv -from tools.translate import _ +from tools.misc import DEFAULT_SERVER_DATETIME_FORMAT import time -import decimal_precision as dp - -class stock_partial_move_memory_out(osv.osv_memory): - _name = "stock.move.memory.out" - _rec_name = 'product_id' +class stock_partial_move_line(osv.osv_memory): + _inherit = "stock.partial.picking.line" + _name = "stock.partial.move.line" _columns = { - 'product_id' : fields.many2one('product.product', string="Product", required=True), - 'quantity' : fields.float("Quantity", required=True), - 'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True), - 'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot'), - 'location_id': fields.many2one('stock.location', 'Location', required=True), - 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', required=True), - 'move_id' : fields.many2one('stock.move', "Move"), - 'wizard_id' : fields.many2one('stock.partial.move', string="Wizard"), - 'cost' : fields.float('Cost', digits_compute = dp.get_precision('Purchase Price'),help="Unit Cost for this product line"), - 'currency' : fields.many2one('res.currency', string="Currency", help="Currency in which Unit cost is expressed"), + 'wizard_id' : fields.many2one('stock.partial.move', string="Wizard", ondelete='CASCADE'), } - -class stock_partial_move_memory_in(osv.osv_memory): - _inherit = "stock.move.memory.out" - _name = "stock.move.memory.in" - + class stock_partial_move(osv.osv_memory): _name = "stock.partial.move" - _description = "Partial Move" + _inherit = 'stock.partial.picking' + _description = "Partial Move Processing Wizard" _columns = { 'date': fields.datetime('Date', required=True), - 'type': fields.char("Type", size=3), - 'product_moves_out' : fields.one2many('stock.move.memory.out', 'wizard_id', 'Moves'), - 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_id', 'Moves'), + 'move_ids' : fields.one2many('stock.partial.move.line', 'wizard_id', 'Moves'), + + # picking_id is not used for move processing, so we remove the required attribute + # from the inherited column, and ignore it + 'picking_id': fields.many2one('stock.picking', 'Picking'), } - - - def __is_in(self,cr, uid, move_ids): - """ - @return: True if one of the moves has as picking type 'in' - """ - if not move_ids: - return False - - move_obj = self.pool.get('stock.move') - move_ids = move_obj.search(cr, uid, [('id','in',move_ids)]) - - for move in move_obj.browse(cr, uid, move_ids): - if move.picking_id.type == 'in' and move.product_id.cost_method == 'average': - return True - return False - - def __get_picking_type(self, cr, uid, move_ids): - if self.__is_in(cr, uid, move_ids): - return "product_moves_in" - else: - return "product_moves_out" - - def view_init(self, cr, uid, fields_list, context=None): - res = super(stock_partial_move, self).view_init(cr, uid, fields_list, context=context) - move_obj = self.pool.get('stock.move') - - if context is None: - context = {} - for move in move_obj.browse(cr, uid, context.get('active_ids', []), context=context): - if move.state in ('done', 'cancel'): - raise osv.except_osv(_('Invalid action !'), _('Cannot deliver products which are already delivered !')) - - return res - - - def __create_partial_move_memory(self, move): - move_memory = { - 'product_id' : move.product_id.id, - 'quantity' : move.product_qty, - 'product_uom' : move.product_uom.id, - 'prodlot_id' : move.prodlot_id.id, - 'move_id' : move.id, - } - - if move.picking_id.type == 'in': - move_memory.update({ - 'cost' : move.product_id.standard_price, - 'currency' : move.product_id.company_id and move.product_id.company_id.currency_id and move.product_id.company_id.currency_id.id or False, - }) - return move_memory - def __get_active_stock_moves(self, cr, uid, context=None): - move_obj = self.pool.get('stock.move') - if context is None: - context = {} - - res = [] - for move in move_obj.browse(cr, uid, context.get('active_ids', []), context=context): - if move.state in ('done', 'cancel'): - continue - res.append(self.__create_partial_move_memory(move)) - + def default_get(self, cr, uid, fields, context=None): + if context is None: context = {} + # no call to super! + res = {} + move_ids = context.get('active_ids', []) + if not move_ids or not context.get('active_model') == 'stock.move': + return res + if 'move_ids' in fields: + move_ids = self.pool.get('stock.move').browse(cr, uid, move_ids, context=context) + moves = [self._partial_move_for(cr, uid, m) for m in move_ids if m.state not in ('done','cancel')] + res.update(move_ids=moves) + if 'date' in fields: + res.update(date=time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)) return res - - _defaults = { - 'product_moves_in' : __get_active_stock_moves, - 'product_moves_out' : __get_active_stock_moves, - 'date' : lambda *a : time.strftime('%Y-%m-%d %H:%M:%S'), - } - - - def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - if not context: - context = {} - - message = { - 'title' : _('Deliver Products'), - 'info' : _('Delivery Information'), - 'button' : _('Deliver'), - } - if context: - if context.get('product_receive', False): - message = { - 'title' : _('Receive Products'), - 'info' : _('Receive Information'), - 'button' : _('Receive'), - } - - move_ids = context.get('active_ids', False) - message['picking_type'] = self.__get_picking_type(cr, uid, move_ids) - result = super(stock_partial_move, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) - _moves_fields = result['fields'] - _moves_fields.update({ - 'product_moves_in' : {'relation': 'stock.move.memory.in', 'type' : 'one2many', 'string' : 'Product Moves'}, - 'product_moves_out' : {'relation': 'stock.move.memory.out', 'type' : 'one2many', 'string' : 'Product Moves'} - }) - - _moves_arch_lst = """ - <form string="%(title)s"> - <separator colspan="4" string="%(info)s"/> - <field name="date" colspan="2"/> - <separator colspan="4" string="Move Detail"/> - <field name="%(picking_type)s" colspan="4" nolabel="1" mode="tree,form" width="550" height="200" ></field> - <separator string="" colspan="4" /> - <label string="" colspan="2"/> - <group col="2" colspan="2"> - <button icon='gtk-cancel' special="cancel" string="_Cancel" /> - <button name="do_partial" string="%(button)s" - colspan="1" type="object" icon="gtk-apply" /> - </group> - </form> """ % message - - result['arch'] = _moves_arch_lst - result['fields'] = _moves_fields - return result - + def do_partial(self, cr, uid, ids, context=None): - """ Makes partial moves and pickings done. - @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 = {} - move_obj = self.pool.get('stock.move') - - move_ids = context.get('active_ids', False) + # no call to super! + assert len(ids) == 1, 'Partial move processing may only be done one form at a time' partial = self.browse(cr, uid, ids[0], context=context) - partial_datas = { + partial_data = { 'delivery_date' : partial.date } - - p_moves = {} - picking_type = self.__get_picking_type(cr, uid, move_ids) - - moves_list = picking_type == 'product_moves_in' and partial.product_moves_in or partial.product_moves_out - for product_move in moves_list: - p_moves[product_move.move_id.id] = product_move - - moves_ids_final = [] - for move in move_obj.browse(cr, uid, move_ids, context=context): - if move.state in ('done', 'cancel'): - continue - if not p_moves.get(move.id): - continue - partial_datas['move%s' % (move.id)] = { - 'product_id' : p_moves[move.id].product_id.id, - 'product_qty' : p_moves[move.id].quantity, - 'product_uom' :p_moves[move.id].product_uom.id, - 'prodlot_id' : p_moves[move.id].prodlot_id.id, + moves_ids = [] + for move in partial.move_ids: + move_id = move.move_id.id + partial_data['move%s' % (move_id)] = { + 'product_id': move.product_id.id, + 'product_qty': move.quantity, + 'product_uom': move.product_uom.id, + 'prodlot_id': move.prodlot_id.id, } - - moves_ids_final.append(move.id) - if (move.picking_id.type == 'in') and (move.product_id.cost_method == 'average'): - partial_datas['move%s' % (move.id)].update({ - 'product_price' : p_moves[move.id].cost, - 'product_currency': p_moves[move.id].currency.id, - }) - - - move_obj.do_partial(cr, uid, moves_ids_final, partial_datas, context=context) + moves_ids.append(move_id) + if (move.move_id.picking_id.type == 'in') and (move.product_id.cost_method == 'average'): + partial_data['move%s' % (move_id)].update(product_price=move.cost, + product_currency=move.currency.id) + self.pool.get('stock.move').do_partial(cr, uid, moves_ids, partial_data, context=context) return {'type': 'ir.actions.act_window_close'} -stock_partial_move() -stock_partial_move_memory_out() -stock_partial_move_memory_in() -# 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/stock/wizard/stock_partial_move_view.xml b/addons/stock/wizard/stock_partial_move_view.xml index 8d4be66b243..2df6adcc9e7 100644 --- a/addons/stock/wizard/stock_partial_move_view.xml +++ b/addons/stock/wizard/stock_partial_move_view.xml @@ -1,16 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <openerp> <data> - - - <record id="action_partial_move_server" model="ir.actions.server"> <field name="name">Deliver/Receive Products</field> <field name="model_id" ref="model_stock_move"/> <field name="state">code</field> <field name="code">action = obj.action_partial_move(context=context)</field> </record> - + <record id="ir_open_partial_move_wizard" model="ir.values"> <field eval="'client_action_multi'" name="key2"/> <field eval="'stock.move'" name="model"/> @@ -19,47 +16,27 @@ <field eval="True" name="object"/> </record> - - - <record id="stock_move_memory_tree_in" model="ir.ui.view"> - <field name="name">stock.move.memory.tree</field> - <field name="model">stock.move.memory.in</field> - <field name="type">tree</field> - <field name="arch" type="xml"> - <tree editable="bottom" string="Product Moves"> - <field name="product_id" /> - <field name="quantity" /> - <field name="product_uom" /> - <field name="location_id" /> - <field name="location_dest_id" /> - <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" /> - <field name="cost" /> - <field name="currency" /> - </tree> - </field> - </record> - - <record id="stock_move_memory_form_in" model="ir.ui.view"> - <field name="name">stock.move.memory.form</field> - <field name="model">stock.move.memory.in</field> + <record id="stock_partial_move_form" model="ir.ui.view"> + <field name="name">stock.partial.move.form</field> + <field name="model">stock.partial.move</field> <field name="type">form</field> <field name="arch" type="xml"> <form> - <field name="product_id" /> - <field name="quantity" /> - <field name="product_uom" /> - <field name="location_id" /> - <field name="location_dest_id" /> - <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" /> - <field name="cost" /> - <field name="currency" /> - </form> + <separator colspan="4" string="Products"/> + <field name="move_ids" colspan="4" nolabel="1" mode="tree,form" width="550" height="200"/> + <separator string="" colspan="4" /> + <label string="" colspan="2"/> + <group col="2" colspan="2"> + <button icon='gtk-cancel' special="cancel" string="_Cancel" /> + <button name="do_partial" string="_Validate" colspan="1" type="object" icon="gtk-go-forward" /> + </group> + </form> </field> - </record> - - <record id="stock_move_memory_tree_out" model="ir.ui.view"> - <field name="name">stock.move.memory.tree</field> - <field name="model">stock.move.memory.out</field> + </record> + + <record id="stock_partial_move_line_list" model="ir.ui.view"> + <field name="name">stock.partial.move.line.list</field> + <field name="model">stock.partial.move.line</field> <field name="type">tree</field> <field name="arch" type="xml"> <tree editable="bottom" string="Product Moves"> @@ -68,14 +45,17 @@ <field name="product_uom" /> <field name="location_id" /> <field name="location_dest_id" /> - <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" /> + <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" /> + <field name="update_cost" invisible="1"/> + <field name="cost" attrs="{'invisible': [('update_cost','=', False)]}"/> + <field name="currency" attrs="{'invisible': [('update_cost','=', False)]}"/> </tree> </field> </record> - - <record id="stock_move_memory_form_out" model="ir.ui.view"> - <field name="name">stock.move.memory.form</field> - <field name="model">stock.move.memory.out</field> + + <record id="stock_partial_move_line_form" model="ir.ui.view"> + <field name="name">stock.partial.move.line.form</field> + <field name="model">stock.partial.move.line</field> <field name="type">form</field> <field name="arch" type="xml"> <form> @@ -85,9 +65,11 @@ <field name="location_id" /> <field name="location_dest_id" /> <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" /> - </form> + <field name="update_cost" invisible="1"/> + <field name="cost" attrs="{'invisible': [('update_cost','=', False)]}"/> + <field name="currency" attrs="{'invisible': [('update_cost','=', False)]}"/> + </form> </field> - </record> - + </record> </data> </openerp> diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py index 9ac3fab9f72..3580b21035d 100644 --- a/addons/stock/wizard/stock_partial_picking.py +++ b/addons/stock/wizard/stock_partial_picking.py @@ -1,9 +1,8 @@ - # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). +# Copyright (C) 2004-TODAY OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -20,169 +19,119 @@ # ############################################################################## -from osv import fields, osv -from tools.translate import _ import time +from osv import fields, osv +from tools.misc import DEFAULT_SERVER_DATETIME_FORMAT + +class stock_partial_picking_line(osv.TransientModel): + _name = "stock.partial.picking.line" + _rec_name = 'product_id' + _columns = { + 'product_id' : fields.many2one('product.product', string="Product", required=True, ondelete='CASCADE'), + 'quantity' : fields.float("Quantity", required=True), + 'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True, ondelete='CASCADE'), + 'prodlot_id' : fields.many2one('stock.production.lot', 'Production Lot', ondelete='CASCADE'), + 'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete='CASCADE'), + 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', required=True, ondelete='CASCADE'), + 'move_id' : fields.many2one('stock.move', "Move", ondelete='CASCADE'), + 'wizard_id' : fields.many2one('stock.partial.picking', string="Wizard", ondelete='CASCADE'), + 'update_cost': fields.boolean('Need cost update'), + 'cost' : fields.float("Cost", help="Unit Cost for this product line"), + 'currency' : fields.many2one('res.currency', string="Currency", help="Currency in which Unit cost is expressed", ondelete='CASCADE'), + } class stock_partial_picking(osv.osv_memory): _name = "stock.partial.picking" - _description = "Partial Picking" + _description = "Partial Picking Processing Wizard" _columns = { 'date': fields.datetime('Date', required=True), - 'product_moves_out' : fields.one2many('stock.move.memory.out', 'wizard_id', 'Moves'), - 'product_moves_in' : fields.one2many('stock.move.memory.in', 'wizard_id', 'Moves'), + 'move_ids' : fields.one2many('stock.partial.picking.line', 'wizard_id', 'Product Moves'), + 'picking_id': fields.many2one('stock.picking', 'Picking', required=True, ondelete='CASCADE'), } - - def get_picking_type(self, cr, uid, picking, context=None): - picking_type = picking.type - for move in picking.move_lines: - if picking.type == 'in' and move.product_id.cost_method == 'average': - picking_type = 'in' - break - else: - picking_type = 'out' - return picking_type - + 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 = {} - - pick_obj = self.pool.get('stock.picking') + if context is None: context = {} res = super(stock_partial_picking, self).default_get(cr, uid, fields, context=context) picking_ids = context.get('active_ids', []) - if not picking_ids: + if not picking_ids or (not context.get('active_model') == 'stock.picking') \ + or len(picking_ids) != 1: + # Partial Picking Processing may only be done for one picking at a time return res - - result = [] - for pick in pick_obj.browse(cr, uid, picking_ids, context=context): - pick_type = self.get_picking_type(cr, uid, pick, context=context) - for m in pick.move_lines: - if m.state in ('done', 'cancel'): - continue - result.append(self.__create_partial_picking_memory(m, pick_type)) - - if 'product_moves_in' in fields: - res.update({'product_moves_in': result}) - if 'product_moves_out' in fields: - res.update({'product_moves_out': result}) + picking_id, = picking_ids + if 'picking_id' in fields: + res.update(picking_id=picking_id) + if 'move_ids' in fields: + picking = self.pool.get('stock.picking').browse(cr, uid, picking_id, context=context) + moves = [self._partial_move_for(cr, uid, m) for m in picking.move_lines if m.state not in ('done','cancel')] + res.update(move_ids=moves) if 'date' in fields: - res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')}) + res.update(date=time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)) return res - - def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): - result = super(stock_partial_picking, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) - - pick_obj = self.pool.get('stock.picking') - picking_ids = context.get('active_ids', False) - - if not picking_ids: - # not called through an action (e.g. buildbot), return the default. - return result - for pick in pick_obj.browse(cr, uid, picking_ids, context=context): - picking_type = self.get_picking_type(cr, uid, pick, context=context) + def _product_cost_for_average_update(self, cr, uid, move): + """Returns product cost and currency ID for the given move, suited for re-computing + the average product cost. - _moves_arch_lst = """<form string="%s"> - <field name="date" invisible="1"/> - <separator colspan="4" string="%s"/> - <field name="%s" colspan="4" nolabel="1" mode="tree,form" width="550" height="200" ></field> - """ % (_('Process Document'), _('Products'), "product_moves_" + picking_type) - _moves_fields = result['fields'] - - # add field related to picking type only - _moves_fields.update({ - 'product_moves_' + picking_type: {'relation': 'stock.move.memory.'+picking_type, 'type' : 'one2many', 'string' : 'Product Moves'}, - }) + :return: map of the form:: - _moves_arch_lst += """ - <separator string="" colspan="4" /> - <label string="" colspan="2"/> - <group col="2" colspan="2"> - <button icon='gtk-cancel' special="cancel" - string="_Cancel" /> - <button name="do_partial" string="_Validate" - colspan="1" type="object" icon="gtk-go-forward" /> - </group> - </form>""" - result['arch'] = _moves_arch_lst - result['fields'] = _moves_fields - return result + {'cost': 123.34, + 'currency': 42} + """ + # Currently, the cost on the product form is supposed to be expressed in the currency + # of the company owning the product. If not set, we fall back to the picking's company, + # which should work in simple cases. + return {'cost': move.product_id.standard_price, + 'currency': move.product_id.company_id.currency_id.id \ + or move.picking_id.company_id.currency_id.id \ + or False} - def __create_partial_picking_memory(self, picking, pick_type): - move_memory = { - 'product_id' : picking.product_id.id, - 'quantity' : picking.product_qty, - 'product_uom' : picking.product_uom.id, - 'prodlot_id' : picking.prodlot_id.id, - 'move_id' : picking.id, - 'location_id' : picking.location_id.id, - 'location_dest_id' : picking.location_dest_id.id, + def _partial_move_for(self, cr, uid, move): + partial_move = { + 'product_id' : move.product_id.id, + 'quantity' : move.product_qty, + 'product_uom' : move.product_uom.id, + 'prodlot_id' : move.prodlot_id.id, + 'move_id' : move.id, + 'location_id' : move.location_id.id, + 'location_dest_id' : move.location_dest_id.id, } - - if pick_type == 'in': - move_memory.update({ - 'cost' : picking.product_id.standard_price, - 'currency' : picking.product_id.company_id and picking.product_id.company_id.currency_id and picking.product_id.company_id.currency_id.id or False, - }) - return move_memory + if move.picking_id.type == 'in' and move.product_id.cost_method == 'average': + partial_move.update(update_cost=True, **self._product_cost_for_average_update(cr, uid, move)) + return partial_move def do_partial(self, cr, uid, ids, context=None): - """ Makes partial moves and pickings done. - @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. - """ - pick_obj = self.pool.get('stock.picking') - stock_move_obj = self.pool.get('stock.move') - picking_ids = context.get('active_ids', False) + assert len(ids) == 1, 'Partial picking processing may only be done one at a time' + stock_picking = self.pool.get('stock.picking') + stock_move = self.pool.get('stock.move') partial = self.browse(cr, uid, ids[0], context=context) - partial_datas = { + partial_data = { 'delivery_date' : partial.date } - for pick in pick_obj.browse(cr, uid, picking_ids, context=context): - picking_type = self.get_picking_type(cr, uid, pick, context=context) - moves_list = picking_type == 'in' and partial.product_moves_in or partial.product_moves_out - for move in moves_list: - if not move.move_id.id: - seq_obj_name = 'stock.picking.' + picking_type - move_id = stock_move_obj.create(cr,uid,{'name' : self.pool.get('ir.sequence').get(cr, uid, seq_obj_name), - 'product_id': move.product_id.id, - 'product_qty': move.quantity, - 'product_uom': move.product_uom.id, - 'prodlot_id': move.prodlot_id.id, - 'location_id' : move.location_id.id, - 'location_dest_id' : move.location_dest_id.id, - 'picking_id': pick.id - },context=context) - stock_move_obj.action_done(cr, uid, [move_id], context) - else: - move_id = move.move_id.id - - partial_datas['move%s' % (move_id)] = { - 'product_id': move.product_id.id, - 'product_qty': move.quantity, - 'product_uom': move.product_uom.id, - 'prodlot_id': move.prodlot_id.id, - } - if (picking_type == 'in') and (move.product_id.cost_method == 'average'): - partial_datas['move%s' % (move.move_id.id)].update({ - 'product_price' : move.cost, - 'product_currency': move.currency.id, - }) - pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context) + picking_type = partial.picking_id.type + for move in partial.move_ids: + move_id = move.move_id.id + if not move_id: + seq_obj_name = 'stock.picking.' + picking_type + move_id = stock_move.create(cr,uid,{'name' : self.pool.get('ir.sequence').get(cr, uid, seq_obj_name), + 'product_id': move.product_id.id, + 'product_qty': move.quantity, + 'product_uom': move.product_uom.id, + 'prodlot_id': move.prodlot_id.id, + 'location_id' : move.location_id.id, + 'location_dest_id' : move.location_dest_id.id, + 'picking_id': partial.picking_id.id + },context=context) + stock_move.action_done(cr, uid, [move_id], context) + partial_data['move%s' % (move_id)] = { + 'product_id': move.product_id.id, + 'product_qty': move.quantity, + 'product_uom': move.product_uom.id, + 'prodlot_id': move.prodlot_id.id, + } + if (picking_type == 'in') and (move.product_id.cost_method == 'average'): + partial_data['move%s' % (move.move_id.id)].update(product_price=move.cost, + product_currency=move.currency.id) + stock_picking.do_partial(cr, uid, [partial.picking_id.id], partial_data, context=context) return {'type': 'ir.actions.act_window_close'} -stock_partial_picking() - -# 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/stock/wizard/stock_partial_picking_view.xml b/addons/stock/wizard/stock_partial_picking_view.xml index 4887c1e16d8..be85d266673 100644 --- a/addons/stock/wizard/stock_partial_picking_view.xml +++ b/addons/stock/wizard/stock_partial_picking_view.xml @@ -9,5 +9,59 @@ <field name="target">new</field> </record> + <record id="stock_partial_picking_form" model="ir.ui.view"> + <field name="name">stock.partial.picking.form</field> + <field name="model">stock.partial.picking</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form> + <separator colspan="4" string="Products"/> + <field name="move_ids" colspan="4" nolabel="1" mode="tree,form" width="550" height="200"/> + <separator string="" colspan="4" /> + <label string="" colspan="2"/> + <group col="2" colspan="2"> + <button icon='gtk-cancel' special="cancel" string="_Cancel" /> + <button name="do_partial" string="_Validate" colspan="1" type="object" icon="gtk-go-forward" /> + </group> + </form> + </field> + </record> + + <record id="stock_partial_picking_line_list" model="ir.ui.view"> + <field name="name">stock.partial.picking.line.list</field> + <field name="model">stock.partial.picking.line</field> + <field name="type">tree</field> + <field name="arch" type="xml"> + <tree editable="bottom" string="Product Moves"> + <field name="product_id" /> + <field name="quantity" /> + <field name="product_uom" /> + <field name="location_id" /> + <field name="location_dest_id" /> + <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" /> + <field name="update_cost" invisible="1"/> + <field name="cost" attrs="{'invisible': [('update_cost','=', False)]}"/> + <field name="currency" attrs="{'invisible': [('update_cost','=', False)]}"/> + </tree> + </field> + </record> + <record id="stock_partial_picking_line_form" model="ir.ui.view"> + <field name="name">stock.partial.picking.line.form</field> + <field name="model">stock.partial.picking.line</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form> + <field name="product_id" /> + <field name="quantity" /> + <field name="product_uom" /> + <field name="location_id" /> + <field name="location_dest_id" /> + <field name="prodlot_id" domain="[('product_id', '=', product_id)]" groups="base.group_extended" /> + <field name="update_cost" invisible="1"/> + <field name="cost" attrs="{'invisible': [('update_cost','=', False)]}"/> + <field name="currency" attrs="{'invisible': [('update_cost','=', False)]}"/> + </form> + </field> + </record> </data> </openerp> diff --git a/addons/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml index 806792868d4..795da509d04 100644 --- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml +++ b/addons/stock_invoice_directly/test/stock_invoice_directly.yml @@ -38,36 +38,19 @@ "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"), }) - - I create a record for partial picking. -- - !record {model: stock.partial.picking, id: stock_partial_picking_0}: - date: !eval time.strftime('%Y-%m-%d %H:%M:%S') -- - I make picking order Done. + I process the delivery - !python {model: stock.partial.picking}: | - pick_obj = self.pool.get('stock.picking') - partial = self.browse(cr, uid, ref('stock_partial_picking_0'), context) - partial_datas = { - 'delivery_date' : partial.date - } - for pick in pick_obj.browse(cr, uid, [ref('stock_picking_out0')]): - for m in pick.move_lines: - partial_datas['move%s'%(m.id)] = { - 'product_id' : m.product_id.id, - 'product_qty' : m.product_qty, - 'product_uom' : m.product_uom.id - } - self.do_partial(cr, uid, [ref('stock_partial_picking_0')], {"lang": "en_US", "search_default_available": - 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner", - "active_ids": [ref('stock_picking_out0')], "active_id": ref("stock_picking_out0"), - }) + 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. - !python {model: stock.invoice.onshipping}: | - wiz_id = self.create(cr, uid, {'invoice_date': '2010-08-04', 'journal_id': ref('account.bank_journal')}, - {'active_ids': [ref("stock_picking_out0")]}) + wiz_id = self.create(cr, uid, {'invoice_date': '2010-08-04', 'journal_id': ref('account.sales_journal')}, + {'active_ids': [ref("stock_picking_out0")], "active_model": "stock.picking"}) self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US", "search_default_available": 1, "tz": False, "active_model": "stock.picking", "contact_display": "partner", "active_ids": [ref("stock_picking_out0")], "active_id": ref("stock_picking_out0")}) diff --git a/addons/stock_invoice_directly/wizard/stock_invoice.py b/addons/stock_invoice_directly/wizard/stock_invoice.py index 11b31725a88..3725d9b6d7f 100644 --- a/addons/stock_invoice_directly/wizard/stock_invoice.py +++ b/addons/stock_invoice_directly/wizard/stock_invoice.py @@ -25,24 +25,15 @@ class invoice_directly(osv.osv_memory): _inherit = 'stock.partial.picking' def do_partial(self, cr, uid, ids, context=None): - """ Makes partial moves and pickings done and - launches Create invoice wizard if invoice state is To be Invoiced. - @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: + """Launch Create invoice wizard if invoice state is To be Invoiced, + after processing the partial picking. """ - if context is None: - context = {} + if context is None: context = {} result = super(invoice_directly, self).do_partial(cr, uid, ids, context) - pick_obj = self.pool.get('stock.picking') - context.update({'active_model':'stock.picking'}) - picking_ids = context.get('active_ids', False) - if picking_ids: - context.update({'active_id':picking_ids[0]}) - pick = pick_obj.browse(cr, uid, picking_ids, context=context)[0] - if pick.invoice_state == '2binvoiced': + partial = self.browse(cr, uid, ids[0], context) + context.update(active_model='stock.picking', + active_ids=[partial.picking_id.id]) + if partial.picking_id.invoice_state == '2binvoiced': return { 'name': 'Create Invoice', 'view_type': 'form', @@ -55,5 +46,5 @@ class invoice_directly(osv.osv_memory): return {'type': 'ir.actions.act_window_close'} invoice_directly() -# 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/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py index fe0b2f8f3ce..3ec992ecd0c 100644 --- a/addons/stock_planning/stock_planning.py +++ b/addons/stock_planning/stock_planning.py @@ -46,7 +46,7 @@ class stock_period(osv.osv): 'name': fields.char('Period Name', size=64, required=True), 'date_start': fields.datetime('Start Date', required=True), 'date_stop': fields.datetime('End Date', required=True), - 'state': fields.selection([('draft','Draft'), ('open','Open'),('close','Close')], 'State') + 'state': fields.selection([('draft','Draft'), ('open','Open'),('close','Close')], 'State'), } _defaults = { 'state': 'draft' diff --git a/addons/stock_planning/wizard/stock_planning_create_periods.py b/addons/stock_planning/wizard/stock_planning_create_periods.py index 05f8aa925a9..963ff416822 100644 --- a/addons/stock_planning/wizard/stock_planning_create_periods.py +++ b/addons/stock_planning/wizard/stock_planning_create_periods.py @@ -46,6 +46,7 @@ class stock_period_createlines(osv.osv_memory): 'date_start': fields.date('Start Date', required=True, help="Starting date for planning period."), 'date_stop': fields.date('End Date', required=True, help="Ending date for planning period."), 'period_ids': fields.one2many('stock.period', 'planning_id', 'Periods'), + 'period_ids': fields.many2many('stock.period', 'stock_period_createlines_stock_period_rel', 'wizard_id', 'period_id', 'Periods'), } _defaults={ 'date_start': _get_new_period_start, diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml index a351a3da9b4..89571bd647a 100644 --- a/addons/survey/survey_demo.xml +++ b/addons/survey/survey_demo.xml @@ -1281,6 +1281,7 @@ <field name="responsible_id" ref="base.user_demo"/> <field name="max_response_limit">20</field> <field name="type" ref="survey_type2"/> + <field name="state">open</field> <field name="response_user">5</field> </record> </data> diff --git a/addons/survey/test/survey00.yml b/addons/survey/test/survey00.yml index 7bfe8a5320d..fa56e9fac39 100644 --- a/addons/survey/test/survey00.yml +++ b/addons/survey/test/survey00.yml @@ -144,8 +144,8 @@ Give answer of the survey, Run "Answer a Survey" wizard and select the survey and press on start button then run the selected survey. - !python {model: survey.name.wiz}: | - ids = self.create(cr, uid, {'survey_id': ref("survey_partner_0")}) - self.action_next(cr, uid, [ids], context) + id = self.create(cr, uid, {'survey_id': ref("survey_partner_0")}) + self.action_next(cr, uid, [id], context) - Give answer of the first and second page in "Partner Feedback" suvey. - diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 471290af2cb..be43a409774 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -40,14 +40,6 @@ class survey_question_wiz(osv.osv_memory): def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Fields View Get method :- generate the new view and display the survey pages of selected survey. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param view_id : view id of the current object. - @param view_type : which type of view is create. like :- form, tree ,search etc... - @param context: A standard dictionary for contextual values - @return : Dictionary value for created view of particular survey pages. """ result = super(survey_question_wiz, self).fields_view_get(cr, uid, view_id, \ @@ -88,7 +80,7 @@ class survey_question_wiz(osv.osv_memory): if not survey_id: # Try one more time to find it if sur_name_rec and sur_name_rec.survey_id: - survey_id = sur_name_rec.survey_id[0] + survey_id = sur_name_rec.survey_id.id else: # raise osv.except_osv(_('Error!'), _("Cannot locate survey for the question wizard!")) # If this function is called without a survey_id in @@ -398,10 +390,10 @@ class survey_question_wiz(osv.osv_memory): sur_response_obj.write(cr, uid, [sur_name_read.response], {'state' : 'done'}) if sur_rec.send_response: - survey_data = survey_obj.browse(cr, uid, int(survey_id)) + survey_data = survey_obj.browse(cr, uid, survey_id) response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response'] context.update({'response_id':response_id}) - report = self.create_report(cr, uid, [int(survey_id)], 'report.survey.browse.response', survey_data.title,context) + report = self.create_report(cr, uid, [survey_id], 'report.survey.browse.response', survey_data.title,context) attachments = {} file = open(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf") file_data = "" @@ -445,15 +437,6 @@ class survey_question_wiz(osv.osv_memory): def create_report(self, cr, uid, res_ids, report_name=False, file_name=False, context=None): """ If any user give answer of survey then last create report of this answer and if 'E-mail Notification on Answer' set True in survey then send mail on responsible person of this survey and attach survey answer report in pdf format. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param res_ids: List of survey answer IDs, - @param report_name: name of the report, - @param file_name: To give file name of the report, - @param context: A standard dictionary for contextual values, - @return : Dictionary value for created report with file nameself. """ if not report_name or not res_ids: return (False, Exception('Report name and Resources ids are required !!!')) @@ -474,13 +457,6 @@ class survey_question_wiz(osv.osv_memory): def default_get(self, cr, uid, fields_list, context=None): """ Assign Default value in particular field. If Browse Answers wizard run then read the value into database and Assigne to a particular fields. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param fields_list: List of fields of current view, - @param context: A standard dictionary for contextual values, - @return : Dictionary value for fields list with value. """ value = {} if context is None: @@ -556,13 +532,6 @@ class survey_question_wiz(osv.osv_memory): def create(self, cr, uid, vals, context=None): """ Create the Answer of survey and store in survey.response object, and if set validation of question then check the value of question if value is wrong then raise the exception. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param vals: Values, - @param context: A standard dictionary for contextual values - @return : True. """ if context is None: context = {} if context.has_key('active') and context.get('active',False): @@ -600,9 +569,10 @@ class survey_question_wiz(osv.osv_memory): #click first time on next button then increemnet on total start suvey if not sur_name_read['store_ans']: his_id = self.pool.get('survey.history').create(cr, uid, {'user_id': uid, \ - 'date': strftime('%Y-%m-%d %H:%M:%S'), 'survey_id': sur_name_read['survey_id']}) - sur_rec = survey_obj.read(cr, uid, sur_name_read['survey_id']) - survey_obj.write(cr, uid, sur_name_read['survey_id'], {'tot_start_survey' : sur_rec['tot_start_survey'] + 1}) + 'date': strftime('%Y-%m-%d %H:%M:%S'), 'survey_id': sur_name_read['survey_id'][0]}) + survey_id = sur_name_read['survey_id'][0] + sur_rec = survey_obj.read(cr, uid, survey_id) + survey_obj.write(cr, uid, survey_id, {'tot_start_survey' : sur_rec['tot_start_survey'] + 1}) if context.has_key('cur_id'): if context.has_key('request') and context.get('request',False): self.pool.get(context.get('object',False)).write(cr, uid, [int(context.get('cur_id',False))], {'response' : response_id}) @@ -1016,13 +986,6 @@ class survey_question_wiz(osv.osv_memory): def action_new_question(self,cr, uid, ids, context=None): """ New survey.Question form. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open new survey.Qestion form. """ if context is None: context = {} @@ -1044,13 +1007,6 @@ class survey_question_wiz(osv.osv_memory): def action_new_page(self, cr, uid, ids, context=None): """ New survey.Page form. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open new survey.page form. """ if context is None: context = {} @@ -1072,13 +1028,6 @@ class survey_question_wiz(osv.osv_memory): def action_edit_page(self,cr, uid, ids, context=None): """ Edit survey.page. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open Edit survey.page form. """ if context is None: context = {} @@ -1101,13 +1050,6 @@ class survey_question_wiz(osv.osv_memory): def action_delete_page(self,cr, uid, ids, context=None): """ Delete survey.page. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open next survey.page form, but delete the selected page. """ if context is None: context = {} @@ -1134,13 +1076,6 @@ class survey_question_wiz(osv.osv_memory): def action_edit_question(self,cr, uid, ids, context=None): """ Edit survey.question. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open Edit survey.question form. """ if context is None: context = {} @@ -1163,13 +1098,6 @@ class survey_question_wiz(osv.osv_memory): def action_delete_question(self,cr, uid, ids, context=None): """ Delete survey.question. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open same survey.page form, but delete the selected survey.question in current survey.page. """ if context is None: context = {} @@ -1197,13 +1125,6 @@ class survey_question_wiz(osv.osv_memory): def action_forward_previous(self, cr, uid, ids, context=None): """ Goes to previous Survey Answer. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open Previous Answer form. """ if context is None: context = {} @@ -1229,13 +1150,6 @@ class survey_question_wiz(osv.osv_memory): def action_forward_next(self, cr, uid, ids, context=None): """ Goes to Next Survey Answer. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open Next Answer form. """ if context is None: context = {} @@ -1261,13 +1175,6 @@ class survey_question_wiz(osv.osv_memory): def action_next(self, cr, uid, ids, context=None): """ Goes to Next page. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open Next survey.page form. """ if context is None: context = {} @@ -1288,13 +1195,6 @@ class survey_question_wiz(osv.osv_memory): def action_previous(self, cr, uid, ids, context=None): """ Goes to previous page. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.question.wiz IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for Open Previous survey.page form. """ if context is None: context = {} diff --git a/addons/survey/wizard/survey_browse_answer.py b/addons/survey/wizard/survey_browse_answer.py index 1798a7c418c..5af913993b2 100644 --- a/addons/survey/wizard/survey_browse_answer.py +++ b/addons/survey/wizard/survey_browse_answer.py @@ -24,26 +24,9 @@ from osv import fields class survey_browse_answer(osv.osv_memory): _name = 'survey.browse.answer' - - def _get_survey(self, cr, uid, context=None): - """ - Set the value in survey_id field, - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param context: A standard dictionary for contextual values, - @return : Tuple in list with values. - """ - surv_obj = self.pool.get("survey") - surv_resp_obj = self.pool.get("survey.response") - result = [] - for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])): - if surv_resp_obj.search(cr, uid, [('survey_id', '=', sur.id)]): - result.append((sur.id, sur.title)) - return result _columns = { - 'survey_id': fields.selection(_get_survey, "Survey", required="1"), + 'survey_id': fields.many2one('survey', "Survey", required="1"), 'response_id': fields.many2one("survey.response", "Survey Answers", help="If this field is empty, all answers of the selected survey will be print."), } @@ -51,13 +34,6 @@ class survey_browse_answer(osv.osv_memory): """ Open Browse Response wizard. if you select only survey_id then this wizard open with all response_ids and if you select survey_id and response_id then open the particular response of the survey. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of survey.browse.answer IDs, - @param context: A standard dictionary for contextual values, - @return : Dictionary value for Open the browse answer wizard. """ if context is None: context = {} record = self.read(cr, uid, ids, []) @@ -66,8 +42,8 @@ class survey_browse_answer(osv.osv_memory): res_id = [(record.get('response_id') and record['response_id'][0])] else: sur_response_obj = self.pool.get('survey.response') - res_id = sur_response_obj.search(cr, uid, [('survey_id', '=',int(record['survey_id']))]) - context.update({'active' : True,'survey_id' : record['survey_id'], 'response_id' : res_id, 'response_no' : 0}) + res_id = sur_response_obj.search(cr, uid, [('survey_id', '=', record['survey_id'][0])]) + context.update({'active' : True,'survey_id' : record['survey_id'][0], 'response_id' : res_id, 'response_no' : 0}) search_obj = self.pool.get('ir.ui.view') search_id = search_obj.search(cr,uid,[('model','=','survey.question.wiz'),('name','=','Survey Search')]) return { diff --git a/addons/survey/wizard/survey_print.py b/addons/survey/wizard/survey_print.py index 87767f34a68..6ae84ed37cc 100644 --- a/addons/survey/wizard/survey_print.py +++ b/addons/survey/wizard/survey_print.py @@ -27,8 +27,7 @@ from tools.translate import _ class survey_print(osv.osv_memory): _name = 'survey.print' _columns = { - 'survey_ids': fields.many2many('survey','survey_print',\ - 'survey_id','print_id', "Survey", required="1"), + 'survey_ids': fields.many2many('survey', string="Survey", required="1"), 'orientation' : fields.selection([('vertical','Portrait(Vertical)'),\ ('horizontal','Landscape(Horizontal)')], 'Orientation'), 'paper_size' : fields.selection([('letter','Letter (8.5" x 11")'),\ diff --git a/addons/survey/wizard/survey_print_statistics.py b/addons/survey/wizard/survey_print_statistics.py index 10b321fcf45..bd8b9f2ad14 100644 --- a/addons/survey/wizard/survey_print_statistics.py +++ b/addons/survey/wizard/survey_print_statistics.py @@ -26,20 +26,12 @@ from tools.translate import _ class survey_print_statistics(osv.osv_memory): _name = 'survey.print.statistics' _columns = { - 'survey_ids': fields.many2many('survey','survey_print_statistics','survey_id',\ - 'print_id', "Survey", required="1"), + 'survey_ids': fields.many2many('survey', string="Survey", required="1"), } def action_next(self, cr, uid, ids, context=None): """ Print Survey Statistics in pdf format. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of Survey statistics IDs - @param context: A standard dictionary for contextual values - @return: Dictionary value for created survey statistics report """ if context is None: context = {} diff --git a/addons/survey/wizard/survey_selection.py b/addons/survey/wizard/survey_selection.py index c6eebd62a67..a803459899c 100644 --- a/addons/survey/wizard/survey_selection.py +++ b/addons/survey/wizard/survey_selection.py @@ -26,71 +26,8 @@ from tools.translate import _ class survey_name_wiz(osv.osv_memory): _name = 'survey.name.wiz' - def default_get(self, cr, uid, fields, context=None): - """ - Set the default value in survey_id field. if open this wizard in survey form then set the default value in survey_id = active survey id. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param fields: List of Survey statistics IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for created survey statistics report - """ - if context is None: - context = {} - data = super(survey_name_wiz, self).default_get(cr, uid, fields, context) - if context.has_key('survey_id'): - data['survey_id'] = context.get('survey_id',False) - return data - - def _get_survey(self, cr, uid, context=None): - """ - Set the value In survey_id field. - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of Survey statistics IDs - @param context: A standard dictionary for contextual values - @return: Dictionary value for created survey statistics report - """ - surv_obj = self.pool.get("survey") - result = [] - if context.has_key('survey_id'): - for sur in surv_obj.browse(cr, uid, [context.get('survey_id',False)]): - result.append((sur.id, sur.title)) - return result - survey_user_group_id = self.pool.get('res.groups').search(cr, uid, [('name', '=', 'Survey / User')]) - group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Tools / Manager','Tools / User','Survey / User'))]) - user_obj = self.pool.get('res.users') - user_rec = user_obj.read(cr, uid, uid, []) - if survey_user_group_id: - if survey_user_group_id == user_rec['groups_id']: - for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])): - if sur.state == 'open': - u_list = [] - for use in sur.invited_user_ids: - u_list.append(use.id) - if uid in u_list: - result.append((sur.id, sur.title)) - return result - for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])): - if sur.state == 'open': - res = False - for i in group_id: - if i in user_rec['groups_id']: - res = True - break - elif sur.id in user_rec['survey_id']: - res = True - break - if res: - result.append((sur.id, sur.title)) - return result - _columns = { - 'survey_id': fields.selection(_get_survey, "Survey", required="1"), + 'survey_id': fields.many2one('survey', 'Survey', required=True, ondelete='cascade'), 'page_no': fields.integer('Page Number'), 'note': fields.text("Description"), 'page': fields.char('Page Position',size = 12), @@ -99,10 +36,11 @@ class survey_name_wiz(osv.osv_memory): 'response': fields.char('Answer',size=16) } _defaults = { - 'page_no': lambda * a: - 1, - 'page': lambda * a: 'next', - 'transfer': lambda * a: 1, - 'response': lambda * a: 0, + 'page_no': -1, + 'page': 'next', + 'transfer': 1, + 'response': 0, + 'survey_id': lambda self,cr,uid,context:context.get('survey_id',False), } def action_next(self, cr, uid, ids, context=None): @@ -110,30 +48,22 @@ class survey_name_wiz(osv.osv_memory): Start the survey, Increment in started survey field but if set the max_response_limit of survey then check the current user how many times start this survey. if current user max_response_limit is reach then this user can not start this survey(Raise Exception). - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of Survey IDs - @param context: A standard dictionary for contextual values - @return : Dictionary value for open survey question wizard. """ survey_obj = self.pool.get('survey') search_obj = self.pool.get('ir.ui.view') if context is None: context = {} this = self.browse(cr, uid, ids, context=context)[0] - survey_id = this.survey_id + survey_id = this.survey_id.id context.update({'survey_id': survey_id, 'sur_name_id': this.id}) cr.execute('select count(id) from survey_history where user_id=%s\ and survey_id=%s' % (uid,survey_id)) res = cr.fetchone()[0] - user_limit = survey_obj.read(cr, uid, survey_id, ['response_user'])['response_user'] - if user_limit and res >= user_limit: + sur_rec = survey_obj.browse(cr,uid,survey_id,context=context) + if sur_rec.response_user and res >= sur_rec.response_user: raise osv.except_osv(_('Warning !'),_("You can not give response for this survey more than %s times") % (user_limit)) - sur_rec = survey_obj.browse(cr,uid,ids,context=context)[0] if sur_rec.max_response_limit and sur_rec.max_response_limit <= sur_rec.tot_start_survey: raise osv.except_osv(_('Warning !'),_("You can not give more response. Please contact the author of this survey for further assistance.")) @@ -152,16 +82,10 @@ class survey_name_wiz(osv.osv_memory): def on_change_survey(self, cr, uid, ids, survey_id, context=None): """ on change event of survey_id field, if note is available in selected survey then display this note in note fields. - @param ids: List of Survey IDs - @param survey_id: Id of Survey - @param context: A standard dictionary for contextual values - @return : Dictionary values of notes fields. """ if not survey_id: return {} notes = self.pool.get('survey').read(cr, uid, survey_id, ['note'])['note'] return {'value': {'note': notes}} -survey_name_wiz() - -# 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/survey/wizard/survey_selection.xml b/addons/survey/wizard/survey_selection.xml index a72566f7888..144525979dd 100644 --- a/addons/survey/wizard/survey_selection.xml +++ b/addons/survey/wizard/survey_selection.xml @@ -15,7 +15,8 @@ <separator colspan="4" string="Select Survey" /> <newline /> <field name="survey_id" colspan="4" - on_change="on_change_survey(survey_id)" width="250"/> + on_change="on_change_survey(survey_id)" width="250" + domain="[('state','=','open')]"/> <group col="1" colspan="4" attrs="{'readonly': [('survey_id','=',False)]}"> <separator colspan="4" string="Survey Details" /> diff --git a/addons/thunderbird/installer.py b/addons/thunderbird/installer.py index 5bf11218842..35d31b9d636 100644 --- a/addons/thunderbird/installer.py +++ b/addons/thunderbird/installer.py @@ -41,7 +41,7 @@ class thunderbird_installer(osv.osv_memory): 'pdf_name':fields.char('File name', size=64), 'thunderbird':fields.boolean('Thunderbird Plug-in', help="Allows you to select an object that you would like to add to your email and its attachments."), 'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbird."), - 'pdf_file':fields.char('Installation Manual', size="264", help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True), + 'pdf_file':fields.char('Installation Manual', size=264, help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True), 'description':fields.text('Description', readonly=True) } |
