[Merge]
authorVir (Open ERP) <vir@tinyerp.com>
Sat, 7 Aug 2010 06:37:44 +0000 (12:07 +0530)
committerVir (Open ERP) <vir@tinyerp.com>
Sat, 7 Aug 2010 06:37:44 +0000 (12:07 +0530)
bzr revid: vir@tinyerp.com-20100807063744-lstq56oy81itxh86

95 files changed:
addons/account/i18n/mn.po
addons/account/i18n/pl.po
addons/auction/__openerp__.py
addons/auction/auction.py
addons/auction/auction_report.xml
addons/auction/auction_view.xml
addons/auction/board_auction_view.xml
addons/auction/report/ach_bordereau_photo.xsl
addons/auction/report/catalog.xsl
addons/auction/report/lots_bids_phone.xsl
addons/auction/report/lots_bids_phone2.xsl
addons/auction/report/lots_deposit.xsl
addons/auction/report/lots_list.xsl
addons/auction/report/lots_with_vat.xsl
addons/auction/report/report_auction.py
addons/auction/report/report_auction_view.xml
addons/auction/report/vnd_bordereau.xsl
addons/auction/security/ir.model.access.csv
addons/auction/test/auction.yml
addons/auction/wizard/auction_lots_auction_move_view.xml
addons/base_calendar/base_calendar.py
addons/caldav/caldav.py
addons/caldav/caldav_data.xml
addons/caldav/caldav_node.py
addons/caldav/caldav_view.xml
addons/caldav/calendar.py
addons/caldav/wizard/calendar_event_export_view.xml
addons/caldav/wizard/calendar_event_import.py
addons/caldav/wizard/calendar_event_import_view.xml
addons/caldav/wizard/calendar_event_subscribe_view.xml
addons/crm/crm_lead.py
addons/crm/crm_phonecall.py
addons/crm/i18n/fi.po
addons/crm/i18n/pl.po
addons/crm_claim/crm_claim.py
addons/document/nodes.py
addons/document_webdav/dav_fs.py
addons/document_webdav/webdav.py
addons/document_webdav/webdav_server.py
addons/email_template/email_template.py
addons/email_template/email_template_account.py
addons/email_template/email_template_engines.py
addons/event/i18n/tr.po
addons/hr_expense/i18n/pl.po
addons/hr_expense/i18n/pt_BR.po
addons/hr_holidays/i18n/pl.po
addons/hr_holidays/i18n/tr.po
addons/hr_holidays/i18n/zh_CN.po
addons/hr_timesheet_sheet/i18n/lt.po
addons/l10n_fr/i18n/tr.po
addons/marketing_campaign/marketing_campaign.py
addons/mrp/i18n/ca.po
addons/mrp/i18n/ru.po
addons/mrp/mrp.py
addons/mrp/mrp_demo.xml
addons/mrp/procurement.py
addons/mrp/product.py
addons/mrp/report/bom_structure.py
addons/mrp/report/mrp_production_order.py
addons/mrp/report/order.py
addons/mrp/report/workcenter_load.py
addons/mrp/test/mrp_phantom_bom.yml
addons/mrp/wizard/mrp_change_standard_price.py
addons/mrp/wizard/mrp_product_produce.py
addons/mrp_jit/__openerp__.py
addons/mrp_jit/test/mrp_jit.yml [new file with mode: 0644]
addons/mrp_operations/mrp_operations.py
addons/mrp_repair/mrp_repair.py
addons/mrp_repair/mrp_repair_view.xml
addons/mrp_repair/test/test_mrp_repair.yml
addons/mrp_subproduct/__openerp__.py
addons/mrp_subproduct/test/mrp_subproduct.yml [new file with mode: 0644]
addons/olap_crm/i18n/mn.po [new file with mode: 0644]
addons/outlook/plugin/Register-plugin.bat [new file with mode: 0644]
addons/outlook/plugin/Unregister-plugin.bat [new file with mode: 0644]
addons/outlook/plugin/dialogs/dialog_map.py
addons/outlook/plugin/tiny_xmlrpc.py
addons/point_of_sale/i18n/lt.po
addons/process/i18n/tr.po
addons/product/i18n/tr.po
addons/product/i18n/zh_CN.po
addons/product/product_demo.xml
addons/profile_accounting/i18n/tr.po
addons/project_caldav/project_caldav_data.xml
addons/purchase/i18n/mn.po [new file with mode: 0644]
addons/purchase/i18n/pt_BR.po
addons/purchase_requisition/test/purchase_requisition.yml
addons/purchase_requisition/test/purchase_requisition_exclusive.yml
addons/sale/i18n/pt_BR.po
addons/sale/sale.py
addons/sale/test/invoice_on_shipped_qty.yml
addons/sale_margin/__openerp__.py
addons/sale_margin/test/sale_margin.yml [new file with mode: 0644]
addons/stock/stock.py
addons/stock_invoice_directly/i18n/nl.po

index a9c72cb..c90f75e 100644 (file)
@@ -8,13 +8,13 @@ msgstr ""
 "Project-Id-Version: openobject-addons\n"
 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-06 03:43+0000\n"
+"PO-Revision-Date: 2010-08-06 07:55+0000\n"
 "Last-Translator: munkhbold <Unknown>\n"
 "Language-Team: Mongolian <mn@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: 2010-08-06 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: account
@@ -1503,7 +1503,7 @@ msgstr "Орлого"
 #. module: account
 #: selection:account.bank.statement.line,type:0
 msgid "Supplier"
-msgstr ""
+msgstr "Нийлүүлэгч"
 
 #. module: account
 #: rml:account.invoice:0
@@ -1513,7 +1513,7 @@ msgstr ""
 #. module: account
 #: field:account.invoice.tax,tax_amount:0
 msgid "Tax Code Amount"
-msgstr ""
+msgstr "Татварын кодны хэмжээ"
 
 #. module: account
 #: selection:account.account.type,sign:0
@@ -1525,41 +1525,41 @@ msgstr ""
 #: model:ir.actions.wizard,name:account.wizard_general_journal
 #: model:ir.ui.menu,name:account.menu_general_journal
 msgid "Print General Journal"
-msgstr ""
+msgstr "Ерөнхий журнал хэвлэх"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_account_chart_template_form
 #: model:ir.ui.menu,name:account.menu_action_account_chart_template_form
 msgid "Chart of Accounts Templates"
-msgstr ""
+msgstr "Дансны модны загвар"
 
 #. module: account
 #: field:account.invoice,move_id:0
 msgid "Invoice Movement"
-msgstr ""
+msgstr "Гүйлгээний нэхэмжлэл"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_wizard_multi_chart
 #: model:ir.ui.menu,name:account.menu_wizard
 #: view:wizard.multi.charts.accounts:0
 msgid "Generate Chart of Accounts from a Chart Template"
-msgstr ""
+msgstr "Загвар ашиглан дансны төлөвлөгөө үүсгэх"
 
 #. module: account
 #: model:ir.ui.menu,name:account.menu_finance_legal_statement
 msgid "Legal Statements"
-msgstr ""
+msgstr "Албан ёсны мэдээ тайлан"
 
 #. module: account
 #: field:account.tax.code,parent_id:0
 #: field:account.tax.code.template,parent_id:0
 msgid "Parent Code"
-msgstr ""
+msgstr "Эцэг ангилал"
 
 #. module: account
 #: wizard_button:account.move.line.reconcile.select,init,open:0
 msgid "Open for reconciliation"
-msgstr ""
+msgstr "Тулгагдсан бичилтүүдийг нээх"
 
 #. module: account
 #: model:account.journal,name:account.bilan_journal
@@ -1575,18 +1575,19 @@ msgstr ""
 #. module: account
 #: rml:account.analytic.account.journal:0
 msgid "Account n°"
-msgstr ""
+msgstr "Данс n°"
 
 #. module: account
 #: view:account.tax:0
 #: view:account.tax.template:0
 msgid "Keep empty to use the expense account"
 msgstr ""
+"Татварын дүнг зарлагын дансанд бичих бол татварын дансыг хоосон орхино"
 
 #. module: account
 #: wizard_field:account.automatic.reconcile,init,account_ids:0
 msgid "Account to reconcile"
-msgstr ""
+msgstr "Тулгалт хийх данс"
 
 #. module: account
 #: rml:account.invoice:0
@@ -1599,7 +1600,7 @@ msgstr ""
 #: selection:account.partner.balance.report,init,result_selection:0
 #: selection:account.third_party_ledger.report,init,result_selection:0
 msgid "Receivable and Payable Accounts"
-msgstr ""
+msgstr "Авлага, өглөгийн дансууд"
 
 #. module: account
 #: view:account.subscription:0
@@ -1613,23 +1614,23 @@ msgstr ""
 #: selection:account.tax,type_tax_use:0
 #: selection:account.tax.template,type_tax_use:0
 msgid "Purchase"
-msgstr ""
+msgstr "Худалдан авалт"
 
 #. module: account
 #: view:account.analytic.line:0
 msgid "Total quantity"
-msgstr ""
+msgstr "Нийт тоо хэмжээ"
 
 #. module: account
 #: field:account.invoice,date_due:0
 msgid "Due Date"
-msgstr ""
+msgstr "Дахин давтах огноо"
 
 #. module: account
 #: wizard_view:account.period.close,init:0
 #: wizard_button:account.period.close,init,close:0
 msgid "Close Period"
-msgstr ""
+msgstr "Мөчлөг хаах"
 
 #. module: account
 #: rml:account.overdue:0
@@ -1644,12 +1645,12 @@ msgstr ""
 #. module: account
 #: view:account.journal:0
 msgid "Accounts Type Allowed (empty for no control)"
-msgstr ""
+msgstr "Зөвшөөрөгдсөн дансны төрөл (хоосон орхивол бүгдийг зөвшөөрнө )"
 
 #. module: account
 #: field:account.bank.statement,balance_start:0
 msgid "Starting Balance"
-msgstr ""
+msgstr "Эхлэлийн баланс"
 
 #. module: account
 #: wizard_field:account.analytic.account.quantity_cost_ledger.report,init,journal:0
@@ -1657,7 +1658,7 @@ msgstr ""
 #: model:ir.actions.act_window,name:account.action_account_journal_period_tree
 #: model:ir.ui.menu,name:account.menu_action_account_journal_period_tree
 msgid "Journals"
-msgstr ""
+msgstr "Журналууд"
 
 #. module: account
 #: rml:account.analytic.account.quantity_cost_ledger:0
@@ -1667,29 +1668,29 @@ msgstr ""
 #. module: account
 #: wizard_button:account.invoice.refund,init,refund:0
 msgid "Refund Invoice"
-msgstr ""
+msgstr "Буцаалтын нэхэмжлэл"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_account_period_tree
 #: model:ir.actions.wizard,name:account.wizard_period_close
 #: model:ir.ui.menu,name:account.menu_action_account_period_close_tree
 msgid "Close a Period"
-msgstr ""
+msgstr "Мөчлөг хаах"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.act_acc_analytic_acc_2_report_hr_timesheet_invoice_journal
 msgid "Costs & Revenues"
-msgstr ""
+msgstr "Өртөг ба Орлого"
 
 #. module: account
 #: constraint:account.account:0
 msgid "Error ! You can not create recursive accounts."
-msgstr ""
+msgstr "Алдаа! Та цикл хэлбэрийн данс үүсгэх боломжгүй."
 
 #. module: account
 #: rml:account.tax.code.entries:0
 msgid "Account Number"
-msgstr ""
+msgstr "Дансны дугаар"
 
 #. module: account
 #: view:account.config.wizard:0
@@ -1699,38 +1700,38 @@ msgstr ""
 #. module: account
 #: field:account.invoice,period_id:0
 msgid "Force Period"
-msgstr ""
+msgstr "Мөчлөг"
 
 #. module: account
 #: help:account.account.type,sequence:0
 msgid "Gives the sequence order when displaying a list of account types."
-msgstr ""
+msgstr "Дансны төрлийн жагсаалтад хэрхэн эрэмбэлэгдэх дараалал."
 
 #. module: account
 #: view:account.invoice:0
 msgid "Re-Open"
-msgstr ""
+msgstr "Дахин нээх"
 
 #. module: account
 #: wizard_view:account.fiscalyear.close,init:0
 msgid "Are you sure you want to create entries?"
-msgstr ""
+msgstr "Та гүйлгээ үүсгэхдээ итгэлтэй байна уу?"
 
 #. module: account
 #: field:account.tax,include_base_amount:0
 msgid "Include in base amount"
-msgstr ""
+msgstr "Суурь дүнд шингэх"
 
 #. module: account
 #: rml:account.analytic.account.analytic.check:0
 msgid "Delta Credit"
-msgstr ""
+msgstr "Кредит зөрүү"
 
 #. module: account
 #: model:ir.actions.wizard,name:account.wizard_reconcile_unreconcile
 #: model:ir.actions.wizard,name:account.wizard_unreconcile
 msgid "Unreconcile Entries"
-msgstr ""
+msgstr "Гүйлгээг үл тулгах"
 
 #. module: account
 #: model:process.node,note:account.process_node_supplierdraftinvoices0
@@ -1746,7 +1747,7 @@ msgstr ""
 #: model:ir.actions.act_window,name:account.action_bank_statement_tree2
 #: model:ir.ui.menu,name:account.menu_bank_statement_tree2
 msgid "New Statement"
-msgstr ""
+msgstr "Шинэ хуулга"
 
 #. module: account
 #: wizard_field:account.analytic.account.chart,init,from_date:0
@@ -1765,24 +1766,24 @@ msgstr ""
 #: model:ir.actions.wizard,name:account.wizard_central_journal
 #: model:ir.ui.menu,name:account.menu_central_journal
 msgid "Print Central Journal"
-msgstr ""
+msgstr "Төв журнал хэвлэх"
 
 #. module: account
 #: wizard_field:account.aged.trial.balance,init,period_length:0
 msgid "Period length (days)"
-msgstr ""
+msgstr "Мөчлөгийн үргэлжилэх хугацаа (өдөр)"
 
 #. module: account
 #: selection:account.payment.term.line,value:0
 #: selection:account.tax,type:0
 #: selection:account.tax.template,type:0
 msgid "Percent"
-msgstr ""
+msgstr "Хувь"
 
 #. module: account
 #: model:ir.ui.menu,name:account.menu_finance_charts
 msgid "Charts"
-msgstr ""
+msgstr "Моднууд"
 
 #. module: account
 #: selection:account.analytic.journal,type:0
@@ -1790,13 +1791,13 @@ msgstr ""
 #: selection:account.tax,type_tax_use:0
 #: selection:account.tax.template,type_tax_use:0
 msgid "Sale"
-msgstr ""
+msgstr "Борлуулалт"
 
 #. module: account
 #: wizard_button:account.account.balance.report,account_selection,checktype:0
 #: wizard_button:account.general.ledger.report,account_selection,checktype:0
 msgid "Next"
-msgstr ""
+msgstr "Цааш нь"
 
 #. module: account
 #: help:res.partner,property_account_position:0
@@ -1804,16 +1805,17 @@ msgid ""
 "The fiscal position will determine taxes and the accounts used for the the "
 "partner."
 msgstr ""
+"Зөвхөн тухайн харилцагчид зориулагдсан татвар, дансуудыг тодорхойлно."
 
 #. module: account
 #: rml:account.analytic.account.cost_ledger:0
 msgid "Date or Code"
-msgstr ""
+msgstr "Огноо эсвэл код"
 
 #. module: account
 #: field:account.analytic.account,user_id:0
 msgid "Account Manager"
-msgstr ""
+msgstr "Дансны менежер"
 
 #. module: account
 #: rml:account.analytic.account.journal:0
@@ -1824,12 +1826,12 @@ msgstr ""
 #: wizard_field:account.move.line.reconcile,init_full,debit:0
 #: wizard_field:account.move.line.reconcile,init_partial,debit:0
 msgid "Debit amount"
-msgstr ""
+msgstr "Дебит дүн"
 
 #. module: account
 #: selection:account.subscription,period_type:0
 msgid "year"
-msgstr ""
+msgstr "Жил"
 
 #. module: account
 #: wizard_button:account.account.balance.report,checktype,report:0
@@ -1846,7 +1848,7 @@ msgstr ""
 #: wizard_button:account.print.journal.report,init,print:0
 #: wizard_button:account.third_party_ledger.report,init,checkreport:0
 msgid "Print"
-msgstr ""
+msgstr "Хэвлэх"
 
 #. module: account
 #: wizard_field:account.account.balance.report,checktype,date_from:0
@@ -1872,29 +1874,29 @@ msgstr ""
 #. module: account
 #: view:account.journal:0
 msgid "Accounts Allowed (empty for no control)"
-msgstr ""
+msgstr "Зөвшөөрөгдсөн дансууд (хоосон орхивол бүгдийг зөвшөөрнө)"
 
 #. module: account
 #: view:account.invoice:0
 msgid "Untaxed amount"
-msgstr ""
+msgstr "Татвар ноогдохгүй хэмжээ"
 
 #. module: account
 #: field:account.tax,account_collected_id:0
 #: field:account.tax.template,account_collected_id:0
 msgid "Invoice Tax Account"
-msgstr ""
+msgstr "Нэхэмжлэлийн татварын данс"
 
 #. module: account
 #: view:account.move.line:0
 msgid "Analytic Lines"
-msgstr ""
+msgstr "Аналитик мөрүүд"
 
 #. module: account
 #: wizard_view:account.invoice.pay,init:0
 #: model:ir.actions.wizard,name:account.wizard_invoice_pay
 msgid "Pay invoice"
-msgstr ""
+msgstr "Цалингийн нэхэмжлэл"
 
 #. module: account
 #: constraint:account.invoice:0
@@ -1905,7 +1907,7 @@ msgstr ""
 #: model:ir.actions.act_window,name:account.action_invoice_tree5
 #: model:ir.ui.menu,name:account.menu_invoice_draft
 msgid "Draft Customer Invoices"
-msgstr ""
+msgstr "Худалдан авагчийн ноорог нэхэмжлэл"
 
 #. module: account
 #: model:ir.model,name:account.model_account_subscription_line
@@ -1918,32 +1920,32 @@ msgstr ""
 #: selection:account.partner.balance.report,init,state:0
 #: selection:account.third_party_ledger.report,init,state:0
 msgid "No Filter"
-msgstr ""
+msgstr "Шүүлтгүй"
 
 #. module: account
 #: field:account.payment.term.line,days:0
 msgid "Number of Days"
-msgstr ""
+msgstr "Өдрийн дугаар"
 
 #. module: account
 #: help:account.invoice,reference:0
 msgid "The partner reference of this invoice."
-msgstr ""
+msgstr "Уг нэхэмжлэлийг тухайн харилцагч хэрхэн нэрлэн дугаарлах."
 
 #. module: account
 #: wizard_field:account.general.ledger.report,checktype,sortbydate:0
 msgid "Sort by:"
-msgstr ""
+msgstr "Эрэмбэлэх"
 
 #. module: account
 #: field:account.move,to_check:0
 msgid "To Be Verified"
-msgstr ""
+msgstr "Шалгагдана"
 
 #. module: account
 #: help:res.partner,debit:0
 msgid "Total amount you have to pay to this supplier."
-msgstr ""
+msgstr "Энэ нийлүүлэгчид өгөх нийт өглөгийн дүн."
 
 #. module: account
 #: selection:account.automatic.reconcile,init,power:0
@@ -1953,7 +1955,7 @@ msgstr ""
 #. module: account
 #: model:ir.actions.report.xml,name:account.account_transfers
 msgid "Transfers"
-msgstr ""
+msgstr "Шилжүүлэлт"
 
 #. module: account
 #: rml:account.overdue:0
@@ -1963,44 +1965,44 @@ msgstr ""
 #. module: account
 #: wizard_view:account.chart,init:0
 msgid "Account charts"
-msgstr ""
+msgstr "Дансны мод"
 
 #. module: account
 #: help:account.tax,name:0
 msgid "This name will be displayed on reports"
-msgstr ""
+msgstr "Энэ нэр тайлан дээр тусгагдана"
 
 #. module: account
 #: rml:account.analytic.account.cost_ledger:0
 #: rml:account.analytic.account.quantity_cost_ledger:0
 msgid "Printing date"
-msgstr ""
+msgstr "Хэвлэсэн огноо"
 
 #. module: account
 #: constraint:ir.ui.view:0
 msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Харагдах архитектурт нийцэхгүй XML!"
 
 #. module: account
 #: wizard_field:account.partner.balance.report,init,date1:0
 msgid "          Start date"
-msgstr ""
+msgstr "          Эхлэх огноо"
 
 #. module: account
 #: wizard_view:account.analytic.account.journal.report,init:0
 msgid "Analytic Journal Report"
-msgstr ""
+msgstr "Аналитик журналын тайлан"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_invoice_tree3
 #: model:ir.ui.menu,name:account.menu_action_invoice_tree3
 msgid "Customer Refunds"
-msgstr ""
+msgstr "Худалдан авагчийн буцаалт"
 
 #. module: account
 #: rml:account.vat.declaration:0
 msgid "Tax Amount"
-msgstr ""
+msgstr "Татварын хэмжээ"
 
 #. module: account
 #: rml:account.analytic.account.quantity_cost_ledger:0
@@ -2010,13 +2012,13 @@ msgstr ""
 #. module: account
 #: field:account.journal.period,name:0
 msgid "Journal-Period Name"
-msgstr ""
+msgstr "Журналын мөчлөгийн нэр"
 
 #. module: account
 #: field:account.tax.code,name:0
 #: field:account.tax.code.template,name:0
 msgid "Tax Case Name"
-msgstr ""
+msgstr "Ангилалын нэр"
 
 #. module: account
 #: help:account.journal,entry_posted:0
@@ -2025,6 +2027,8 @@ msgid ""
 "'draft' state and instead goes directly to the 'posted state' without any "
 "manual validation."
 msgstr ""
+"Уг журналд гүйлгээ бичих үед 'ноорог' төлвийг алгасан шууд 'батлагдсан' "
+"төлөвт шилжинэ. Нягтлан гараар батлах шаардлагагүй."
 
 #. module: account
 #: field:account.bank.statement.line,partner_id:0
@@ -2036,7 +2040,7 @@ msgstr ""
 #: wizard_field:account.third_party_ledger.report,init,result_selection:0
 #: field:wizard.company.setup,partner_id:0
 msgid "Partner"
-msgstr ""
+msgstr "Харилцагч"
 
 #. module: account
 #: help:account.invoice,number:0
@@ -2053,39 +2057,39 @@ msgstr ""
 #. module: account
 #: model:account.account.type,name:account.account_type_expense
 msgid "Expense"
-msgstr ""
+msgstr "Зарлага"
 
 #. module: account
 #: field:account.journal,invoice_sequence_id:0
 msgid "Invoice Sequence"
-msgstr ""
+msgstr "Нэхэмжлэлийн дугаарлалт"
 
 #. module: account
 #: wizard_view:account.automatic.reconcile,init:0
 msgid "Options"
-msgstr ""
+msgstr "Өгөгдлүүд"
 
 #. module: account
 #: model:process.process,name:account.process_process_invoiceprocess0
 msgid "Customer Invoice Process"
-msgstr ""
+msgstr "Худалдан авагчийн нэхэмжлэлийн явц"
 
 #. module: account
 #: rml:account.invoice:0
 msgid "Fiscal Position Remark :"
-msgstr ""
+msgstr "Фискал посишион тайлбар :"
 
 #. module: account
 #: wizard_field:account.fiscalyear.close,init,period_id:0
 msgid "Opening Entries Period"
-msgstr ""
+msgstr "Нээлтийн гүйлгээний мөчлөг"
 
 #. module: account
 #: model:ir.actions.wizard,name:account.wizard_validate_account_moves
 #: model:ir.actions.wizard,name:account.wizard_validate_account_moves_line
 #: model:ir.ui.menu,name:account.menu_validate_account_moves
 msgid "Validate Account Moves"
-msgstr ""
+msgstr "Гүйлгээ батлах"
 
 #. module: account
 #: selection:account.subscription,period_type:0
@@ -2109,23 +2113,23 @@ msgstr ""
 #: field:account.model.line,currency_id:0
 #: field:account.move.line,currency_id:0
 msgid "Currency"
-msgstr ""
+msgstr "Валют"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.act_account_journal_2_account_invoice_opened
 msgid "Unpaid invoices"
-msgstr ""
+msgstr "Төлөгдөөгүй нэхэмжлэлүүд"
 
 #. module: account
 #: model:process.transition,name:account.process_transition_paymentreconcile0
 msgid "Payment Reconcile"
-msgstr ""
+msgstr "Төлбөрийн тулгалт хийх"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_bank_statement_reconciliation_form
 #: model:ir.ui.menu,name:account.menu_action_account_bank_reconcile_tree
 msgid "Statements reconciliation"
-msgstr ""
+msgstr "Тулгалтын хуулга"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_subscription_form_new
@@ -2136,24 +2140,24 @@ msgstr ""
 #. module: account
 #: view:account.payment.term:0
 msgid "Computation"
-msgstr ""
+msgstr "Тооцоололт"
 
 #. module: account
 #: view:account.analytic.line:0
 msgid "Analytic Entry"
-msgstr ""
+msgstr "Аналитик гүйлгээ"
 
 #. module: account
 #: view:res.company:0
 #: field:res.company,overdue_msg:0
 msgid "Overdue Payments Message"
-msgstr ""
+msgstr "Төлбөр шаардах зурвас"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_tax_code_tree
 #: model:ir.ui.menu,name:account.menu_action_tax_code_tree
 msgid "Chart of Taxes"
-msgstr ""
+msgstr "Татварын мод"
 
 #. module: account
 #: field:account.payment.term.line,value_amount:0
@@ -2163,49 +2167,49 @@ msgstr ""
 #. module: account
 #: model:ir.actions.act_window,name:account.act_account_acount_move_line_reconcile_open
 msgid "Reconciled entries"
-msgstr ""
+msgstr "Нэгтгэсэн бичилтүүд"
 
 #. module: account
 #: field:account.invoice,address_contact_id:0
 msgid "Contact Address"
-msgstr ""
+msgstr "Холбогдох хаяг"
 
 #. module: account
 #: view:account.fiscalyear:0
 msgid "Create 3 Months Periods"
-msgstr ""
+msgstr "3 сарын мөчлөг үүсгэх"
 
 #. module: account
 #: view:account.invoice:0
 msgid "(keep empty to use the current period)"
-msgstr ""
+msgstr "(Хоосон орхивол батлагдсан огноон мөчлөг.)"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_invoice_tree8
 #: model:ir.ui.menu,name:account.menu_action_invoice_tree8
 msgid "Draft Supplier Invoices"
-msgstr ""
+msgstr "Нийлүүлэгчийн ноорог нэхэмжлэл"
 
 #. module: account
 #: wizard_field:account.invoice.refund,init,period:0
 msgid "Force period"
-msgstr ""
+msgstr "Мөчлөг"
 
 #. module: account
 #: selection:account.account.type,close_method:0
 msgid "Detail"
-msgstr ""
+msgstr "Задаргаа"
 
 #. module: account
 #: selection:account.account,type:0
 #: selection:account.account.template,type:0
 msgid "Consolidation"
-msgstr ""
+msgstr "Нэгтгэл"
 
 #. module: account
 #: field:account.chart.template,account_root_id:0
 msgid "Root Account"
-msgstr ""
+msgstr "Толгой данс"
 
 #. module: account
 #: rml:account.overdue:0
@@ -2227,7 +2231,7 @@ msgstr ""
 #: model:ir.ui.menu,name:account.menu_action_account_tree
 #: model:ir.ui.menu,name:account.menu_action_account_tree2
 msgid "Chart of Accounts"
-msgstr ""
+msgstr "Дансны мод"
 
 #. module: account
 #: model:account.journal,name:account.check_journal
@@ -2243,22 +2247,22 @@ msgstr ""
 #. module: account
 #: wizard_field:account.fiscalyear.close,init,journal_id:0
 msgid "Opening Entries Journal"
-msgstr ""
+msgstr "Нээлтийн гүйлгээний журнал"
 
 #. module: account
 #: view:account.config.wizard:0
 msgid "Create a Fiscal Year"
-msgstr ""
+msgstr "Санхүүгийн жил үүсгэх"
 
 #. module: account
 #: field:product.template,taxes_id:0
 msgid "Customer Taxes"
-msgstr ""
+msgstr "Үйлчлүүлэгчийн татварууд"
 
 #. module: account
 #: field:account.invoice,date_invoice:0
 msgid "Date Invoiced"
-msgstr ""
+msgstr "Нэхэмжилсэн огноо"
 
 #. module: account
 #: help:account.account.balance.report,checktype,periods:0
@@ -2267,12 +2271,12 @@ msgstr ""
 #: help:account.third_party_ledger.report,init,periods:0
 #: help:account.vat.declaration,init,periods:0
 msgid "All periods if empty"
-msgstr ""
+msgstr "All periods if empty"
 
 #. module: account
 #: model:account.account.type,name:account.account_type_liability
 msgid "Liability"
-msgstr ""
+msgstr "Үүрэг"
 
 #. module: account
 #: selection:account.automatic.reconcile,init,power:0
@@ -2283,11 +2287,12 @@ msgstr ""
 #: wizard_view:account.chart,init:0
 msgid "(If you do not select Fiscal year it will take all open fiscal years)"
 msgstr ""
+"(Санхүүгийн жилийг сонгоогүй бол бүх нээлттэй санхүүгийн жилүүд сонгогдоно)"
 
 #. module: account
 #: help:account.invoice.tax,base_code_id:0
 msgid "The account basis of the tax declaration."
-msgstr ""
+msgstr "Татварын зарлалтын суурь данс."
 
 #. module: account
 #: rml:account.analytic.account.journal:0
@@ -2312,24 +2317,24 @@ msgstr ""
 #. module: account
 #: field:account.invoice,reference_type:0
 msgid "Reference Type"
-msgstr ""
+msgstr "Дугаарлалтын төрөл"
 
 #. module: account
 #: wizard_button:account.move.line.unreconcile,init,unrec:0
 #: wizard_button:account.reconcile.unreconcile,init,unrec:0
 msgid "Unreconcile"
-msgstr ""
+msgstr "Үл тулгалт хийх"
 
 #. module: account
 #: field:account.tax,type:0
 #: field:account.tax.template,type:0
 msgid "Tax Type"
-msgstr ""
+msgstr "Татварын төрөл"
 
 #. module: account
 #: model:process.transition,name:account.process_transition_statemententries0
 msgid "Statement Entries"
-msgstr ""
+msgstr "Гүйлгээнүүдийн хуулга"
 
 #. module: account
 #: field:account.analytic.line,user_id:0
@@ -2341,12 +2346,12 @@ msgstr ""
 #: model:ir.actions.act_window,name:account.action_account_template_form
 #: model:ir.ui.menu,name:account.menu_action_account_template_form
 msgid "Account Templates"
-msgstr ""
+msgstr "Дансны загвар"
 
 #. module: account
 #: view:account.chart.template:0
 msgid "Chart of Accounts Template"
-msgstr ""
+msgstr "Дансны модны загвар"
 
 #. module: account
 #: model:account.journal,name:account.refund_sales_journal
@@ -2356,38 +2361,38 @@ msgstr ""
 #. module: account
 #: rml:account.journal.period.print:0
 msgid "Voucher No"
-msgstr ""
+msgstr "Хувьцааны бичиг №"
 
 #. module: account
 #: model:ir.actions.wizard,name:account.wizard_automatic_reconcile
 #: model:ir.ui.menu,name:account.menu_automatic_reconcile
 msgid "Automatic reconciliation"
-msgstr ""
+msgstr "Автомат тулгалт"
 
 #. module: account
 #: view:account.bank.statement:0
 msgid "Import Invoice"
-msgstr ""
+msgstr "Нэхэмжлэл оруулах"
 
 #. module: account
 #: wizard_view:account.analytic.account.quantity_cost_ledger.report,init:0
 msgid "and Journals"
-msgstr ""
+msgstr "болон журналууд"
 
 #. module: account
 #: view:account.tax:0
 msgid "Account Tax"
-msgstr ""
+msgstr "Дэд татвар"
 
 #. module: account
 #: field:account.analytic.line,move_id:0
 msgid "Move Line"
-msgstr ""
+msgstr "Журналын бичилт"
 
 #. module: account
 #: field:account.bank.accounts.wizard,acc_no:0
 msgid "Account No."
-msgstr ""
+msgstr "Дансны №."
 
 #. module: account
 #: help:account.tax,child_depend:0
@@ -2395,11 +2400,13 @@ msgid ""
 "Set if the tax computation is based on the computation of child taxes rather "
 "than on the total amount."
 msgstr ""
+"Тухайн татварыг дэд татваруудаар тооцоологдсон нийт дүн дээр нэмж тооцоолох "
+"эсэх. Үгүй бол үндсэн дүн дээр тооцоолно."
 
 #. module: account
 #: rml:account.central.journal:0
 msgid "Journal Code"
-msgstr ""
+msgstr "Журналын код"
 
 #. module: account
 #: help:account.tax,applicable_type:0
@@ -2407,6 +2414,8 @@ msgid ""
 "If not applicable (computed through a Python code), the tax won't appear on "
 "the invoice."
 msgstr ""
+"Хэрэв програмчлалаар тооцоологдох бол тухайн татвар нэхэмжлэл дээр "
+"тусгагдахгүй."
 
 #. module: account
 #: field:account.model,lines_id:0
@@ -2416,7 +2425,7 @@ msgstr ""
 #. module: account
 #: field:account.analytic.account,date:0
 msgid "Date End"
-msgstr ""
+msgstr "Дуусах огноо"
 
 #. module: account
 #: view:account.bank.statement:0
@@ -2425,18 +2434,18 @@ msgstr ""
 #: model:ir.actions.act_window,name:account.action_move_line_tree1
 #: model:ir.ui.menu,name:account.menu_action_move_line_search
 msgid "Entry Lines"
-msgstr ""
+msgstr "Журналын бичилтүүд"
 
 #. module: account
 #: view:account.tax:0
 #: view:account.tax.template:0
 msgid "Applicable Code (if type=code)"
-msgstr ""
+msgstr "Хэрэглэх програмчлалын код (хэрэв төрөл=програмчлал)"
 
 #. module: account
 #: wizard_button:account.move.journal,init,open:0
 msgid "Open Journal"
-msgstr ""
+msgstr "Журнал нээх"
 
 #. module: account
 #: rml:account.analytic.account.journal:0
@@ -2449,12 +2458,12 @@ msgstr ""
 #: model:ir.ui.menu,name:account.account_entries_analytic_entries
 #: model:ir.ui.menu,name:account.menu_action_move_journal_line_form
 msgid "Entries Encoding by Line"
-msgstr ""
+msgstr "Журналын бичилтүүд"
 
 #. module: account
 #: help:account.chart.template,tax_template_ids:0
 msgid "List of all the taxes that have to be installed by the wizard"
-msgstr ""
+msgstr "Шинээр үүсгэх татваруудын жагсаалт"
 
 #. module: account
 #: rml:account.analytic.account.cost_ledger:0
@@ -2467,7 +2476,7 @@ msgstr ""
 #: model:process.node,name:account.process_node_bankstatement0
 #: model:process.node,name:account.process_node_supplierbankstatement0
 msgid "Bank Statement"
-msgstr ""
+msgstr "Банкны хуулга"
 
 #. module: account
 #: wizard_view:account.invoice.pay,addendum:0
@@ -2479,23 +2488,23 @@ msgstr ""
 #: model:process.transition,name:account.process_transition_entriesreconcile0
 #: model:process.transition,name:account.process_transition_supplierentriesreconcile0
 msgid "Entries Reconcile"
-msgstr ""
+msgstr "Гүйлгээнүүдийн тулгалт"
 
 #. module: account
 #: help:account.bank.statement.reconcile,total_second_amount:0
 msgid "The amount in the currency of the journal"
-msgstr ""
+msgstr "Журналын валютаар тооцсон дүн"
 
 #. module: account
 #: wizard_field:account.general.ledger.report,checktype,landscape:0
 msgid "Landscape Mode"
-msgstr ""
+msgstr "Хэвтээ горим"
 
 #. module: account
 #: model:process.transition,note:account.process_transition_analyticinvoice0
 #: model:process.transition,note:account.process_transition_supplieranalyticcost0
 msgid "From analytic accounts, Create invoice."
-msgstr ""
+msgstr "Аналитизк дансаас нэхэмжлэл үүсгэх."
 
 #. module: account
 #: wizard_button:account.account.balance.report,account_selection,end:0
@@ -2544,12 +2553,12 @@ msgstr ""
 #: view:wizard.company.setup:0
 #: view:wizard.multi.charts.accounts:0
 msgid "Cancel"
-msgstr ""
+msgstr "Болих"
 
 #. module: account
 #: field:account.account.type,name:0
 msgid "Acc. Type Name"
-msgstr ""
+msgstr "Дансны төрлийн нэр"
 
 #. module: account
 #: help:account.tax,base_code_id:0
@@ -2561,7 +2570,7 @@ msgstr ""
 #: help:account.tax.template,ref_tax_code_id:0
 #: help:account.tax.template,tax_code_id:0
 msgid "Use this code for the VAT declaration."
-msgstr ""
+msgstr "Уг ангилал нь татварын зарлалтанд хэрэглэгдэнэ."
 
 #. module: account
 #: field:account.move.line,blocked:0
@@ -2573,32 +2582,32 @@ msgstr ""
 #: wizard_view:account.move.validate,init:0
 #: view:account.payment.term:0
 msgid "Information"
-msgstr ""
+msgstr "Мэдээлэл"
 
 #. module: account
 #: model:ir.ui.menu,name:account.menu_tax_report
 msgid "Taxes Reports"
-msgstr ""
+msgstr "Татваруудын мэдээлэлүүд"
 
 #. module: account
 #: field:res.partner,property_account_payable:0
 msgid "Account Payable"
-msgstr ""
+msgstr "Өглөгийн данс"
 
 #. module: account
 #: wizard_view:populate_statement_from_inv,init:0
 msgid "Import Invoices in Statement"
-msgstr ""
+msgstr "Нэхэмжлэлүүдийн хуулгыг оруулах"
 
 #. module: account
 #: view:account.invoice:0
 msgid "Other Info"
-msgstr ""
+msgstr "Бусад мэдээлэл"
 
 #. module: account
 #: field:account.journal,default_credit_account_id:0
 msgid "Default Credit Account"
-msgstr ""
+msgstr "Тогтсон кредит данс"
 
 #. module: account
 #: model:process.node,name:account.process_node_supplierpaymentorder0
@@ -2610,6 +2619,7 @@ msgstr ""
 msgid ""
 "Check this option if you want the user to reconcile entries in this account."
 msgstr ""
+"Хэрэглэгч уг дансны гүйлгээг банкны хуулгатай тулган тааруулж болох эсэх."
 
 #. module: account
 #: rml:account.analytic.account.journal:0
@@ -2617,12 +2627,12 @@ msgstr ""
 #: model:process.node,name:account.process_node_analytic0
 #: model:process.node,name:account.process_node_analyticcost0
 msgid "Analytic"
-msgstr ""
+msgstr "Аналитик"
 
 #. module: account
 #: model:process.node,name:account.process_node_invoiceinvoice0
 msgid "Create Invoice"
-msgstr ""
+msgstr "Нэхэмжлэл үүсгэх"
 
 #. module: account
 #: model:account.account.type,name:account.account_type_cash_equity
@@ -2637,7 +2647,7 @@ msgstr ""
 #. module: account
 #: model:ir.model,name:account.model_account_tax_code_template
 msgid "Tax Code Template"
-msgstr ""
+msgstr "Татварын ангилалын загвар"
 
 #. module: account
 #: rml:account.partner.balance:0
@@ -2653,31 +2663,38 @@ msgid ""
 "partners accounts (for debit/credit computations), closed for deprecated "
 "accounts."
 msgstr ""
+"Энэ төрөл нь тухайн данс хаана хэрхэн хэрэглэгдэхийг тодорхойлно: \\n\r\n"
+"  харах төрөлтэй дансанд гүйлгээ бичихгүй зөвхөн дансны модыг тодорхойлох "
+"зорилготой\\n\r\n"
+"  нэгтгэх төрөлтэй данс нь олон компаний дансуудыг өөртөө нэгтгэж тайлагнах "
+"зорилготой\\n\r\n"
+"  өглөг, авлага төрөлтэй данс нь харилцагчийн гүйлгээнд хэрэглэгдэнэ\\n\r\n"
+"  хаагдсан төрөлтэй данс нь хэрэглэгдэхээ больсон гэсэн үг юм."
 
 #. module: account
 #: model:ir.ui.menu,name:account.menu_account_end_year_treatments
 msgid "End of Year Treatments"
-msgstr ""
+msgstr "Жилийн төгсгөлийн боловсруулалт"
 
 #. module: account
 #: model:ir.ui.menu,name:account.menu_generic_report
 msgid "Generic Reports"
-msgstr ""
+msgstr "Ерөнхий тайлангууд"
 
 #. module: account
 #: wizard_field:account.automatic.reconcile,init,power:0
 msgid "Power"
-msgstr ""
+msgstr "Хүч"
 
 #. module: account
 #: wizard_view:account.analytic.line,init:0
 msgid "Account Analytic Lines Analysis"
-msgstr ""
+msgstr "Аналитик дансны бичилт шинжилгээ"
 
 #. module: account
 #: rml:account.invoice:0
 msgid "Price"
-msgstr ""
+msgstr "Үнэ"
 
 #. module: account
 #: rml:account.analytic.account.journal:0
@@ -2698,27 +2715,27 @@ msgstr ""
 #: model:ir.ui.menu,name:account.account_analytic_def_chart
 #: model:ir.ui.menu,name:account.menu_action_analytic_account_tree2
 msgid "Analytic Chart of Accounts"
-msgstr ""
+msgstr "Аналитик дансны мод"
 
 #. module: account
 #: wizard_view:account.analytic.line,init:0
 msgid "View Account Analytic Lines"
-msgstr ""
+msgstr "Аналитик дансны бичилтийн харагдац"
 
 #. module: account
 #: wizard_view:account.move.validate,init:0
 msgid "Select Period and Journal for Validation"
-msgstr ""
+msgstr "Батлах шаардлагатай мөчлөг болон журналыг сонгох"
 
 #. module: account
 #: field:account.invoice,number:0
 msgid "Invoice Number"
-msgstr ""
+msgstr "Нэхэмжлэлийн дугаар"
 
 #. module: account
 #: field:account.period,date_stop:0
 msgid "End of Period"
-msgstr ""
+msgstr "Мөчлөг дуусах"
 
 #. module: account
 #: wizard_button:populate_statement_from_inv,go,finish:0
@@ -2728,24 +2745,24 @@ msgstr ""
 #. module: account
 #: field:account.invoice,amount_untaxed:0
 msgid "Untaxed"
-msgstr ""
+msgstr "Татвар ноогдохүй"
 
 #. module: account
 #: model:ir.actions.report.xml,name:account.account_analytic_account_inverted_balance
 #: model:ir.actions.wizard,name:account.account_analytic_account_inverted_balance_report
 msgid "Inverted Analytic Balance"
-msgstr ""
+msgstr "Тонгоруулсан аналитик баланс"
 
 #. module: account
 #: field:account.tax,applicable_type:0
 #: field:account.tax.template,applicable_type:0
 msgid "Applicable Type"
-msgstr ""
+msgstr "Хэрэглэх төрөл"
 
 #. module: account
 #: field:account.invoice,reference:0
 msgid "Invoice Reference"
-msgstr ""
+msgstr "Нэхэмжлэлийн дугаарлалт"
 
 #. module: account
 #: field:account.account,name:0
@@ -2761,7 +2778,7 @@ msgstr ""
 #: field:account.move.reconcile,name:0
 #: field:account.subscription,name:0
 msgid "Name"
-msgstr ""
+msgstr "Нэр"
 
 #. module: account
 #: wizard_view:account.move.line.reconcile,init_full:0
@@ -2787,7 +2804,7 @@ msgstr ""
 #. module: account
 #: field:account.move.line,date:0
 msgid "Effective date"
-msgstr ""
+msgstr "Огноо"
 
 #. module: account
 #: help:account.tax.template,sequence:0
@@ -2796,6 +2813,9 @@ msgid ""
 "higher ones. The order is important if you have a tax that has several tax "
 "children. In this case, the evaluation order is important."
 msgstr ""
+"Нэг татварын дотор орших дэд татваруудын хувьд аль нь эхэлж тооцоологдохыг "
+"илэрхийлэх эрэмбэ буюу дараалал. Татварууд бага эрэмбээсээ эхэлж "
+"тооцоологдоно."
 
 #. module: account
 #: field:account.journal.column,view_id:0
@@ -2803,7 +2823,7 @@ msgstr ""
 #: field:account.journal.view,name:0
 #: model:ir.model,name:account.model_account_journal_view
 msgid "Journal View"
-msgstr ""
+msgstr "Журналын харагдац"
 
 #. module: account
 #: selection:account.move.line,centralisation:0
@@ -2813,12 +2833,12 @@ msgstr ""
 #. module: account
 #: rml:account.overdue:0
 msgid "Customer Ref:"
-msgstr ""
+msgstr "Худалдан авагчийн дугаар"
 
 #. module: account
 #: xsl:account.transfer:0
 msgid "Partner ID"
-msgstr ""
+msgstr "Харилцагчийн дугаар"
 
 #. module: account
 #: wizard_view:account.automatic.reconcile,init:0
@@ -2830,13 +2850,13 @@ msgstr ""
 #. module: account
 #: view:account.move.line:0
 msgid "Total credit"
-msgstr ""
+msgstr "Нийт кредит"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_invoice_tree1_new
 #: model:ir.ui.menu,name:account.menu_action_invoice_tree1_new
 msgid "New Customer Invoice"
-msgstr ""
+msgstr "Шинэ худалдан авагчийн нэхэмжлэл"
 
 #. module: account
 #: field:account.account,reconcile:0
@@ -2848,22 +2868,22 @@ msgstr ""
 #: wizard_button:account.move.line.reconcile,addendum,reconcile:0
 #: wizard_button:account.move.line.reconcile,init_full,reconcile:0
 msgid "Reconcile"
-msgstr ""
+msgstr "Банкны тулгалт"
 
 #. module: account
 #: rml:account.overdue:0
 msgid "Best regards."
-msgstr ""
+msgstr "Хүндэтгэсэн."
 
 #. module: account
 #: model:ir.model,name:account.model_report_hr_timesheet_invoice_journal
 msgid "Analytic account costs and revenues"
-msgstr ""
+msgstr "Аналитик дансны зардал болон орлого"
 
 #. module: account
 #: wizard_view:account.invoice.refund,init:0
 msgid "Are you sure you want to refund this invoice ?"
-msgstr ""
+msgstr "Та энэ нэхэмжлэлийг буцаахдаа итгэлтэй байна уу?"
 
 #. module: account
 #: model:ir.actions.wizard,name:account.wizard_paid_open
@@ -2873,7 +2893,7 @@ msgstr ""
 #. module: account
 #: field:account.journal,entry_posted:0
 msgid "Skip 'Draft' State for Created Entries"
-msgstr ""
+msgstr "Үүссэн гүйлгээг шууд батлах"
 
 #. module: account
 #: field:account.invoice.tax,account_id:0
@@ -2884,12 +2904,12 @@ msgstr "Татварын данс"
 #. module: account
 #: model:process.transition,note:account.process_transition_statemententries0
 msgid "From statement, create entries"
-msgstr ""
+msgstr "Хуулгаас гүйлгээнүүдийг үүсгэх"
 
 #. module: account
 #: field:account.analytic.account,complete_name:0
 msgid "Full Account Name"
-msgstr ""
+msgstr "Дансны бүтэн нэр"
 
 #. module: account
 #: rml:account.account.balance:0
@@ -2903,54 +2923,54 @@ msgstr ""
 #: rml:account.third_party_ledger_other:0
 #: rml:account.vat.declaration:0
 msgid "1cm 27.7cm 20cm 27.7cm"
-msgstr ""
+msgstr "1см 27.7см 20см 27.7см"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_invoice_tree12
 #: model:ir.ui.menu,name:account.menu_action_invoice_tree12
 msgid "Draft Supplier Refunds"
-msgstr ""
+msgstr "Нийлүүлэгчийн ноорог буцаалт"
 
 #. module: account
 #: model:process.node,name:account.process_node_accountingstatemententries0
 msgid "Accounting Statement"
-msgstr ""
+msgstr "Дансны хуулга"
 
 #. module: account
 #: rml:account.overdue:0
 msgid "Document: Customer account statement"
-msgstr ""
+msgstr "Баримт: Худалдан авагчийн дансны хуулга"
 
 #. module: account
 #: view:product.product:0
 #: view:product.template:0
 #: view:res.partner:0
 msgid "Accounting"
-msgstr ""
+msgstr "Санхүү бүртгэл"
 
 #. module: account
 #: view:account.fiscal.position.template:0
 msgid "Taxes Mapping"
-msgstr ""
+msgstr "Татваруудын зурагжуулалт"
 
 #. module: account
 #: wizard_view:account.move.line.unreconcile,init:0
 #: wizard_view:account.reconcile.unreconcile,init:0
 msgid "Unreconciliation transactions"
-msgstr ""
+msgstr "Тулгагдаагүй гүйлгээнүүд"
 
 #. module: account
 #: model:process.transition,note:account.process_transition_paymentorderbank0
 #: model:process.transition,note:account.process_transition_paymentorderreconcilation0
 msgid "Reconcilation of entries from payment order."
-msgstr ""
+msgstr "Төлбөрийн ордероос гүйлгээнүүдийн тулгалт."
 
 #. module: account
 #: field:account.bank.statement,move_line_ids:0
 #: model:ir.actions.act_window,name:account.act_account_journal_2_account_move_line
 #: model:ir.model,name:account.model_account_move_line
 msgid "Entry lines"
-msgstr ""
+msgstr "Журналын бичилтүүд"
 
 #. module: account
 #: wizard_view:account.automatic.reconcile,init:0
@@ -2961,7 +2981,7 @@ msgstr ""
 #: model:process.node,name:account.process_node_reconciliation0
 #: model:process.node,name:account.process_node_supplierreconciliation0
 msgid "Reconciliation"
-msgstr ""
+msgstr "Тулгагдсан бичилтүүд"
 
 #. module: account
 #: field:account.move.line,centralisation:0
@@ -2975,33 +2995,33 @@ msgstr ""
 #: field:account.tax.template,tax_code_id:0
 #: model:ir.model,name:account.model_account_tax_code
 msgid "Tax Code"
-msgstr ""
+msgstr "Татварын ангилал"
 
 #. module: account
 #: rml:account.analytic.account.journal:0
 msgid "Analytic Journal -"
-msgstr ""
+msgstr "Аналитик журнал -"
 
 #. module: account
 #: rml:account.analytic.account.analytic.check:0
 msgid "Analytic Debit"
-msgstr ""
+msgstr "Аналитик дебит"
 
 #. module: account
 #: field:account.account,currency_mode:0
 msgid "Outgoing Currencies Rate"
-msgstr ""
+msgstr "Гаралтын валютын ханш"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_invoice_tree10
 #: model:ir.ui.menu,name:account.menu_action_invoice_tree10
 msgid "Draft Customer Refunds"
-msgstr ""
+msgstr "Худалдан авагчийн ноорог буцаалт"
 
 #. module: account
 #: field:account.journal.column,readonly:0
 msgid "Readonly"
-msgstr ""
+msgstr "Зөвхөн харах"
 
 #. module: account
 #: help:account.model.line,date_maturity:0
@@ -3015,28 +3035,28 @@ msgstr ""
 #: selection:account.analytic.journal,type:0
 #: selection:account.journal,type:0
 msgid "Situation"
-msgstr ""
+msgstr "Орон байрлал"
 
 #. module: account
 #: rml:account.invoice:0
 #: xsl:account.transfer:0
 msgid "Document"
-msgstr ""
+msgstr "Баримт бичиг"
 
 #. module: account
 #: help:account.move.line,move_id:0
 msgid "The move of this entry line."
-msgstr ""
+msgstr "Уг журналын бичилтийг агуулж буй ажил гүйлгээ."
 
 #. module: account
 #: field:account.invoice.line,uos_id:0
 msgid "Unit of Measure"
-msgstr ""
+msgstr "Хэмжих нэгж"
 
 #. module: account
 #: field:account.chart.template,property_account_receivable:0
 msgid "Receivable Account"
-msgstr ""
+msgstr "Авлагын данс"
 
 #. module: account
 #: help:account.journal,group_invoice_lines:0
@@ -3044,6 +3064,8 @@ msgid ""
 "If this box is checked, the system will try to group the accounting lines "
 "when generating them from invoices."
 msgstr ""
+"Хэрэв үүнийг сонговол нэхэмжлэлээс үүдэлтэй гүйлгээний бичилтүүдийг систем "
+"нэхэмжлэлийн дагуу нэгтгэх гэж оролдоно."
 
 #. module: account
 #: wizard_field:account.move.line.reconcile,init_full,trans_nbr:0
@@ -3054,7 +3076,7 @@ msgstr ""
 #. module: account
 #: model:ir.actions.wizard,name:account.wizard_invoice_state_cancel
 msgid "Cancel selected invoices"
-msgstr ""
+msgstr "Сонгогдсон нэхэмжлэлүүдийг цуцлах"
 
 #. module: account
 #: view:account.analytic.journal:0
@@ -3063,12 +3085,12 @@ msgstr ""
 #: model:ir.actions.report.xml,name:account.analytic_journal_print
 #: model:ir.actions.wizard,name:account.account_analytic_account_journal_report
 msgid "Analytic Journal"
-msgstr ""
+msgstr "Аналитик журнал"
 
 #. module: account
 #: rml:account.general.ledger:0
 msgid "Entry Label"
-msgstr ""
+msgstr "Гүйлгээний нэр"
 
 #. module: account
 #: model:process.transition,note:account.process_transition_paymentreconcile0
@@ -3085,37 +3107,37 @@ msgstr ""
 #: view:account.period:0
 #: view:account.subscription:0
 msgid "Set to Draft"
-msgstr ""
+msgstr "Ноорог болгох"
 
 #. module: account
 #: help:account.invoice,origin:0
 #: help:account.invoice.line,origin:0
 msgid "Reference of the document that produced this invoice."
-msgstr ""
+msgstr "Reference of the document that produced this invoice."
 
 #. module: account
 #: selection:account.account,type:0
 #: selection:account.account.template,type:0
 #: selection:account.aged.trial.balance,init,result_selection:0
 msgid "Payable"
-msgstr ""
+msgstr "Өглөг"
 
 #. module: account
 #: rml:account.invoice:0
 #: field:account.invoice.tax,base:0
 msgid "Base"
-msgstr ""
+msgstr "Суурь"
 
 #. module: account
 #: field:account.model,name:0
 msgid "Model Name"
-msgstr ""
+msgstr "Моделийн нэр"
 
 #. module: account
 #: selection:account.account,type:0
 #: selection:account.account.template,type:0
 msgid "Others"
-msgstr ""
+msgstr "Бусад"
 
 #. module: account
 #: selection:account.automatic.reconcile,init,power:0
@@ -3127,7 +3149,7 @@ msgstr ""
 #: view:account.move:0
 #: wizard_button:account.move.validate,init,validate:0
 msgid "Validate"
-msgstr ""
+msgstr "Батлах"
 
 #. module: account
 #: view:account.model:0
@@ -3161,7 +3183,7 @@ msgstr ""
 #: wizard_field:account.move.line.unreconcile.select,init,account_id:0
 #: model:ir.model,name:account.model_account_account
 msgid "Account"
-msgstr ""
+msgstr "Данс"
 
 #. module: account
 #: model:account.journal,name:account.bank_journal
@@ -3174,7 +3196,7 @@ msgstr ""
 #: selection:account.partner.balance.report,init,state:0
 #: selection:account.third_party_ledger.report,init,state:0
 msgid "By Date and Period"
-msgstr ""
+msgstr "Огноо болон мөчлөгөөр"
 
 #. module: account
 #: view:account.account:0
@@ -3185,7 +3207,7 @@ msgstr ""
 #: view:account.invoice.line:0
 #: field:account.invoice.line,note:0
 msgid "Notes"
-msgstr ""
+msgstr "Тэмдэглэлүүд"
 
 #. module: account
 #: help:account.invoice,reconciled:0
@@ -3202,17 +3224,17 @@ msgstr ""
 #: model:ir.ui.menu,name:account.menu_action_tax_form
 #: model:ir.ui.menu,name:account.next_id_27
 msgid "Taxes"
-msgstr ""
+msgstr "Татварууд"
 
 #. module: account
 #: wizard_view:account.fiscalyear.close,init:0
 msgid "Close Fiscal Year with new entries"
-msgstr ""
+msgstr "Шинэ гүйлгээ үүсгэж санхүүгийн жил хаах"
 
 #. module: account
 #: selection:account.account,currency_mode:0
 msgid "Average Rate"
-msgstr ""
+msgstr "Дундаж ханшаар"
 
 #. module: account
 #: model:process.node,note:account.process_node_bankstatement0
@@ -3237,12 +3259,12 @@ msgstr ""
 #: rml:account.partner.balance:0
 #: field:account.period,code:0
 msgid "Code"
-msgstr ""
+msgstr "Код"
 
 #. module: account
 #: model:ir.ui.menu,name:account.menu_finance
 msgid "Financial Management"
-msgstr ""
+msgstr "Санхүүгийн менежмент"
 
 #. module: account
 #: selection:account.account.type,close_method:0
@@ -3255,12 +3277,12 @@ msgstr ""
 #: model:ir.actions.wizard,name:account.wizard_fiscalyear_close
 #: model:ir.ui.menu,name:account.menu_wizard_fy_close
 msgid "Generate Fiscal Year Opening Entries"
-msgstr ""
+msgstr "Нээлтийн гүйлгээтэй санхүүгийн жил үүсгэх"
 
 #. module: account
 #: model:ir.actions.wizard,name:account.wizard_reconcile
 msgid "Reconcile Entries"
-msgstr ""
+msgstr "Гүйлгээг тулгалт хийх"
 
 #. module: account
 #: wizard_view:account.wizard_paid_open,init:0
@@ -3270,29 +3292,29 @@ msgstr ""
 #. module: account
 #: view:account.invoice:0
 msgid "Additionnal Information"
-msgstr ""
+msgstr "Нэмэлт мэдээлэл"
 
 #. module: account
 #: field:account.tax,name:0
 #: field:account.tax.template,name:0
 #: rml:account.vat.declaration:0
 msgid "Tax Name"
-msgstr ""
+msgstr "Татварын нэр"
 
 #. module: account
 #: wizard_view:account.fiscalyear.close.state,init:0
 msgid " Close states of Fiscal year and periods"
-msgstr ""
+msgstr " Санхүүгийн жил болон мөчлөгүүдийн төлвийг хаах"
 
 #. module: account
 #: model:account.payment.term,name:account.account_payment_term
 msgid "30 Days End of Month"
-msgstr ""
+msgstr "Сарын төгөсгөл 30 өдөр"
 
 #. module: account
 #: field:account.chart.template,tax_code_root_id:0
 msgid "Root Tax Code"
-msgstr ""
+msgstr "Толгой татварын ангилал"
 
 #. module: account
 #: constraint:account.invoice:0
@@ -3303,44 +3325,44 @@ msgstr ""
 #: field:account.tax.code,notprintable:0
 #: field:account.tax.code.template,notprintable:0
 msgid "Not Printable in Invoice"
-msgstr ""
+msgstr "Нэхэмжлэлд тусгагдахгүй"
 
 #. module: account
 #: field:account.move.line,move_id:0
 msgid "Move"
-msgstr ""
+msgstr "Ажил гүйлгээ"
 
 #. module: account
 #: field:account.fiscal.position.tax,tax_src_id:0
 #: field:account.fiscal.position.tax.template,tax_src_id:0
 msgid "Tax Source"
-msgstr ""
+msgstr "Эх татвар"
 
 #. module: account
 #: model:ir.actions.report.xml,name:account.account_analytic_account_balance
 #: model:ir.actions.wizard,name:account.account_analytic_account_balance_report
 msgid "Analytic Balance"
-msgstr ""
+msgstr "Аналитик баланс"
 
 #. module: account
 #: view:account.move.line:0
 msgid "Total debit"
-msgstr ""
+msgstr "Нийт дебит"
 
 #. module: account
 #: selection:account.analytic.account,state:0
 msgid "Pending"
-msgstr ""
+msgstr "Хүлээсэн"
 
 #. module: account
 #: view:wizard.multi.charts.accounts:0
 msgid "Bank Information"
-msgstr ""
+msgstr "Банкны мэдээлэл"
 
 #. module: account
 #: rml:account.invoice:0
 msgid "Fax :"
-msgstr ""
+msgstr "факс :"
 
 #. module: account
 #: rml:account.partner.balance:0
@@ -3348,7 +3370,7 @@ msgstr ""
 #: model:ir.actions.wizard,name:account.wizard_partner_balance_report
 #: model:ir.ui.menu,name:account.menu_partner_balance
 msgid "Partner Balance"
-msgstr ""
+msgstr "Харилцагчийн баланс"
 
 #. module: account
 #: rml:account.third_party_ledger:0
@@ -3361,7 +3383,7 @@ msgstr ""
 msgid ""
 "This account will be used instead of the default one as the receivable "
 "account for the current partner"
-msgstr ""
+msgstr "Энэ бол тухайн харилцагчийн авлагын бичилт хийх тогтсон данс юм"
 
 #. module: account
 #: selection:account.tax,applicable_type:0
@@ -3373,17 +3395,17 @@ msgstr ""
 #: field:account.tax.template,python_compute:0
 #: selection:account.tax.template,type:0
 msgid "Python Code"
-msgstr ""
+msgstr "Програмчлал"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.act_account_journal_2_account_bank_statement
 msgid "Bank statements"
-msgstr ""
+msgstr "Банкны хуулга"
 
 #. module: account
 #: model:ir.ui.menu,name:account.next_id_22
 msgid "Partner Accounts"
-msgstr ""
+msgstr "Харилцагчийн дансууд"
 
 #. module: account
 #: help:account.tax.template,tax_group:0
@@ -3391,23 +3413,25 @@ msgid ""
 "If a default tax if given in the partner it only override taxes from account "
 "(or product) of the same group."
 msgstr ""
+"Хэрэв харилцагч дээр тогтсон татвар сонгосон бол тухайн татвартай ижил "
+"группийн татваруудаас сонгох боломжтой байна."
 
 #. module: account
 #: view:account.bank.statement:0
 msgid "Real Entries"
-msgstr ""
+msgstr "Жинхэнэ гүйлгээнүүд"
 
 #. module: account
 #: model:process.node,name:account.process_node_importinvoice0
 msgid "Import invoice"
-msgstr ""
+msgstr "Нэхэмжлэл оруулах"
 
 #. module: account
 #: view:account.invoice:0
 #: view:wizard.company.setup:0
 #: view:wizard.multi.charts.accounts:0
 msgid "Create"
-msgstr ""
+msgstr "Үүсгэх"
 
 #. module: account
 #: model:process.transition.action,name:account.process_transition_action_createentries0
@@ -3417,13 +3441,13 @@ msgstr ""
 #. module: account
 #: model:ir.model,name:account.model_account_invoice_line
 msgid "Invoice line"
-msgstr ""
+msgstr "Нэхэмжлэлийн гүйлгээ"
 
 #. module: account
 #: field:account.account,shortcut:0
 #: field:account.account.template,shortcut:0
 msgid "Shortcut"
-msgstr ""
+msgstr "Богино холбоос"
 
 #. module: account
 #: wizard_view:account.move.validate,init:0
@@ -3431,6 +3455,8 @@ msgid ""
 "All draft account entries in this journal and period will be validated. It "
 "means you won't be able to modify their accouting fields."
 msgstr ""
+"Тухайн журналын тухайн мөчлөгөд бичигдсэн бүх ноорог бичилтүүдийг батална. "
+"Ингэснээр тухайн бичилтүүдийг засварлах боломжгүй болно."
 
 #. module: account
 #: selection:account.model.line,date:0
@@ -3449,7 +3475,7 @@ msgstr ""
 #: field:account.tax,parent_id:0
 #: field:account.tax.template,parent_id:0
 msgid "Parent Tax Account"
-msgstr ""
+msgstr "Эцэг татварын данс"
 
 #. module: account
 #: field:account.account,user_type:0
@@ -3458,12 +3484,12 @@ msgstr ""
 #: field:account.analytic.account,type:0
 #: model:ir.model,name:account.model_account_account_type
 msgid "Account Type"
-msgstr ""
+msgstr "Дансны төрөл"
 
 #. module: account
 #: view:res.partner:0
 msgid "Bank account owner"
-msgstr ""
+msgstr "Банкны данс эзэмшигч"
 
 #. module: account
 #: wizard_view:account.account.balance.report,checktype:0
@@ -3471,23 +3497,23 @@ msgstr ""
 #: wizard_view:account.partner.balance.report,init:0
 #: wizard_view:account.third_party_ledger.report,init:0
 msgid "Filter on Periods"
-msgstr ""
+msgstr "Filter on Periods"
 
 #. module: account
 #: field:res.partner,property_account_receivable:0
 msgid "Account Receivable"
-msgstr ""
+msgstr "Авлагын данс"
 
 #. module: account
 #: wizard_button:account.invoice.pay,addendum,reconcile:0
 msgid "Pay and reconcile"
-msgstr ""
+msgstr "Өглөг ба тулгалт"
 
 #. module: account
 #: rml:account.central.journal:0
 #: model:ir.actions.report.xml,name:account.account_central_journal
 msgid "Central Journal"
-msgstr ""
+msgstr "Төв журнал"
 
 #. module: account
 #: rml:account.third_party_ledger:0
@@ -3498,7 +3524,7 @@ msgstr ""
 #. module: account
 #: field:account.account,child_consol_ids:0
 msgid "Consolidated Children"
-msgstr ""
+msgstr "Нэгтгэгдсэн дэд дансууд"
 
 #. module: account
 #: wizard_field:account.account.balance.report,checktype,fiscalyear:0
@@ -3507,18 +3533,18 @@ msgstr ""
 #: wizard_field:account.partner.balance.report,init,fiscalyear:0
 #: wizard_field:account.third_party_ledger.report,init,fiscalyear:0
 msgid "Fiscal year"
-msgstr ""
+msgstr "Санхүүгийн жил"
 
 #. module: account
 #: rml:account.overdue:0
 msgid "Balance :"
-msgstr ""
+msgstr "Баланс :"
 
 #. module: account
 #: selection:account.account.balance.report,checktype,display_account:0
 #: selection:account.general.ledger.report,checktype,display_account:0
 msgid "With balance is not equal to 0"
-msgstr ""
+msgstr "Баланс нь тэгээс ялгаатай"
 
 #. module: account
 #: selection:account.automatic.reconcile,init,power:0
@@ -3528,33 +3554,33 @@ msgstr ""
 #. module: account
 #: model:ir.actions.report.xml,name:account.account_vat_declaration
 msgid "Taxes Report"
-msgstr ""
+msgstr "Татварын мэдээлэл"
 
 #. module: account
 #: selection:account.journal.period,state:0
 msgid "Printed"
-msgstr ""
+msgstr "Хэвлэгдсэн"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_invoice_tree4_new
 #: model:ir.ui.menu,name:account.menu_action_invoice_tree4_new
 msgid "New Supplier Refund"
-msgstr ""
+msgstr "Шинэ нийлүүлэгчийн буцаалт"
 
 #. module: account
 #: view:account.model:0
 msgid "Entry Model"
-msgstr ""
+msgstr "Гүйлгээний модель"
 
 #. module: account
 #: wizard_field:account.general.ledger.report,checktype,amount_currency:0
 msgid "With Currency"
-msgstr ""
+msgstr "Валютаар"
 
 #. module: account
 #: view:account.account:0
 msgid "Chart of accounts"
-msgstr ""
+msgstr "Дансны мод"
 
 #. module: account
 #: field:account.subscription.line,subscription_id:0
@@ -3564,18 +3590,18 @@ msgstr ""
 #. module: account
 #: field:account.analytic.journal,code:0
 msgid "Journal code"
-msgstr ""
+msgstr "Журналын код"
 
 #. module: account
 #: wizard_button:account.fiscalyear.close,init,close:0
 #: view:account.model:0
 msgid "Create entries"
-msgstr ""
+msgstr "Гүйлгээ үүсгэх"
 
 #. module: account
 #: view:account.analytic.line:0
 msgid "Project line"
-msgstr ""
+msgstr "Төслийн бичилт"
 
 #. module: account
 #: wizard_field:account.automatic.reconcile,init,max_amount:0
@@ -3585,35 +3611,35 @@ msgstr ""
 #. module: account
 #: field:account.invoice.tax,manual:0
 msgid "Manual"
-msgstr ""
+msgstr "Гараар"
 
 #. module: account
 #: view:account.invoice:0
 msgid "Compute Taxes"
-msgstr ""
+msgstr "Татваруудыг тооцоолох"
 
 #. module: account
 #: field:wizard.multi.charts.accounts,code_digits:0
 msgid "# of Digits"
-msgstr ""
+msgstr "Оронгийн хэмжээ"
 
 #. module: account
 #: help:res.partner,property_payment_term:0
 msgid ""
 "This payment term will be used instead of the default one for the current "
 "partner"
-msgstr ""
+msgstr "Тухайн харилцагчид хэрэглэгдэх тогтсон төлбөрийн нөхцөл"
 
 #. module: account
 #: wizard_field:account.invoice.pay,addendum,comment:0
 #: wizard_field:account.invoice.pay,init,name:0
 msgid "Entry Name"
-msgstr ""
+msgstr "Гүйлгээний нэр"
 
 #. module: account
 #: help:account.invoice,account_id:0
 msgid "The partner account used for this invoice."
-msgstr ""
+msgstr "Уг нэхэмжлэл дээр хэрэглэгдэх харилцагчийн данс"
 
 #. module: account
 #: help:account.tax.code,notprintable:0
@@ -3622,6 +3648,8 @@ msgid ""
 "Check this box if you don't want any VAT related to this Tax Code to appear "
 "on invoices"
 msgstr ""
+"Уг ангилалд хамрагдах татварууд нэхэмжлэл дээр тусгагдахгүй буюу татвар "
+"тооцохгүй"
 
 #. module: account
 #: field:account.account.type,sequence:0
@@ -3634,28 +3662,28 @@ msgstr ""
 #: field:account.tax.template,sequence:0
 #: field:fiscalyear.seq,sequence_id:0
 msgid "Sequence"
-msgstr ""
+msgstr "Дугаарлалт"
 
 #. module: account
 #: model:ir.model,name:account.model_account_fiscal_position_template
 msgid "Template for Fiscal Position"
-msgstr ""
+msgstr "Санхүүгийн байршилын загвар"
 
 #. module: account
 #: view:account.bank.statement:0
 msgid "Entry encoding"
-msgstr ""
+msgstr "Гүйлгээний жагсаалт"
 
 #. module: account
 #: wizard_view:account.invoice.refund,init:0
 #: model:ir.actions.wizard,name:account.wizard_invoice_refund
 msgid "Credit Note"
-msgstr ""
+msgstr "Кредитийн тэмдэглэл"
 
 #. module: account
 #: model:ir.actions.todo,note:account.config_fiscalyear
 msgid "Define Fiscal Years and Select Charts of Account"
-msgstr ""
+msgstr "Санхүүгийн жилийг тодорхойлох болон дансны модыг сонгох"
 
 #. module: account
 #: wizard_field:account.move.line.reconcile,addendum,period_id:0
@@ -3665,12 +3693,12 @@ msgstr ""
 #. module: account
 #: selection:account.config.wizard,period:0
 msgid "3 Months"
-msgstr ""
+msgstr "3 сар"
 
 #. module: account
 #: wizard_view:account.move.journal,init:0
 msgid "Standard entries"
-msgstr ""
+msgstr "Стандарт гүйлгээнүүд"
 
 #. module: account
 #: help:account.account,check_history:0
@@ -3678,6 +3706,8 @@ msgid ""
 "Check this box if you want to print all entries when printing the General "
 "Ledger, otherwise it will only print its balance."
 msgstr ""
+"Ерөнхий дэвтэр хэвлэх үед тухайн дансны бүх гүйлгээг хэвлэх эсэх, сонгохгүй "
+"бол зөвхөн балансыг хэвлэнэ."
 
 #. module: account
 #: model:ir.model,name:account.model_account_payment_term_line
@@ -3688,7 +3718,7 @@ msgstr ""
 #: selection:account.config.wizard,period:0
 #: field:report.hr.timesheet.invoice.journal,name:0
 msgid "Month"
-msgstr ""
+msgstr "Сар"
 
 #. module: account
 #: model:ir.model,name:account.model_account_subscription
@@ -3700,7 +3730,7 @@ msgstr ""
 #: field:account.move.line,date_maturity:0
 #: rml:account.overdue:0
 msgid "Maturity date"
-msgstr ""
+msgstr "Maturity date"
 
 #. module: account
 #: view:account.subscription:0
@@ -3710,36 +3740,36 @@ msgstr ""
 #. module: account
 #: selection:account.print.journal.report,init,sort_selection:0
 msgid "By date"
-msgstr ""
+msgstr "Огноогоор"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_account_config_wizard_form
 msgid "Account Configure Wizard "
-msgstr ""
+msgstr "Данс тохиргооны хэсэг "
 
 #. module: account
 #: field:account.config.wizard,date1:0
 #: field:account.fiscalyear,date_start:0
 #: field:account.subscription,date_start:0
 msgid "Start Date"
-msgstr ""
+msgstr "Эхлэх огноо"
 
 #. module: account
 #: wizard_view:account.general.ledger.report,account_selection:0
 msgid "Select Chart"
-msgstr ""
+msgstr "Мод сонгох"
 
 #. module: account
 #: selection:account.chart,init,target_move:0
 #: model:ir.actions.report.xml,name:account.account_move_line_list
 msgid "All Entries"
-msgstr ""
+msgstr "All Entries"
 
 #. module: account
 #: model:process.node,name:account.process_node_draftinvoices0
 #: model:process.node,name:account.process_node_supplierdraftinvoices0
 msgid "Draft Invoices"
-msgstr ""
+msgstr "Ноорог нэхэмжлэлүүд"
 
 #. module: account
 #: model:ir.model,name:account.model_account_fiscal_position_tax_template
@@ -3749,18 +3779,18 @@ msgstr ""
 #. module: account
 #: rml:account.invoice:0
 msgid "Invoice Date"
-msgstr ""
+msgstr "Нэхэмжилсэн огноо"
 
 #. module: account
 #: selection:account.account.type,close_method:0
 msgid "Unreconciled"
-msgstr ""
+msgstr "Тулгагдаагүй гүйлгээ"
 
 #. module: account
 #: field:account.account,note:0
 #: field:account.account.template,note:0
 msgid "Note"
-msgstr ""
+msgstr "Тэмдэглэл"
 
 #. module: account
 #: model:ir.module.module,description:account.module_meta_information
@@ -3779,13 +3809,13 @@ msgstr ""
 #. module: account
 #: field:account.journal,sequence_id:0
 msgid "Entry Sequence"
-msgstr ""
+msgstr "Entry Sequence"
 
 #. module: account
 #: selection:account.account,type:0
 #: selection:account.account.template,type:0
 msgid "Closed"
-msgstr ""
+msgstr "Хаагдсан"
 
 #. module: account
 #: model:process.node,name:account.process_node_paymententries0
@@ -3796,13 +3826,14 @@ msgstr ""
 #: help:account.move.line,tax_code_id:0
 msgid "The Account can either be a base tax code or tax code account."
 msgstr ""
+"Уг данс нь татварын үндсэн данс эсвэл татварын ангилалын данс байж болно."
 
 #. module: account
 #: help:account.automatic.reconcile,init,account_ids:0
 msgid ""
 "If no account is specified, the reconciliation will be made using every "
 "accounts that can be reconcilied"
-msgstr ""
+msgstr "Хэрэв данс сонгохгүй бол тулгалт хийх боломжтой бүх дансаар тулгана"
 
 #. module: account
 #: model:ir.actions.act_window,name:account.action_wizard_company_setup_form
@@ -3814,7 +3845,7 @@ msgstr ""
 #: selection:account.tax,tax_group:0
 #: selection:account.tax.template,tax_group:0
 msgid "Other"
-msgstr ""
+msgstr "Бусад"
 
 #. module: account
 #: model:ir.actions.report.xml,name:account.account_general_ledger
@@ -3822,22 +3853,22 @@ msgstr ""
 #: model:ir.actions.wizard,name:account.wizard_general_ledger_report
 #: model:ir.ui.menu,name:account.menu_general_ledger
 msgid "General Ledger"
-msgstr ""
+msgstr "Ерөнхий дэвтэр"
 
 #. module: account
 #: field:account.journal.view,columns_id:0
 msgid "Columns"
-msgstr ""
+msgstr "Багана"
 
 #. module: account
 #: selection:account.general.ledger.report,checktype,sortbydate:0
 msgid "Movement"
-msgstr ""
+msgstr "Гүйлгээ"
 
 #. module: account
 #: help:account.period,special:0
 msgid "These periods can overlap."
-msgstr ""
+msgstr "Энэ мөчлөг дахин ашиглагдах эсэх."
 
 #. module: account
 #: help:product.template,property_account_expense:0
@@ -3845,6 +3876,8 @@ msgid ""
 "This account will be used instead of the default one to value outgoing stock "
 "for the current product"
 msgstr ""
+"Энэ бол тухайн бараа материалын зарлага хийж буй нөөцийг бичих тогтсон данс "
+"юм"
 
 #. module: account
 #: model:process.node,note:account.process_node_manually0
@@ -3855,7 +3888,7 @@ msgstr ""
 #: model:ir.actions.act_window,name:account.action_account_journal_form
 #: model:ir.ui.menu,name:account.menu_action_account_journal_form
 msgid "Financial Journals"
-msgstr ""
+msgstr "Санхүүгийн журналууд"
 
 #. module: account
 #: selection:account.account.balance.report,checktype,state:0
@@ -3863,12 +3896,12 @@ msgstr ""
 #: selection:account.partner.balance.report,init,state:0
 #: selection:account.third_party_ledger.report,init,state:0
 msgid "By Period"
-msgstr ""
+msgstr "Мөчлөгөөр"
 
 #. module: account
 #: help:account.invoice,date_invoice:0
 msgid "Keep empty to use the current date"
-msgstr ""
+msgstr "Хоосон орхивол одоогийн огноог хэрэглэнэ"
 
 #. module: account
 #: rml:account.overdue:0
@@ -3878,12 +3911,12 @@ msgstr ""
 #. module: account
 #: field:account.analytic.account,quantity_max:0
 msgid "Maximum Quantity"
-msgstr ""
+msgstr "Дээд тоо хэмжээ"
 
 #. module: account
 #: field:account.period,name:0
 msgid "Period Name"
-msgstr ""
+msgstr "Мөчлөгийн нэр"
 
 #. module: account
 #: help:account.analytic.journal,type:0
@@ -3892,16 +3925,19 @@ msgid ""
 "needs to create analytic entries, Open ERP will look for a matching journal "
 "of the same type."
 msgstr ""
+"Аналитик журналын төрөл зүйл. Ямар нэгэн баримт (жш: нэхэмжлэл) дээр "
+"аналитик гүйлгээ бичих шаардлагатай үед систем холбогдох журнал дээр "
+"автоматаар бичилт хийнэ."
 
 #. module: account
 #: field:account.journal,groups_id:0
 msgid "Groups"
-msgstr ""
+msgstr "Бүлгүүд"
 
 #. module: account
 #: rml:account.analytic.account.quantity_cost_ledger:0
 msgid "Code/Date"
-msgstr ""
+msgstr "Код/Огноо"
 
 #. module: account
 #: field:account.account,active:0
@@ -3912,32 +3948,32 @@ msgstr ""
 #: field:account.payment.term,active:0
 #: field:account.tax,active:0
 msgid "Active"
-msgstr ""
+msgstr "Идэвхтэй"
 
 #. module: account
 #: model:process.node,note:account.process_node_electronicfile0
 msgid "Import from your bank statements"
-msgstr ""
+msgstr "Таны банкны хуулгануудаас оруулах"
 
 #. module: account
 #: view:account.chart.template:0
 msgid "Properties"
-msgstr ""
+msgstr "Нэмэлт Талбарууд"
 
 #. module: account
 #: view:res.partner:0
 msgid "Customer Accounting Properties"
-msgstr ""
+msgstr "Худалдан авагчийн санхүү бүртгэл"
 
 #. module: account
 #: view:account.bank.statement:0
 msgid "Select entries"
-msgstr ""
+msgstr "Гүйлгээг сонгох"
 
 #. module: account
 #: selection:account.chart,init,target_move:0
 msgid "All Posted Entries"
-msgstr ""
+msgstr "Бүх батлагдсан гүйлгээнүүд"
 
 #. module: account
 #: wizard_field:account.vat.declaration,init,based_on:0
index 920ffbf..b22a86e 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 12:26+0000\n"
-"Last-Translator: OpenERP Administrators <Unknown>\n"
+"PO-Revision-Date: 2010-08-06 16:49+0000\n"
+"Last-Translator: Grzegorz Grzelak (Cirrus.pl) <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: 2010-08-04 03:40+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: account
@@ -4458,6 +4458,9 @@ msgid ""
 "to the higher ones. The order is important if you have a tax with several "
 "tax children. In this case, the evaluation order is important."
 msgstr ""
+"Pole numeracji  jest stosowane do ustalania kolejności pozycji podatkowych "
+"od najniższej do najwyższej. Kolejność jest istotna, jeśli masz podatki z "
+"podatkami podrzędnymi."
 
 #. module: account
 #: view:account.tax:0
index 7ad16bf..75b5011 100644 (file)
         'report/report_auction_view.xml',
         'auction_wizard.xml',
         'board_auction_view.xml',
-        'board_auction_manager_view.xml',
+       # 'board_auction_manager_view.xml',
 
     ],
     'demo_xml': ['auction_demo.xml','board_auction_demo.xml'],
-    'test': ['test/auction.yml', 'test/auction_wizard.yml'],
+    'test': ['test/auction.yml'],
              
     'installable': True,
     'active': False,
index a1c21eb..f6aebbb 100644 (file)
@@ -293,7 +293,16 @@ class auction_lots(osv.osv):
                 elif name == "net_revenue":
                     if lot.auction_id:
                         result = lot.buyer_price - lot.seller_price - lot.costs
-
+                        
+                elif name == "gross_margin":
+                   if ((lot.obj_price==0) and (lot.state=='draft')):
+                     amount = lot.lot_est1
+                   else: 
+                     amount = lot.obj_price
+                   if amount > 0:
+                     result = (lot.gross_revenue * 100) / amount
+                     result = round(result,2)
+                     
                 elif name == "net_margin":
                     if ((lot.obj_price==0) and (lot.state=='draft')):
                         amount = lot.lot_est1
@@ -301,9 +310,11 @@ class auction_lots(osv.osv):
                         amount = lot.obj_price
                     if amount > 0:
                         result = (lot.net_revenue * 100) / amount
+                        result = round(result,2)
                 elif name == "costs":
                     # costs: Total credit of analytic account
                     # objects sold during this auction (excluding analytic lines that are in the analytic journal of the auction date)
+                    #TOCHECK: Calculation OF Indirect Cost
                     som = 0.0
                     if lot.auction_id:
                         auct_id = lot.auction_id.id
@@ -344,15 +355,15 @@ class auction_lots(osv.osv):
 
     _columns = {
         'bid_lines':fields.one2many('auction.bid_line', 'lot_id', 'Bids'), 
-        'auction_id': fields.many2one('auction.dates', 'Auctions', select=1, help="Auction For Objects"), 
-        'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Auction Deposit For Deposit Inventory"), 
-        'name': fields.char('Title', size=64, required=True, help='Auction Objects Name'), 
+        'auction_id': fields.many2one('auction.dates', 'Auction', select=1, help="Auction For Object"), 
+        'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Provide Deposit Information: seller, Withdrawned Method, Object, Deposit Costs"), 
+        'name': fields.char('Title', size=64, required=True, help='Auction Object Name'), 
         'name2': fields.char('Short Description (2)', size=64), 
         'lot_type': fields.selection(_type_get, 'Object category', size=64), 
         'author_right': fields.many2one('account.tax', 'Author rights', help="Account Tax For Author Commission"), 
-        'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price Of Objects"), 
-        'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price Of Objects"), 
-        'lot_num': fields.integer('List Number', required=True, select=1, help="List Number For selected Object in Deposit"), 
+        'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price"), 
+        'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price"), 
+        'lot_num': fields.integer('List Number', required=True, select=1, help="List Number In Depositer Inventory"), 
         'create_uid': fields.many2one('res.users', 'Created by', readonly=True), 
         'history_ids':fields.one2many('auction.lot.history', 'lot_id', 'Auction history'), 
         'lot_local':fields.char('Location', size=64, help="Auction Location"), 
@@ -362,15 +373,15 @@ class auction_lots(osv.osv):
         'product_id':fields.many2one('product.product', 'Product', required=True), 
         'obj_desc': fields.text('Object Description'), 
         'obj_num': fields.integer('Catalog Number'), 
-        'obj_ret': fields.float('Price retired', help="Objects Ret"), 
+        'obj_ret': fields.float('Price retired', help="Object Ret"), 
         'obj_comm': fields.boolean('Commission'), 
-        'obj_price': fields.float('Adjudication price', help="Objects Price"), 
+        'obj_price': fields.float('Adjudication price', help="Object Price"), 
         'ach_avance': fields.float('Buyer Advance'), 
         'ach_login': fields.char('Buyer Username', size=64), 
         'ach_uid': fields.many2one('res.partner', 'Buyer'),
-        'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True, help="Seller who is related to depositor Inventory"), 
-        'ach_emp': fields.boolean('Taken Away', readonly=True, help="When This Field is True means, Objects is taken away by Buyer"), 
-        'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Account Bank statement', This field is selected as True.", readonly=True), 
+        'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True), 
+        'ach_emp': fields.boolean('Taken Away', readonly=True, help="When state is Taken Away, This field is Marked as True"), 
+        'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Bank statement', This field is Marked"), 
         'ach_inv_id': fields.many2one('account.invoice', 'Buyer Invoice', readonly=True, states={'draft':[('readonly', False)]}), 
         'sel_inv_id': fields.many2one('account.invoice', 'Seller Invoice', readonly=True, states={'draft':[('readonly', False)]}), 
         'vnd_lim': fields.float('Seller limit'), 
@@ -388,14 +399,14 @@ class auction_lots(osv.osv):
                 \n* The \'Unsold\' state is used when object does not sold for long time, user can also set it as draft state after unsold. \
                 \n* The \'Paid\' state is used when user pay for the object \
                 \n* The \'Sold\' state is used when user buy the object.'), 
-        'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Objects Price which Buyer Given For Objects"), 
+        'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Buyer Price"), 
         'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price", help="Seller Price"), 
-        'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Revenue Minus Cost Of Objects Sold."), 
-        'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="Gross Income Divided by Net Sales"), 
-        'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Total credit of analytic account"), 
-        'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Account Bank statement Line For Given Buyer"), 
-        'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Total Revenue Minus Returns"), 
-        'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="The ratio of net profits to revenues"), 
+        'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"), 
+        'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"), 
+        'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Deposit cost"), 
+        'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement Line For Given Buyer"), 
+        'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"), 
+        'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"), 
     }
     _defaults = {
         'state':lambda *a: 'draft', 
index 4d594b6..885c085 100644 (file)
@@ -3,7 +3,7 @@
        <data>
                <!--<delete model="ir.actions.report.xml" search="[('model','like','auction.')]"/>-->
 
-    <report string="Listing Huissiers"
+    <report string="Bailiffs Listing"
                model="auction.lots"
                name="flagey.huissier"
                xsl="auction/report/huissier.xsl"
@@ -12,7 +12,6 @@
                multi="1"
                />
 
-
     <report string="Artists Biography"
                 model="auction.artists"
                 name="report.auction.artists"
@@ -45,7 +44,7 @@
 
 
        <report
-               string="Code barres du lot"
+               string="Barcode batch"
                model="auction.lots"
                name="auction.code_bar_lot"
                rml="auction/report/report_lot_bar_code.rml"
index 8fecd13..9f1ba5b 100644 (file)
@@ -40,7 +40,7 @@
         <field name="view_type">form</field>
         <field name="view_id" ref="view_auction_artist_tree"/>
     </record>
-    <menuitem name="Define Artists" parent="auction_config_menu" action="action_auction_artist" id="menu_auction_artist"/>
+    <menuitem name="Artists" parent="auction_config_menu" action="action_auction_artist" id="menu_auction_artist"/>
 
     
   <!--  Auction Management/Configuration/objectcategories  --> 
@@ -50,7 +50,7 @@
         <field name="model">auction.lot.category</field>
         <field name="type">tree</field>
         <field name="arch" type="xml">
-           <tree string="Lot Category">
+           <tree string="Object Categories">
                <field name="name"/>
            </tree>
         </field>
@@ -61,7 +61,7 @@
         <field name="model">auction.lot.category</field>
         <field name="type">form</field>
         <field name="arch" type="xml">
-           <form string="Lot Category">
+           <form string="Object Categories">
                <field name="name" colspan="4" select="1"/>
                <newline/>
                <field name="aie_categ" colspan="4"/>
                           </group>
                       </group>
                       <group colspan="4" col="6">
-                        <group colspan="2" col="1">
-                            <separator string="Authors" colspan="2"/>
+                        <group colspan="2" col="2">
+                            <separator string="Authors" colspan="4"/>
                             <field name="artist_id"/>
                             <field name="artist2_id"/>
                             <field name="author_right" domain="[('domain','=','sabam'),('parent_id','=',False),('type_tax_use','&lt;&gt;','sale')]"/>
                         </group>
-                        <group colspan="2" col="1">
+                        <group colspan="2" col="2">
                             <separator string="Price" colspan="4"/>
                             <field name="lot_est1"/>
                             <field name="lot_est2"/>
                             <field name="buyer_price"/>
                             <field name="obj_comm"/>
                         </group>
-                        <group colspan="2" col="1">
+                        <group colspan="2" col="2">
                             <separator string="Statistical" colspan="4"/>
                             <field name="gross_revenue"/>
                             <field name="net_revenue"/>
                                </field>
                             </group>
                     </page>
-                    
                 </notebook>
            </form>
         </field>
index e1d92d5..7a23328 100644 (file)
@@ -1,12 +1,62 @@
 <?xml version="1.0"?>
 <openerp>
-<data>
-        <record model="board.note.type" id="note_auction_type">
-            <field name="name">Auction</field>
+    <data>
+        <record model="board.note.type" id="note_auction_type1">
+            <field name="name">Auction DashBoard</field>
         </record>
-        <record model="ir.ui.view" id="board_auction_manager_form">
-            <field name="name">board.auction.manager.form</field>
+
+        <record model="ir.actions.act_window" id="action_report_latest_objects_tree">
+            <field name="res_model">auction.lots</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+        </record>
+        
+        <record model="ir.actions.act_window" id="action_report_latest_doposit_tree">
+            <field name="res_model">auction.deposit</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+        </record>      
+        
+        <record model="ir.ui.view" id="view_report_auction_estimation_adj_category_tree">
+             <field name="name">report.auction.estimation.adj.category.tree</field>
+            <field name="model">auction.lots</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+            <tree string="Min est/Adj/Max est">
+                <!--field name="date" select="1"/-->
+                <field name="create_uid" select="1"/>
+                <field name="lot_type" select="1"/>
+                <field name="lot_est1" select="1"/>
+                <field name="lot_est2" select="1"/>
+                <field name="obj_price" select="1"/>
+            </tree>
+        </field>
+    </record>
+
+    <record model="ir.ui.view" id="view_report_auction_lots_estimation_adj_category_graph">
+        <field name="name">report.auction.lots.estimation.adj.category.graph</field>
+        <field name="model">auction.lots</field>
+        <field name="type">graph</field>
+        <field name="arch" type="xml">
+            <graph string="Min est/Adj/Max est" orientation="vertical" type="bar">
+                <field name="lot_type" select="1"/>
+                <field name="lot_est1" operator="+"/>
+                <field name="obj_price" operator="+"/>
+                <field name="lot_est2" operator="+"/>
+                <field name="create_uid" group="True"/>
+            </graph>
+        </field>
+    </record>
+    
+    <record model="ir.actions.act_window" id="action_report_auction_lots_estimation_adj_category_tree">
+        <field name="name">Min est/Adj/Max est</field>
+        <field name="res_model">auction.lots</field>
+        <field name="view_type">form</field>
+        <field name="view_mode">graph,tree</field>
+    </record>  
+
+        <record model="ir.ui.view" id="board_auction_form1">
+            <field name="name">board.auction.form</field>
             <field name="model">board.board</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                     <hpaned position="100">
                         <child1>
                             <action
-                                string="My Latest Objects"
+                                string="Latest objects"
                                 name="%(auction.action_report_latest_objects_tree)d"
                                 height="200"
-                                width="510"/>
-                            <action string="My Latest Deposits"
-                                name="%(auction.action_report_latest_doposit_manager_tree)d"
-                                domain="[('create_uid','=',uid)]"
-                                />
+                                width="510"    />
+                            <action string="Latest deposits"
+                                name="%(auction.action_report_latest_doposit_tree)d"/>
                             <action string="Objects statistics"
-                                name="%(auction.action_report_object_encoded_member_tree)d"
+                                name="%(auction.action_report_object_encoded_tree)d"
                                 />
-                            </child1>
+                        </child1>
 
                         <child2>
-                            <button
-                                string="Menu"
-                                name="%(base.action_menu_admin)d"
-                                icon="gtk-justify-fill"
-                                type="action"
+                            <action
+                                string="Total Adjudications"
+                                name="%(auction.action_report_auction_adjudication_tree)d"
+                                view_mode="graph,tree"
                                 colspan="4"/>
-
                             <action
-                                string="My Objects By Day"
+                                string="Min/Adj/Max"
+                                name="%(auction.action_report_auction_lots_estimation_adj_category_tree)d"
+                                view_mode="graph,tree" colspan="4" />
+                            <action
+                                string="Objects by day"
                                 name="%(auction.action_report_auction_object_date_tree)d"
-                                view_mode="graph,tree" colspan="4"
-                                domain="[('user_id','=',uid),('month','=',time.strftime('%%Y-%%m-01'))]"/>
-                        <action
-                                string="Estimations/Adjudication"
-                                name="%(auction.action_report_auction_estimation_adj_category_member_tree)d"
-                                view_mode="graph,tree" colspan="4"/>
+                                view_mode="graph,tree" colspan="4" />
                         </child2>
                     </hpaned>
                 </form>
         </record>
 
         <record model="ir.actions.act_window" id="open_board_auction">
-            <field name="name">Auction member board</field>
+            <field name="name">Auction board</field>
             <field name="res_model">board.board</field>
             <field name="view_type">form</field>
             <field name="view_mode">form</field>
             <field name="usage">menu</field>
-            <field name="view_id" ref="board_auction_manager_form"/>
+            <field name="view_id" ref="board_auction_form1"/>
         </record>
+        
         <menuitem name="Dashboard" id="menu_board_auction" parent="auction.auction_report_menu" sequence="0"/>
+        
         <menuitem
-            name="Auction Member"
+            name="Auction DashBoard"
             action="open_board_auction"
-            sequence="2"
-            id="board_menu_auction_member" icon="terp-graph" parent="menu_board_auction" />
+            sequence="1"
+            id="menu_board_auction_open"  icon="terp-graph" parent="menu_board_auction"/>
 
-</data>
+    </data>
 </openerp>
-
index 40e0104..0eca114 100644 (file)
@@ -1,14 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:fo="http://www.w3.org/1999/XSL/Format">
-   <!-- TOFIX: Path Problem
-    <xsl:import href="../../base/report/corporate_defaults.xsl" /> -->
+    xmlns:fo="http://www.w3.org/1999/XSL/Format"/>
+   
+    <xsl:import href="corporate_defaults.xsl" />
     <xsl:template match="/">
         <xsl:call-template name="rml" />
     </xsl:template>
 
-
     <xsl:template name="rml" match="/">
         <document filename="example.pdf">
             <template>
@@ -62,3 +61,4 @@
             </story>
         </document>
     </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
index 29c5da5..5ce0419 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
 
-       <xsl:import href="../../base/report/corporate_defaults.xsl"/>
-       <xsl:import href="../../base/report/rml_template.xsl"/>
+       <xsl:import href="corporate_defaults.xsl"/>
+       <xsl:import href="rml_template.xsl"/>
        <xsl:variable name="page_format">a4_normal</xsl:variable>
 
        <xsl:template match="/">
index 4e22235..d24b86d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
-       <xsl:import href="../../base/report/corporate_defaults.xsl"/>
+       <xsl:import href="corporate_defaults.xsl"/>
        <xsl:template match="/">
                <xsl:apply-templates select="lots"/>
        </xsl:template>
index 27c57f4..02611f5 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
-       <xsl:import href="../../base/report/corporate_defaults.xsl"/>
+       <xsl:import href="corporate_defaults.xsl"/>
 
        <xsl:template match="/">
                <xsl:apply-templates select="lots"/>
index 1b88f93..79ae4ac 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
-       <xsl:import href="../../base/report/corporate_defaults.xsl"/>
-       <xsl:import href="../../base/report/rml_template.xsl"/>
+       <xsl:import href="corporate_defaults.xsl"/>
+       <xsl:import href="rml_template.xsl"/>
 
        <xsl:template match="/">
                <xsl:call-template name="rml"/>
index 9675683..bb61596 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
-       <xsl:import href="../../base/report/corporate_defaults.xsl"/>
+       <xsl:import href="corporate_defaults.xsl"/>
        <xsl:template match="/">
                <xsl:apply-templates select="lots"/>
        </xsl:template>
index 1dd6bda..b388406 100644 (file)
@@ -3,8 +3,8 @@
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:fo="http://www.w3.org/1999/XSL/Format">
 
-    <xsl:import href="../../base/report/corporate_defaults.xsl"/>
-    <xsl:import href="../../base/report/rml_template.xsl"/>
+    <xsl:import href="corporate_defaults.xsl"/>
+    <xsl:import href="rml_template.xsl"/>
     <xsl:variable name="page_format">a4_normal</xsl:variable>
 
     <xsl:template name="stylesheet">
index 3dffc25..9ce346a 100644 (file)
@@ -53,9 +53,9 @@ class report_auction(osv.osv):
         'buyer':fields.many2one('res.partner', 'Buyer', readonly=True, select=2), 
         'seller': fields.many2one('res.partner', 'Seller', readonly=True, select=1),
         'object':fields.integer('No of objects', readonly=True, select=1), 
-        'total_price':fields.float('Total Adj.', digits=(16, 2), readonly=True, select=2),
+        'total_price':fields.float('Total Price', digits=(16, 2), readonly=True, select=2),
         'lot_type': fields.selection(_type_get, 'Object category', size=64), 
-        'avg_price':fields.float('Avg Adj.', digits=(16, 2), readonly=True, select=2), 
+        'avg_price':fields.float('Avg Price.', digits=(16, 2), readonly=True, select=2), 
         'date': fields.date('Create Date', select=1),
         'auction': fields.many2one('auction.dates', 'Auction date', readonly=True, select=1),
         'gross_revenue':fields.float('Gross Revenue', readonly=True), 
@@ -112,7 +112,7 @@ report_auction()
 
 
 #==========================
-#Others Report for Dashboard (Employee & Manager)
+#Dashboard Report
 #==========================
 
 class report_auction_object_date(osv.osv):
@@ -145,42 +145,6 @@ class report_auction_object_date(osv.osv):
         """)
 report_auction_object_date()
 
-class report_auction_estimation_adj_category(osv.osv):
-    _name = "report.auction.estimation.adj.category"
-    _description = "comparaison estimate/adjudication "
-    _auto = False
-    _rec_name='date'
-    _columns = {
-            'lot_est1': fields.float('Minimum Estimation',select=2),
-            'lot_est2': fields.float('Maximum Estimation',select=2),
-#            'obj_price': fields.float('Adjudication price'),
-            'date': fields.date('Date', readonly=True,select=1),
-            'lot_type': fields.selection(_type_get, 'Object Type', size=64),
-            'adj_total': fields.float('Total Adjudication',select=2),
-            'user_id':fields.many2one('res.users', 'User', select=1)
-    }
-
-    def init(self, cr):
-        cr.execute("""
-            create or replace view report_auction_estimation_adj_category as (
-                select
-                   min(l.id) as id,
-                   to_char(l.create_date, 'YYYY-MM-01') as date,
-                   l.lot_type as lot_type,
-                   sum(l.lot_est1) as lot_est1,
-                   sum(l.lot_est2) as lot_est2,
-                   sum(l.obj_price) as adj_total,
-                   l.create_uid as user_id
-                from
-                    auction_lots l,auction_dates m
-                where
-                    l.auction_id=m.id and l.obj_price >0
-                group by
-                     to_char(l.create_date, 'YYYY-MM-01'),lot_type,l.create_uid
-            )
-        """)
-report_auction_estimation_adj_category()
-
 class report_auction_adjudication(osv.osv):
     _name = "report.auction.adjudication"
     _description = "report_auction_adjudication"
@@ -194,7 +158,6 @@ class report_auction_adjudication(osv.osv):
 
     }
 
-
     def init(self, cr):
         cr.execute("""
             create or replace view report_auction_adjudication as (
@@ -216,115 +179,11 @@ class report_auction_adjudication(osv.osv):
         """)
 report_auction_adjudication()
 
-class report_attendance(osv.osv):
-    _name="report.attendance"
-    _description = "Report Sign In/Out"
-    _auto = False
-    #_rec_name='date'
-    _columns = {
-        'name': fields.date('Date', readonly=True,select=1),
-        'employee_id' : fields.many2one('hr.employee', 'Employee', select=1, readonly=True),
-        'total_attendance': fields.float('Total', readonly=True),
-}
-    def init(self, cr):
-        cr.execute("""CREATE OR REPLACE VIEW report_attendance AS
-            SELECT
-                id,
-                name,
-                employee_id,
-                CASE WHEN SUM(total_attendance) < 0
-                    THEN (SUM(total_attendance) +
-                        CASE WHEN current_date <> name
-                            THEN 1440
-                            ELSE (EXTRACT(hour FROM current_time) * 60) + EXTRACT(minute FROM current_time)
-                        END
-                        )
-                    ELSE SUM(total_attendance)
-                END /60  as total_attendance
-            FROM (
-                SELECT
-                    max(a.id) as id,
-                    a.name::date as name,
-                    a.employee_id,
-                    SUM(((EXTRACT(hour FROM a.name) * 60) + EXTRACT(minute FROM a.name)) * (CASE WHEN a.action = 'sign_in' THEN -1 ELSE 1 END)) as total_attendance
-                FROM hr_attendance a
-                where name > current_date + interval '-1 day'
-                GROUP BY a.name::date, a.employee_id
-            ) AS fs
-            GROUP BY name,fs.id,employee_id
-            """)
-
-report_attendance()
-
-
-class report_deposit_border(osv.osv):
-    _name="report.deposit.border"
-    _description = "Report deposit border"
-    _auto = False
-    _rec_name='bord'
-    _columns = {
-        'bord': fields.char('Depositer Inventory', size=64, required=True),
-        'seller': fields.many2one('res.partner','Seller',select=1),
-        'moy_est' : fields.float('Avg. Est', select=1, readonly=True),
-        'total_marge': fields.float('Total margin', readonly=True),
-        'nb_obj':fields.float('# of objects', readonly=True),
-}
-    def init(self, cr):
-        cr.execute("""CREATE OR REPLACE VIEW report_deposit_border AS
-            SELECT
-                min(al.id) as id,
-                ab.partner_id as seller,
-                ab.name as bord,
-                COUNT(al.id) as nb_obj,
-                SUM((al.lot_est1 + al.lot_est2)/2) as moy_est,
-                SUM(al.net_revenue)/(count(ad.id)) as total_marge
-
-            FROM
-                auction_lots al,auction_deposit ab,auction_dates ad
-            WHERE
-                ad.id=al.auction_id
-                and al.bord_vnd_id=ab.id
-            GROUP BY
-                ab.name,ab.partner_id""")
-report_deposit_border()
-
 class report_object_encoded(osv.osv):
     _name = "report.object.encoded"
     _description = "Object encoded"
     _auto = False
     _columns = {
-        'state': fields.selection((('draft','Draft'),('unsold','Unsold'),('paid','Paid'),('invoiced','Invoiced')),'Status', required=True,select=1),
-        'user_id':fields.many2one('res.users', 'User', select=1),
-        'estimation': fields.float('Estimation',select=2),
-        'date': fields.date('Create Date',  required=True),
-#        'gross_revenue':fields.float('Gross revenue',readonly=True, select=2),
-#        'net_revenue':fields.float('Net revenue',readonly=True, select=2),
-#        'obj_margin':fields.float('Net margin', readonly=True, select=2),
-        'obj_ret':fields.integer('# obj ret', readonly=True, select=2),
-#        'adj':fields.integer('Adj.', readonly=True, select=2),
-        'obj_num':fields.integer('# of Encoded obj.', readonly=True, select=2),
-    }
-    def init(self, cr):
-        cr.execute('''create or replace view report_object_encoded  as
-            (select min(al.id) as id,
-                to_char(al.create_date, 'YYYY-MM-DD') as date,
-                al.state as state,
-                al.create_uid as user_id,
-                (SELECT count(1) FROM auction_lots WHERE obj_ret>0) as obj_ret,
-                sum((100* al.lot_est1)/al.obj_price) as estimation,
-                COUNT(al.product_id) as obj_num
-            from auction_lots al
-            where al.obj_price>0 and state='draft'
-            group by to_char(al.create_date, 'YYYY-MM-DD'), al.state, al.create_uid)
-             ''')
-report_object_encoded()
-
-
-class report_object_encoded_manager(osv.osv):
-    _name = "report.object.encoded.manager"
-    _description = "Object encoded"
-    _auto = False
-    _columns = {
         'user_id':fields.many2one('res.users', 'User', select=True),
         'estimation': fields.float('Estimation',select=True),
         'date': fields.date('Create Date',  required=True),
@@ -334,12 +193,14 @@ class report_object_encoded_manager(osv.osv):
         'obj_ret':fields.integer('# obj ret', readonly=True, select=True),
         'adj':fields.integer('Adj.', readonly=True, select=True),
         'obj_num':fields.integer('# of Encoded obj.', readonly=True, select=True),
+        'state': fields.selection((('draft','Draft'),('unsold','Unsold'),('paid','Paid'),('invoiced','Invoiced')),'Status', required=True,select=1),
     }
     def init(self, cr):
-        cr.execute('''create or replace view report_object_encoded_manager  as
+        cr.execute('''create or replace view report_object_encoded  as
             (select
                 min(al.id) as id,
                 to_char(al.create_date, 'YYYY-MM-DD') as date,
+                al.state as state,
                 al.create_uid as user_id,
                 sum((100*lot_est1)/obj_price) as estimation,
                 (SELECT count(1) FROM auction_lots WHERE obj_ret>0) as obj_ret,
@@ -350,46 +211,8 @@ class report_object_encoded_manager(osv.osv):
                 SUM(al.obj_price) as "adj"
             from auction_lots al
             where al.obj_price>0
-            group by to_char(al.create_date, 'YYYY-MM-DD'), al.create_uid)
+            group by to_char(al.create_date, 'YYYY-MM-DD'), al.state, al.create_uid)
              ''')
-report_object_encoded_manager()
+        
+report_object_encoded()
 
-class report_unclassified_objects(osv.osv):
-    _name = "report.unclassified.objects"
-    _description = "Unclassified objects "
-    _auto = False
-    _columns = {
-        'name': fields.char('Short Description',size=64, required=True),
-        'obj_num': fields.integer('Catalog Number'),
-        'obj_price': fields.float('Adjudication price'),
-        'lot_num': fields.integer('List Number', required=True, select=1 ),
-        'state': fields.selection((('draft','Draft'),('unsold','Unsold'),('paid','Paid'),('sold','Sold')),'Status', required=True, readonly=True),
-        'obj_comm': fields.boolean('Commission'),
-        'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True),
-        'ach_login': fields.char('Buyer Username',size=64),
-        'lot_est1': fields.float('Minimum Estimation'),
-        'lot_est2': fields.float('Maximum Estimation'),
-        'lot_type': fields.selection(_type_get, 'Object category', size=64),
-        'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
-    }
-    def init(self, cr):
-        cr.execute("""create or replace view report_unclassified_objects as
-            (select
-                min(al.id) as id,
-                al.name as name,
-                al.obj_price as obj_price,
-                al.obj_num as obj_num,
-                al.lot_num as lot_num,
-                al.state as state,
-                al.obj_comm as obj_comm,
-                al.bord_vnd_id as bord_vnd_id,
-                al.ach_login as ach_login,
-                al.lot_est1 as lot_est1,
-                al.lot_est2 as lot_est2,
-                al.lot_type as lot_type,
-                al.auction_id as auction
-            from auction_lots al,auction_lot_category ac
-            where (al.lot_type=ac.name) AND (ac.aie_categ='41') AND (al.auction_id is null)
-group by al.obj_price,al.obj_num, al.lot_num, al.state, al.obj_comm,al.bord_vnd_id,al.ach_login,al.lot_est1,al.lot_est2,al.lot_type,al.auction_id,al.name)
-             """)
-report_unclassified_objects()
index f601739..686cb80 100644 (file)
@@ -20,6 +20,7 @@
                 <field name="object" select="1" invisible="1"/>
                 <field name="state" select="1" invisible="1"/>
                 <field name="lot_type" select="1" invisible="1"/>
+                <field name="avg_estimation" />
                 <field name="avg_price" select="1"/>
                 <field name="gross_revenue" />
                 <field name="net_revenue" />
     </record>    
     
     <record model="ir.actions.act_window" id="action_report_auction">
-        <field name="name">Auction's Summary</field>
+        <field name="name">Auction Analysis</field>
         <field name="res_model">report.auction</field>
         <field name="view_type">form</field>
         <field name="view_mode">tree,graph</field>
         <field name="context">{'search_default_month':1}</field>
     </record>
     
-    <menuitem name="Auction" id="auction_report_auction_menu" parent="auction.auction_report_menu"/>
-    <menuitem name="Auction's Summary" action="action_report_auction" id="menu_report_auction" parent="auction_report_auction_menu"/>
+<!--    <menuitem name="Auction" id="auction_report_auction_menu" parent="auction.auction_report_menu"/>-->
+    <menuitem name="Auction Analysis" action="action_report_auction" id="menu_report_auction" parent="auction.auction_report_menu"/>
 
 <!--end : creating buyer Reporting menu for the buyer by pmo-->
 
-<!-- Employee and Manager Report -->
-
-
-        <record model="ir.ui.view" id="view_report_unplanned_object_tree">
-        <field name="name">Unplanned objects</field>
-        <field name="model">report.unplanned.object</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Unplanned Objects">
-                <field name="depos" select="1"/>
-                <field name="lot" select="1"/>
-                <field name="product_l" select="1"/>
-                <field name="lot_est1_l" select="2"/>
-                <field name="lot_est2_l" select="1"/>
-                <field name="artist_id_l" select="1"/>
-                <field name="name_l" select="1"/>
-                <field name="obj_desc_l" select="2"/>
-            </tree>
-        </field>
-    </record>
-        <record model="ir.ui.view" id="view_report_unplanned_object_form">
-            <field name="name">Unplanned objects</field>
-            <field name="model">report.unplanned.object</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-            <form string="Unplanned Objects">
-                <field name="depos" select="1"/>
-                <field name="lot" select="1"/>
-                <field name="product_l" select="1"/>
-                <field name="lot_est1_l" select="1"/>
-                <field name="lot_est2_l" select="1"/>
-                <field name="artist_id_l" select="1"/>
-                <field name="obj_desc_l" select="1"/>
-                <field name="name_l" select="1"/>
-            </form>
-        </field>
-    </record>
 
 =============================
-estimation.adj.category
-==============================
-    <record model="ir.ui.view" id="view_report_auction_estimation_adj_category_form">
-        <field name="name">report.auction.estimation.adj.category.form</field>
-        <field name="model">report.auction.estimation.adj.category</field>
-        <field name="type">form</field>
-        <field name="arch" type="xml">
-            <form string="Min est/Adj/Max est">
-                <!--field name="date" select="1"/-->
-                <field name="lot_type" select="1"/>
-                <field name="user_id" select="1"/>
-                <field name="lot_est1" select="2"/>
-                <field name="lot_est2" select="2"/>
-                <field name="adj_total" select="2"/>
-                <field name="date" select="1"/>
-            </form>
-        </field>
-    </record>
-    <record model="ir.ui.view" id="view_report_auction_estimation_adj_category_tree">
-        <field name="name">report.auction.estimation.adj.category.tree</field>
-        <field name="model">report.auction.estimation.adj.category</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Min est/Adj/Max est">
-                <!--field name="date" select="1"/-->
-                <field name="user_id" select="1"/>
-                <field name="lot_type" select="1"/>
-                <field name="lot_est1" select="1"/>
-                <field name="lot_est2" select="1"/>
-                <field name="adj_total" select="1"/>
-                <field name="date" select="1"/>
-            </tree>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_report_auction_estimation_adj_category_graph">
-        <field name="name">report.auction.estimation.adj.category.graph</field>
-        <field name="model">report.auction.estimation.adj.category</field>
-        <field name="type">graph</field>
-        <field name="arch" type="xml">
-            <graph string="Min est/Adj/Max est" orientation="vertical" type="bar">
-                <!--field name="date" operator="+"/-->
-                <field name="lot_type" select="1"/>
-                <field name="lot_est1" operator="+"/>
-                <field name="adj_total" operator="+"/>
-                <field name="lot_est2" operator="+"/>
-                <field name="user_id" group="True"/>
-            </graph>
-        </field>
-    </record>
-        <record model="ir.actions.act_window" id="action_report_auction_estimation_adj_category_manager_tree">
-        <field name="name">Min est/Adj/Max est</field>
-        <field name="res_model">report.auction.estimation.adj.category</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">graph,tree</field>
-        <field name="domain">[('date','like',time.strftime('%Y-%m'))]</field>
-    </record>
-
-    <record model="ir.actions.act_window" id="action_report_auction_estimation_adj_category_member_tree">
-        <field name="name">Min est/Adj/Max est</field>
-        <field name="res_model">report.auction.estimation.adj.category</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">graph,tree</field>
-        <field name="domain">[('date','like',time.strftime('%Y-%m')),('user_id','=',uid)]</field>
-    </record>
-
-<menuitem name="Employees" id="auction_report_employees_menu" parent="auction_report_menu"/>
-<menuitem name="Comparison of estimations" action="action_report_auction_estimation_adj_category_member_tree" id="menu_report_auction_estimation_adj_category_member" parent="auction_report_employees_menu"/>
-<menuitem name="Manager" id="auction_report_manager_menu" parent="auction_report_menu"/>
-<menuitem name="Comparison of estimations"  action="action_report_auction_estimation_adj_category_manager_tree" id="menu_report_auction_estimation_adj_category_manager" parent="auction_report_manager_menu"/>
-
-
-<!--=============================
-sign in sign out report by user
-==============================
-
-    <record model="ir.ui.view" id="view_report_auction_sign_in_out_tree">
-        <field name="name">report.auction.user.pointing.tree</field>
-        <field name="model">report.auction.user.pointing</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Summary pointing by user ">
-                <field name="user_id" select="1"/>
-                <field name="total_timesheet" widget="float_time"/>
-            </tree>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_report_auction_sign_in_out_graph">
-        <field name="name">report.auction.user.pointing.graph</field>
-        <field name="model">report.auction.user.pointing</field>
-        <field name="type">graph</field>
-        <field name="arch" type="xml">
-
-            <graph string="Summary pointing by user " orientation="vertical" type="bar">
-                <field name="user_id" select="1"/>
-                <field name="total_timesheet" />
-            </graph>
-        </field>
-    </record>
-
-
-    <record model="ir.actions.act_window" id="action_report_auction_sign_in_out_member_tree">
-        <field name="res_model">report.auction.user.pointing</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,graph</field>
-    </record>
-    <record model="ir.actions.act_window" id="action_report_auction_sign_in_out_manager_tree">
-        <field name="res_model">report.auction.user.pointing</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,graph</field>
-    </record>
-    <menuitem name="Summury of Sign_in Sign_out" action="action_report_auction_sign_in_out_member_tree" id="menu_report_auction_sign_in_out_member_tree" parent="auction_report_manager_menu"/>
-    <menuitem name="Summury of Sign_in Sign_out"  action="action_report_auction_sign_in_out_manager_tree" id="menu_report_auction_sign_in_out_manager_tree" parent="auction_report_manager_menu"/>
-
--->
-    <record model="ir.ui.view" id="view_report_auction_sign_in_out_tree1">
-        <field name="name">report attendance</field>
-        <field name="model">report.attendance</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="User's pointing">
-                <field name="employee_id" select="1"/>
-                <field name="name" select="1"/>
-                <field name="total_attendance" select="1"/>
-            </tree>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="view_report_auction_sign_in_out_graph1">
-        <field name="name">Graph attendance</field>
-        <field name="model">report.attendance</field>
-        <field name="type">graph</field>
-        <field name="arch" type="xml">
-            <graph string="User's pointing"  orientation="vertical" type="bar">
-                <field name="employee_id" select="1"/>
-                <field name="total_attendance" operator="+"/>
-                <field name="name" select="1"/>
-        </graph>
-
-        </field>
-    </record>
-
-
-    <record model="ir.actions.act_window" id="action_report_auction_sign_in_out_member_tree1">
-        <field name="res_model">report.attendance</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,graph</field>
-        <field name="domain"> [('name','=',time.strftime('%Y-%m-%d')),('employee_id','=',uid)]</field>
-        <!--<field name="domain"> [('name','ilike',time.strftime('%Y-%m'))]</field>-->
-    </record>
-    <menuitem name="Attendance" action="action_report_auction_sign_in_out_member_tree1" id="menu_report_auction_sign_in_out_member_tree1" parent="auction_report_employees_menu"/>
-
-
-    <record model="ir.actions.act_window" id="action_report_auction_sign_in_out_manager_tree1">
-        <field name="res_model">report.attendance</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,graph</field>
-        <field name="domain"> [('name','=',time.strftime('%Y-%m-%d'))]</field>
-    </record>
-
-    <menuitem name="Attendance"  action="action_report_auction_sign_in_out_manager_tree1" id="menu_report_auction_sign_in_out_manager_tree1" parent="auction_report_manager_menu"/>
-
-==============================
-My Latest Objects
-==============================
-    <record model="ir.actions.act_window" id="action_report_latest_objects_tree">
-        <field name="res_model">auction.lots</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,form</field>
-        <field name="domain">[('create_uid','=',uid)]</field>
-    </record>
-
-    <record model="ir.actions.act_window" id="action_report_latest_objects_manager_tree">
-        <field name="res_model">auction.lots</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,form</field>
-        <field name="limit" eval="80"/>
-    </record>
-
-
-=============================
-My Latest Deposit
-==============================
-
-    <record model="ir.actions.act_window" id="action_report_latest_doposit_tree">
-        <field name="res_model">auction.deposit</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,form</field>
-        <field name="domain">[('create_uid','=',uid)]</field>
-    </record>
-    <menuitem name="My Latest Deposits" action="action_report_latest_doposit_tree" id="menu_report_latest_doposit_tree" parent="auction_report_employees_menu"/>
-
-    <record model="ir.actions.act_window" id="action_report_latest_doposit_manager_tree">
-        <field name="res_model">auction.deposit</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,form</field>
-    </record>
-
-    <menuitem name="Latest Deposits" action="action_report_latest_doposit_manager_tree" id="menu_report_latest_doposit_tree_manager" parent="auction_report_manager_menu"/>
-=============================
 Objects per Day
 ==============================
     <record model="ir.ui.view" id="view_report_auction_object_date_tree">
@@ -417,59 +180,7 @@ Objects per Day
         <field name="view_mode">graph,tree</field>
         <field name="domain">[('month','=',time.strftime('%Y-%m-01'))]</field>
     </record>
-    <menuitem
-        name="Encoded Objects Per Day"
-        action="action_report_auction_object_date_tree"
-        id="menu_report_auction_object_date_tree"
-        parent="auction_report_manager_menu"/>
-    <menuitem
-        name="My Encoded Objects Per Day"
-        action="action_report_auction_object_date_tree_my"
-        id="menu_report_auction_object_date_tree1_my"
-        parent="auction_report_employees_menu"/>
-
-
-    <record model="ir.actions.act_window" id="view_report_object_by_auction">
-        <field name="name">Detailed lots</field>
-        <field name="res_model">auction.lots</field>
-        <field name="view_type">form</field>
-        <field name="domain">[('auction_id','=', active_id)]</field>
-        <field name="limit" eval="2000"/>
-    </record>
-    <record model="ir.values" id="ir_open_auction_lots">
-        <field name="key2">tree_but_open</field>
-        <field name="model">auction.dates</field>
-        <field name="name">Open auction</field>
-        <field name="value" eval="'ir.actions.act_window,%d'%view_report_object_by_auction"/>
-        <field name="object" eval="True"/>
-    </record>
 
-    <record model="ir.actions.act_window" id="auction_lots_open">
-        <field name="name">Simplified lots for adjudication</field>
-        <field name="res_model">auction.lots</field>
-        <field name="view_type">form</field>
-        <field name="domain">[('auction_id','=',active_id)]</field>
-        <field name="limit" eval="2000"/>
-    </record>
-
-    <record model="ir.values" id="ir_open_auction_lots_adj">
-        <field name="key2">tree_but_action</field>
-        <field name="model">auction.dates</field>
-        <field name="name">Open lots for adjudication</field>
-        <field name="value" eval="'ir.actions.act_window,%d'%auction_lots_open"/>
-        <field name="object" eval="True"/>
-    </record>
-
-    <record model="ir.actions.act_window" id="action_report_object_by_auction">
-        <field name="name">Auction dates</field>
-        <field name="res_model">auction.dates</field>
-        <field name="view_type">tree</field>
-        <field name="domain">[('state','=', 'draft')]</field>
-    </record>
-    <menuitem name="Objects by Auction"
-        parent="auction_objects_menu"
-        id="menu_auction_dates_next_by_auction"
-        action="action_report_object_by_auction" sequence="11"/>
 =============================
 Auction adjudication
 ==============================
@@ -505,48 +216,10 @@ Auction adjudication
         <field name="view_type">form</field>
         <field name="view_mode">graph,tree</field>
     </record>
-    <menuitem name="Adjudication by Auction" action="action_report_auction_adjudication_tree" id="menu_report_auction_adjudication_tree" parent="auction_report_manager_menu"/>
-
 
-    <record model="ir.ui.view" id="view_auction_deposit_tree">
-        <field name="name">Depositer's statistics</field>
-        <field name="model">report.deposit.border</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Depositer's statistics">
-                <field name="bord" select="1"/>
-                <field name="seller" select="1"/>
-                <field name="moy_est" select="1"/>
-                <field name="total_marge" select="1"/>
-                <field name="nb_obj" select="1"/>
-                </tree>
-        </field>
-    </record>
-    <record model="ir.actions.act_window" id="menu_view_auction_deposit_tree">
-        <field name="res_model">report.deposit.border</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree</field>
-    </record>
-    <menuitem name="Depositer's Statistics" action="menu_view_auction_deposit_tree" id="menu_report_deposit_tree_m" parent="auction_report_manager_menu"/>
-    <menuitem name="Depositer's Statistics" action="menu_view_auction_deposit_tree" id="menu_report_deposit_tree_member" parent="auction_report_employees_menu"/>
 =============================
 Object encoded
 ==============================
-    <record model="ir.ui.view" id="view_report_object_encoded_form">
-        <field name="name">report.object.encoded.form</field>
-        <field name="model">report.object.encoded</field>
-        <field name="type">form</field>
-        <field name="arch" type="xml">
-            <form string="Objects statistics">
-                <field name="date" select="1"/>
-                <field name="state" select="1"/>
-                <field name="user_id" select="1"/>
-                <field name="estimation" select="2"/>
-                <field name="obj_ret" select="2"/>
-                <field name="obj_num" select="2" sum="# objects"/>
-            </form>
-        </field>
-    </record>
 
     <record model="ir.ui.view" id="view_report_object_encoded_tree">
         <field name="name">report.object.encoded.tree</field>
@@ -554,59 +227,8 @@ Object encoded
         <field name="type">tree</field>
         <field name="arch" type="xml">
             <tree string="Objects statistics">
-                <field name="date" select="1"/>
-                <field name="state" select="1"/>
                 <field name="user_id" select="1"/>
-                <field name="estimation"/>
-                <field name="obj_ret"/>
-                <field name="obj_num"/>
-            </tree>
-        </field>
-    </record>
-<!--    <record model="ir.ui.view" id="view_report_object_encoded_tree">
-        <field name="name">report.object.encoded.tree</field>
-        <field name="model">report.object.encoded</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Objects statistics" >
-                <field name="date" select="1"/>
                 <field name="state" select="1"/>
-                <field name="user_id" select="1"/>
-                <field name="estimation" />
-                <field name="obj_ret" />
-                <field name="obj_num" />
-            </tree>
-        </field>
-    </record>
--->
-    <record model="ir.ui.view" id="view_report_object_encoded_graph">
-        <field name="name">report.object.encoded.graph</field>
-        <field name="model">report.object.encoded</field>
-        <field name="type">graph</field>
-        <field name="arch" type="xml">
-            <graph string="Objects statistics" type="bar">
-                <field name="user_id" select="1"/>
-                <field name="estimation" operator="+" />
-                <field name="obj_ret"  operator="+" />
-                <field name="obj_num"  operator="+" />
-            </graph>
-        </field>
-    </record>
-
-    <record model="ir.actions.act_window" id="action_report_object_encoded_member_tree">
-        <field name="res_model">report.object.encoded</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree</field>
-        <field name="domain"> [('user_id','=',uid),('date','ilike',time.strftime('%Y-%m'))]</field>
-    </record>
-
-    <record model="ir.ui.view" id="view_report_object_encoded_manager_tree">
-        <field name="name">report.object.encoded.tree</field>
-        <field name="model">report.object.encoded.manager</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Objects statistics">
-                <field name="user_id" select="1"/>
                 <field name="estimation" />
                 <field name="obj_ret" />
                 <field name="obj_num" sum="# objects" select="1"/>
@@ -619,9 +241,9 @@ Object encoded
         </field>
     </record>
 
-    <record model="ir.ui.view" id="view_report_object_encoded_manager_graph">
+    <record model="ir.ui.view" id="view_report_object_encoded_graph">
         <field name="name">report.object.encoded.graph</field>
-        <field name="model">report.object.encoded.manager</field>
+        <field name="model">report.object.encoded</field>
         <field name="type">graph</field>
         <field name="arch" type="xml">
             <graph string="Object statistic" type="bar">
@@ -635,34 +257,13 @@ Object encoded
         </field>
     </record>
 
-    <record model="ir.actions.act_window" id="action_report_object_encoded_manager_tree">
-        <field name="res_model">report.object.encoded.manager</field>
+    <record model="ir.actions.act_window" id="action_report_object_encoded_tree">
+        <field name="name">Object statistics</field>
+        <field name="res_model">report.object.encoded</field>
         <field name="view_type">form</field>
-        <field name="view_mode">tree</field>
+        <field name="view_mode">tree,graph</field>
         <field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
     </record>
 
-    <record model="ir.ui.view" id="view_report_unclassified_objects">
-        <field name="name">report.unclassified.objects</field>
-        <field name="model">report.unclassified.objects</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Unclassified objects">
-                <field name="obj_num" string="Ref" select="1"/>
-                <field name="name" select="1"/>
-                <field name="ach_login"/>
-                <field name="obj_price"/>
-                <field name="state" select="1"/>
-                <field name="obj_comm"/>
-                <field name="bord_vnd_id"/>
-                <field name="lot_num"/>
-                <field name="lot_est1"/>
-                <field name="lot_est2"/>
-                <field name="lot_type" select="1"/>
-                <field name="auction"/>
-            </tree>
-        </field>
-    </record>
-
     </data>
 </openerp>
\ No newline at end of file
index 356f069..d5442be 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
-       <xsl:import href="../../base/report/corporate_defaults.xsl"/>
-               <xsl:import href="../../base/report/rml_template.xsl"/>
+       <xsl:import href="corporate_defaults.xsl"/>
+               <xsl:import href="rml_template.xsl"/>
 
        <xsl:template match="/">
                <xsl:call-template name="rml"/>
index 47850e2..b06179b 100644 (file)
 "access_auction_lot_history","auction.lot.history","model_auction_lot_history","base.group_user",1,1,1,1
 "access_report_auction","report.auction","model_report_auction","base.group_user",1,0,0,0
 "access_report_auction_object_date","report.auction.object.date","model_report_auction_object_date","base.group_user",1,0,0,0
-"access_report_auction_estimation_adj_category","report.auction.estimation.adj.category","model_report_auction_estimation_adj_category","base.group_user",1,0,0,0
 "access_report_auction_adjudication","report.auction.adjudication","model_report_auction_adjudication","base.group_user",1,0,0,0
-"access_report_attendance","report.attendance","model_report_attendance","base.group_user",1,0,0,0
-"access_report_deposit_border","report.deposit.border","model_report_deposit_border","base.group_user",1,0,0,0
 "access_report_object_encoded","report.object.encoded","model_report_object_encoded","base.group_user",1,0,0,0
-"access_report_object_encoded_manager","report.object.encoded.manager","model_report_object_encoded_manager","base.group_user",1,0,0,0
-"access_report_unclassified_objects","report.unclassified.objects","model_report_unclassified_objects","base.group_user",1,0,0,0
 "access_aie_category","aie.category","model_aie_category","base.group_user",1,0,0,0
index a77ad4c..6b86511 100644 (file)
     analytic_journal_id: account.cose_journal_sale    
         
 -      
-  I'm creating new partner "Mark Johnson" with him email "info@mycustomer.com".
+  I'm creating new Seller "Mr. Pinakin" with him email "info@mycustomer.com".
 - 
-  !record {model: res.partner, id: res_partner_markjohnson0}:
+  !record {model: res.partner, id: res_partner_mrpinakin0}:
+    address:
+        - city: Namur
+          country_id: base.be
+          phone: (+32).10.45.18.77
+          street: 23, street ways
+          type: default
+          zip: '2324324'
+          email: 'info@mycustomer.com'
+    name: Mr. Pinakin
+
+-      
+  I'm creating new Buyer "Mr. Patel" with him email "info@myinfobid.com".
+- 
+  !record {model: res.partner, id: res_partner_mrpatel0}:
     address:
       - city: Bruxelles
         country_id: base.be
         street: Rue des Palais 51, bte 33
         type: default
         zip: '1000'
-        email: 'info@mycustomer.com'
-    name: Mark Johnson       
+        email: 'info@myinfobid.com'
+    name: Mr. Patel
+        
+-      
+  I'm creating new Buyer "Mr. Johnson" with him email "info@mrkjohnson.com".
+- 
+  !record {model: res.partner, id: res_partner_mrkjohnson0}:
+    address:
+      - city: paris
+        country_id: base.fr
+        name: Mark Johnson
+        street: 1 rue Rockfeller
+        type: invoice
+        zip: '75016'
+        email: 'info@mrkjohnson.com'
+    name: Mr. Mark Johnson
+        
+-      
+  I'm creating new Buyer "Mr. Rahi" with him email "info@poalrahi.com".
+- 
+  !record {model: res.partner, id: res_partner_poalrahi0}:
+    address:
+      - city: Bruxelles
+        country_id: base.be
+        street: Rue des Palais 51, bte 33
+        type: default
+        zip: '1000'
+        email: 'info@poalrahi.com'
+    name: Mr. Rahi
+        
+    
+-
+  I create Account tax with 0.03 amount to give Buyer "3%" Commision.
+- 
+  !record {model: account.tax, id: account_tax_buyer0}:
+    amount: 0.029999999999999999
+    applicable_type: 'true'
+    company_id: base.main_company
+    domain: auction
+    name: Buyer Costs(%3)
+    sequence: 1
+    type: percent
+    type_tax_use: all
+-
+  I create Account tax with 0.04 amount to give seller "4%" commision.
+- 
+  !record {model: account.tax, id: account_tax_sellercosts0}:
+    amount: 0.040000000000000001
+    applicable_type: 'true'
+    company_id: base.main_company
+    domain: auction
+    name: Seller Costs(%4)
+    sequence: 1
+    type: percent
+    type_tax_use: all      
+                  
 -
-  Now I want to associate an object with the auction so for that I create an auction "Antique furniture exhibition"
+  Now I want to associate an object with the auction so for that I create an auction "Antique furniture exhibition" which
+  start from 1 Aug to 31 Aug with Seller Commition 4%, buyer commition 3%.
 -
   !record {model: auction.dates, id: auction_dates_antiquefurnitureexhibition0}:
     acc_expense: account.a_pay
     acc_income: account.a_recv
     account_analytic_id: account.analytic_root
-    auction1: '2010-05-20'
-    auction2: '2010-05-21'
-    expo1: '2010-05-18'
-    expo2: '2010-05-19'
+    auction1: '2010-08-01'
+    auction2: '2010-08-31'
+    expo1: '2010-08-01'
+    expo2: '2010-08-31'
     journal_id: account.expenses_journal
     journal_seller_id: account.sales_journal
     name: Antique furniture exhibition
+    seller_costs:
+      - auction.account_tax_sellercosts0
+    buyer_costs:
+      - auction.account_tax_buyer0       
 -
-  An object is being deposited for an auction,I create a seller's deposit record.  
+  An object is being deposited for an auction,I create a seller's deposit record with deposit cost.  
 -
   !record {model: auction.deposit, id: auction_deposit_ad0}:
-    date_dep: '2010-05-18'
+    date_dep: '2010-08-01'
     method: keep
     name: AD/006
-    partner_id: base.res_partner_9
+    partner_id: res_partner_mrpinakin0
+    specific_cost_ids:
+      - account: auction.auction_expense
+        amount: 200.0
+        name: Transfer Cost    
 -
   I create a new object wooden-chair which is to be auctioned.
 -
   !record {model: auction.lots, id: auction_lots_woodenchair0}:
-    ach_uid: res_partner_markjohnson0
+    ach_uid: res_partner_mrkjohnson0
     artist_id: auction_artists_vincentvangogh0
     auction_id: auction_dates_antiquefurnitureexhibition0
     bord_vnd_id: auction_deposit_ad0
     name2: antique wooden chair
     obj_num: 1
     obj_price: 4000.0
-    obj_ret: 5000.0
+    obj_ret: 0.0
     product_id: 'product_product_furniture0'
     state: draft
     vnd_lim: 5000.0
 -
-  I create a bid for an object "wooden-chair" which is to be auctioned in Antique furniture exhibition.
+  I create a bid for an object "wooden-chair" which is to be auctioned in Antique furniture exhibition bided by Mr.Patel.
 -
   !record {model: auction.bid, id: auction_bid_bid0}:
     auction_id: auction_dates_antiquefurnitureexhibition0
     contact_tel: (+32)2 211 34 83
     name: bid/001
-    partner_id: res_partner_markjohnson0
+    partner_id: res_partner_mrpatel0
 -
   I create a bid line.
 -
     auction: Antique furniture exhibition
     bid_id: auction_bid_bid0
     lot_id: auction.auction_lots_woodenchair0
-    price: 3500.0
+    price: 3100.0
+
 -
-  I create another bid for an object "wooden-chair" bided by a different partner
+  I create another bid for an object "wooden-chair" bided by a Mr.poalrahi
 -  
   !record {model: auction.bid, id: auction_bid_bid1}:
     auction_id: auction_dates_antiquefurnitureexhibition0
     name: bid/002
-    partner_id: res_partner_markjohnson0
+    partner_id: res_partner_poalrahi0
 -
   I create a bid line.
 -
     bid_id: 'auction_bid_bid1'
     call: 1
     lot_id: auction.auction_lots_woodenchair0
+    price: 3200.0
+-
+  I create another bid for an object "wooden-chair" bided by a Mr.Johnson
+-  
+  !record {model: auction.bid, id: auction_bid_bid2}:
+    auction_id: auction_dates_antiquefurnitureexhibition0
+    name: bid/003
+    partner_id: res_partner_mrkjohnson0
+-
+  I create a bid line.
+-
+  !record {model: auction.bid_line, id: auction_bid_line_2}:
+    auction: Antique furniture exhibition
+    bid_id: 'auction_bid_bid2'
+    call: 1
+    lot_id: auction.auction_lots_woodenchair0
     price: 4000.0
 -
+  Mr. MarkJohnson bid are selected as Finallist Bid with 4000 Euro
+-
   I check that buyer price and seller price gets bind with the value
 -
   !python {model: auction.lots}: |
     from tools.translate import _
     auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
     assert(auc_id.buyer_price,auc_id.seller_price), _('Buyer price and seller price are not available!')
-    
 -
-  I check that a record gets created in the Auction's Summary.
+  Now, An object has been sold,so I click on the "Sold" button.
 -
   !python {model: auction.lots}: |
+    self.button_bought(cr, uid, [ref("auction_lots_woodenchair0")], {"lang": "en_US", "tz":
+      False, "active_model": "ir.ui.menu", "active_ids": [ref("auction.auction_lots_woodenchair0")],
+      "active_id": ref("auction.auction_lots_woodenchair0")})   
+-
+  I click on the "Create all invoices" button for all Objects in this Auction.
+-
+  !python {model: auction.dates}: |
+    self.close(cr, uid, [ref("auction.auction_dates_antiquefurnitureexhibition0")],
+      {"active_model": "ir.ui.menu", "active_ids":
+      [ref("auction.menu_auction_dates_next1")], "active_id": ref("auction.menu_auction_dates_next1")})
+-
+  I check that a record gets created in the "Supplier Invoices".
+-
+ !python {model: auction.lots}: |
     from tools.translate import _
-    auc_id2=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
-    rep_auc_obj1 = self.pool.get('report.auction')
-    ids2=rep_auc_obj1.search(cr, uid, [('auction', '=', auc_id2.auction_id.id)])
-    assert ids2, _('No record found!')   
+    auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
+    assert(auc_id.sel_inv_id), _('Seller Invoice has not been created!') 
+    
+-
+  I create a buyer's invoice by using the "Invoice Buyer objects" wizard.
+-
+  !record {model: auction.lots.make.invoice.buyer, id: auction_lots_make_invoice_buyer_0}:
+    amount: 3090.0
+    buyer_id: res_partner_mrkjohnson0
+    number: 2010/003
+    objects: 1
 -
-  An object has been sold,so I click on the "Sold" button.
+  Then I click on the "Create Invoices" button.
+-
+  !python {model: auction.lots.make.invoice.buyer}: |
+    self.makeInvoices(cr, uid, [ref("auction_lots_make_invoice_buyer_0")], {"active_model": "auction.lots", "active_ids": [ref("auction_lots_woodenchair0")],
+      "active_id": ref("auction_lots_woodenchair0"), })
+-
+  I check that a "Buyer Invoice" field gets bind with the value.
 -
   !python {model: auction.lots}: |
-    self.button_bought(cr, uid, [ref("auction_lots_woodenchair0")], {"lang": "en_US", "tz":
-      False, "active_model": "ir.ui.menu", "active_ids": [ref("auction.auction_lots_woodenchair0")],
-      "active_id": ref("auction.auction_lots_woodenchair0")})   
+    from tools.translate import _
+    auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
+    assert(auc_id.ach_inv_id), _('Buyer Invoice has not been created!')     
+- 
+  Buyer Create a Invoice payment record by Click on "Pay Invoice" Button of Account invoice. 
+- 
+  !record {model: account.invoice.pay, id: account_invoice_pay_furniture0}:
+    amount: 4120.0
+    date: '2010-08-06'
+    journal_id: account.cash_journal
+    name: Furniture
+    period_id: account.period_8
+- 
+  Now Buyer want to make Full payment by click on "Full Payment" button of Account Invoice wizard.
+- 
+  !python {model: account.invoice.pay}: |
+    obj_invoice = self.pool.get('account.invoice')
+    obj_lots = self.pool.get('auction.lots')
+    lots_id = obj_lots.browse(cr, uid, ref("auction_lots_woodenchair0"))
+    invoice_ids = obj_invoice.search(cr, uid, [('id', '=', lots_id.ach_inv_id.id)])
+    self.wo_check(cr, uid, [ref("account_invoice_pay_furniture0")], {"active_model": "account.invoice", "department_id": False,
+      "record_id": 7, "search_default_draft": "1", "active_ids": invoice_ids,
+      "active_id": invoice_ids[0]})
+- 
+  After Click on Full Payment Button, Creating a account invoice pay writeoff record.
+- 
+  !record {model: account.invoice.pay.writeoff, id: account_invoice_pay_writeoff_0}:
+    comment: Write-Off
+    writeoff_acc_id: auction.auction_income_costs
+    writeoff_journal_id: account.sales_journal
+- 
+  And  click on "pay_and_reconcile_writeoff" button. 
+- 
+  !python {model: account.invoice.pay.writeoff}: |
+    obj_invoice = self.pool.get('account.invoice')
+    obj_lots = self.pool.get('auction.lots')
+    lots_id = obj_lots.browse(cr, uid, ref("auction_lots_woodenchair0"))
+    invoice_ids = obj_invoice.search(cr, uid, [('id', '=', lots_id.ach_inv_id.id)])
+    self.pay_and_reconcile_writeoff(cr, uid, [ref("account_invoice_pay_writeoff_0")],
+      {"active_model": "account.invoice", "department_id":
+      False, "record_id": 7, "search_default_draft": "1", "active_ids": invoice_ids ,
+      "active_id": invoice_ids[0], })
+-
+  I check that "Buyer Invoice Reconciled" field is marked.
+-
+  !assert {model: auction.lots, id: auction_lots_woodenchair0}:
+      - paid_ach == True, 'Buyer Invoice should be Reconciled.'
 -
   I check that the order which was initially in the draft state has transit to sold state.
 -
     from tools.translate import _
     auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
     assert(auc_id.state == 'sold'), _('State not changed!')
-        
 -
   Then I click on the Taken Away button.
 -
 -
   I check that the order which was initially in the sold state has transit to taken away state.
 -
-  !python {model: auction.lots}: |
-    from tools.translate import _
-    auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
-    assert(auc_id.state == 'taken_away'), _('State not changed!')
+  !assert {model: auction.lots, id: auction_lots_woodenchair0}:
+    - state == 'taken_away', "state is not taken Away"
 -
-  I click on the "Create all invoices" button
+  In order to change the auction for an object I use the "Change auction date" wizard.
+  This will Erase The Object Adjudication Price and Its Buyer!
 -
-  !python {model: auction.dates}: |
-    self.close(cr, uid, [ref("auction.auction_dates_antiquefurnitureexhibition0")],
-      {"lang": "en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids":
-      [ref("auction.menu_auction_dates_next1")], "active_id": ref("auction.menu_auction_dates_next1")})
+  !record {model: auction.lots.auction.move, id: auction_lots_auction_move_0}:
+    auction_id: auction.auction_date_2
+- 
+  Then I click on the "Move to Auction date" button.
+- 
+  !python {model: auction.lots.auction.move}: |
+    self.auction_move_set(cr, uid, [ref("auction_lots_auction_move_0")], {"lang":
+      "en_US", "tz": False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_woodenchair0")],
+      "active_id": ref("auction_lots_woodenchair0"), })
 -
-  I check that a record gets created in the "Supplier Invoices".
+  I check that a record gets created in the lot history.
 -
- !python {model: auction.lots}: |
+  !python {model: auction.lots}: |
     from tools.translate import _
     auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
-    assert(auc_id.sel_inv_id), _('Seller Invoice has not been created!') 
-    
\ No newline at end of file
+    auc_lot_his=self.pool.get('auction.lot.history')
+    ids=auc_lot_his.search(cr, uid, [('lot_id', '=', auc_id.id)])
+    assert ids, _('Auction history does not exists!')     
index fc216cd..27d6879 100644 (file)
@@ -7,8 +7,8 @@
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Change Auction Date">
-                    <label string ="Warning, This will Erase The Object Adjudication Price and Its Buyer!" colspan="4"/>
-                    <separator string="" colspan="4"/>
+                    <label string ="Warning, Erase The Object Adjudication Price and Its Buyer!" colspan="4"/>
+                    <separator string="Change Auction Date" colspan="4"/>
                     <field name="auction_id"/>
                     <separator string="" colspan="4"/>   
                     <group colspan="4" col="4">
index 241a36b..27b6800 100644 (file)
@@ -1500,6 +1500,7 @@ true, it will allow you to hide the event alarm information without removing it.
         @param context: A standard dictionary for contextual values
         @return: List of Dictionary of form [{‘name_of_the_field’: value, ...}, ...]
         """
+        # FIXME This whole id mangling has to go!
         if not context:
             context = {}
 
index f760421..2517f88 100644 (file)
 ##############################################################################
 
 from document_webdav import webdav
-import tools
-from DAV.propfind import PROPFIND
 import urlparse
 urlparse.uses_netloc.append('caldav')
 urlparse.uses_netloc.append('caldavs')
-super_mk_prop_response = webdav.mk_prop_response
-def mk_prop_response(self,uri,good_props,bad_props,doc):                
-    res = super_mk_prop_response(self, uri,good_props,bad_props,doc)    
-    uris = uri.split('/') 
-    calendar = False    
-    if 'http://calendarserver.org/ns/' in good_props or 'http://calendarserver.org/ns/' in bad_props:
-        calendar = True
-    if calendar:
-        ad = doc.createElement('calendar')
-        ad.setAttribute('xmlns', 'urn:ietf:params:xml:ns:caldav')        
-        cols = res.getElementsByTagName('D:collection')
-        if cols:
-            cols[0].parentNode.appendChild(ad)
-                #cols[0].parentNode.appendChild(vc)
-    return res
 
-PROPFIND.mk_prop_response = mk_prop_response
+#EOF
index e2ae662..2394c95 100644 (file)
 <?xml version="1.0"?>
 <openerp>
-       <data noupdate="1">
+    <data noupdate="1">
 
         <record model="document.directory" id="document.dir_calendars">
             <field name="name">Calendars</field>
             <field name="calendar_collection">True</field>
         </record>
 
-               <!--            Event attributes-->
+        <!--        Event attributes-->
 
-               <record model="basic.calendar.attributes" id="field_event_comment">
-                       <field name="name">comment</field>
-                       <field name="type">vevent</field>
-               </record>
+        <record model="basic.calendar.attributes" id="field_event_comment">
+            <field name="name">comment</field>
+            <field name="type">vevent</field>
+        </record>
 
         <record model="basic.calendar.attributes" id="field_event_organizer">
-                       <field name="name">organizer</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_uid">
-                       <field name="name">uid</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_seq">
-                       <field name="name">seq</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_recurrence-id">
-                       <field name="name">recurrence-id</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_transp">
-                       <field name="name">transp</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_attendee">
-                       <field name="name">attendee</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_related">
-                       <field name="name">related</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_rrule">
-                       <field name="name">rrule</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_dtend">
-                       <field name="name">dtend</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_valarm">
-                       <field name="name">valarm</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_vtimezone">
-                       <field name="name">vtimezone</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_priority">
-                       <field name="name">priority</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_location">
-                       <field name="name">location</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_exrule">
-                       <field name="name">exrule</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_resources">
-                       <field name="name">resources</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_rstatus">
-                       <field name="name">rstatus</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_status">
-                       <field name="name">status</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_exdate">
-                       <field name="name">exdate</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_dtstamp">
-                       <field name="name">dtstamp</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_description">
-                       <field name="name">description</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_rdate">
-                       <field name="name">rdate</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_dtstart">
-                       <field name="name">dtstart</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_class">
-                       <field name="name">class</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_x-openobject-model">
-                       <field name="name">x-openobject-model</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_created">
-                       <field name="name">created</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_url">
-                       <field name="name">url</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_summary">
-                       <field name="name">summary</field>
-                       <field name="type">vevent</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_event_contact">
-                       <field name="name">contact</field>
-                       <field name="type">vevent</field>
-               </record>
-
-
-<!--           Todo attributes-->
-
-               <record model="basic.calendar.attributes" id="field_todo_status">
-                       <field name="name">status</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_comment">
-                       <field name="name">comment</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_attendee">
-                       <field name="name">attendee</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_valarm">
-                       <field name="name">valarm</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_description">
-                       <field name="name">description</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_seq">
-                       <field name="name">seq</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_vtimezone">
-                       <field name="name">vtimezone</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_url">
-                       <field name="name">url</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_completed">
-                       <field name="name">completed</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_percent">
-                       <field name="name">percent</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_due">
-                       <field name="name">due</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_summary">
-                       <field name="name">summary</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_priority">
-                       <field name="name">priority</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_exdate">
-                       <field name="name">exdate</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_location">
-                       <field name="name">location</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_exrule">
-                       <field name="name">exrule</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_duration">
-                       <field name="name">duration</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_organizer">
-                       <field name="name">organizer</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_dtstart">
-                       <field name="name">dtstart</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_rrule">
-                       <field name="name">rrule</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_class">
-                       <field name="name">class</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_todo_uid">
-                       <field name="name">uid</field>
-                       <field name="type">vtodo</field>
-               </record>
-
-<!--           Attendee's attributes-->
-
-               <record model="basic.calendar.attributes" id="field_attendee_cn">
-                       <field name="name">cn</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_sent-by">
-                       <field name="name">sent-by</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_language">
-                       <field name="name">language</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_delegated-from">
-                       <field name="name">delegated-from</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_member">
-                       <field name="name">member</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_cutype">
-                       <field name="name">cutype</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_role">
-                       <field name="name">role</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_partstat">
-                       <field name="name">partstat</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_delegated-to">
-                       <field name="name">delegated-to</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_dir">
-                       <field name="name">dir</field>
-                       <field name="type">attendee</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_attendee_rsvp">
-                       <field name="name">rsvp</field>
-                       <field name="type">attendee</field>
-               </record>
-
-<!--   Alarm attributes-->
-
-               <record model="basic.calendar.attributes" id="field_alarm_attendee">
-                       <field name="name">attendee</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_trigger_duration">
-                       <field name="name">trigger_duration</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_description">
-                       <field name="name">description</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_attach">
-                       <field name="name">attach</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_trigger_occurs">
-                       <field name="name">trigger_occurs</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_trigger_interval">
-                       <field name="name">trigger_interval</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_summary">
-                       <field name="name">summary</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_duration">
-                       <field name="name">duration</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_repeat">
-                       <field name="name">repeat</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_action">
-                       <field name="name">action</field>
-                       <field name="type">alarm</field>
-               </record>
-
-               <record model="basic.calendar.attributes" id="field_alarm_trigger_related">
-                       <field name="name">trigger_related</field>
-                       <field name="type">alarm</field>
-               </record>
-
-       </data>
+            <field name="name">organizer</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_uid">
+            <field name="name">uid</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_seq">
+            <field name="name">seq</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_recurrence-id">
+            <field name="name">recurrence-id</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_transp">
+            <field name="name">transp</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_attendee">
+            <field name="name">attendee</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_related">
+            <field name="name">related</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_rrule">
+            <field name="name">rrule</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_dtend">
+            <field name="name">dtend</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_duration">
+            <field name="name">duration</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_valarm">
+            <field name="name">valarm</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_vtimezone">
+            <field name="name">vtimezone</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_priority">
+            <field name="name">priority</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_location">
+            <field name="name">location</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_exrule">
+            <field name="name">exrule</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_resources">
+            <field name="name">resources</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_rstatus">
+            <field name="name">rstatus</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_status">
+            <field name="name">status</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_exdate">
+            <field name="name">exdate</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_dtstamp">
+            <field name="name">dtstamp</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_description">
+            <field name="name">description</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_rdate">
+            <field name="name">rdate</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_dtstart">
+            <field name="name">dtstart</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_class">
+            <field name="name">class</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_x-openobject-model">
+            <field name="name">x-openobject-model</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_created">
+            <field name="name">created</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_url">
+            <field name="name">url</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_summary">
+            <field name="name">summary</field>
+            <field name="type">vevent</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_event_contact">
+            <field name="name">contact</field>
+            <field name="type">vevent</field>
+        </record>
+
+
+<!--        Todo attributes-->
+
+        <record model="basic.calendar.attributes" id="field_todo_status">
+            <field name="name">status</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_comment">
+            <field name="name">comment</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_attendee">
+            <field name="name">attendee</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_valarm">
+            <field name="name">valarm</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_description">
+            <field name="name">description</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_seq">
+            <field name="name">sequence</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_vtimezone">
+            <field name="name">vtimezone</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_url">
+            <field name="name">url</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_completed">
+            <field name="name">completed</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_percent">
+            <field name="name">percent-complete</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_due">
+            <field name="name">due</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_summary">
+            <field name="name">summary</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_priority">
+            <field name="name">priority</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_exdate">
+            <field name="name">exdate</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_location">
+            <field name="name">location</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_exrule">
+            <field name="name">exrule</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_duration">
+            <field name="name">duration</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_organizer">
+            <field name="name">organizer</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_dtstart">
+            <field name="name">dtstart</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_rrule">
+            <field name="name">rrule</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_class">
+            <field name="name">class</field>
+            <field name="type">vtodo</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_todo_uid">
+            <field name="name">uid</field>
+            <field name="type">vtodo</field>
+        </record>
+
+<!--        Attendee's attributes-->
+
+        <record model="basic.calendar.attributes" id="field_attendee_cn">
+            <field name="name">cn</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_sent-by">
+            <field name="name">sent-by</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_language">
+            <field name="name">language</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_delegated-from">
+            <field name="name">delegated-from</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_member">
+            <field name="name">member</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_cutype">
+            <field name="name">cutype</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_role">
+            <field name="name">role</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_partstat">
+            <field name="name">partstat</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_delegated-to">
+            <field name="name">delegated-to</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_dir">
+            <field name="name">dir</field>
+            <field name="type">attendee</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_attendee_rsvp">
+            <field name="name">rsvp</field>
+            <field name="type">attendee</field>
+        </record>
+
+<!--    Alarm attributes-->
+
+        <record model="basic.calendar.attributes" id="field_alarm_attendee">
+            <field name="name">attendee</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_trigger_duration">
+            <field name="name">trigger_duration</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_description">
+            <field name="name">description</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_attach">
+            <field name="name">attach</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_trigger_occurs">
+            <field name="name">trigger_occurs</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_trigger_interval">
+            <field name="name">trigger_interval</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_summary">
+            <field name="name">summary</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_duration">
+            <field name="name">duration</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_repeat">
+            <field name="name">repeat</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_action">
+            <field name="name">action</field>
+            <field name="type">alarm</field>
+        </record>
+
+        <record model="basic.calendar.attributes" id="field_alarm_trigger_related">
+            <field name="name">trigger_related</field>
+            <field name="type">alarm</field>
+        </record>
+
+    </data>
 </openerp>
index 8ec7422..b931b0f 100644 (file)
@@ -24,7 +24,6 @@ from tools.translate import _
 import pooler
 import tools
 import time
-import base64
 from document import nodes
 import StringIO
 
@@ -38,78 +37,48 @@ class node_database(nodes.node_database):
             domain = []
         domain2 = domain + [('calendar_collection','=', False)]
         res = super(node_database, self)._child_get(cr, name=name, parent_id=parent_id, domain=domain2)
-        where = [('parent_id','=',parent_id)] 
-        domain2 = domain + [('calendar_collection','=', True)]                             
+        where = [('parent_id','=',parent_id)]
+        domain2 = domain + [('calendar_collection','=', True)]
         if name:
             where.append(('name','=',name))
         if domain2:
             where += domain2
 
         where2 = where + [('type', '=', 'directory')]
-        ids = dirobj.search(cr, uid, where2, context=ctx)              
-        for dirr in dirobj.browse(cr,uid,ids,context=ctx):            
+        ids = dirobj.search(cr, uid, where2, context=ctx)
+        for dirr in dirobj.browse(cr,uid,ids,context=ctx):
             res.append(node_calendar_collection(dirr.name,self,self.context,dirr))
         return res
 
-class node_calendar_collection(nodes.node_dir): 
-    PROPS = {
-            "http://calendarserver.org/ns/" : ('getctag'),
-            }          
-    M_NS = { 
+class node_calendar_collection(nodes.node_dir):
+    DAV_PROPS = {
+            "http://calendarserver.org/ns/" : ('getctag',),
+            }
+    DAV_M_NS = {
            "http://calendarserver.org/ns/" : '_get_dav',
-           }      
-
-
-    def get_dav_props(self, cr):                
-        return self.PROPS
-
-    
-
-    def get_dav_eprop(self,cr, ns, propname): 
-        if self.M_NS.has_key(ns):
-            prefix = self.M_NS[ns]
-        else:
-            print "No namespace:",ns, "( for prop:", propname,")"
-            return None
+           }
 
-        mname = prefix + "_" + propname
-
-        if not hasattr(self, mname):
-            return None
-
-        try:
-            m = getattr(self, mname)
-            r = m(cr)
-            return r
-        except AttributeError, e:
-            print 'Property %s not supported' % propname
-            print "Exception:", e            
-        return None
+    http_options = { 'DAV': ['calendar-access'] }
 
     def _file_get(self,cr, nodename=False):
         return []
 
-    
-    
-
-    def _child_get(self, cr, name=False, parent_id=False, domain=None):        
+    def _child_get(self, cr, name=False, parent_id=False, domain=None):
         dirobj = self.context._dirobj
         uid = self.context.uid
         ctx = self.context.context.copy()
         ctx.update(self.dctx)
-        where = [('collection_id','=',self.dir_id)]  
-        ext = False 
-        if name: 
-            res = name.split('.ics') 
-            if len(res) > 1:
-                name = res[0]
-                ext = '.ics'
-        if name:            
+        where = [('collection_id','=',self.dir_id)]
+        ext = False
+        if name and name.endswith('.ics'):
+            name = name[-4]
+            ext = '.ics'
+        if name:
             where.append(('name','=',name))
         if not domain:
-            domain = []       
+            domain = []
         where = where + domain
-        fil_obj = dirobj.pool.get('basic.calendar')        
+        fil_obj = dirobj.pool.get('basic.calendar')
         ids = fil_obj.search(cr,uid,where,context=ctx)
         res = []
         for calender in fil_obj.browse(cr, uid, ids, context=ctx):
@@ -120,34 +89,21 @@ class node_calendar_collection(nodes.node_dir):
         return res
 
     def _get_dav_owner(self, cr):
+       # Todo?
         return False
 
-    
-    def get_etag(self, cr):
-        """ Get a tag, unique per object + modification.
-
-            see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
-        return self._get_ttag(cr) + ':' + self._get_wtag(cr)
-
-    def _get_wtag(self, cr):
-        """ Return the modification time as a unique, compact string """
-        if self.write_date:
-            wtime = time.mktime(time.strptime(self.write_date, '%Y-%m-%d %H:%M:%S'))
-        else: wtime = time.time()
-        return str(wtime)
-
     def _get_ttag(self, cr):
-        return 'calendar collection-%d' % self.dir_id
+        return 'calen-dir-%d' % self.dir_id
 
     def _get_dav_getctag(self, cr):
-        result = self.get_etag(cr)        
-        return str(result)   
-        
-
-class node_calendar(nodes.node_class):   
-    our_type = 'collection' 
-    PROPS = {
-            "http://calendarserver.org/ns/" : ('getctag'),
+        result = self.get_etag(cr)
+        return str(result)
+
+class node_calendar(nodes.node_class):
+    our_type = 'collection'
+    DAV_PROPS = {
+            "http://calendarserver.org/ns/" : ('getctag',),
+            'http://groupdav.org/': ('resourcetype',),
             "urn:ietf:params:xml:ns:caldav" : (
                     'calendar-description',
                     'calendar-data',
@@ -155,10 +111,13 @@ class node_calendar(nodes.node_class):
                     'calendar-user-address-set',
                     'schedule-inbox-URL',
                     'schedule-outbox-URL',)}
-    M_NS = {
-           "DAV:" : '_get_dav', 
+    DAV_M_NS = {
+           "DAV:" : '_get_dav',
+           'http://groupdav.org/': '_get_gdav',
            "http://calendarserver.org/ns/" : '_get_dav',
-           "urn:ietf:params:xml:ns:caldav" : '_get_caldav'} 
+           "urn:ietf:params:xml:ns:caldav" : '_get_caldav'}
+
+    http_options = { 'DAV': ['calendar-access'] }
 
     def __init__(self,path, parent, context, calendar):
         super(node_calendar,self).__init__(path, parent,context)
@@ -170,45 +129,34 @@ class node_calendar(nodes.node_class):
         self.displayname = calendar.name
         self.cal_type = calendar.type
 
-    def _get_dav_getctag(self, cr):        
+    def _get_dav_getctag(self, cr):
         result = self._get_ttag(cr) + ':' + str(time.time())
-        return str(result) 
-
-    def match_dav_eprop(self, cr, match, ns, prop):
-        if ns == "DAV:" and prop == "getetag":
-            dirobj = self.context._dirobj
-            uid = self.context.uid
-            ctx = self.context.context.copy()            
-            tem, dav_time = tuple(match.split(':'))
-            model, res_id = tuple(tem.split('_'))
-            model_obj = dirobj.pool.get(model)
-            model = model_obj.browse(cr, uid, res_id, context=ctx)
-            write_time = model.write_date or model.create_date
-            wtime = time.mktime(time.strptime(write_time,'%Y-%m-%d %H:%M:%S'))            
-            if float(dav_time) == float(wtime):
-                return True
-            return False
-        res = super(node_calendar, self).match_dav_eprop(cr, match, ns, prop)
-        return res 
-        
-         
-    def get_domain(self, cr, filters):        
+        return str(result)
+
+    def get_dav_resourcetype(self, cr):
+        res = [ ('collection', 'DAV:'),
+                (str(self.cal_type + '-collection'), 'http://groupdav.org/'),
+                ('calendar', 'urn:ietf:params:xml:ns:caldav') ]
+        return res
+
+    def get_domain(self, cr, filters):
+        # TODO: doc.
         res = []
-        dirobj = self.context._dirobj
-        uid = self.context.uid
-        ctx = self.context.context.copy()
-        ctx.update(self.dctx)
-        calendar_obj = dirobj.pool.get('basic.calendar')
+        # dirobj = self.context._dirobj
+        #uid = self.context.uid
+        #ctx = self.context.context.copy()
+        #ctx.update(self.dctx)
+        # calendar_obj = dirobj.pool.get('basic.calendar')
         if not filters:
             return res
-        if filters.localName == 'calendar-query':      
+        if filters.localName == 'calendar-query':
             res = []
             for filter_child in filters.childNodes:
                 if filter_child.nodeType == filter_child.TEXT_NODE:
-                    continue                
-                if filter_child.localName == 'filter':                    
+                    continue
+                if filter_child.localName == 'filter':
                     for vcalendar_filter in filter_child.childNodes:
-                        if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE:                            
+                        if vcalendar_filter.nodeType == vcalendar_filter.TEXT_NODE:
                             continue
                         if vcalendar_filter.localName == 'comp-filter':
                             if vcalendar_filter.getAttribute('name') == 'VCALENDAR':
@@ -216,10 +164,10 @@ class node_calendar(nodes.node_class):
                                     if vevent_filter.nodeType == vevent_filter.TEXT_NODE:
                                         continue
                                     if vevent_filter.localName == 'comp-filter':
-                                        if vevent_filter.getAttribute('name') == 'VEVENT':    
+                                        if vevent_filter.getAttribute('name') == 'VEVENT':
                                             res = [('type','=','vevent')]
                                         if vevent_filter.getAttribute('name') == 'VTODO':
-                                            res = [('type','=','vtodo')]                                           
+                                            res = [('type','=','vtodo')]
             return res
         elif filters.localName == 'calendar-multiget':
             names = []
@@ -229,105 +177,70 @@ class node_calendar(nodes.node_class):
                 if filter_child.localName == 'href':
                     if not filter_child.firstChild:
                         continue
-                    uri = filter_child.firstChild.data  
+                    uri = filter_child.firstChild.data
                     caluri = uri.split('/')
                     if len(caluri):
                         caluri = caluri[-2]
                         if caluri not in names : names.append(caluri)
             res = [('name','in',names)]
             return res
-        return res  
+        return res
 
-    def children(self, cr, domain=None):     
+    def children(self, cr, domain=None):
         return self._child_get(cr, domain=domain)
 
-    def child(self,cr, name, domain=None):            
-        res = self._child_get(cr, name, domain=domain)                
+    def child(self,cr, name, domain=None):
+        res = self._child_get(cr, name, domain=domain)
         if res:
             return res[0]
-        return None 
+        return None
 
 
     def _child_get(self, cr, name=False, parent_id=False, domain=None):
         dirobj = self.context._dirobj
         uid = self.context.uid
         ctx = self.context.context.copy()
-        ctx.update(self.dctx)   
-        where = []                               
-        if name:            
-            where.append(('id','=',int(name))) 
+        ctx.update(self.dctx)
+        where = []
+        if name:
+            if name.endswith('.ics'):
+                name = name[:-4]
+            where.append(('id','=',int(name)))
         if not domain:
             domain = []
         #for opr1, opt, opr2 in domain:
         #    if opr1 == 'type' and opr2 != self.cal_type:
         #        return []
 
-        fil_obj = dirobj.pool.get('basic.calendar')  
+        fil_obj = dirobj.pool.get('basic.calendar')
         ids = fil_obj.search(cr, uid, domain)
         res = []
         if self.calendar_id in ids:
-            res = fil_obj.get_calendar_objects(cr, uid, [self.calendar_id], self, domain=where, context=ctx)  
-        return res    
-
-       
-   
-    def get_dav_props(self, cr):        
-        return self.PROPS
-
-    def get_dav_eprop(self,cr, ns, propname):
-        if self.M_NS.has_key(ns):
-            prefix = self.M_NS[ns]
-        else:
-            print "No namespace:",ns, "( for prop:", propname,")"
-            return None
-        propname = propname.replace('-','_')
-        mname = prefix + "_" + propname
-        if not hasattr(self, mname):
-            return None
-
-        try:
-            m = getattr(self, mname)
-            r = m(cr)            
-            return r
-        except AttributeError, e:
-            print 'Property %s not supported' % propname
-            print "Exception:", e            
-        return None
-
+            res = fil_obj.get_calendar_objects(cr, uid, [self.calendar_id], self, domain=where, context=ctx)
+        return res
 
-    def create_child(self,cr,path,data):
+    def create_child(self, cr, path, data):
         """ API function to create a child file object and node
             Return the node_* created
         """
-        return self.set_data(cr, data)        
+        # we ignore the path, it will be re-generated automatically
+        res = self.set_data(cr, data)
+        
+        # TODO: use the res to create at least one node
+        return None
 
 
     def set_data(self, cr, data, fil_obj = None):
         uid = self.context.uid
         calendar_obj = self.context._dirobj.pool.get('basic.calendar')
-        return calendar_obj.import_cal(cr, uid, base64.encodestring(data), self.calendar_id)
+        res = calendar_obj.import_cal(cr, uid, data, self.calendar_id)
+        return res
 
-    def get_data_len(self, cr, fil_obj = None):        
+    def get_data_len(self, cr, fil_obj = None):
         return self.content_length
 
-    
     def _get_ttag(self,cr):
-        return 'calendar-%d' % (self.calendar_id,)   
-    
-    
-
-    def get_etag(self, cr):
-        """ Get a tag, unique per object + modification.
-
-            see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
-        return self._get_ttag(cr) + ':' + self._get_wtag(cr)
-
-    def _get_wtag(self, cr):
-        """ Return the modification time as a unique, compact string """
-        if self.write_date:
-            wtime = time.mktime(time.strptime(self.write_date, '%Y-%m-%d %H:%M:%S'))
-        else: wtime = time.time()
-        return str(wtime)   
+        return 'calendar-%d' % (self.calendar_id,)
 
     def rmcol(self, cr):
         return False
@@ -335,7 +248,7 @@ class node_calendar(nodes.node_class):
 
 class res_node_calendar(nodes.node_class):
     our_type = 'file'
-    PROPS = {
+    DAV_PROPS = {
             "http://calendarserver.org/ns/" : ('getctag'),
             "urn:ietf:params:xml:ns:caldav" : (
                     'calendar-description',
@@ -344,76 +257,54 @@ class res_node_calendar(nodes.node_class):
                     'calendar-user-address-set',
                     'schedule-inbox-URL',
                     'schedule-outbox-URL',)}
-    M_NS = { 
+    DAV_M_NS = {
            "http://calendarserver.org/ns/" : '_get_dav',
-           "urn:ietf:params:xml:ns:caldav" : '_get_caldav'} 
+           "urn:ietf:params:xml:ns:caldav" : '_get_caldav'}
+
+    http_options = { 'DAV': ['calendar-access'] }
 
     def __init__(self,path, parent, context, res_obj, res_model=None, res_id=None):
-        super(res_node_calendar,self).__init__(path, parent, context)        
+        super(res_node_calendar,self).__init__(path, parent, context)
         self.mimetype = 'text/calendar'
         self.create_date = parent.create_date
         self.write_date = parent.write_date or parent.create_date
         self.calendar_id = hasattr(parent, 'calendar_id') and parent.calendar_id or False
         if res_obj:
             if not self.calendar_id: self.calendar_id = res_obj.id
-            self.create_date = res_obj.create_date
-            self.write_date = res_obj.write_date or res_obj.create_date
+            pr = res_obj.perm_read()[0]
+            self.create_date = pr.get('create_date')
+            self.write_date = pr.get('write_date') or pr.get('create_date')
             self.displayname = res_obj.name
 
         self.content_length = 0
-        
+
         self.model = res_model
         self.res_id = res_id
-         
+
     def open(self, cr, mode=False):
-        uid = self.context.uid        
+        uid = self.context.uid
         if self.type in ('collection','database'):
-            return False           
-        s = StringIO.StringIO(self.get_data(cr))        
+            return False
+        s = StringIO.StringIO(self.get_data(cr))
         s.name = self
-        return s           
-
-       
-   
-    def get_dav_props(self, cr):        
-        return self.PROPS
-
-    def get_dav_eprop(self,cr, ns, propname): 
-        if self.M_NS.has_key(ns):
-            prefix = self.M_NS[ns]
-        else:
-            print "No namespace:",ns, "( for prop:", propname,")"
-            return None
-        propname = propname.replace('-','_')
-        mname = prefix + "_" + propname
-        if not hasattr(self, mname):
-            return None
-
-        try:
-            m = getattr(self, mname)
-            r = m(cr)            
-            return r
-        except AttributeError, e:
-            print 'Property %s not supported' % propname
-            print "Exception:", e            
-        return None
-
+        return s
 
-    def get_data(self, cr, fil_obj = None):         
+    def get_data(self, cr, fil_obj = None):
         uid = self.context.uid
         calendar_obj = self.context._dirobj.pool.get('basic.calendar')
-        context = self.context.context.copy()   
-        context.update({'model': self.model, 'res_id':self.res_id})     
-        res = calendar_obj.export_cal(cr, uid, [self.calendar_id], context=context)        
+        context = self.context.context.copy()
+        context.update({'model': self.model, 'res_id':self.res_id})
+        res = calendar_obj.export_cal(cr, uid, [self.calendar_id], context=context)
         return res
 
-    def get_data_len(self, cr, fil_obj = None):        
+    def get_data_len(self, cr, fil_obj = None):
         return self.content_length
 
     def set_data(self, cr, data, fil_obj = None):
         uid = self.context.uid
         calendar_obj = self.context._dirobj.pool.get('basic.calendar')
-        return calendar_obj.import_cal(cr, uid, base64.encodestring(data), self.calendar_id)
+        res =  calendar_obj.import_cal(cr, uid, data, self.calendar_id)
+        return res
 
     def _get_ttag(self,cr):
         res = False
@@ -423,30 +314,28 @@ class res_node_calendar(nodes.node_class):
             res = '%d' % (self.calendar_id)
         return res
 
-
-    
-    def _get_caldav_calendar_data(self, cr):        
+    def _get_caldav_calendar_data(self, cr):
         return self.get_data(cr)
-        
+
 
     def _get_caldav_calendar_description(self, cr):
         uid = self.context.uid
         calendar_obj = self.context._dirobj.pool.get('basic.calendar')
         ctx = self.context.context.copy()
-        ctx.update(self.dctx)        
+        ctx.update(self.dctx)
         calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx)
         return calendar.description
-    
+
 
     def _get_caldav_calendar_home_set(self, cr):
         import xml.dom.minidom
-        import urllib       
+        import urllib
         uid = self.context.uid
         ctx = self.context.context.copy()
         ctx.update(self.dctx)
-        doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None)        
-        
-        calendar_obj = self.context._dirobj.pool.get('basic.calendar')             
+        doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None)
+
+        calendar_obj = self.context._dirobj.pool.get('basic.calendar')
         calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx)
         huri = doc.createTextNode(urllib.quote('/%s/%s' % (cr.dbname, calendar.collection_id.name)))
         href = doc.documentElement
@@ -461,7 +350,7 @@ class res_node_calendar(nodes.node_class):
         ctx = self.context.context.copy()
         ctx.update(self.dctx)
         user_obj = self.context._dirobj.pool.get('res.users')
-        user = user_obj.browse(cr, uid, uid, context=ctx)        
+        user = user_obj.browse(cr, uid, uid, context=ctx)
         doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None)
         href = doc.documentElement
         href.tagName = 'D:href'
@@ -472,11 +361,11 @@ class res_node_calendar(nodes.node_class):
 
     def _get_caldav_schedule_inbox_URL(self, cr):
         import xml.dom.minidom
-        import urllib        
+        import urllib
         uid = self.context.uid
         ctx = self.context.context.copy()
         ctx.update(self.dctx)
-        calendar_obj = self.context._dirobj.pool.get('basic.calendar')             
+        calendar_obj = self.context._dirobj.pool.get('basic.calendar')
         calendar = calendar_obj.browse(cr, uid, self.calendar_id, context=ctx)
         res = '%s/%s' %(calendar.name, calendar.collection_id.name)
         doc = xml.dom.minidom.getDOMImplementation().createDocument(None, 'href', None)
@@ -491,31 +380,15 @@ class res_node_calendar(nodes.node_class):
         uid = self.context.uid
         res = False
         if self.type in ('collection','database'):
-            return False          
-        if self.model and self.res_id:            
+            return False
+        if self.model and self.res_id:
             document_obj = self.context._dirobj.pool.get(self.model)
             if document_obj:
-                res = False
-                #res = document_obj.unlink(cr, uid, [self.res_id]) #TOFIX
-                
-        return res 
-
+                res =  document_obj.unlink(cr, uid, [self.res_id])
 
+        return res
 
     def _get_caldav_schedule_outbox_URL(self, cr):
         return self._get_caldav_schedule_inbox_URL(cr)
-    
-
-    def get_etag(self, cr):
-        """ Get a tag, unique per object + modification.
-
-            see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
-        return self._get_ttag(cr) + ':' + self._get_wtag(cr)
 
-    def _get_wtag(self, cr):
-        """ Return the modification time as a unique, compact string """
-        if self.write_date:
-            wtime = time.mktime(time.strptime(self.write_date, '%Y-%m-%d %H:%M:%S'))
-        else: wtime = time.time()
-        return str(wtime)          
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4
index d1cb79a..9184a0a 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
-       <data>
+    <data>
         <record model="ir.ui.view" id="view_calendar_collection_form">
         <field name="name">Calendar Collections : Form</field>
         <field name="model">document.directory</field>
     <record model="ir.ui.view" id="view_calendar_collection_tree">
         <field name="name">Calendar Collections : Tree</field>
         <field name="model">document.directory</field>
-        <field name="type">tree</field>        
+        <field name="type">tree</field>
         <field name="arch" type="xml">
             <tree string="Calendar Collections" toolbar="1">
-                <field name="name"/>                
+                <field name="name"/>
                 <field name="user_id"/>
                 <field name="create_date"/>
                 <field name="write_date"/>
                     <field name="name"/>
                     <field name="type"/>
                     <field name="user_id"/>
-                    <field name="collection_id" required="1"/>                                        
+                    <field name="collection_id" required="1"/>
                     <field name="line_ids" mode="form,tree" colspan="4" nolabel="1">
-                                           <form string="Calendar Lines">
-                                               <field name="name" required="1" select="1" />
-                                               <field name="object_id" required="1" select="1" />
-                                               <field name="domain" select="1" />
-                                               <field name="mapping_ids" select="1" colspan="4" nolabel="1">
-                                                       <tree string="Attributes Mapping" editable="bottom">
-                                                               <field name="name" required="1" domain="[('type', '=', parent.name)]"/>
-                                                               <field name="fn" select="1" />
-                                                               <field name="field_id" select="1" required="1" domain="[('model_id', '=', parent.object_id)]" />
-                                                               <field name="expr" />
-                                                       </tree>
-                                                       <form string="Attributes Mapping">
-                                                               <field name="name" select="1" required="1" domain="[('type', '=', parent.name)]"/>
-                                                               <field name="field_id" select="1" domain="[('model_id', '=', parent.object_id)]"
-                                                                       required="1" />
-                                                               <field name="fn" select="1" required="1" />
-                                                               <field name="expr" />
-                                                               <separator string="Value Mapping" colspan="4" />
-                                                               <field name="mapping" select="1" colspan="4" nolabel="1" />
-                                                       </form>
-                                              </field>
-                                       </form>
+                        <form string="Calendar Lines">
+                            <field name="name" required="1" select="1" />
+                            <field name="object_id" required="1" select="1" />
+                            <field name="domain" select="1" />
+                            <field name="mapping_ids" select="1" colspan="4" nolabel="1">
+                                <tree string="Attributes Mapping" editable="bottom">
+                                    <field name="name" required="1" domain="[('type', '=', parent.name)]"/>
+                                    <field name="fn" select="1" />
+                                    <field name="field_id" select="1" required="1" domain="[('model_id', '=', parent.object_id)]" />
+                                    <field name="expr" />
+                                </tree>
+                                <form string="Attributes Mapping">
+                                    <field name="name" select="1" required="1" domain="[('type', '=', parent.name)]"/>
+                                    <field name="field_id" select="1" domain="[('model_id', '=', parent.object_id)]"
+                                        required="1" />
+                                    <field name="fn" select="1" required="1" />
+                                    <field name="expr" />
+                                    <separator string="Value Mapping" colspan="4" />
+                                    <field name="mapping" select="1" colspan="4" nolabel="1" />
+                                </form>
+                           </field>
+                        </form>
                         <tree string="Calendar Lines" editable="bottom">
-                                               <field name="name" select="1" />
-                                               <field name="object_id" select="1" />
-                                       </tree>
+                            <field name="name" select="1" />
+                            <field name="object_id" select="1" />
+                        </tree>
                     </field>
             </form>
         </field>
     <record model="ir.ui.view" id="view_caldav_tree">
         <field name="name">Calendar : Tree</field>
         <field name="model">basic.calendar</field>
-        <field name="type">tree</field>        
+        <field name="type">tree</field>
         <field name="arch" type="xml">
             <tree string="Calendars" toolbar="1">
-                <field name="name"/>  
-                <field name="type"/>               
+                <field name="name"/>
+                <field name="type"/>
                 <field name="user_id"/>
                 <field name="create_date"/>
                 <field name="write_date"/>
         <field name="type">ir.actions.act_window</field>
         <field name="res_model">basic.calendar</field>
         <field name="view_type">form</field>
-        <field name="view_mode">tree,form</field>        
-    </record>    
+        <field name="view_mode">tree,form</field>
+    </record>
 
     <record id="action_caldav_view1" model="ir.actions.act_window.view">
         <field eval="10" name="sequence"/>
         action="action_caldav_form"
         id="menu_caldav_directories"
         parent="menu_calendar"/>
-       </data>
+    </data>
 </openerp>
index a451525..04bcd6e 100644 (file)
@@ -24,7 +24,6 @@ from dateutil import parser
 from dateutil.rrule import *
 from osv import osv, fields
 from tools.translate import _
-import base64
 import math
 import pooler
 import pytz
@@ -52,6 +51,8 @@ def uid2openobjectid(cr, uidval, oomodel, rdate):
         @param rdate: Get Recurrent Date
     """
     __rege = re.compile(r'OpenObject-([\w|\.]+)_([0-9]+)@(\w+)$')
+    if not uidval:
+        return (False, None)
     wematch = __rege.match(uidval.encode('utf8'))
     if not wematch:
         return (False, None)
@@ -133,7 +134,7 @@ def map_data(cr, uid, obj, context=None):
                     continue
                 mapping = obj.__attribute__[map_dict].get('mapping', False)
                 if mapping:
-                    map_val = mapping[map_val.lower()]
+                    map_val = mapping.get(map_val.lower(), False)
                 else:
                     map_val = map_val.lower()
             if field_type == 'many2many':
@@ -229,7 +230,8 @@ class CalDAV(object):
         att_data = []
         for cal_data in child.getChildren():
             if cal_data.name.lower() == 'organizer':
-                self.ical_set(cal_data.name.lower(), {'name':cal_data.params['CN']}, 'value')
+                self.ical_set(cal_data.name.lower(), {'name': cal_data.params.get('CN') and cal_data.params.get('CN')[0]}, 'value')
+                continue
             if cal_data.name.lower() == 'attendee':
                 ctx = context.copy()
                 if cal_children:
@@ -381,7 +383,7 @@ class CalDAV(object):
             raise osv.except_osv(('Error !'), (str(e)))
         return ids
 
-    def export_cal(self, cr, uid, datas, vobj=None, context={}):
+    def export_cal(self, cr, uid, datas, vobj=None, context=None):
         """ Export Calendar
             @param self: The object pointer
             @param cr: the current row, from the database cursor,
@@ -396,7 +398,7 @@ class CalDAV(object):
             self.create_ics(cr, uid, datas, vobj, ical, context=context)
             return ical
         except Exception, e:
-            raise osv.except_osv(('Error !'), (str(e)))
+            raise  # osv.except_osv(('Error !'), (str(e)))
 
     def import_cal(self, cr, uid, content, data_id=None, context=None):
         """ Import Calendar
@@ -407,7 +409,7 @@ class CalDAV(object):
             @param context: A standard dictionary for contextual values
         """
 
-        ical_data = base64.decodestring(content)
+        ical_data = content
         self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context)
         parsedCal = vobject.readOne(ical_data)
         res = []
@@ -447,8 +449,8 @@ class Calendar(CalDAV, osv.osv):
             'type': fields.selection([('vevent', 'Event'), ('vtodo', 'TODO')], \
                                     string="Type", size=64),
             'line_ids': fields.one2many('basic.calendar.lines', 'calendar_id', 'Calendar Lines'),
-            'create_date': fields.datetime('Created Date'),
-            'write_date': fields.datetime('Modifided Date'),
+            'create_date': fields.datetime('Created Date', readonly=True),
+            'write_date': fields.datetime('Modifided Date', readonly=True),
     }
 
     def get_calendar_objects(self, cr, uid, ids, parent=None, domain=None, context=None):
@@ -473,17 +475,16 @@ class Calendar(CalDAV, osv.osv):
                 data_ids = mod_obj.search(cr, uid, line_domain, context=context)
                 for data in mod_obj.browse(cr, uid, data_ids, context):
                     ctx = parent and parent.context or None
-                    node = res_node_calendar('%s' %data.id, parent, ctx, data, line.object_id.model, data.id)
+                    node = res_node_calendar('%s.ics' %data.id, parent, ctx, data, line.object_id.model, data.id)
                     res.append(node)
         return res
 
     def export_cal(self, cr, uid, ids, vobj='vevent', context=None):
         """ Export Calendar
-            @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 calendar’s IDs
-            @param context: A standard dictionary for contextual values
+            @param vobj: the type of object to export
+            
+            @return the ical data.
         """
         if not context:
            context = {}
@@ -521,7 +522,7 @@ class Calendar(CalDAV, osv.osv):
         if not context:
             context = {}
         vals = []
-        ical_data = base64.decodestring(content)
+        ical_data = content
         parsedCal = vobject.readOne(ical_data)
         if not data_id:
             data_id = self.search(cr, uid, [])[0]
@@ -541,14 +542,19 @@ class Calendar(CalDAV, osv.osv):
                 val = self.parse_ics(cr, uid, child, cal_children=cal_children, context=context)
                 vals.append(val)
                 objs.append(cal_children[child.name.lower()])
+        
+        res = []
         for obj_name in list(set(objs)):
             obj = self.pool.get(obj_name)
             if hasattr(obj, 'check_import'):
-                obj.check_import(cr, uid, vals, context=context)
+                r = obj.check_import(cr, uid, vals, context=context)
                 checked = True
+                res.extend(r)
+
         if not checked:
-            self.check_import(cr, uid, vals, context=context)
-        return {}
+            r = self.check_import(cr, uid, vals, context=context)
+            res.extend(r)
+        return res
 Calendar()
 
 
@@ -632,6 +638,10 @@ class basic_calendar_fields(osv.osv):
         'fn': lambda *a: 'field',
     }
 
+    _sql_constraints = [
+        ( 'name_type_uniq', 'UNIQUE(name, type_id)', 'Can not map a field more than once'),
+    ]
+
     def check_line(self, cr, uid, vals, name, context=None):
         """ check calendar's line
             @param self: The object pointer
@@ -667,12 +677,6 @@ class basic_calendar_fields(osv.osv):
         name = name[0]
         if name in ('valarm', 'attendee'):
             self.check_line(cr, uid, vals, name, context=context)
-        cr.execute("Select count(id) from basic_calendar_fields \
-                                where name=%s and type_id=%s" % (vals.get('name'), vals.get('type_id')))
-        res = cr.fetchone()
-        if res:
-            if res[0] > 0:
-                raise osv.except_osv(_('Warning !'), _('Can not map the field more than once'))
         return super(basic_calendar_fields, self).create(cr, uid, vals, context=context)
 
     def write(self, cr, uid, ids, vals, context=None):
@@ -691,13 +695,6 @@ class basic_calendar_fields(osv.osv):
             name = field.name.name
             if name in ('valarm', 'attendee'):
                 self.check_line(cr, uid, vals, name, context=context)
-            qry = "Select count(id) from basic_calendar_fields \
-                                where name=%s and type_id=%s" % (field.name.id, field.type_id.id)
-            cr.execute(qry)
-            res = cr.fetchone()
-            if res:
-                if res[0] > 1:
-                    raise osv.except_osv(_('Warning !'), _('Can not map same field more than once'))
         return super(basic_calendar_fields, self).write(cr, uid, ids, vals, context)
 
 basic_calendar_fields()
index cfadf94..3161bb7 100644 (file)
@@ -1,25 +1,25 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
     <data>
-               <record id="view_calendar_event_export" model="ir.ui.view">
+        <record id="view_calendar_event_export" model="ir.ui.view">
             <field name="name">calendar.event.export.form</field>
             <field name="model">calendar.event.export</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Export ICS">
-                       <group colspan="4" >
-                                <field name="name"/>
-                                <field name="file_path" colspan="4" width="300"/>
+                    <group colspan="4" >
+                         <field name="name"/>
+                         <field name="file_path" colspan="4" width="300"/>
                     </group>
-                               <separator string="" colspan="4" />
+                        <separator string="" colspan="4" />
                     <group colspan="4" col="6">
-                       <label string=""/>
-                       <button  icon="gtk-close" special="cancel" string="_Close"/>
+                        <label string=""/>
+                        <button  icon="gtk-close" special="cancel" string="_Close"/>
                    </group>
                </form>
             </field>
-               </record>
-               
+        </record>
+        
         <record id="action_calendar_event_export" model="ir.actions.act_window">
             <field name="name">Export .ics File</field>
             <field name="res_model">calendar.event.export</field>
         </record>
 
 
-       <act_window id="action_calendar_event_export_values"
-               key2="client_action_multi" name="Export .ics File"
-               res_model="calendar.event.export" src_model="basic.calendar"
-               view_mode="form" target="new" view_type="form" />
+        <act_window id="action_calendar_event_export_values"
+            key2="client_action_multi" name="Export .ics File"
+            res_model="calendar.event.export" src_model="basic.calendar"
+            view_mode="form" target="new" view_type="form" />
 
     </data>
 </openerp>
index 64a1990..875e48d 100644 (file)
@@ -51,7 +51,7 @@ class calendar_event_import(osv.osv_memory):
             id2 = data_obj._get_id(cr, uid, 'caldav', 'view_calendar_event_import_display')
             if id2:
                  id2 = data_obj.browse(cr, uid, id2, context=context).res_id
-            vals = model_obj.import_cal(cr, uid, data['file_path'], context['active_id'], context)
+            vals = model_obj.import_cal(cr, uid, base64.decodestring(data['file_path']), context['active_id'], context)
             global cnt
             if vals:
                 cnt = len(vals)
index 7e31d08..41afcc7 100644 (file)
@@ -1,42 +1,42 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
     <data>
-               <record id="view_calendar_event_import" model="ir.ui.view">
+        <record id="view_calendar_event_import" model="ir.ui.view">
             <field name="name">calendar.event.import.form</field>
             <field name="model">calendar.event.import</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Import ICS">
-                       <group colspan="4" >
-                                <separator string="Select ICS file"/>
-                                <field name="file_path" colspan="4" width="300" nolabel="1"/>
+                    <group colspan="4" >
+                         <separator string="Select ICS file"/>
+                         <field name="file_path" colspan="4" width="300" nolabel="1"/>
                     </group>
-                               <separator string="" colspan="4" />
+                        <separator string="" colspan="4" />
                     <group colspan="4" col="6">
-                       <button  icon="gtk-cancel" special="cancel" string="_Cancel"/>
-                       <button  icon="gtk-ok"  name="process_imp_ics"  string="_Import" type="object"/>
+                        <button  icon="gtk-cancel" special="cancel" string="_Cancel"/>
+                        <button  icon="gtk-ok"  name="process_imp_ics"  string="_Import" type="object"/>
                    </group>
                </form>
             </field>
-               </record>
-               
-               <record id="view_calendar_event_import_display" model="ir.ui.view">
+        </record>
+        
+        <record id="view_calendar_event_import_display" model="ir.ui.view">
             <field name="name">calendar.event.import.form.display</field>
             <field name="model">calendar.event.import</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Import Message">
-                       <group colspan="4" >
-                                 <field name="msg" colspan="4" width="300" nolabel="1"/>
+                    <group colspan="4" >
+                          <field name="msg" colspan="4" width="300" nolabel="1"/>
                     </group>
-                               <separator string="" colspan="4" />
+                        <separator string="" colspan="4" />
                     <group colspan="4">
-                       <button  icon="gtk-ok" special="cancel" string="Ok"/>
+                        <button  icon="gtk-ok" special="cancel" string="Ok"/>
                    </group>
                </form>
             </field>
-               </record>
-               
+        </record>
+        
         <record id="action_calendar_event_import" model="ir.actions.act_window">
             <field name="name">Import .ics File</field>
             <field name="res_model">calendar.event.import</field>
@@ -47,9 +47,9 @@
         </record>
               
        <act_window id="action_calendar_event_import_values"
-               key2="client_action_multi" name="Import .ics File"
-               res_model="calendar.event.import" src_model="basic.calendar"
-               view_mode="form" target="new" view_type="form" />
-               
+            key2="client_action_multi" name="Import .ics File"
+            res_model="calendar.event.import" src_model="basic.calendar"
+            view_mode="form" target="new" view_type="form" />
+        
     </data>
 </openerp>
index 39eaae2..5636353 100644 (file)
@@ -1,42 +1,42 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
     <data>
-               <record id="view_calendar_event_subscribe" model="ir.ui.view">
+        <record id="view_calendar_event_subscribe" model="ir.ui.view">
             <field name="name">calendar.event.subscribe.form</field>
             <field name="model">calendar.event.subscribe</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Subscribe to Remote Calendar">
-                       <group colspan="4" >
-                                <separator string="Provide path for Remote Calendar"/>
-                                 <field name="url_path" colspan="4" width="300" nolabel="1" widget="url"/>
+                    <group colspan="4" >
+                         <separator string="Provide path for Remote Calendar"/>
+                          <field name="url_path" colspan="4" width="300" nolabel="1" widget="url"/>
                     </group>
-                               <separator string="" colspan="4" />
+                        <separator string="" colspan="4" />
                     <group colspan="4" col="6">
-                       <button  icon="gtk-cancel" special="cancel" string="_Cancel"/>
-                       <button  icon="gtk-ok"  name="process_imp_ics"  string="_Subscribe" type="object"/>
+                        <button  icon="gtk-cancel" special="cancel" string="_Cancel"/>
+                        <button  icon="gtk-ok"  name="process_imp_ics"  string="_Subscribe" type="object"/>
                    </group>
                </form>
             </field>
-               </record>
-               
-               <record id="view_calendar_event_subscribe_display" model="ir.ui.view">
+        </record>
+        
+        <record id="view_calendar_event_subscribe_display" model="ir.ui.view">
             <field name="name">calendar.event.subscribe.form.display</field>
             <field name="model">calendar.event.subscribe</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Message...">
-                       <group colspan="4" >
-                                 <field name="msg" colspan="4" width="300" nolabel="1"/>
+                    <group colspan="4" >
+                          <field name="msg" colspan="4" width="300" nolabel="1"/>
                     </group>
-                               <separator string="" colspan="4" />
+                        <separator string="" colspan="4" />
                     <group colspan="4">
-                       <button  icon="gtk-ok" special="cancel" string="Ok"/>
+                        <button  icon="gtk-ok" special="cancel" string="Ok"/>
                    </group>
                </form>
             </field>
-               </record>
-               
+        </record>
+        
         <record id="action_calendar_event_subscribe" model="ir.actions.act_window">
             <field name="name">Subscribe</field>
             <field name="res_model">calendar.event.subscribe</field>
@@ -47,9 +47,9 @@
         </record>
         
         <act_window id="action_calendar_event_subscribe_values"
-               key2="client_action_multi" name="Subscribe"
-               res_model="calendar.event.subscribe" src_model="basic.calendar"
-               view_mode="form" target="new" view_type="form" />
+            key2="client_action_multi" name="Subscribe"
+            res_model="calendar.event.subscribe" src_model="basic.calendar"
+            view_mode="form" target="new" view_type="form" />
         
     </data>
 </openerp>
index 2eae682..6702e86 100644 (file)
@@ -105,6 +105,7 @@ class crm_lead(osv.osv, crm_case):
             select=True, help="Optional linked partner, usually after conversion of the lead"),
         
         # From crm.case
+        'id': fields.integer('ID'),
         'name': fields.char('Name', size=64),
         'active': fields.boolean('Active', required=False),
         'date_action_last': fields.datetime('Last Action', readonly=1),
index 61bb4f3..e44d0ed 100644 (file)
@@ -35,6 +35,7 @@ class crm_phonecall(osv.osv, crm_case):
     _inherit = ['mailgate.thread']
     _columns = {
         # From crm.case
+        'id': fields.integer('ID'),
         'name': fields.char('Name', size=64),
         'active': fields.boolean('Active', required=False), 
         'date_action_last': fields.datetime('Last Action', readonly=1),
index f8e45ea..1081565 100644 (file)
@@ -8,13 +8,13 @@ msgstr ""
 "Project-Id-Version: openobject-addons\n"
 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
 "POT-Creation-Date: 2010-01-05 05:59+0000\n"
-"PO-Revision-Date: 2010-08-03 04:22+0000\n"
-"Last-Translator: mga (Open ERP) <Unknown>\n"
+"PO-Revision-Date: 2010-08-07 02:19+0000\n"
+"Last-Translator: OpenERP Administrators <Unknown>\n"
 "Language-Team: Finnish <fi@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: 2010-08-04 03:38+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:42+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: crm
index f9c9029..52f1dcd 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2010-01-05 05:59+0000\n"
-"PO-Revision-Date: 2010-08-03 04:35+0000\n"
-"Last-Translator: mga (Open ERP) <Unknown>\n"
+"PO-Revision-Date: 2010-08-07 03:00+0000\n"
+"Last-Translator: OpenERP Administrators <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: 2010-08-04 03:38+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: crm
index 905b1bb..9e7954e 100644 (file)
@@ -115,7 +115,6 @@ class crm_claim(osv.osv, crm.crm_case):
         addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['contact'])
         data = {'partner_address_id': addr['contact']}
         data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value'])
-        print data
         return {'value': data}
 
     def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
index f1ac35c..228f104 100644 (file)
@@ -44,6 +44,20 @@ from StringIO import StringIO
 #   root: if we are at the first directory of a ressource
 #
 
+def _str2time(cre):
+    """ Convert a string with time representation (from db) into time (float)
+    
+        Note: a place to fix if datetime is used in db.
+    """
+    if not cre:
+        return time.time()
+    frac = 0.0
+    if isinstance(cre, basestring) and '.' in cre:
+        fdot = cre.find('.')
+        frac = float(cre[fdot:])
+        cre = cre[:fdot]
+    return time.mktime(time.strptime(cre,'%Y-%m-%d %H:%M:%S')) + frac
+
 def get_node_context(cr, uid, context):
     return node_context(cr, uid, context)
 
@@ -157,6 +171,8 @@ class node_class(object):
         Nodes have attributes which contain usual file properties
         """
     our_type = 'baseclass'
+    DAV_PROPS = None
+    DAV_M_NS = None
 
     def __init__(self, path, parent, context):
         assert isinstance(context,node_context)
@@ -253,24 +269,21 @@ class node_class(object):
             see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
         return self._get_ttag(cr) + ':' + self._get_wtag(cr)
 
-    def _get_wtag(self,cr):
+    def _get_wtag(self, cr):
         """ Return the modification time as a unique, compact string """
-        if self.write_date:
-            wtime = time.mktime(time.strptime(self.write_date,'%Y-%m-%d %H:%M:%S'))
-        else: wtime = time.time()
-        return str(wtime)
+        return str(_str2time(self.write_date))
 
     def _get_ttag(self,cr):
         """ Get a unique tag for this type/id of object.
             Must be overriden, so that each node is uniquely identified.
         """
         print "node_class.get_ttag()",self
-        raise RuntimeError("get_etag stub()")
+        raise NotImplementedError("get_etag stub()")
 
     def get_dav_props(self, cr):
         """ If this class has special behaviour for GroupDAV etc, export
         its capabilities """
-        return {}
+        return self.DAV_PROPS or {}
 
     def match_dav_eprop(self, cr, match, ns, prop):
         res = self.get_dav_eprop(cr, ns, prop)
@@ -279,8 +292,36 @@ class node_class(object):
         return False
 
     def get_dav_eprop(self, cr, ns, prop):
+        if not self.DAV_M_NS:
+            return None
+        
+        if self.DAV_M_NS.has_key(ns):
+            prefix = self.DAV_M_NS[ns]
+        else:
+            logger.debug('No namespace: %s ("%s")',ns, prop)
+            return None
+
+        mname = prefix + "_" + prop.replace('-','_')
+
+        if not hasattr(self, mname):
+            return None
+
+        try:
+            m = getattr(self, mname)
+            r = m(cr)
+            return r
+        except AttributeError:
+            logger.debug('Property %s not supported' % prop, exc_info=True)
         return None
 
+    def get_dav_resourcetype(self, cr):
+        """ Get the DAV resource type.
+        
+            Is here because some nodes may exhibit special behaviour, like
+            CalDAV/GroupDAV collections
+        """
+        raise NotImplementedError
+
     def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False):
         """ Move this node to a new parent directory.
         @param ndir_node the collection that this node should be moved under
@@ -327,6 +368,7 @@ class node_class(object):
         raise NotImplementedError(repr(self))
 
     def get_domain(self, cr, filters):
+        # TODO Document
         return []
 
     def check_perms(self, perms):
@@ -422,6 +464,9 @@ class node_database(node_class):
     def _get_ttag(self,cr):
         return 'db-%s' % cr.dbname
 
+    def get_dav_resourcetype(self, cr):
+        return ('collection', 'DAV:')
+
 def mkdosname(company_name, default='noname'):
     """ convert a string to a dos-like name"""
     if not company_name:
@@ -573,19 +618,6 @@ class node_dir(node_database):
             fnode.set_data(cr, data, fil)
         return fnode
 
-    def get_etag(self, cr):
-        """ Get a tag, unique per object + modification.
-
-            see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
-        return self._get_ttag(cr) + ':' + self._get_wtag(cr)
-
-    def _get_wtag(self, cr):
-        """ Return the modification time as a unique, compact string """
-        if self.write_date:
-            wtime = time.mktime(time.strptime(self.write_date, '%Y-%m-%d %H:%M:%S'))
-        else: wtime = time.time()
-        return str(wtime)
-
     def _get_ttag(self,cr):
         return 'dir-%d' % self.dir_id
 
@@ -757,6 +789,9 @@ class node_res_dir(node_class):
     def _get_ttag(self,cr):
         return 'rdir-%d' % self.dir_id
 
+    def get_dav_resourcetype(self, cr):
+        return ('collection', 'DAV:')
+
 class node_res_obj(node_class):
     """ A special sibling to node_dir, which does only contain dynamically
         created folders foreach resource in the foreign model.
@@ -1013,6 +1048,9 @@ class node_res_obj(node_class):
     def _get_ttag(self,cr):
         return 'rodir-%d-%d' % (self.dir_id, self.res_id)
 
+    def get_dav_resourcetype(self, cr):
+        return ('collection', 'DAV:')
+
 class node_file(node_class):
     our_type = 'file'
     def __init__(self, path, parent, context, fil):
@@ -1147,6 +1185,9 @@ class node_file(node_class):
     def _get_ttag(self,cr):
         return 'file-%d' % self.file_id
 
+    def get_dav_resourcetype(self, cr):
+        return ''
+
     def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False):
         if ndir_node.context != self.context:
             raise NotImplementedError("Cannot move files between contexts")
@@ -1292,6 +1333,8 @@ class node_content(node_class):
     def _get_ttag(self,cr):
         return 'cnt-%d%s' % (self.cnt_id,(self.act_id and ('-' + str(self.act_id))) or '')
 
+    def get_dav_resourcetype(self, cr):
+        return ''
 
 class nodefd_content(StringIO, node_descriptor):
     """ A descriptor to content nodes
index ab9d3a7..af8738e 100644 (file)
@@ -46,6 +46,10 @@ CACHE_SIZE=20000
 urlparse.uses_netloc.append('webdav')
 urlparse.uses_netloc.append('webdavs')
 
+day_names = { 0: 'Mon', 1: 'Tue' , 2: 'Wed', 3: 'Thu', 4: 'Fri', 5: 'Sat', 6: 'Sun' }
+month_names = { 1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun',
+        7: 'Jul', 8: 'Aug', 9: 'Sep', 10: 'Oct', 11: 'Nov', 12: 'Dec' }
+
 class DAV_NotFound2(DAV_NotFound):
     """404 exception, that accepts our list uris
     """
@@ -55,6 +59,19 @@ class DAV_NotFound2(DAV_NotFound):
             args = (path, )
         DAV_NotFound.__init__(self, *args)
 
+
+def _str2time(cre):
+    """ Convert a string with time representation (from db) into time (float)
+    """
+    if not cre:
+        return time.time()
+    frac = 0.0
+    if isinstance(cre, basestring) and '.' in cre:
+        fdot = cre.find('.')
+        frac = float(cre[fdot:])
+        cre = cre[:fdot]
+    return time.mktime(time.strptime(cre,'%Y-%m-%d %H:%M:%S')) + frac
+
 class openerp_dav_handler(dav_interface):
     """
     This class models a OpenERP interface for the DAV server
@@ -79,20 +96,21 @@ class openerp_dav_handler(dav_interface):
             return props
         node = self.uri2object(cr, uid, pool, uri2)
         if node:
+            props = props.copy()
             props.update(node.get_dav_props(cr))
         cr.close()     
         return props
 
-    def _try_function(self, funct, args, opname='run function', cr=None, 
-           default_exc=DAV_Forbidden):
+    def _try_function(self, funct, args, opname='run function', cr=None,
+            default_exc=DAV_Forbidden):
         """ Try to run a function, and properly convert exceptions to DAV ones.
-        
+
             @objname the name of the operation being performed
             @param cr if given, the cursor to close at exceptions
         """
-        
+
         try:
-            funct(*args)
+            return funct(*args)
         except DAV_Error:
             if cr: cr.close()
             raise
@@ -111,7 +129,7 @@ class openerp_dav_handler(dav_interface):
             raise default_exc(err.strerror)
         except Exception,e:
             import traceback
-            self.parent.log_error("Cannot create %s: %s", opname, str(e))
+            self.parent.log_error("Cannot %s: %s", opname, str(e))
             self.parent.log_message("Exc: %s",traceback.format_exc())
             raise default_exc("Operation failed")
 
@@ -122,6 +140,8 @@ class openerp_dav_handler(dav_interface):
         raise DAV_NotFound
 
     def match_prop(self, uri, match, ns, propname):        
+        if self.M_NS.has_key(ns):
+            return match == dav_interface.get_prop(self, uri, ns, propname)
         cr, uid, pool, dbname, uri2 = self.get_cr(uri)
         if not dbname:
             if cr: cr.close()
@@ -134,6 +154,37 @@ class openerp_dav_handler(dav_interface):
         cr.close()          
         return res  
 
+    def prep_http_options(self, uri, opts):
+        """see HttpOptions._prep_OPTIONS """
+        self.parent.log_message('get options: %s' % uri)
+        cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True)
+
+        if not dbname:
+            if cr: cr.close()
+            return opts
+        node = self.uri2object(cr, uid, pool, uri2[:])
+
+        if not node:
+            if cr: cr.close()
+            return opts
+        else:
+            if hasattr(node, 'http_options'):
+                ret = opts.copy()
+                for key, val in node.http_options.items():
+                    if isinstance(val, basestring):
+                        val = [val, ]
+                    if key in ret:
+                        ret[key] = ret[key][:]  # copy the orig. array
+                    else:
+                        ret[key] = []
+                    ret[key].extend(val)
+
+                self.parent.log_message('options: %s' % ret)
+            else:
+                ret = opts
+            cr.close()
+            return ret
+
     def get_prop(self, uri, ns, propname):
         """ return the value of a given property
 
@@ -159,18 +210,18 @@ class openerp_dav_handler(dav_interface):
         """Parse the uri and get the dbname and the rest.
            Db name should be the first component in the unix-like
            path supplied in uri.
-           
+
            @param rest_ret Instead of the db_name, return (db_name, rest),
                 where rest is the remaining path
            @param allow_last If the dbname is the last component in the
                 path, allow it to be resolved. The default False value means
                 we will not attempt to use the db, unless there is more
                 path.
-                
+
            @return db_name or (dbname, rest) depending on rest_ret,
                 will return dbname=False when component is not found.
         """
-        
+
         uri2 = self.uri2local(uri)
         if uri2.startswith('/'):
             uri2 = uri2[1:]
@@ -294,7 +345,7 @@ class openerp_dav_handler(dav_interface):
         try:
             if not dbname:
                 raise DAV_Error, 409
-            node = self.uri2object(cr, uid, pool, uri2)   
+            node = self.uri2object(cr, uid, pool, uri2)
             if not node:
                 raise DAV_NotFound2(uri2)
             try:
@@ -319,19 +370,22 @@ class openerp_dav_handler(dav_interface):
             if cr: cr.close()    
 
     @memoize(CACHE_SIZE)
-    def _get_dav_resourcetype(self,uri):
+    def _get_dav_resourcetype(self, uri):
         """ return type of object """        
         self.parent.log_message('get RT: %s' % uri)
         cr, uid, pool, dbname, uri2 = self.get_cr(uri)
         try:
             if not dbname:
                 return COLLECTION
-            node = self.uri2object(cr,uid,pool, uri2)
+            node = self.uri2object(cr, uid, pool, uri2)
             if not node:
                 raise DAV_NotFound2(uri2)
-            if node.type in ('collection','database'):
-                return COLLECTION
-            return OBJECT
+            try:
+                return node.get_dav_resourcetype(cr)
+            except NotImplementedError:
+                if node.type in ('collection','database'):
+                    return ('collection', 'DAV:')
+                return ''
         finally:
             if cr: cr.close()
 
@@ -339,11 +393,11 @@ class openerp_dav_handler(dav_interface):
         self.parent.log_message('get DN: %s' % uri)
         cr, uid, pool, dbname, uri2 = self.get_cr(uri)
         if not dbname:
-            cr.close()
+            if cr: cr.close()
             return COLLECTION
         node = self.uri2object(cr, uid, pool, uri2)
         if not node:
-            cr.close()
+            if cr: cr.close()
             raise DAV_NotFound2(uri2)
         cr.close()
         return node.displayname
@@ -359,7 +413,7 @@ class openerp_dav_handler(dav_interface):
             return str(result)
         node = self.uri2object(cr, uid, pool, uri2)
         if not node:
-            cr.close()
+            if cr: cr.close()
             raise DAV_NotFound2(uri2)
         result = node.content_length or 0
         cr.close()
@@ -372,34 +426,41 @@ class openerp_dav_handler(dav_interface):
         result = 0
         cr, uid, pool, dbname, uri2 = self.get_cr(uri)
         if not dbname:
-            cr.close()
+            if cr: cr.close()
             return '0'
         node = self.uri2object(cr, uid, pool, uri2)
         if not node:
             cr.close()
             raise DAV_NotFound2(uri2)
-        result = node.get_etag(cr)
+        result = self._try_function(node.get_etag ,(cr,), "etag %s" %uri, cr=cr)
         cr.close()
         return str(result)
 
     @memoize(CACHE_SIZE)
     def get_lastmodified(self, uri):
         """ return the last modified date of the object """
-        today = time.time()
         cr, uid, pool, dbname, uri2 = self.get_cr(uri)
         if not dbname:
-            return today
+            return time.time()
         try:            
             node = self.uri2object(cr, uid, pool, uri2)
             if not node:
                 raise DAV_NotFound2(uri2)
-            if node.write_date:
-                return time.mktime(time.strptime(node.write_date,'%Y-%m-%d %H:%M:%S'))
-            else:
-                return today
+            return _str2time(node.write_date)
         finally:
             if cr: cr.close()
 
+    def _get_dav_getlastmodified(self,uri):
+        """ return the last modified date of a resource
+        """
+        d=self.get_lastmodified(uri)
+        # format it. Note that we explicitly set the day, month names from
+        # an array, so that strftime() doesn't use its own locale-aware
+        # strings.
+        gmt = time.gmtime(d)
+        return time.strftime("%%s, %d %%s %Y %H:%M:%S GMT", gmt ) % \
+                    (day_names[gmt.tm_wday], month_names[gmt.tm_mon])
+
     @memoize(CACHE_SIZE)
     def get_creationdate(self, uri):
         """ return the last modified date of the object """        
@@ -410,11 +471,8 @@ class openerp_dav_handler(dav_interface):
             node = self.uri2object(cr, uid, pool, uri2)
             if not node:
                 raise DAV_NotFound2(uri2)
-            if node.create_date:
-                result = time.mktime(time.strptime(node.create_date,'%Y-%m-%d %H:%M:%S'))
-            else:
-                result = time.time()
-            return result
+
+            return _str2time(node.create_date)
         finally:
             if cr: cr.close()
 
@@ -423,6 +481,7 @@ class openerp_dav_handler(dav_interface):
         self.parent.log_message('get contenttype: %s' % uri)
         cr, uid, pool, dbname, uri2 = self.get_cr(uri)
         if not dbname:
+            if cr: cr.close()
             return 'httpd/unix-directory'
         try:            
             node = self.uri2object(cr, uid, pool, uri2)
@@ -441,10 +500,10 @@ class openerp_dav_handler(dav_interface):
         self.parent.log_message('MKCOL: %s' % uri)
         cr, uid, pool, dbname, uri2 = self.get_cr(uri)
         if not uri2[-1]:
-            cr.close()
+            if cr: cr.close()
             raise DAV_Error(409, "Cannot create nameless collection")
         if not dbname:
-            cr.close()
+            if cr: cr.close()
             raise DAV_Error, 409
         node = self.uri2object(cr,uid,pool, uri2[:-1])
         if not node:
@@ -466,10 +525,11 @@ class openerp_dav_handler(dav_interface):
         parent='/'.join(uri.split('/')[:-1])
         cr, uid, pool,dbname, uri2 = self.get_cr(uri)
         if not dbname:
+            if cr: cr.close()
             raise DAV_Forbidden
         try:
             node = self.uri2object(cr, uid, pool, uri2[:])
-        except:
+        except Exception:
             node = False
         
         objname = uri2[-1]
@@ -481,7 +541,7 @@ class openerp_dav_handler(dav_interface):
                 cr.close()
                 raise DAV_NotFound('Parent folder not found')
 
-            self._try_function(dir_node.create_child, (cr, objname, data), 
+            self._try_function(dir_node.create_child, (cr, objname, data),
                     "create %s" % objname, cr=cr)
         else:
             self._try_function(node.set_data, (cr, data), "save %s" % objname, cr=cr)
@@ -494,9 +554,11 @@ class openerp_dav_handler(dav_interface):
         """ delete a collection """
         cr, uid, pool, dbname, uri2 = self.get_cr(uri)        
         if not dbname:
+            if cr: cr.close()
             raise DAV_Error, 409
+
         node = self.uri2object(cr, uid, pool, uri2)             
-        node.rmcol(cr)
+        self._try_function(node.rmcol, (cr,), "rmcol %s" % uri, cr=cr)
 
         cr.commit()
         cr.close()
@@ -505,11 +567,12 @@ class openerp_dav_handler(dav_interface):
     def rm(self,uri):
         cr, uid, pool,dbname, uri2 = self.get_cr(uri)
         if not dbname:        
-            cr.close()
+            if cr: cr.close()
             raise DAV_Error, 409
         node = self.uri2object(cr, uid, pool, uri2)
-        res = node.rm(cr)
+        res = self._try_function(node.rm, (cr,), "rm %s"  % uri, cr=cr)
         if not res:
+            if cr: cr.close()
             raise OSError(1, 'Operation not permited.')        
         cr.commit()
         cr.close()
@@ -671,7 +734,7 @@ class openerp_dav_handler(dav_interface):
             node = self.uri2object(cr, uid, pool, uri2)
             if node:
                 result = True
-        except:
+        except Exception:
             pass
         cr.close()
         return result
@@ -679,6 +742,17 @@ class openerp_dav_handler(dav_interface):
     @memoize(CACHE_SIZE)
     def is_collection(self, uri):
         """ test if the given uri is a collection """
-        return self._get_dav_resourcetype(uri)==COLLECTION
+        cr, uid, pool, dbname, uri2 = self.get_cr(uri)
+        try:
+            if not dbname:
+                return True
+            node = self.uri2object(cr,uid,pool, uri2)
+            if not node:
+                raise DAV_NotFound2(uri2)
+            if node.type in ('collection','database'):
+                return True
+            return False
+        finally:
+            if cr: cr.close()
 
 #eof
index f2f57c7..1fd530c 100644 (file)
@@ -30,21 +30,88 @@ import tools
 
 
 super_mk_prop_response = PROPFIND.mk_prop_response
-def mk_prop_response(self, uri, good_props, bad_props, doc):        
-    """ make a new <prop> result element 
+def mk_prop_response(self, uri, good_props, bad_props, doc):
+    """ make a new <prop> result element
 
     We differ between the good props and the bad ones for
     each generating an extra <propstat>-Node (for each error
     one, that means).
-    
-    """      
+
+    """
     re=doc.createElement("D:response")
     # append namespaces to response
     nsnum=0
-    for nsname in self.namespaces:
+    namespaces = self.namespaces
+    if 'DAV:' in namespaces:
+        namespaces.remove('DAV:')
+    for nsname in namespaces:
         re.setAttribute("xmlns:ns"+str(nsnum),nsname)
         nsnum=nsnum+1
-    
+
+    def _prop_child(xnode, ns, prop, value):
+        """Append a property xml node to xnode, with <prop>value</prop>
+           
+           And a little smarter than that, it will consider namespace and
+           also allow nested properties etc.
+           
+           :param ns the namespace of the <prop/> node
+           :param prop the name of the property
+           :param value the value. Can be:
+                    string: text node
+                    tuple ('elem', 'ns') for empty sub-node <ns:elem />
+                    tuple ('elem', 'ns', sub-elems) for sub-node with elements
+                    list, of above tuples
+        """
+        if ns == 'DAV:':
+            ns_prefix = 'D:'
+        else:
+            ns_prefix="ns"+str(namespaces.index(ns))+":"
+
+        pe=doc.createElement(ns_prefix+str(prop))
+        if hasattr(value, '__class__') and value.__class__.__name__ == 'Element':
+            pe.appendChild(value)
+        else:
+            if ns == 'DAV:' and prop=="resourcetype" and isinstance(value, int):
+                # hack, to go..
+                if value == 1:
+                    ve=doc.createElement("D:collection")
+                    pe.appendChild(ve)
+            else:
+                _prop_elem_child(pe, ns, value, ns_prefix)
+
+            xnode.appendChild(pe)
+
+    def _prop_elem_child(pnode, pns, v, pns_prefix):
+        
+        if isinstance(v, list):
+            for vit in v:
+                _prop_elem_child(pnode, pns, vit, pns_prefix)
+        elif isinstance(v,tuple):
+            need_ns = False
+            if v[1] == pns:
+                ns_prefix = pns_prefix
+            elif v[1] == 'DAV:':
+                ns_prefix = 'D:'
+            elif v[1] in namespaces:
+                ns_prefix="ns"+str(namespaces.index(v[1]))+":"
+            else:
+                # namespaces.append(v[1])
+                # nsnum += 1
+                ns_prefix="ns"+str(nsnum)+":"
+                need_ns = True
+
+            ve=doc.createElement(ns_prefix+v[0])
+            if need_ns:
+                ve.setAttribute("xmlns:ns"+str(nsnum), v[1])
+            if len(v) > 2 and isinstance(v[2], list):
+                # support nested elements like:
+                # ( 'elem', 'ns:', [('sub-elem1', 'ns1'), ...]
+                _prop_elem_child(ve, v[1], v[2], ns_prefix)
+            pnode.appendChild(ve)
+        else:
+            ve=doc.createTextNode(tools.ustr(v))
+            pnode.appendChild(ve)
+
     # write href information
     uparts=urlparse.urlparse(uri)
     fileloc=uparts[2]
@@ -64,24 +131,15 @@ def mk_prop_response(self, uri, good_props, bad_props, doc):
 
     gp=doc.createElement("D:prop")
     for ns in good_props.keys():
-        ns_prefix="ns"+str(self.namespaces.index(ns))+":"
-        for p,v in good_props[ns].items():            
+        if ns == 'DAV:':
+            ns_prefix = 'D:'
+        else:
+            ns_prefix="ns"+str(namespaces.index(ns))+":"
+        for p,v in good_props[ns].items():
             if not v:
-                pass
-            pe=doc.createElement(ns_prefix+str(p))
-            if hasattr(v, '__class__') and v.__class__.__name__ == 'Element':
-                pe.appendChild(v)
-            else:
-                if p=="resourcetype":
-                    if v==1:
-                        ve=doc.createElement("D:collection")
-                        pe.appendChild(ve)
-                else:
-                    ve=doc.createTextNode(tools.ustr(v))
-                    pe.appendChild(ve)
+                continue
+            _prop_child(gp, ns, p, v)
 
-            gp.appendChild(pe)
-    
     ps.appendChild(gp)
     s=doc.createElement("D:status")
     t=doc.createTextNode("HTTP/1.1 200 OK")
@@ -100,12 +158,15 @@ def mk_prop_response(self, uri, good_props, bad_props, doc):
             ps.appendChild(bp)
 
             for ns in bad_props[ecode].keys():
-                ns_prefix="ns"+str(self.namespaces.index(ns))+":"
-            
+                if ns == 'DAV:':
+                    ns_prefix='D:'
+                else:
+                    ns_prefix="ns"+str(self.namespaces.index(ns))+":"
+
             for p in bad_props[ecode][ns]:
                 pe=doc.createElement(ns_prefix+str(p))
                 bp.appendChild(pe)
-            
+
             s=doc.createElement("D:status")
             t=doc.createTextNode(utils.gen_estring(ecode))
             s.appendChild(t)
@@ -114,10 +175,10 @@ def mk_prop_response(self, uri, good_props, bad_props, doc):
 
     # return the new response element
     return re
-    
+
 
 def mk_propname_response(self,uri,propnames,doc):
-    """ make a new <prop> result element for a PROPNAME request 
+    """ make a new <prop> result element for a PROPNAME request
 
     This will simply format the propnames list.
     propnames should have the format {NS1 : [prop1, prop2, ...], NS2: ...}
@@ -143,16 +204,20 @@ def mk_propname_response(self,uri,propnames,doc):
     for ns,plist in propnames.items():
         # write prop element
         pr=doc.createElement("D:prop")
-        nsp="ns"+str(nsnum)
-        pr.setAttribute("xmlns:"+nsp,ns)
-        nsnum=nsnum+1
+        if ns == 'DAV':
+            nsp = 'D'
+        else:
+            nsp="ns"+str(nsnum)
+            ps.setAttribute("xmlns:"+nsp,ns)
+            nsnum=nsnum+1
+
+        # write propertynames
+        for p in plist:
+            pe=doc.createElement(nsp+":"+p)
+            pr.appendChild(pe)
 
-    # write propertynames
-    for p in plist:
-        pe=doc.createElement(nsp+":"+p)
-        pr.appendChild(pe)
+        ps.appendChild(pr)
 
-    ps.appendChild(pr)
     re.appendChild(ps)
 
     return re
index 9f9f273..34c255a 100644 (file)
@@ -32,12 +32,13 @@ import tools
 from dav_fs import openerp_dav_handler
 from tools.config import config
 from DAV.WebDAVServer import DAVRequestHandler
-from service.websrv_lib import HTTPDir,FixSendError
+from service.websrv_lib import HTTPDir, FixSendError, HttpOptions
 from BaseHTTPServer import BaseHTTPRequestHandler
 import urlparse
 import urllib
 from string import atoi,split
 from DAV.errors import *
+# from DAV.constants import DAV_VERSION_1, DAV_VERSION_2
 
 def OpenDAVConfig(**kw):
     class OpenDAV:
@@ -53,10 +54,15 @@ def OpenDAVConfig(**kw):
     return Config()
 
 
-class DAVHandler(FixSendError,DAVRequestHandler):
+class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler):
     verbose = False
     protocol_version = 'HTTP/1.1'
-    
+    _HTTP_OPTIONS= { 'DAV' : ['1',],
+                    'Allow' : [ 'GET', 'HEAD', 'COPY', 'MOVE', 'POST', 'PUT', 
+                            'PROPFIND', 'PROPPATCH', 'OPTIONS', 'MKCOL',
+                            'DELETE', 'TRACE', 'REPORT', ]
+                    }
+
     def get_userinfo(self,user,pw):
         return False
     def _log(self, message):
@@ -99,6 +105,21 @@ class DAVHandler(FixSendError,DAVRequestHandler):
     def log_error(self, format, *args):
         netsvc.Logger().notifyChannel('xmlrpc', netsvc.LOG_WARNING, format % args)
 
+    def _prep_OPTIONS(self, opts):
+        ret = opts
+        dc=self.IFACE_CLASS
+        uri=urlparse.urljoin(self.get_baseuri(dc), self.path)
+        uri=urllib.unquote(uri)
+        try:
+            #location = dc.put(uri,body,ct)
+            ret = dc.prep_http_options(uri, opts)
+        except DAV_Error, (ec,dd):
+            pass
+        except Exception,e:
+            self.log_error("Error at options: %s", str(e))
+            raise
+        return ret
+            
     def send_response(self, code, message=None):
         # the BufferingHttpServer will send Connection: close , while
         # the BaseHTTPRequestHandler will only accept int code.
@@ -110,6 +131,22 @@ class DAVHandler(FixSendError,DAVRequestHandler):
             self.close_connection = 1
         DAVRequestHandler.send_header(self, key, value)
 
+    def send_body(self, DATA, code = None, msg = None, desc = None, ctype='application/octet-stream', headers=None):
+        if headers and 'Connection' in headers:
+            pass
+        elif self.request_version in ('HTTP/1.0', 'HTTP/0.9'):
+            pass
+        elif self.close_connection == 1: # close header already sent
+            pass
+        else:
+            if headers is None:
+                headers = {}
+            if self.headers.get('Connection',False) == 'Keep-Alive':
+                headers['Connection'] = 'keep-alive'
+
+        DAVRequestHandler.send_body(self, DATA, code=code, msg=msg, desc=desc,
+                    ctype=ctype, headers=headers)
+
     def do_PUT(self):
         dc=self.IFACE_CLASS        
         uri=urlparse.urljoin(self.get_baseuri(dc), self.path)
@@ -120,6 +157,8 @@ class DAVHandler(FixSendError,DAVRequestHandler):
             etag = None
             
             for match in self.headers['If-Match'].split(','):                
+                if match.startswith('"') and match.endswith('"'):
+                    match = match[1:-1]
                 if match == '*':
                     if dc.exists(uri):
                         test = True
@@ -129,6 +168,7 @@ class DAVHandler(FixSendError,DAVRequestHandler):
                         test = True
                         break
             if not test:
+                self._get_body()
                 self.send_status(412)
                 return
 
@@ -146,6 +186,7 @@ class DAVHandler(FixSendError,DAVRequestHandler):
                         test = False
                         break
             if not test:
+                self._get_body()
                 self.send_status(412)
                 return
 
@@ -158,10 +199,7 @@ class DAVHandler(FixSendError,DAVRequestHandler):
             self._flush()
 
         # read the body
-        body=None
-        if self.headers.has_key("Content-Length"):
-            l=self.headers['Content-Length']
-            body=self.rfile.read(atoi(l))
+        body=self._get_body()
 
         # locked resources are not allowed to be overwritten
         if self._l_isLocked(uri):
@@ -187,6 +225,13 @@ class DAVHandler(FixSendError,DAVRequestHandler):
 
         self.send_body(None, '201', 'Created', '', headers=headers)
 
+    def _get_body(self):
+        body = None
+        if self.headers.has_key("Content-Length"):
+            l=self.headers['Content-Length']
+            body=self.rfile.read(atoi(l))
+        return body
+
     def do_DELETE(self):
         try:
             DAVRequestHandler.do_DELETE(self)
index 5aedea7..cbc03ec 100644 (file)
@@ -468,18 +468,18 @@ class email_template(osv.osv):
                                           data,
                                           context)
         attachment_obj = self.pool.get('ir.attachment')
+
+        fname = tools.ustr(get_value(cursor, user, record_id,
+                                     template.file_name, template, context)
+                           or 'Report')
+        ext = '.' + format
+        if not fname.endswith(ext):
+            fname += ext
+
         new_att_vals = {
             'name':mail.subject + ' (Email Attachment)',
             'datas':base64.b64encode(result),
-            'datas_fname':tools.ustr(
-                             get_value(
-                                   cursor,
-                                   user,
-                                   record_id,
-                                   template.file_name,
-                                   template,
-                                   context
-                                   ) or 'Report') + "." + format,
+            'datas_fname': fname,
             'description':mail.subject or "No Description",
             'res_model':'email_template.mailbox',
             'res_id':mail.id
@@ -606,14 +606,12 @@ class email_template(osv.osv):
                 mailbox_values['body_text'] += sign
             if mailbox_values['body_html']:
                 mailbox_values['body_html'] += sign
-        print 'Creating', mailbox_values
         mailbox_id = self.pool.get('email_template.mailbox').create(
                                                              cursor,
                                                              user,
                                                              mailbox_values,
                                                              context)
 
-        print 'Sending', mailbox_id
         return mailbox_id
         
 
@@ -628,7 +626,6 @@ class email_template(osv.osv):
         template = self.browse(cursor, user, template_id, context=context)
         if not template:
             raise Exception("The requested template could not be loaded")
-        print 'loaded', record_ids
         result = True
         for record_id in record_ids:
             mailbox_id = self._generate_mailbox_item_from_template(
@@ -637,7 +634,6 @@ class email_template(osv.osv):
                                                                 template,
                                                                 record_id,
                                                                 context)
-            print 'loaded'
             mail = self.pool.get('email_template.mailbox').browse(
                                                         cursor,
                                                         user,
index 8c71ce0..e2ea301 100644 (file)
@@ -347,7 +347,6 @@ class email_template_account(osv.osv):
                     logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:MIME Error\nDescription: %s") % (id, error))
                     return {'error_msg': "Server Send Error\nDescription: %s"%error}
                 try:
-                    #print msg['From'],toadds
                     serv.sendmail(msg['From'], addresses_l['all'], msg.as_string())
                 except Exception, error:
                     logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:Server Send Error\nDescription: %s") % (id, error))
@@ -367,7 +366,6 @@ class email_template_account(osv.osv):
         logger = netsvc.Logger()
         #The standard email dates are of format similar to:
         #Thu, 8 Oct 2009 09:35:42 +0200
-        #print time_as_string
         date_as_date = False
         convertor = {'+':1, '-':-1}
         try:
@@ -406,7 +404,6 @@ class email_template_account(osv.osv):
                 offset = datetime.timedelta(hours=0)
             dt = dt + offset
             date_as_date = dt.strftime('%Y-%m-%d %H:%M:%S')
-            #print date_as_date
         except Exception, e:
             logger.notifyChannel(
                     _("Email Template"),
index cd6aeda..01811eb 100644 (file)
@@ -31,11 +31,8 @@ class email_template_engines(osv.osv):
     _name = "email_template.engines"
     _description = "Email Template Engine"
 
-#    def __init__(self):
-#        print "Started Engine"
-
     def check(self):
-        print "Start self check"
+        pass
         
     def strip_html(self,text):
         #Removes HTML, Have to check if still relevent
@@ -71,7 +68,6 @@ class email_template_engines(osv.osv):
         #message: the complete text including placeholders
         #templateid: the template id of the template
         #context: TODO
-        #print cr,uid,id,message,templateid,context
         if message:
             logger = netsvc.Logger()
             def merge(match):
@@ -79,14 +75,11 @@ class email_template_engines(osv.osv):
                 obj_pool = self.pool.get(template.object_name.model)
                 obj = obj_pool.browse(cr, uid, id, context)
                 exp = str(match.group()[2:-2]).strip()
-                #print "level 1:",exp
                 exp_spl = exp.split('/')
-                #print "level 2:",exp_spl
                 try:
                     result = eval(exp_spl[0], {'object':obj,})
                 except:
                     result = "Rendering Error"
-                #print "result:",result
                 try:
                     if result in (None, False):
                         if len(exp_spl)>1:
index c8236cb..2aa6e3c 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.4\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 03:55+0000\n"
+"PO-Revision-Date: 2010-08-07 01:28+0000\n"
 "Last-Translator: oguzhan <tazmanyacanawari@hotmail.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: 2010-08-04 03:37+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:42+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: event
index 6e01f31..e9749bb 100644 (file)
@@ -7,67 +7,67 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-11-09 17:40+0000\n"
-"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
+"PO-Revision-Date: 2010-08-06 17:13+0000\n"
+"Last-Translator: Grzegorz Grzelak (Cirrus.pl) <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: 2010-06-22 04:14+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: hr_expense
 #: model:process.node,name:hr_expense.process_node_confirmedexpenses0
 msgid "Confirmed Expenses"
-msgstr ""
+msgstr "Potwierdzone wydatki"
 
 #. module: hr_expense
 #: model:ir.model,name:hr_expense.model_hr_expense_line
 msgid "Expense Line"
-msgstr ""
+msgstr "Pozycja wydatków"
 
 #. module: hr_expense
 #: model:process.node,note:hr_expense.process_node_reimbursement0
 msgid "The accoutant reimburse the expenses"
-msgstr ""
+msgstr "Księgowość zwraca wydatki"
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_all_confirm
 #: model:ir.ui.menu,name:hr_expense.menu_expense_all_confirm
 msgid "Expenses waiting validation"
-msgstr ""
+msgstr "Wydatki czekające na zatwierdzenie"
 
 #. module: hr_expense
 #: constraint:ir.actions.act_window:0
 msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nieprawidłowa nazwa modelu w definicji akcji."
 
 #. module: hr_expense
 #: field:hr.expense.expense,date_confirm:0
 msgid "Date Confirmed"
-msgstr ""
+msgstr "Data potwierdzenia"
 
 #. module: hr_expense
 #: selection:hr.expense.expense,state:0
 msgid "Waiting confirmation"
-msgstr ""
+msgstr "Czeka na zatwierdzenie"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 msgid "Set to Draft"
-msgstr ""
+msgstr "Ustaw na projekt"
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_my_confirm
 #: model:ir.ui.menu,name:hr_expense.menu_expense_my_confirm
 msgid "My expenses waiting validation"
-msgstr ""
+msgstr "Moje wydatki czekające na zatwierdzenie"
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_all
 #: model:ir.ui.menu,name:hr_expense.menu_expense_all
 msgid "All expenses"
-msgstr ""
+msgstr "Wszystkie wydatki"
 
 #. module: hr_expense
 #: model:process.node,name:hr_expense.process_node_approved0
@@ -77,7 +77,7 @@ msgstr "Zatwierdzone"
 #. module: hr_expense
 #: field:hr.expense.line,uom_id:0
 msgid "UoM"
-msgstr ""
+msgstr "JM"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
@@ -98,7 +98,7 @@ msgstr "Anulowano"
 #. module: hr_expense
 #: view:hr.expense.expense:0
 msgid "Validation"
-msgstr "Sprawdzanie"
+msgstr "Zatwierdzenie"
 
 #. module: hr_expense
 #: help:product.product,hr_expense_ok:0
@@ -112,7 +112,7 @@ msgstr ""
 #. module: hr_expense
 #: selection:hr.expense.expense,state:0
 msgid "Accepted"
-msgstr "Zaakceptowany"
+msgstr "Zaakceptowano"
 
 #. module: hr_expense
 #: rml:hr.expense:0
@@ -124,17 +124,17 @@ msgstr "Odnośnik"
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "Certified honest and conform,"
-msgstr ""
+msgstr "Potwierdzono rzetelność i zgodność z zasadami"
 
 #. module: hr_expense
 #: model:ir.actions.report.xml,name:hr_expense.hr_expenses
 msgid "Print HR expenses"
-msgstr ""
+msgstr "Drukuj wydatki pracownicze"
 
 #. module: hr_expense
 #: model:process.transition,name:hr_expense.process_transition_refuseexpense0
 msgid "Refuse expense"
-msgstr ""
+msgstr "Odmów wydatku"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
@@ -145,81 +145,81 @@ msgstr "Potwierdź"
 #. module: hr_expense
 #: model:process.node,note:hr_expense.process_node_supplierinvoice0
 msgid "The accoutant validates the sheet"
-msgstr ""
+msgstr "Księgowy zatwierdza delegację"
 
 #. module: hr_expense
 #: field:hr.expense.line,analytic_account:0
 msgid "Analytic account"
-msgstr ""
+msgstr "Konto analityczne"
 
 #. module: hr_expense
 #: model:process.node,name:hr_expense.process_node_supplierinvoice0
 #: model:process.transition,name:hr_expense.process_transition_approveinvoice0
 msgid "Supplier Invoice"
-msgstr ""
+msgstr "Faktura od dostawcy"
 
 #. module: hr_expense
 #: field:hr.expense.expense,state:0
 msgid "State"
-msgstr ""
+msgstr "Stan"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 #: field:hr.expense.expense,employee_id:0
 msgid "Employee"
-msgstr ""
+msgstr "Pracownik"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "Qty"
-msgstr ""
+msgstr "Il."
 
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "Total Price"
-msgstr ""
+msgstr "Suma"
 
 #. module: hr_expense
 #: model:process.node,note:hr_expense.process_node_reinvoicing0
 msgid "Some costs may be reinvoices to the customer"
-msgstr ""
+msgstr "Część kosztów może być refakturowana na klienta"
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_my
 #: model:ir.ui.menu,name:hr_expense.menu_expense_my
 msgid "My Expenses"
-msgstr ""
+msgstr "Moje wydatki"
 
 #. module: hr_expense
 #: field:hr.expense.expense,id:0
 msgid "Sheet ID"
-msgstr ""
+msgstr "Numer rozliczenia"
 
 #. module: hr_expense
 #: model:process.transition,name:hr_expense.process_transition_reimburseexpense0
 msgid "Reimburse expense"
-msgstr ""
+msgstr "Zwrot wydatków"
 
 #. module: hr_expense
 #: field:hr.expense.expense,journal_id:0
 msgid "Force Journal"
-msgstr ""
+msgstr "Wymuś dziennik"
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_my_new
 #: model:ir.ui.menu,name:hr_expense.menu_expense_my_new
 msgid "New Expenses Sheet"
-msgstr ""
+msgstr "Nowe rozliczenie"
 
 #. module: hr_expense
 #: model:process.transition,note:hr_expense.process_transition_reimburseexpense0
 msgid "After creating invoice, reimburse expenses"
-msgstr ""
+msgstr "Po utworzeniu faktury zwrot wydatków"
 
 #. module: hr_expense
 #: model:process.node,name:hr_expense.process_node_reimbursement0
 msgid "Reimbursement"
-msgstr ""
+msgstr "Zwrot wydatków"
 
 #. module: hr_expense
 #: constraint:ir.ui.view:0
@@ -230,49 +230,49 @@ msgstr "XML niewłaściwy dla tej architektury wyświetlania!"
 #: field:hr.expense.line,expense_id:0
 #: model:ir.model,name:hr_expense.model_hr_expense_expense
 msgid "Expense"
-msgstr ""
+msgstr "Wydatek"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 #: field:hr.expense.expense,line_ids:0
 #: view:hr.expense.line:0
 msgid "Expense Lines"
-msgstr ""
+msgstr "Pozycja wydatków"
 
 #. module: hr_expense
 #: field:hr.expense.expense,currency_id:0
 msgid "Currency"
-msgstr ""
+msgstr "Waluta"
 
 #. module: hr_expense
 #: model:process.node,note:hr_expense.process_node_draftexpenses0
 msgid "Employee encode all his expenses"
-msgstr ""
+msgstr "Pracownik wprowadza swoje wydatki"
 
 #. module: hr_expense
 #: selection:hr.expense.expense,state:0
 msgid "Invoiced"
-msgstr ""
+msgstr "Zafakturowano"
 
 #. module: hr_expense
 #: selection:hr.expense.expense,state:0
 msgid "Reimbursed"
-msgstr ""
+msgstr "Zwrócono"
 
 #. module: hr_expense
 #: field:hr.expense.expense,note:0
 msgid "Note"
-msgstr ""
+msgstr "Notatka"
 
 #. module: hr_expense
 #: model:process.transition,note:hr_expense.process_transition_reimbursereinvoice0
 msgid "Create Customer invoice"
-msgstr ""
+msgstr "Utwórz fakturę dla klienta"
 
 #. module: hr_expense
 #: selection:hr.expense.expense,state:0
 msgid "Draft"
-msgstr ""
+msgstr "Projekt"
 
 #. module: hr_expense
 #: constraint:ir.model:0
@@ -285,246 +285,246 @@ msgstr ""
 #. module: hr_expense
 #: view:hr.expense.expense:0
 msgid "Accounting data"
-msgstr ""
+msgstr "Dane księgowe"
 
 #. module: hr_expense
 #: model:process.transition,note:hr_expense.process_transition_approveexpense0
 msgid "Expense is approved."
-msgstr ""
+msgstr "Wydatek zatwierdzono."
 
 #. module: hr_expense
 #: field:hr.expense.expense,amount:0
 msgid "Total Amount"
-msgstr ""
+msgstr "Suma kwot"
 
 #. module: hr_expense
 #: model:process.node,name:hr_expense.process_node_draftexpenses0
 msgid "Draft Expenses"
-msgstr ""
+msgstr "Projekt wydatków"
 
 #. module: hr_expense
 #: field:hr.expense.expense,user_id:0
 msgid "User"
-msgstr ""
+msgstr "Użytkownik"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 #: field:hr.expense.expense,date:0
 #: field:hr.expense.line,date_value:0
 msgid "Date"
-msgstr ""
+msgstr "Data"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "Total:"
-msgstr ""
+msgstr "Suma:"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "HR Expenses"
-msgstr ""
+msgstr "Wydatki pracowników"
 
 #. module: hr_expense
 #: field:hr.expense.expense,date_valid:0
 msgid "Date Validated"
-msgstr ""
+msgstr "Data zatwierdzenia"
 
 #. module: hr_expense
 #: field:hr.expense.expense,account_move_id:0
 msgid "Account Move"
-msgstr ""
+msgstr "Zapis księgowy"
 
 #. module: hr_expense
 #: model:process.node,note:hr_expense.process_node_confirmedexpenses0
 msgid "The employee validates his expense sheet"
-msgstr ""
+msgstr "Pracownik potwierdza swoje rozliczenie"
 
 #. module: hr_expense
 #: model:process.node,note:hr_expense.process_node_refused0
 msgid "The direct manager refuses the sheet.Reset as draft."
-msgstr ""
+msgstr "Bezpośredni przełożony odrzuca delegację. Ustaw na projekt."
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 msgid "Expenses Sheet"
-msgstr ""
+msgstr "Rozliczenie wydatków (Delegacja)"
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_all_invoiced
 #: model:ir.ui.menu,name:hr_expense.menu_expense_all_invoiced
 msgid "Expenses waiting payment"
-msgstr ""
+msgstr "Wydatki oczekujące na zapłacenie"
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_my_draft
 #: model:ir.ui.menu,name:hr_expense.menu_expense_my_draft
 msgid "My Draft expenses"
-msgstr ""
+msgstr "Moje wydatki - projekty"
 
 #. module: hr_expense
 #: model:ir.module.module,shortdesc:hr_expense.module_meta_information
 msgid "Human Resources Expenses Tracking"
-msgstr ""
+msgstr "Wydatki pracownicze"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 #: field:hr.expense.expense,invoice_id:0
 #: model:process.transition.action,name:hr_expense.process_transition_action_supplierinvoice0
 msgid "Invoice"
-msgstr ""
+msgstr "Faktura"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 msgid "Cancel"
-msgstr ""
+msgstr "Anuluj"
 
 #. module: hr_expense
 #: model:process.transition,name:hr_expense.process_transition_reimbursereinvoice0
 msgid "Reinvoice"
-msgstr ""
+msgstr "Refakturuj"
 
 #. module: hr_expense
 #: model:process.process,name:hr_expense.process_process_expenseprocess0
 msgid "Expense Process"
-msgstr ""
+msgstr "Proces wydatków"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 msgid "Other Info"
-msgstr ""
+msgstr "Inne informacje"
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_all_draft
 #: model:ir.ui.menu,name:hr_expense.menu_expense_all_draft
 msgid "Draft expenses"
-msgstr ""
+msgstr "Projekty wydatków"
 
 #. module: hr_expense
 #: model:process.transition,name:hr_expense.process_transition_confirmexpense0
 msgid "Confirm expense"
-msgstr ""
+msgstr "Potwierdź wydatek"
 
 #. module: hr_expense
 #: model:process.transition,name:hr_expense.process_transition_approveexpense0
 msgid "Approve expense"
-msgstr ""
+msgstr "Zaaprobuj wydatek"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 #: model:process.transition.action,name:hr_expense.process_transition_action_accept0
 msgid "Accept"
-msgstr ""
+msgstr "Akceptuj"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "This document must be dated and signed for reimbursement"
-msgstr ""
+msgstr "Ten dokument musi być datowany i podpisany do uzyskania zwrotu"
 
 #. module: hr_expense
 #: model:process.transition,note:hr_expense.process_transition_refuseexpense0
 msgid "Expense is refused."
-msgstr ""
+msgstr "Wydatek odrzucony"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 #: field:hr.expense.line,unit_amount:0
 msgid "Unit Price"
-msgstr ""
+msgstr "Cena jedn."
 
 #. module: hr_expense
 #: model:ir.actions.act_window,name:hr_expense.expense_all_valid
 #: model:ir.ui.menu,name:hr_expense.menu_expense_all_valid
 msgid "Expenses waiting invoice"
-msgstr ""
+msgstr "Wydatki oczekujące na fakturę"
 
 #. module: hr_expense
 #: field:hr.expense.line,product_id:0
 msgid "Product"
-msgstr ""
+msgstr "Produkt"
 
 #. module: hr_expense
 #: field:hr.expense.line,description:0
 msgid "Description"
-msgstr ""
+msgstr "Opis"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 #: field:hr.expense.expense,name:0
 msgid "Expense Sheet"
-msgstr ""
+msgstr "Rozliczenie wydatków"
 
 #. module: hr_expense
 #: field:hr.expense.line,unit_quantity:0
 msgid "Quantities"
-msgstr ""
+msgstr "Ilości"
 
 #. module: hr_expense
 #: model:process.node,name:hr_expense.process_node_refused0
 msgid "Refused"
-msgstr ""
+msgstr "Odrzucono"
 
 #. module: hr_expense
 #: field:product.product,hr_expense_ok:0
 msgid "Can be Expensed"
-msgstr "Może być wydatkowane"
+msgstr "Może być wydatkiem"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "Ref."
-msgstr ""
+msgstr "Odn."
 
 #. module: hr_expense
 #: field:hr.expense.expense,user_valid:0
 msgid "Validation User"
-msgstr ""
+msgstr "Użytkownik zatwierdzający"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "(Date and signature)"
-msgstr ""
+msgstr "(Data i podpis)"
 
 #. module: hr_expense
 #: rml:hr.expense:0
 msgid "Name"
-msgstr ""
+msgstr "Nazwa"
 
 #. module: hr_expense
 #: field:hr.expense.line,name:0
 msgid "Short Description"
-msgstr ""
+msgstr "Krótki opis"
 
 #. module: hr_expense
 #: model:process.transition,note:hr_expense.process_transition_approveinvoice0
 msgid "Creates supplier invoice."
-msgstr ""
+msgstr "Tworzy fakturę od dostawcy"
 
 #. module: hr_expense
 #: model:process.node,note:hr_expense.process_node_approved0
 msgid "The direct manager approves the sheet"
-msgstr ""
+msgstr "Bezpośredni przełożony aprobuje zestawienie"
 
 #. module: hr_expense
 #: field:hr.expense.line,sequence:0
 msgid "Sequence"
-msgstr ""
+msgstr "Numeracja"
 
 #. module: hr_expense
 #: model:process.transition,note:hr_expense.process_transition_confirmexpense0
 msgid "Expense is confirmed."
-msgstr ""
+msgstr "Wydatek został potwierdzony"
 
 #. module: hr_expense
 #: view:hr.expense.expense:0
 #: model:ir.ui.menu,name:hr_expense.next_id_49
 msgid "Expenses"
-msgstr ""
+msgstr "Wydatki"
 
 #. module: hr_expense
 #: field:hr.expense.line,total_amount:0
 msgid "Total"
-msgstr ""
+msgstr "Suma"
 
 #. module: hr_expense
 #: model:process.node,name:hr_expense.process_node_reinvoicing0
 msgid "Reinvoicing"
-msgstr ""
+msgstr "Refakturowanie"
index 40ea76f..e290098 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 05:45+0000\n"
+"PO-Revision-Date: 2010-08-07 03:06+0000\n"
 "Last-Translator: Fabien (Open ERP) <fp@tinyerp.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: 2010-08-04 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: hr_expense
index 4716ac4..e3081ab 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.4\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-05 19:25+0000\n"
+"PO-Revision-Date: 2010-08-06 15:55+0000\n"
 "Last-Translator: Grzegorz Grzelak (Cirrus.pl) <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: 2010-08-06 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: hr_holidays
@@ -24,7 +24,7 @@ msgstr "Nowy wniosek o urlop"
 #. module: hr_holidays
 #: model:ir.ui.menu,name:hr_holidays.menu_action_all_holiday
 msgid "All Holidays Requests"
-msgstr "Wszystkie wnioski o urlop"
+msgstr "Wszystkie wnioski urlopowe"
 
 #. module: hr_holidays
 #: constraint:ir.actions.act_window:0
@@ -39,7 +39,7 @@ msgstr "Pozostało dni urlopu"
 #. module: hr_holidays
 #: model:ir.actions.act_window,name:hr_holidays.action_holiday_waiting
 msgid "Requests Awaiting for Validation"
-msgstr "Wnioski oczekujące na zatwierdzenie"
+msgstr "Wnioski urlopowe - czekające na zatwierdzenie"
 
 #. module: hr_holidays
 #: selection:hr.holidays.status,color_name:0
@@ -137,7 +137,7 @@ msgstr ""
 #. module: hr_holidays
 #: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday
 msgid "My Holidays Requests"
-msgstr "Moje wnioski o urlop"
+msgstr "Moje wnioski urlopowe"
 
 #. module: hr_holidays
 #: field:hr.holidays,notes:0
@@ -239,7 +239,7 @@ msgstr "Potwierdź"
 #: model:ir.actions.act_window,name:hr_holidays.action_my_holiday_waiting
 #: model:ir.ui.menu,name:hr_holidays.menu_action_my_holiday_waiting
 msgid "My Awaiting Confirmation Holidays Requests"
-msgstr "Moje wnioski o urlop oczekujące na potwierdzenie"
+msgstr "Moje wnioski urlopowe - czekające na zatwierdzenie"
 
 #. module: hr_holidays
 #: field:hr.holidays,user_id:0
@@ -286,7 +286,7 @@ msgstr "Liczba wnioskowanych dni urlopu"
 #. module: hr_holidays
 #: model:ir.actions.act_window,name:hr_holidays.act_hr_employee_holiday_request
 msgid "My Holiday Requests"
-msgstr "Moje wnioski o urlop"
+msgstr "Moje wnioski urlopowe"
 
 #. module: hr_holidays
 #: view:hr.holidays:0
@@ -567,7 +567,7 @@ msgstr "Wnioski urlopowe."
 #. module: hr_holidays
 #: model:ir.ui.menu,name:hr_holidays.menu_action_holiday_waiting
 msgid "Holidays Requests Awaiting for Validation"
-msgstr "Wnioski urlopowe oczekujące na zatwierdzenie"
+msgstr "Wnioski urlopowe - czekające na zatwierdzenie"
 
 #. module: hr_holidays
 #: view:hr.holidays:0
index 753a8af..fe466f6 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.4\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 06:07+0000\n"
+"PO-Revision-Date: 2010-08-06 23:52+0000\n"
 "Last-Translator: Fabien (Open ERP) <fp@tinyerp.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: 2010-08-04 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: hr_holidays
index c2acd96..45e7ace 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.6\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 06:08+0000\n"
+"PO-Revision-Date: 2010-08-07 02:04+0000\n"
 "Last-Translator: Black Jack <onetimespeed@hotmail.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: 2010-08-04 03:45+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: hr_holidays
index 65ac4da..6b93dc6 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 06:28+0000\n"
-"Last-Translator: mga (Open ERP) <Unknown>\n"
+"PO-Revision-Date: 2010-08-07 03:25+0000\n"
+"Last-Translator: OpenERP Administrators <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: 2010-08-04 03:44+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: hr_timesheet_sheet
index e6eaa50..3d49a5a 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.4\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 07:06+0000\n"
+"PO-Revision-Date: 2010-08-07 02:01+0000\n"
 "Last-Translator: Fabien (Open ERP) <fp@tinyerp.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: 2010-08-04 03:39+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: l10n_fr
index 7875571..57abd8f 100644 (file)
@@ -159,11 +159,11 @@ Normal - the campaign runs normally and automatically sends all emails and repor
         return True
 
 
-    def signal(self, cr, uid, model, res_id, signal, context=None):
+    def signal(self, cr, uid, model, res_id, signal, run_existing=True, context=None):
         record = self.pool.get(model).browse(cr, uid, res_id, context)
-        return self._signal(cr, uid, record, signal, context)
+        return self._signal(cr, uid, record, signal, run_existing, context)
 
-    def _signal(self, cr, uid, record, signal, context=None):
+    def _signal(self, cr, uid, record, signal, run_existing=True, context=None):
         if not signal:
             raise ValueError('signal cannot be False')
 
@@ -182,7 +182,10 @@ Normal - the campaign runs normally and automatically sends all emails and repor
                 wi_domain = [(k, '=', v) for k, v in data.items()]
 
                 wi_ids = Workitems.search(cr, uid, wi_domain, context=context)
-                if not wi_ids:
+                if wi_ids:
+                    if not run_existing:
+                        continue
+                else:
                     partner = self._get_partner_for(campaign, record)
                     if partner:
                         data['partner_id'] = partner.id
index ad5b3ef..e81343e 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 07:30+0000\n"
+"PO-Revision-Date: 2010-08-07 03:03+0000\n"
 "Last-Translator: Fabien (Open ERP) <fp@tinyerp.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: 2010-08-04 03:36+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:42+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: mrp
index 9128308..638a7d7 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-04 08:05+0000\n"
+"PO-Revision-Date: 2010-08-06 07:47+0000\n"
 "Last-Translator: vrsb <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: 2010-08-05 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:42+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: mrp
@@ -191,12 +191,12 @@ msgstr ""
 #. module: mrp
 #: view:mrp.workcenter:0
 msgid "Capacity Information"
-msgstr ""
+msgstr "Нормирование рабочего времени"
 
 #. module: mrp
 #: selection:mrp.production,state:0
 msgid "Packing Exception"
-msgstr ""
+msgstr "Исключение снабжения"
 
 #. module: mrp
 #: model:process.node,note:mrp.process_node_orderrfq0
@@ -251,7 +251,7 @@ msgstr ""
 #. module: mrp
 #: wizard_view:mrp.procurement.compute,init:0
 msgid "This wizard will schedule procurements."
-msgstr ""
+msgstr "Этот мастер планирут снабжение"
 
 #. module: mrp
 #: field:mrp.bom,position:0
@@ -292,6 +292,9 @@ msgid ""
 "When the virtual stock goes belong the Min Quantity, Open ERP generates a "
 "procurement to bring the virtual stock to the Max Quantity."
 msgstr ""
+"Когда запасы(с учётом неподтверждённых операций) достигают минимального "
+"значения, Open ERP автоматически планирует снабжения до достижения "
+"максимального количества."
 
 #. module: mrp
 #: model:process.transition,name:mrp.process_transition_stockmts0
@@ -353,12 +356,12 @@ msgstr "Подробности"
 #. module: mrp
 #: model:process.process,name:mrp.process_process_procurementprocess0
 msgid "Procurement Process"
-msgstr ""
+msgstr "Процесс снабжения"
 
 #. module: mrp
 #: field:mrp.production,date_planned_date:0
 msgid "Scheduled Date"
-msgstr ""
+msgstr "Запланированная дата"
 
 #. module: mrp
 #: selection:mrp.procurement,priority:0
@@ -375,7 +378,7 @@ msgstr ""
 #. module: mrp
 #: rml:mrp.production.order:0
 msgid "Bill Of Material"
-msgstr ""
+msgstr "Спецификация"
 
 #. module: mrp
 #: help:mrp.routing,location_id:0
@@ -393,12 +396,12 @@ msgstr "Резервирование"
 #. module: mrp
 #: model:ir.actions.act_window,name:mrp.action2
 msgid "Bill of Materials Structure"
-msgstr ""
+msgstr "Древовидная спецификация"
 
 #. module: mrp
 #: wizard_field:product.product.procurement,init,product_id:0
 msgid "product"
-msgstr ""
+msgstr "изделие"
 
 #. module: mrp
 #: selection:mrp.property,composition:0
@@ -441,7 +444,7 @@ msgstr ""
 #. module: mrp
 #: field:res.company,po_lead:0
 msgid "Purchase Lead Time"
-msgstr ""
+msgstr "Время доставки"
 
 #. module: mrp
 #: field:mrp.routing,location_id:0
@@ -451,12 +454,12 @@ msgstr "Расположение производства"
 #. module: mrp
 #: view:mrp.production:0
 msgid "Change Qty"
-msgstr ""
+msgstr "Изменить кол-во"
 
 #. module: mrp
 #: view:mrp.production:0
 msgid "Force Reservation"
-msgstr ""
+msgstr "Не ждать пополнения расходных"
 
 #. module: mrp
 #: field:mrp.bom.revision,author_id:0
@@ -472,7 +475,7 @@ msgstr ""
 #: field:mrp.bom,product_uos:0
 #: field:mrp.production.product.line,product_uos:0
 msgid "Product UOS"
-msgstr ""
+msgstr "Вторая ед. изм."
 
 #. module: mrp
 #: model:process.transition,name:mrp.process_transition_productionprocureproducts0
@@ -502,7 +505,7 @@ msgstr "Позиции спецификации"
 #. module: mrp
 #: field:mrp.workcenter,time_start:0
 msgid "Time before prod."
-msgstr "Время до производства"
+msgstr "Подготовительное время"
 
 #. module: mrp
 #: model:ir.model,name:mrp.model_mrp_routing_workcenter
@@ -512,7 +515,7 @@ msgstr ""
 #. module: mrp
 #: view:mrp.production:0
 msgid "Consumed Products"
-msgstr ""
+msgstr "Расходные материалы или компоненты сборки"
 
 #. module: mrp
 #: constraint:mrp.bom:0
@@ -534,12 +537,12 @@ msgstr ""
 #: model:ir.actions.act_window,name:mrp.mrp_procurement_action4
 #: model:ir.ui.menu,name:mrp.menu_mrp_procurement_action4
 msgid "Exceptions Procurements to Fix"
-msgstr ""
+msgstr "Исключения снабжения, требующие вмешательства"
 
 #. module: mrp
 #: selection:mrp.procurement,state:0
 msgid "Ready"
-msgstr ""
+msgstr "Готово"
 
 #. module: mrp
 #: view:mrp.routing:0
@@ -550,17 +553,17 @@ msgstr ""
 #: model:ir.actions.act_window,name:mrp.mrp_production_action2_gantt
 #: model:ir.ui.menu,name:mrp.menu_production_orders_start_gantt
 msgid "Production Orders Planning"
-msgstr ""
+msgstr "Планирование заказов на производство"
 
 #. module: mrp
 #: help:mrp.workcenter,time_efficiency:0
 msgid "Factor that multiplies all times expressed in the workcenter."
-msgstr ""
+msgstr "Коэффициент, а который умножаются все нормы времени"
 
 #. module: mrp
 #: help:mrp.workcenter,time_cycle:0
 msgid "Time in hours for doing one cycle."
-msgstr ""
+msgstr "Время в часах на выполнение одного цикла"
 
 #. module: mrp
 #: field:mrp.production,date_finnished:0
@@ -573,6 +576,7 @@ msgid ""
 "This is the internal picking list take bring the raw materials to the "
 "production plan."
 msgstr ""
+"Перечень материалов, доставляемых со склада на производственный участок"
 
 #. module: mrp
 #: selection:mrp.production,state:0
@@ -596,7 +600,7 @@ msgstr "В ожидании"
 #: view:mrp.routing:0
 #: model:process.node,name:mrp.process_node_routing0
 msgid "Routing"
-msgstr ""
+msgstr "Техн. маршрут"
 
 #. module: mrp
 #: wizard_button:mrp.workcenter.load,init,report:0
@@ -617,7 +621,7 @@ msgstr ""
 #. module: mrp
 #: selection:mrp.workcenter.load,init,time_unit:0
 msgid "Per month"
-msgstr ""
+msgstr "В месяц"
 
 #. module: mrp
 #: field:mrp.procurement,product_uos_qty:0
@@ -669,7 +673,7 @@ msgstr "Заказы на производство"
 #: field:mrp.bom,child_complete_ids:0
 #: field:mrp.bom,child_ids:0
 msgid "BoM Hyerarchy"
-msgstr ""
+msgstr "Структура спецификаций"
 
 #. module: mrp
 #: view:mrp.procurement:0
@@ -724,11 +728,13 @@ msgid ""
 "This wizard will planify the procurement for this product. This procurement "
 "may generate task, production orders or purchase orders."
 msgstr ""
+"Этот мастер планирует снабжение. Он может сгенерировать заказ поставщику, "
+"заказ на поизводство или задачу."
 
 #. module: mrp
 #: model:process.node,note:mrp.process_node_mts0
 msgid "The system waits for requested products in stock."
-msgstr ""
+msgstr "Ожидание требуемого материала/изделия на складе"
 
 #. module: mrp
 #: model:process.transition,name:mrp.process_transition_servicemto0
@@ -762,7 +768,7 @@ msgstr "Код"
 #. module: mrp
 #: rml:mrp.production.order:0
 msgid "No. Of Hours"
-msgstr ""
+msgstr "Количество часов"
 
 #. module: mrp
 #: model:ir.model,name:mrp.model_mrp_property_group
@@ -808,7 +814,7 @@ msgstr "Машина"
 #. module: mrp
 #: model:process.node,name:mrp.process_node_servicemts0
 msgid "Make to stock"
-msgstr ""
+msgstr "Изготовление про запас"
 
 #. module: mrp
 #: field:mrp.workcenter,name:0
@@ -840,7 +846,7 @@ msgstr ""
 #. module: mrp
 #: selection:mrp.workcenter,type:0
 msgid "Human Resource"
-msgstr ""
+msgstr "Штат служащих"
 
 #. module: mrp
 #: model:ir.actions.act_window,name:mrp.mrp_workcenter_action
@@ -868,7 +874,7 @@ msgstr ""
 #. module: mrp
 #: field:mrp.production.workcenter.line,cycle:0
 msgid "Nbr of cycle"
-msgstr ""
+msgstr "Кол-во циклов"
 
 #. module: mrp
 #: field:mrp.bom,name:0
@@ -885,7 +891,7 @@ msgstr "Название"
 #. module: mrp
 #: field:mrp.routing.workcenter,cycle_nbr:0
 msgid "Number of Cycle"
-msgstr ""
+msgstr "Кол-во циклов"
 
 #. module: mrp
 #: wizard_field:mrp.workcenter.load,init,measure_unit:0
@@ -908,7 +914,7 @@ msgstr ""
 #. module: mrp
 #: field:mrp.workcenter,time_efficiency:0
 msgid "Time Efficiency"
-msgstr ""
+msgstr "Поправочный коэффициент"
 
 #. module: mrp
 #: help:res.company,manufacturing_lead:0
@@ -933,12 +939,12 @@ msgstr ""
 #. module: mrp
 #: field:mrp.production,location_dest_id:0
 msgid "Finished Products Location"
-msgstr ""
+msgstr "Склад для размешения готовых изделий"
 
 #. module: mrp
 #: wizard_field:product.product.procurement,init,uom_id:0
 msgid "Unit of Measure"
-msgstr ""
+msgstr "Единица измерения"
 
 #. module: mrp
 #: field:mrp.procurement,procure_method:0
@@ -953,7 +959,7 @@ msgstr "Книга аналитики"
 #. module: mrp
 #: selection:mrp.workcenter.load,init,time_unit:0
 msgid "Per week"
-msgstr ""
+msgstr "В неделю"
 
 #. module: mrp
 #: wizard_button:mrp.procurement.compute,init,compute:0
@@ -985,7 +991,7 @@ msgstr "Кол-во часов"
 #. module: mrp
 #: view:mrp.procurement:0
 msgid "Notes"
-msgstr ""
+msgstr "Примечания"
 
 #. module: mrp
 #: model:ir.model,name:mrp.model_mrp_bom
@@ -1002,12 +1008,12 @@ msgstr "Выбрать ед. времени"
 #. module: mrp
 #: wizard_field:product_price,init,number:0
 msgid "Number of products to produce"
-msgstr ""
+msgstr "Количество производимых изделий"
 
 #. module: mrp
 #: help:mrp.production,location_dest_id:0
 msgid "Location where the system will stock the finished products."
-msgstr ""
+msgstr "Склад для размещения готовых изделий"
 
 #. module: mrp
 #: model:process.transition,name:mrp.process_transition_billofmaterialrouting0
@@ -1027,7 +1033,7 @@ msgstr ""
 #. module: mrp
 #: view:mrp.bom:0
 msgid "Revisions"
-msgstr ""
+msgstr "Ревизии"
 
 #. module: mrp
 #: field:mrp.bom,product_efficiency:0
@@ -1047,7 +1053,7 @@ msgstr ""
 #. module: mrp
 #: field:mrp.production,sale_ref:0
 msgid "Sale Ref"
-msgstr ""
+msgstr "Номер заказа"
 
 #. module: mrp
 #: field:mrp.procurement,priority:0
@@ -1071,7 +1077,7 @@ msgstr "Новое снабжение"
 #. module: mrp
 #: rml:mrp.production.order:0
 msgid "Production Order N° :"
-msgstr ""
+msgstr "Заказ на производство  №"
 
 #. module: mrp
 #: selection:mrp.workcenter,type:0
@@ -1082,18 +1088,18 @@ msgstr "Инструмент"
 #: help:mrp.production,location_src_id:0
 msgid ""
 "Location where the system will look for products used in raw materials."
-msgstr ""
+msgstr "Склад, с которого списываются расходные материалы"
 
 #. module: mrp
 #: rml:mrp.production.order:0
 #: wizard_field:product.product.procurement,init,date_planned:0
 msgid "Planned Date"
-msgstr ""
+msgstr "Планируемая дата"
 
 #. module: mrp
 #: model:process.node,note:mrp.process_node_purchaseprocure0
 msgid "Procurement orders"
-msgstr ""
+msgstr "Заказ на производство"
 
 #. module: mrp
 #: model:process.node,name:mrp.process_node_mts0
@@ -1124,7 +1130,7 @@ msgstr "Снабжение"
 #. module: mrp
 #: model:ir.actions.wizard,name:mrp.product_procurement_wizard
 msgid "Procurement Request"
-msgstr ""
+msgstr "Заявка на снабжение"
 
 #. module: mrp
 #: model:ir.actions.wizard,name:mrp.wizard_price
@@ -1164,14 +1170,14 @@ msgstr "алфавитные указатели"
 #. module: mrp
 #: model:process.node,note:mrp.process_node_productionorder0
 msgid "Procurement for raw materials."
-msgstr ""
+msgstr "Снабжение расходными материалами"
 
 #. module: mrp
 #: view:mrp.procurement:0
 #: field:mrp.procurement,note:0
 #: rml:mrp.production.order:0
 msgid "Note"
-msgstr ""
+msgstr "Примечание"
 
 #. module: mrp
 #: model:process.transition,name:mrp.process_transition_procurestockableproduct0
@@ -1181,7 +1187,7 @@ msgstr ""
 #. module: mrp
 #: field:mrp.bom,method:0
 msgid "Method"
-msgstr ""
+msgstr "Способ"
 
 #. module: mrp
 #: wizard_view:product_price,init:0
@@ -1191,7 +1197,7 @@ msgstr "Оплачено ?"
 #. module: mrp
 #: model:process.node,note:mrp.process_node_routing0
 msgid "Define a routing to describe the manufacturing steps."
-msgstr ""
+msgstr "Задайте маршрут обработки"
 
 #. module: mrp
 #: field:mrp.bom,active:0
@@ -1233,7 +1239,7 @@ msgstr "Доп. информация"
 #. module: mrp
 #: model:process.node,note:mrp.process_node_billofmaterial0
 msgid "Define the product structure, with sub-products and/or components."
-msgstr ""
+msgstr "Задайте структуру изделия, с подсборками"
 
 #. module: mrp
 #: model:process.node,note:mrp.process_node_minimumstockrule0
@@ -1241,6 +1247,7 @@ msgid ""
 "Procurement is created if the product quantity is lower than the minimum "
 "limit."
 msgstr ""
+"Снабжение начинаетя, если количество продукта ниже минимального предела"
 
 #. module: mrp
 #: field:mrp.procurement,date_close:0
@@ -1266,12 +1273,12 @@ msgstr "Продукция в ожидании заказов на произв
 #. module: mrp
 #: rml:mrp.production.order:0
 msgid "SO Number"
-msgstr ""
+msgstr "Номер заказа клиента"
 
 #. module: mrp
 #: model:ir.actions.wizard,name:mrp.wizard_change_production_qty
 msgid "Change Product Qty."
-msgstr ""
+msgstr "Изменить кол-во"
 
 #. module: mrp
 #: selection:mrp.procurement,state:0
@@ -1320,7 +1327,7 @@ msgstr ""
 #. module: mrp
 #: field:mrp.workcenter,capacity_per_cycle:0
 msgid "Capacity per Cycle"
-msgstr ""
+msgstr "Количество одновременно изготавливаемых деталей"
 
 #. module: mrp
 #: field:mrp.bom,product_id:0
@@ -1336,17 +1343,17 @@ msgstr "Продукция"
 #: view:mrp.production:0
 #: field:mrp.production,hour_total:0
 msgid "Total Hours"
-msgstr ""
+msgstr "Общее время"
 
 #. module: mrp
 #: field:mrp.production,location_src_id:0
 msgid "Raw Materials Location"
-msgstr ""
+msgstr "Склад расходных материалов"
 
 #. module: mrp
 #: model:ir.actions.act_window,name:mrp.action_product_bom_structure
 msgid "Product BoM Structure"
-msgstr ""
+msgstr "Структура спецификации изделия"
 
 #. module: mrp
 #: field:mrp.bom,product_uom:0
@@ -1383,7 +1390,7 @@ msgstr ""
 #: field:mrp.procurement,product_uos:0
 #: field:mrp.production,product_uos:0
 msgid "Product UoS"
-msgstr ""
+msgstr "Вторая ед изм."
 
 #. module: mrp
 #: field:mrp.procurement,product_uom:0
@@ -1408,12 +1415,12 @@ msgstr "Весьма срочно"
 #: field:mrp.procurement,purchase_id:0
 #: field:stock.warehouse.orderpoint,procurement_id:0
 msgid "Purchase Order"
-msgstr ""
+msgstr "Заказ на закупку"
 
 #. module: mrp
 #: view:mrp.production:0
 msgid "Production Workcenters"
-msgstr ""
+msgstr "Участки обработки"
 
 #. module: mrp
 #: view:mrp.property.group:0
@@ -1456,7 +1463,7 @@ msgstr "численные индексы"
 #. module: mrp
 #: model:process.transition,note:mrp.process_transition_servicerfq0
 msgid "If Procure method is Make to order and supply method is buy"
-msgstr ""
+msgstr "Если способ снабжения \"изготовление на заказ\" и изделие закупается"
 
 #. module: mrp
 #: model:process.transition,note:mrp.process_transition_procurestockableproduct0
@@ -1468,7 +1475,7 @@ msgstr ""
 #: view:mrp.production:0
 #: rml:mrp.production.order:0
 msgid "Work Orders"
-msgstr ""
+msgstr "Технологиские операции"
 
 #. module: mrp
 #: field:mrp.workcenter,costs_cycle:0
@@ -1478,7 +1485,7 @@ msgstr "Стоимость по циклам"
 #. module: mrp
 #: model:ir.model,name:mrp.model_mrp_bom_revision
 msgid "Bill of material revisions"
-msgstr ""
+msgstr "Ревизии спецификации"
 
 #. module: mrp
 #: view:mrp.procurement:0
@@ -1505,7 +1512,7 @@ msgstr ""
 #. module: mrp
 #: field:mrp.workcenter,time_cycle:0
 msgid "Time for 1 cycle (hour)"
-msgstr "Время цикла (часов)"
+msgstr "Оперативное время"
 
 #. module: mrp
 #: wizard_view:product.product.procurement,done:0
@@ -1541,7 +1548,7 @@ msgstr "Категории свойств"
 #: model:ir.actions.wizard,name:mrp.wiz_mrp_proc1
 #: model:ir.ui.menu,name:mrp.menu_wiz_mrp_proc1
 msgid "Compute Procurements Only"
-msgstr ""
+msgstr "Рассчитать только снабжение"
 
 #. module: mrp
 #: field:mrp.production,product_uos_qty:0
@@ -1557,7 +1564,7 @@ msgstr "Структура спецификации"
 #. module: mrp
 #: field:mrp.bom,date_stop:0
 msgid "Valid Until"
-msgstr ""
+msgstr "Действителен до"
 
 #. module: mrp
 #: model:ir.actions.act_window,name:mrp.mrp_procurement_action11
@@ -1568,7 +1575,7 @@ msgstr "Временные исключения снабжения"
 #. module: mrp
 #: field:mrp.bom,date_start:0
 msgid "Valid From"
-msgstr ""
+msgstr "Действителен от"
 
 #. module: mrp
 #: selection:mrp.bom,type:0
@@ -1607,7 +1614,7 @@ msgstr ""
 msgid ""
 "Efficiency on the production. A factor of 0.9 means a loss of 10% in the "
 "production."
-msgstr ""
+msgstr "Коэффициент потерь. Значение 0,9 означает потерю 10% продукции."
 
 #. module: mrp
 #: field:mrp.bom,product_rounding:0
@@ -1617,7 +1624,7 @@ msgstr ""
 #. module: mrp
 #: field:mrp.production.workcenter.line,name:0
 msgid "Work Order"
-msgstr ""
+msgstr "Техн. операция"
 
 #. module: mrp
 #: view:mrp.production:0
@@ -1627,7 +1634,7 @@ msgstr ""
 #. module: mrp
 #: model:process.node,note:mrp.process_node_serviceonorder0
 msgid "If procurement is make to order"
-msgstr ""
+msgstr "Если изделие изготовляется на заказ"
 
 #. module: mrp
 #: selection:mrp.bom,method:0
@@ -1637,7 +1644,7 @@ msgstr ""
 #. module: mrp
 #: model:process.node,name:mrp.process_node_minimumstockrule0
 msgid "Minimum Stock Rule"
-msgstr ""
+msgstr "Правила минимальных запасов"
 
 #. module: mrp
 #: model:ir.actions.act_window,name:mrp.mrp_bom_form_action_new
@@ -1648,7 +1655,7 @@ msgstr "Новая спецификация"
 #. module: mrp
 #: field:mrp.workcenter,time_stop:0
 msgid "Time after prod."
-msgstr ""
+msgstr "Заключительное время"
 
 #. module: mrp
 #: wizard_field:mrp.workcenter.load,init,time_unit:0
@@ -1658,12 +1665,12 @@ msgstr "Тип периода"
 #. module: mrp
 #: view:mrp.production:0
 msgid "Total Qty"
-msgstr ""
+msgstr "Итоговое кол-во"
 
 #. module: mrp
 #: field:mrp.routing.workcenter,hour_nbr:0
 msgid "Number of Hours"
-msgstr ""
+msgstr "Количество часов"
 
 #. module: mrp
 #: model:ir.actions.act_window,name:mrp.mrp_procurement_action
@@ -1684,7 +1691,7 @@ msgstr ""
 #. module: mrp
 #: help:mrp.workcenter,time_start:0
 msgid "Time in hours for the setup."
-msgstr ""
+msgstr "Время наладки в часах"
 
 #. module: mrp
 #: selection:mrp.production,state:0
@@ -1710,6 +1717,8 @@ msgid ""
 "operations and to plan futur loads on workcenters based on production "
 "plannification."
 msgstr ""
+"Список операций и участков обработки для производства готового изделия. "
+"Обычно используется для расчёта и планирования загрузки участков."
 
 #. module: mrp
 #: selection:mrp.production,state:0
@@ -1730,7 +1739,7 @@ msgstr "Новый заказ на производство"
 #. module: mrp
 #: model:process.node,note:mrp.process_node_rfq0
 msgid "A Request for Quotation is created and sent to the supplier."
-msgstr ""
+msgstr "Заявка выслана поставщику"
 
 #. module: mrp
 #: field:mrp.bom.revision,last_indice:0
@@ -1741,7 +1750,7 @@ msgstr "последний индекс"
 #: field:mrp.bom,revision_ids:0
 #: view:mrp.bom.revision:0
 msgid "BoM Revisions"
-msgstr ""
+msgstr "Ревизии спецификации"
 
 #. module: mrp
 #: view:mrp.procurement:0
@@ -1769,7 +1778,7 @@ msgstr ""
 #: model:ir.actions.act_window,name:mrp.mrp_production_action2
 #: model:ir.ui.menu,name:mrp.menu_production_orders_start
 msgid "Production Orders To Start"
-msgstr ""
+msgstr "Заказы на производство, готовые к запуску"
 
 #. module: mrp
 #: view:mrp.procurement:0
@@ -1836,7 +1845,7 @@ msgstr ""
 #. module: mrp
 #: model:process.node,note:mrp.process_node_productminimumstockrule0
 msgid "Create minimum stock rules"
-msgstr ""
+msgstr "Создать правила минимальных запасов"
 
 #. module: mrp
 #: wizard_field:product.product.procurement,init,warehouse_id:0
@@ -1864,7 +1873,7 @@ msgstr ""
 #. module: mrp
 #: wizard_view:change_production_qty,confirm:0
 msgid "Change Product Qty"
-msgstr ""
+msgstr "Изменить кол-о"
 
 #. module: mrp
 #: field:mrp.bom.revision,description:0
@@ -1887,7 +1896,7 @@ msgstr "Выполняется"
 #. module: mrp
 #: model:ir.ui.menu,name:mrp.menu_mrp_root
 msgid "Manufacturing"
-msgstr ""
+msgstr "Производство"
 
 #. module: mrp
 #: model:ir.actions.act_window,name:mrp.mrp_procurement_action3
@@ -1904,12 +1913,12 @@ msgstr "Структура спецификации"
 #. module: mrp
 #: model:ir.actions.wizard,name:mrp.wizard_workcenter_load
 msgid "Workcenter load"
-msgstr ""
+msgstr "Загрузка участка"
 
 #. module: mrp
 #: help:mrp.workcenter,time_stop:0
 msgid "Time in hours for the cleaning."
-msgstr ""
+msgstr "Время в часах на сбор отходов"
 
 #. module: mrp
 #: view:mrp.procurement:0
@@ -1919,7 +1928,7 @@ msgstr "Детали снабжения"
 #. module: mrp
 #: model:process.transition,note:mrp.process_transition_bom0
 msgid "You can see its bill of material which are used to make product"
-msgstr ""
+msgstr "Посмотреть спецификацию, по которой изготовляется изделие"
 
 #. module: mrp
 #: field:mrp.production,date_planned_end:0
@@ -1996,4 +2005,4 @@ msgstr "Изменения оценки запасов"
 #. module: mrp
 #: view:board.board:0
 msgid "Next production orders"
-msgstr ""
+msgstr "Ближайшие заказы на производство"
index 4f33b0c..d2079df 100644 (file)
@@ -34,15 +34,12 @@ import time
 # capacity_hour : capacity per hour. default: 1.0.
 #          Eg: If 5 concurrent operations at one time: capacity = 5 (because 5 employees)
 # unit_per_cycle : how many units are produced for one cycle
-#
-# TODO: Work Center may be recursive ?
-#
+
 class mrp_workcenter(osv.osv):
     _name = 'mrp.workcenter'
     _description = 'Work Center'
     _inherits = {'resource.resource':"resource_id"}
     _columns = {
-#        'name': fields.char('Work Center Name', size=64, required=True),
         'note': fields.text('Description', help="Description of the workcenter. Explain here what's a cycle according to this workcenter."),
         'capacity_per_cycle': fields.float('Capacity per Cycle', help="Number of operations this workcenter can do in parallel. If this workcenter represents a team of 5 workers, the capacity per cycle is 5."),
         'time_cycle': fields.float('Time for 1 cycle (hour)', help="Time in hours for doing one cycle."),
@@ -56,7 +53,6 @@ class mrp_workcenter(osv.osv):
             help="Complete this only if you want automatic analytic accounting entries on production orders."),
         'costs_journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal'),
         'costs_general_account_id': fields.many2one('account.account', 'General Account', domain=[('type','<>','view')]),
-#        'company_id': fields.many2one('res.company','Company',required=True),
        'resource_id': fields.many2one('resource.resource','Resource',ondelete='cascade'),
     }
     _defaults = {
@@ -255,7 +251,6 @@ class mrp_bom(osv.osv):
         @return: False or BoM id.
         """
         bom_result = False
-        # Why searching on BoM without parent ?
         cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,))
         ids = map(lambda x: x[0], cr.fetchall())
         max_prop = 0
@@ -607,9 +602,6 @@ class mrp_production(osv.osv):
             if not bom_id:
                 raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
 
-            #if bom_point.routing_id and bom_point.routing_id.location_id:
-            #   self.write(cr, uid, [production.id], {'location_src_id': bom_point.routing_id.location_id.id})
-
             factor = production.product_qty * production.product_uom.factor / bom_point.product_uom.factor
             res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties)
             results = res[0]
@@ -631,11 +623,9 @@ class mrp_production(osv.osv):
             if production.move_created_ids:
                 move_obj.action_cancel(cr, uid, [x.id for x in production.move_created_ids])
             move_obj.action_cancel(cr, uid, [x.id for x in production.move_lines])
-        self.write(cr, uid, ids, {'state': 'cancel'}) #,'move_lines':[(6,0,[])]})
+        self.write(cr, uid, ids, {'state': 'cancel'})
         return True
 
-    #XXX: may be a bug here; lot_lines are unreserved for a few seconds;
-    #     between the end of the picking list and the call to this function
     def action_ready(self, cr, uid, ids):
         """ Changes the production state to Ready and location id of stock move.
         @return: True
@@ -981,3 +971,4 @@ class mrp_production_product_line(osv.osv):
     }
 mrp_production_product_line()
 
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 581cc04..fa54dc0 100644 (file)
@@ -3,8 +3,8 @@
     <data noupdate="1">
 
         <!--
-       Resource: mrp.workcenter
-       -->
+    Resource: mrp.workcenter
+    -->
 
         <record id="mrp_workcenter_0" model="mrp.workcenter">
             <field name="name">Assembly workshop</field>
@@ -16,8 +16,8 @@
         </record>
 
         <!--
-       Resource: mrp.property.group
-       -->
+    Resource: mrp.property.group
+    -->
 
         <record id="mrp_property_group_ram" model="mrp.property.group">
             <field name="name">RAM</field>
@@ -54,8 +54,8 @@
         </record>
 
         <!--
-       Resource: mrp.property
-       -->
+    Resource: mrp.property
+    -->
 
         <record id="mrp_property_0" model="mrp.property">
             <field name="group_id" ref="mrp_property_group_ram"/>
         </record>
 
         <!--
-       Resource: mrp.routing
-       -->
+    Resource: mrp.routing
+    -->
 
         <record id="mrp_routing_0" model="mrp.routing">
             <field name="workcenter_lines">[1]</field>
         </record>
 
         <!--
-       Resource: mrp.routing.workcenter
-       -->
+    Resource: mrp.routing.workcenter
+    -->
 
         <record id="mrp_routing_workcenter_0" model="mrp.routing.workcenter">
             <field name="routing_id" ref="mrp_routing_0"/>
         </record>
 
         <!--
-       Resource: mrp.bom
-       -->
+    Resource: mrp.bom
+    -->
 
         <record id="mrp_bom_0" model="mrp.bom">
             <field name="name">Regular processor config</field>
             <field model="product.product" name="product_id" ref="product.product_product_24"/>
         </record>
 
+        <!--
+    Resource: mrp.bom new EVV
+    -->
+
+    <record id="mrp_bom_assemblysection0" model="mrp.bom">
+        <field name="name">Assembly Section</field>
+            <field name="sequence">123</field>
+        <field name="product_id" ref="product.product_product_assemblysection0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">4.0</field>
+        <field model="mrp.bom" name="bom_id" search="[('name', '=', u'Default BOM for Shelf of 100cm')]"/>
+    </record>
+    
+    <record id="mrp_bom_sidepanel0" model="mrp.bom">
+        <field name="name">Side Panel</field>
+            <field name="sequence">125</field>
+        <field name="product_id" ref="product.product_product_sidepanel0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">2.0</field>
+        <field model="mrp.bom" name="bom_id" search="[('name', '=', u'Default BOM for Shelf of 100cm')]"/>
+    </record>
+
+    <record id="mrp_bom_metalcleats0" model="mrp.bom">
+        <field name="name">Metal Cleats</field>
+            <field name="sequence">127</field>
+        <field name="product_id" ref="product.product_product_metalcleats0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">12.0</field>
+        <field model="mrp.bom" name="bom_id" search="[('name', '=', u'Default BOM for Shelf of 100cm')]"/>
+    </record>
+
+    <record id="mrp_bom_defaultbomforshelfofcm0" model="mrp.bom">
+        <field name="name">Default BOM for Shelf of 100cm</field>
+        <field name="code">SHE100</field>
+            <field name="sequence">129</field>
+        <field name="product_id" ref="product.product_product_shelfofcm0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">1.0</field>
+    </record>
+
+    <record id="mrp_bom_rearpanelarm0" model="mrp.bom">
+           <field name="sequence">131</field>
+       <field name="product_id" ref="product.product_product_rearpanelarm0"/>
+       <field name="product_uom" ref="product.product_uom_unit"/>
+       <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm0"/>
+           <field name="product_qty">1.0</field>
+       <field name="name">Rear panel SHE100</field>
+    </record>
+
+    <record id="mrp_bom_shelf0" model="mrp.bom">
+           <field name="sequence">133</field>
+       <field name="product_id" ref="product.product_product_shelf0"/>
+       <field name="product_uom" ref="product.product_uom_unit"/>
+       <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm0"/>
+           <field name="product_qty">3.0</field>
+       <field name="name">Shelf 100</field>
+    </record>
+
+    <record id="mrp_bom_woodlintelm0" model="mrp.bom">
+           <field name="sequence">135</field>
+       <field name="product_id" ref="product.product_product_woodlintelm0"/>
+       <field name="product_uom" ref="product.product_uom_meter"/>
+       <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm0"/>
+           <field name="product_qty">1.0</field>
+       <field model="mrp.bom" name="bom_id" search="[('name', '=', u'Assembly Section')]"/>
+       <field name="name">Wood Lintel 4m</field>
+    </record>
+
+    <record id="mrp_bom_defaultbomforshelfofcm1" model="mrp.bom">
+        <field name="name">Default BOM for Shelf of 200cm</field>
+        <field name="code">SHE200</field>
+            <field name="sequence">137</field>
+        <field name="product_id" ref="product.product_product_shelfofcm0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">1.0</field>
+    </record>
+
+    <record id="mrp_bom_defaultbomforkitshelfofcm0" model="mrp.bom">
+        <field name="name">Default BOM for KIT Shelf of 100cm</field>
+        <field name="code">SHE100KIT</field>
+            <field name="sequence">139</field>
+        <field name="product_id" ref="product.product_product_kitshelfofcm0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">1.0</field>
+        <field name="type">phantom</field>
+    </record>
+
+    <record id="mrp_bom_rearpanelarm1" model="mrp.bom">
+           <field name="sequence">141</field>
+       <field name="product_id" ref="product.product_product_rearpanelarm0"/>
+       <field name="product_uom" ref="product.product_uom_unit"/>
+       <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm0"/>
+           <field name="product_qty">1.0</field>
+       <field name="name">Rear panel SHE100</field>
+    </record>
+
+    <record id="mrp_bom_assemblysection2" model="mrp.bom">
+        <field name="name">Assembly Section</field>
+            <field name="sequence">143</field>
+        <field name="product_id" ref="product.product_product_assemblysection0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">4.0</field>
+        <field name="bom_id" ref="mrp_bom_defaultbomforkitshelfofcm0"/>
+    </record>
+
+    <record id="mrp_bom_sidepanel2" model="mrp.bom">
+        <field name="name">Side Panel</field>
+            <field name="sequence">145</field>
+        <field name="product_id" ref="product.product_product_sidepanel0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">2.0</field>
+        <field name="bom_id" ref="mrp_bom_defaultbomforkitshelfofcm0"/>
+    </record>
+
+    <record id="mrp_bom_rearpanelarm2" model="mrp.bom">
+           <field name="sequence">147</field>
+       <field name="product_id" ref="product.product_product_rearpanelarm0"/>
+       <field name="product_uom" ref="product.product_uom_unit"/>
+       <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm1"/>
+           <field name="product_qty">1.0</field>
+       <field name="name">Rear panel SHE200</field>
+    </record>
+
+    <record id="mrp_bom_assemblysection3" model="mrp.bom">
+        <field name="name">Assembly Section</field>
+            <field name="sequence">149</field>
+        <field name="product_id" ref="product.product_product_assemblysection0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">4.0</field>
+        <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm1"/>
+    </record>
+
+    <record id="mrp_bom_sidepanel3" model="mrp.bom">
+        <field name="name">Side Panel</field>
+            <field name="sequence">151</field>
+        <field name="product_id" ref="product.product_product_sidepanel0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">2.0</field>
+        <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm1"/>
+    </record>
+
+    <record id="mrp_bom_shelf2" model="mrp.bom">
+           <field name="sequence">153</field>
+       <field name="product_id" ref="product.product_product_shelf1"/>
+       <field name="product_uom" ref="product.product_uom_unit"/>
+       <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm1"/>
+           <field name="product_qty">3.0</field>
+       <field name="name">Shelf 200</field>
+    </record>
+
+    <record id="mrp_bom_metalcleats3" model="mrp.bom">
+        <field name="name">Metal Cleats</field>
+            <field name="sequence">155</field>
+        <field name="product_id" ref="product.product_product_metalcleats0"/>
+        <field name="product_uom" ref="product.product_uom_unit"/>
+            <field name="product_qty">12.0</field>
+        <field name="bom_id" ref="mrp_bom_defaultbomforshelfofcm1"/>
+    </record>
+
     </data>
 </openerp>
index 50a976c..6425f6e 100644 (file)
@@ -55,7 +55,7 @@ class procurement_order(osv.osv):
         procurement_obj = self.pool.get('procurement.order')
         res = procurement_obj.make_mo(cr, uid, ids, context=context)
         res = res.values()
-        return len(res) and res[0] or 0 #TO CHECK: why workflow is generated error if return not integer value
+        return len(res) and res[0] or 0
     
     def make_mo(self, cr, uid, ids, context={}):
         """ Make Manufacturing(production) order from procurement
index 1af0bd6..a146342 100644 (file)
@@ -32,7 +32,7 @@ class product_product(osv.osv):
         @return: dictionary which contains information regarding stock input account, stock output account and stock journal
         """           
         product_obj = self.pool.get('product.product').browse(cr, uid, product_id, False)
-        
+        res = super(product_product,self).get_product_accounts(cr, uid, product_id, context)
         stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False 
         if not stock_input_acc:
             stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False
@@ -43,7 +43,6 @@ class product_product(osv.osv):
 
         journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False
         
-        res = {}
         res.update({'stock_account_input': stock_input_acc})
         res.update({'stock_account_output': stock_output_acc})
         res.update({'stock_journal': journal_id})  
index 25d179b..fa2f583 100644 (file)
@@ -1,22 +1,21 @@
-# -*- encoding: utf-8 -*-
+## -*- coding: utf-8 -*-
 ##############################################################################
-#
+#    
 #    OpenERP, Open Source Management Solution
-#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-#    $Id$
+#    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 General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
 #
 #    This program is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
+#    GNU Affero General Public License for more details.
 #
-#    You should have received a copy of the GNU General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#    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/>.     
 #
 ##############################################################################
 
index 4fffbdf..9aeae17 100644 (file)
@@ -18,6 +18,7 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
+
 from osv import fields,osv
 import tools
 
index 7acf602..4481c2c 100644 (file)
@@ -21,8 +21,6 @@
 
 import time
 from report import report_sxw
-from osv import osv
-import pooler
 
 class order(report_sxw.rml_parse):
     def __init__(self, cr, uid, name, context):
@@ -31,9 +29,6 @@ class order(report_sxw.rml_parse):
             'time': time,
         })
 
-
-
 report_sxw.report_sxw('report.mrp.production.order','mrp.production','addons/mrp/report/order.rml',parser=order,header=1)
 
-
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 8e5b9bf..9c31e34 100644 (file)
@@ -173,7 +173,6 @@ class report_custom(report_int):
             ar.add_plot(bar_plot.T(label=workcenter['name'], data=data, fill_style=f, hcol=workcenter_num+1, cluster=(workcenter_num, len(res))))
             workcenter_num += 1
 
-        #plot = bar_plot.T(label=workcenter['name'], data=data, hcol=1, fill_style=fill_style.white, cluster=(color_index,len(ids)))
         if (not data) or (len(data[0]) <= 1):
             ar = self._empty_graph(time.strftime('%Y-%m-%d'))
         ar.draw(can)
index 9777840..1cb7aa9 100644 (file)
 -
   !function {model: procurement.order, name: run_scheduler}:
     - model: procurement.order
-      search: "[('state','!=','confirmed')]"
+      search: "[('state','=','confirmed')]"
 -
   I am checking Internal picking. I see one picking for Orange juice and its 
   stock moves for Oranges, Sugar and Water made correctly.
index 21492bd..3fc63bc 100644 (file)
@@ -47,3 +47,5 @@ class change_standard_price(osv.osv_memory):
         return super(change_standard_price, self).change_price(cr, uid, ids, context=context)
     
 change_standard_price()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 180c083..a554a82 100644 (file)
@@ -74,3 +74,4 @@ class mrp_product_produce(osv.osv_memory):
 
 mrp_product_produce()
 
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index aa06715..0cf1111 100644 (file)
@@ -43,6 +43,7 @@
     'depends': ['procurement'],
     'update_xml': ['mrp_jit.xml'],
     'demo_xml': [],
+    'test': ['test/mrp_jit.yml'],
     'installable': True,
     'active': False,
     'certificate': '0086634760061',
diff --git a/addons/mrp_jit/test/mrp_jit.yml b/addons/mrp_jit/test/mrp_jit.yml
new file mode 100644 (file)
index 0000000..edafb8c
--- /dev/null
@@ -0,0 +1,35 @@
+-
+  In order to test mrp_jit module with OpenERP, I will create manufacturing order
+  and check whether the procurement orders run without scheduler or not.
+-
+  !record {model: mrp.production, id: mrp_production_mo0}:
+    bom_id: mrp.mrp_bom_1
+    company_id: base.main_company
+    date_planned: '2010-08-05 17:59:49'
+    location_dest_id: stock.stock_location_stock
+    location_src_id: stock.stock_location_stock
+    name: MO/00017
+    product_id: product.product_product_pc2
+    product_qty: 10.0
+    product_uom: product.product_uom_unit
+    product_uos_qty: 0.0
+    routing_id: mrp.mrp_routing_0
+- 
+  |
+  I confirm production order.
+- 
+  !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_mo0}
+-
+  |
+  I check the procurement orders generated from the production order.
+-
+  |
+  It runs without using schedulers.
+-
+  !python {model: procurement.order}: |
+    prod_obj = self.pool.get('mrp.production')
+    production = prod_obj.browse(cr, uid, ref('mrp_production_mo0'))
+    products = map(lambda x:x.product_id.id, production.move_lines)
+    procurement_ids = self.search(cr, uid, [('product_id','in',products)])
+    procurements = self.browse(cr, uid, procurement_ids)
+    assert all(proc.state != 'confirmed' for proc in procurements), 'Procurement not scheduled!'
index 5fbbc5e..d0a6695 100644 (file)
@@ -34,9 +34,6 @@ from tools.translate import _
 # capacity_hour : capacity per hour. default: 1.0.
 #          Eg: If 5 concurrent operations at one time: capacity = 5 (because 5 employees)
 # unit_per_cycle : how many units are produced for one cycle
-#
-# TODO: Work Center may be recursive ?
-#
 
 class stock_move(osv.osv):
     _inherit = 'stock.move'
index 819acff..248234d 100644 (file)
@@ -411,7 +411,6 @@ class mrp_repair(osv.osv):
                             })
                         repair_fee_obj.write(cr, uid, [fee.id], {'invoiced': True, 'invoice_line_id': invoice_fee_id})
                 res[repair.id] = inv_id
-        #self.action_invoice_end(cr, uid, ids)
         return res
 
     def action_repair_ready(self, cr, uid, ids, context=None):
@@ -444,7 +443,6 @@ class mrp_repair(osv.osv):
             if (order.invoice_method == 'b4repair'):
                 val['state'] = 'ready'
             else:
-                #val['state'] = 'done'
                 pass
             self.write(cr, uid, [order.id], val)
         return True
@@ -462,7 +460,6 @@ class mrp_repair(osv.osv):
             elif (not order.invoiced and order.invoice_method=='b4repair'):
                 val['state'] = 'ready'
             else:
-                #val['state'] = 'done'
                 pass
             self.write(cr, uid, [order.id], val)
         return True
@@ -496,7 +493,6 @@ class mrp_repair(osv.osv):
                     'state': 'done',
                 })
                 repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id})
-
             if repair.deliver_bool:
                 pick_name = seq_obj.get(cr, uid, 'stock.picking.out')
                 picking = pick_obj.create(cr, uid, {
@@ -509,23 +505,20 @@ class mrp_repair(osv.osv):
                     'invoice_state': 'none',
                     'type': 'out',
                 })
-                wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr)
-
                 move_id = move_obj.create(cr, uid, {
                     'name': repair.name,
                     'picking_id': picking,
                     'product_id': repair.product_id.id,
                     'product_qty': 1.0,
                     'product_uom': repair.product_id.uom_id.id,
-                    #'product_uos_qty': line.product_uom_qty,
-                    #'product_uos': line.product_uom.id,
                     'prodlot_id': repair.prodlot_id and repair.prodlot_id.id or False,
                     'address_id': repair.address_id and repair.address_id.id or False,
                     'location_id': repair.location_id.id,
                     'location_dest_id': repair.location_dest_id.id,
                     'tracking_id': False,
-                    'state': 'assigned',    # FIXME done ?
+                    'state': 'assigned',    
                 })
+                wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr)
                 self.write(cr, uid, [repair.id], {'state': 'done', 'picking_id': picking})
                 res[repair.id] = picking
             else:
index 97700fd..bc776ea 100644 (file)
               <search string="Search Reair Orders">
                <group col='4' colspan='4'>
                       <filter icon="terp-document-new" string="Quotations" domain="[('state','=','draft')]"/>   
-                       <filter icon="terp-check" string="Confirmed" domain="[('state','=', 'confirmed)]" name="current" />
+                       <filter icon="terp-check" string="Confirmed" domain="[('state','=','confirmed')]" name="current" />
                        <filter icon="terp-emblem-important" string="Ready To Repair" domain="[('state','=','ready')]"/>
                        <separator orientation="vertical"/>
                        <filter icon="terp-dolar" string="invoiced" domain="[('state','=','2binvoiced')]"/>
index a3fe8ef..961ebdf 100644 (file)
@@ -1,5 +1,5 @@
 - |
-  In order to test "mrp_repair" module, I start with creating repairt order, confirm it, and start repair.
+  In order to test "mrp_repair" module, I start with creating repair order, confirm it, and start repair.
 
 - |
   Given that I have already  stock move line created.
index f208e0b..b1c9db1 100644 (file)
@@ -38,6 +38,7 @@ With this module:
     'init_xml': [],
     'update_xml': ['security/ir.model.access.csv', 'mrp_subproduct_view.xml'],
     'demo_xml': [],
+    'test': ['test/mrp_subproduct.yml'],
     'installable': True,
     'active': False,
     'certificate': '0050060616733',
diff --git a/addons/mrp_subproduct/test/mrp_subproduct.yml b/addons/mrp_subproduct/test/mrp_subproduct.yml
new file mode 100644 (file)
index 0000000..520a4e9
--- /dev/null
@@ -0,0 +1,169 @@
+-
+  In order to test mrp_subproduct with OpenERP, I create a bill of material with subproducts.
+  I make a production order, confirm it so stock moves for subproducts are generated.
+-
+  I create a record for the product Chair.
+-
+  !record {model: product.product, id: product_product_woodenchair0}:
+    categ_id: product.cat1
+    name: Wooden Chair
+    procure_method: make_to_stock
+    supply_method: produce
+    type: product
+    uom_id: product.product_uom_unit
+    uom_po_id: product.product_uom_unit
+    property_stock_inventory: stock.location_inventory
+    property_stock_procurement: stock.location_procurement
+    property_stock_production: stock.location_production
+-
+  I create a record for the product Wood.
+-
+  !record {model: product.product, id: product_product_wood0}:
+    categ_id: product.cat1
+    name: Wood
+    procure_method: make_to_order
+    supply_method: buy
+    property_stock_inventory: stock.location_inventory
+    property_stock_procurement: stock.location_procurement
+    property_stock_production: stock.location_production
+    seller_ids:
+      - delay: 1
+        name: base.res_partner_maxtor
+        min_qty: 300.0
+    type: product
+    uom_id: product.product_uom_unit
+    uom_po_id: product.product_uom_unit
+-
+  I create a record for the product Nails.
+-
+  !record {model: product.product, id: product_product_nails0}:
+    categ_id: product.cat1
+    name: Nails
+    procure_method: make_to_order
+    supply_method: buy
+    property_stock_inventory: stock.location_inventory
+    property_stock_procurement: stock.location_procurement
+    property_stock_production: stock.location_production
+    seller_ids:
+      - delay: 1
+        name: base.res_partner_asus
+        min_qty: 500.0
+    type: product
+    uom_id: product.product_uom_unit
+    uom_po_id: product.product_uom_unit
+-
+  I create a record for the product Table.
+-
+  !record {model: product.product, id: product_product_woodentable0}:
+    categ_id: product.cat1
+    name: Wooden Table
+    procure_method: make_to_stock
+    supply_method: produce
+    type: product
+    uom_id: product.product_uom_unit
+    uom_po_id: product.product_uom_unit
+    property_stock_inventory: stock.location_inventory
+    property_stock_procurement: stock.location_procurement
+    property_stock_production: stock.location_production
+-
+  Now I create a bill of material for the product Wooden Chair.
+-
+  !record {model: mrp.bom, id: mrp_bom_woodenchair0}:
+    company_id: base.main_company
+    name: Wooden Chair
+    product_efficiency: 1.0
+    product_id: product_product_woodenchair0
+    product_qty: 1.0
+    product_uom: product.product_uom_unit
+    product_uos_qty: 0.0
+    type: normal
+    bom_lines:
+      - company_id: base.main_company
+        name: Wood
+        product_efficiency: 1.0
+        product_id: product_product_wood0
+        product_qty: 10.0
+        product_uom: product.product_uom_unit
+        product_uos_qty: 0.0
+        sequence: 0.0
+        type: normal
+      - company_id: base.main_company
+        name: Nails
+        product_efficiency: 1.0
+        product_id: product_product_nails0
+        product_qty: 35.0
+        product_uom: product.product_uom_unit
+        product_uos_qty: 0.0
+        sequence: 0.0
+        type: normal
+    sub_products:
+      - product_id: product_product_woodentable0
+        product_uom: product.product_uom_unit
+        product_qty: 1.0
+        subproduct_type: fixed
+-
+  I create a production order for Wooden Chair.
+-
+  !record {model: mrp.production, id: mrp_production_mo0}:
+    bom_id: mrp_bom_woodenchair0
+    company_id: base.main_company
+    date_planned: '2010-08-06 14:55:52'
+    location_dest_id: stock.stock_location_stock
+    location_src_id: stock.stock_location_stock
+    name: MO/00004
+    product_id: product_product_woodenchair0
+    product_qty: 10.0
+    product_uom: product.product_uom_unit
+    product_uos_qty: 0.0
+-
+  I compute the data of production order.
+-
+  !python {model: mrp.production}: |
+    self.action_compute(cr, uid, [ref("mrp_production_mo0")], {"lang": "en_US", "tz": False, "search_default_Current":
+      1, "active_model": "ir.ui.menu", "active_ids": [ref("mrp.menu_mrp_production_action")],
+      "active_id": ref("mrp.menu_mrp_production_action"), })
+-
+  I confirm the production order.
+-
+  !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_mo0}
+-
+  Now I check the stock moves for the subproduct I created in the bill of material.
+  This move is created automatically when I confirmed the production order.
+-
+  !python {model: stock.move}: |
+    move_id = self.search(cr, uid, [('product_id','=',ref('product_product_woodentable0'))])
+    assert move_id, 'No moves are created !'
+-
+  I want to start the production so I force the reservation of products.
+-
+  !python {model: mrp.production}: |
+    self.force_production(cr, uid, [ref("mrp_production_mo0")], {"lang": "en_US", "tz": False,
+      "search_default_Current": 1, "active_model": "ir.ui.menu", "active_ids":
+      [ref("mrp.menu_mrp_production_action")], "active_id": ref("mrp.menu_mrp_production_action"),
+      })
+-
+  I start the production.
+-
+  !workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0}
+-
+  I consume and produce the Production of products.
+-
+  I create record for selecting mode and quantity of products to produce.
+-
+  !record {model: mrp.product.produce, id: mrp_product_produce0}:
+    product_qty: 10.00
+    mode: 'consume_produce'
+-
+  I finish the production order.
+-
+  !python {model: mrp.product.produce}: |
+    self.do_produce(cr, uid, [ref("mrp_product_produce0")], {"lang": "en_US", "tz":
+      False, "search_default_Current": 1, "active_model": "mrp.production", "active_ids":
+      [ref("mrp_production_mo0")], "active_id": ref("mrp_production_mo0"), })
+-
+  I see that stock moves of Wood and Nails including Wooden Table are done now.
+-
+  !python {model: stock.move}: |
+    move_ids = self.search(cr, uid, [('product_id','in',[ref("product_product_woodenchair0"),ref("product_product_woodentable0"),ref("product_product_wood0"),ref("product_product_nails0")])])
+    moves = self.browse(cr, uid, move_ids)
+    assert all(move.state == 'done' for move in moves), 'Moves are not done!'
diff --git a/addons/olap_crm/i18n/mn.po b/addons/olap_crm/i18n/mn.po
new file mode 100644 (file)
index 0000000..b6b8987
--- /dev/null
@@ -0,0 +1,31 @@
+# Mongolian translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-11-26 05:29+0000\n"
+"PO-Revision-Date: 2010-08-06 08:47+0000\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: Mongolian <mn@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: 2010-08-07 03:43+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: olap_crm
+#: model:ir.module.module,description:olap_crm.module_meta_information
+msgid ""
+"\n"
+"    Sale module will load the data in olap tables\n"
+"    "
+msgstr ""
+
+#. module: olap_crm
+#: model:ir.module.module,shortdesc:olap_crm.module_meta_information
+msgid "olap_crm"
+msgstr ""
diff --git a/addons/outlook/plugin/Register-plugin.bat b/addons/outlook/plugin/Register-plugin.bat
new file mode 100644 (file)
index 0000000..3df2924
--- /dev/null
@@ -0,0 +1 @@
+python addin.py
diff --git a/addons/outlook/plugin/Unregister-plugin.bat b/addons/outlook/plugin/Unregister-plugin.bat
new file mode 100644 (file)
index 0000000..0d06912
--- /dev/null
@@ -0,0 +1 @@
+python addin.py --unregister
index 98dcc6b..1583ec7 100755 (executable)
- #!/usr/bin/python\r
- #-*- encoding: utf-8 -*-\r
-\r
-from processors import *\r
-from opt_processors import *\r
-import sys\r
-import os\r
-import addin\r
-from dialogs import ShowDialog, MakePropertyPage\r
-import win32ui\r
-import commctrl\r
-import win32con\r
-import win32gui\r
-import win32gui_struct\r
-import xmlrpclib\r
-from manager import ustr\r
-import chilkat\r
-\r
-try:\r
-    enumerate\r
-except NameError:   # enumerate new in 2.3\r
-    def enumerate(seq):\r
-        return [(i, seq[i]) for i in xrange(len(seq))]\r
-\r
-BIF_NEWDIALOGSTYLE = 0x00000040\r
-BIF_NONEWFOLDERBUTTON = 0x0000200\r
-CSIDL_COMMONMYPICTURES = 0x00000036\r
-\r
-class _WIN32MASKEDSTRUCT:\r
-    def __init__(self, **kw):\r
-        full_fmt = ""\r
-        for name, fmt, default, mask in self._struct_items_:\r
-            self.__dict__[name] = None\r
-            if fmt == "z":\r
-                full_fmt += "pi"\r
-            else:\r
-                full_fmt += fmt\r
-        for name, val in kw.iteritems():\r
-            if name not in self.__dict__:\r
-                raise ValueError("LVITEM structures do not have an item '%s'" % (name,))\r
-            self.__dict__[name] = val\r
-\r
-    def __setattr__(self, attr, val):\r
-        if not attr.startswith("_") and attr not in self.__dict__:\r
-            raise AttributeError(attr)\r
-        self.__dict__[attr] = val\r
-\r
-    def toparam(self):\r
-        self._buffs = []\r
-        full_fmt = ""\r
-        vals = []\r
-        mask = 0\r
-        # calc the mask\r
-        for name, fmt, default, this_mask in self._struct_items_:\r
-            if this_mask is not None and self.__dict__.get(name) is not None:\r
-                mask |= this_mask\r
-        self.mask = mask\r
-        for name, fmt, default, this_mask in self._struct_items_:\r
-            val = self.__dict__[name]\r
-            if fmt == "z":\r
-                fmt = "Pi"\r
-                if val is None:\r
-                    vals.append(0)\r
-                    vals.append(0)\r
-                else:\r
-                    # Note this demo still works with byte strings.  An\r
-                    # alternate strategy would be to use unicode natively\r
-                    # and use the 'W' version of the messages - eg,\r
-                    # LVM_SETITEMW etc.\r
-                    val = val + "\0"\r
-                    if isinstance(val, unicode):\r
-                        val = val.encode("mbcs")\r
-                    str_buf = array.array("b", val)\r
-                    vals.append(str_buf.buffer_info()[0])\r
-                    vals.append(len(val))\r
-                    self._buffs.append(str_buf) # keep alive during the call.\r
-            else:\r
-                if val is None:\r
-                    val = default\r
-                vals.append(val)\r
-            full_fmt += fmt\r
-        return struct.pack(*(full_fmt,) + tuple(vals))\r
-\r
-\r
-# NOTE: See the win32gui_struct module for an alternative way of dealing\r
-# with these structures\r
-class LVITEM(_WIN32MASKEDSTRUCT):\r
-    _struct_items_ = [\r
-        ("mask", "I", 0, None),\r
-        ("iItem", "i", 0, None),\r
-        ("iSubItem", "i", 0, None),\r
-        ("state", "I", 0, commctrl.LVIF_STATE),\r
-        ("stateMask", "I", 0, None),\r
-        ("text", "z", None, commctrl.LVIF_TEXT),\r
-        ("iImage", "i", 0, commctrl.LVIF_IMAGE),\r
-        ("lParam", "i", 0, commctrl.LVIF_PARAM),\r
-        ("iIdent", "i", 0, None),\r
-        ("cchTextMax", "i", 0, 255),\r
-        ("pszText", "i", 0, None),\r
-        ("flags", "i", 0, None),\r
-    ]\r
-\r
-class LVCOLUMN(_WIN32MASKEDSTRUCT):\r
-    _struct_items_ = [\r
-        ("mask", "I", 0, None),\r
-        ("fmt", "i", 0, commctrl.LVCF_FMT),\r
-        ("cx", "i", 0, commctrl.LVCF_WIDTH),\r
-        ("text", "z", None, commctrl.LVCF_TEXT),\r
-        ("iSubItem", "i", 0, commctrl.LVCF_SUBITEM),\r
-        ("iImage", "i", 0, commctrl.LVCF_IMAGE),\r
-        ("iOrder", "i", 0, commctrl.LVCF_ORDER),\r
-    ]\r
-\r
-global flag_stop\r
-flag_stop=win32con.MB_ICONSTOP\r
-\r
-global flag_error\r
-flag_error=win32con.MB_ICONERROR\r
-\r
-global flag_info\r
-flag_info=win32con.MB_ICONINFORMATION\r
-\r
-global flag_excl\r
-flag_excl=win32con.MB_ICONEXCLAMATION\r
-\r
-#global NewConn\r
-NewConn=addin.GetConn()\r
-## Retrieves current registered XMLRPC connection\r
-def GetConn():\r
-    return NewConn\r
-\r
-global objects_with_match\r
-objects_with_match=[]\r
-\r
-global hwndChk_list\r
-hwndChk_list=[]\r
-\r
-global search_text\r
-search_text='search_text'\r
-\r
-global name\r
-name=''\r
-global email\r
-email=''\r
-\r
-def check():\r
-    server = NewConn.getitem('_server')\r
-    port = NewConn.getitem('_port')\r
-    NewConn.GetDBList()\r
-    if str(NewConn.getitem('_running')) == 'False':\r
-        win32ui.MessageBox("No server running on host "+ server+" at port "+str(port), "Server Connection", flag_excl)\r
-        return False\r
-    if str(NewConn.getitem('_login')) == 'False':\r
-        win32ui.MessageBox("Please login to the database first", "Database Connection", flag_excl)\r
-        return False\r
-    return True\r
-def resetConnAttribs(window):\r
-    config = window.manager.LoadConfig()\r
-    NewConn.setitem('_server', config['server'])\r
-    NewConn.setitem('_port', config['port'])\r
-    NewConn.setitem('protocol', config['protocol'])\r
-    NewConn.setitem('_uri', "http://" + config['server'] + ":" + str(config['port']))\r
-    NewConn.setitem('_obj_list', config['objects'])\r
-    NewConn.setitem('_dbname', config['database'])\r
-    NewConn.setitem('_uname', config['uname'])\r
-    NewConn.setitem('_pwd', config['pwd'])\r
-    NewConn.setitem('_login', str(config['login']))\r
-    return\r
-\r
-def setConnAttribs(server, port, manager):\r
-    protocol = NewConn.getitem('protocol')\r
-    if protocol=='XML-RPCS':\r
-        protocol='https://'\r
-    else:\r
-        protocol='http://'\r
-    uri = protocol + server + ":" + str(port)\r
-    NewConn.setitem('_server',server)\r
-    NewConn.setitem('_port',port)\r
-    NewConn.setitem('_uri',uri)\r
-    NewConn.GetDBList()\r
-    manager.config = manager.LoadConfig()\r
-    NewConn.setitem('_dbname',manager.config['database'])\r
-    NewConn.setitem('_uname', manager.config['uname'])\r
-    NewConn.setitem('_pwd', manager.config['pwd'])\r
-    NewConn.setitem('_login', str(manager.config['login']))\r
-    NewConn.setitem('_obj_list', manager.config['objects'])\r
-    return\r
-\r
-def getConnAttributes(manager):\r
-    manager.config['server'] = NewConn.getitem('_server')\r
-    manager.config['port'] = NewConn.getitem('_port')\r
-    manager.config['protocol'] = NewConn.getitem('protocol')\r
-    manager.config['objects'] = eval(NewConn.getitem('_obj_list'))\r
-    manager.config['database'] = NewConn.getitem('_dbname')\r
-    manager.config['uname'] = NewConn.getitem('_uname')\r
-    manager.config['pwd'] = NewConn.getitem('_pwd')\r
-    manager.config['login'] = NewConn.getitem('_login')\r
-    return\r
-\r
-def getMessage(e):\r
-    import pywintypes\r
-    print "Exception %s: %s"%(type(e),str(e))\r
-    msg = str(e)\r
-    if type(e) == pywintypes.com_error:\r
-        msg=str(e)\r
-    elif type(e) == xmlrpclib.Fault:\r
-        msg = str(e.faultCode) or e.faultString or e.message or str(e)\r
-    else:\r
-        if hasattr(e, 'faultCode') and e.faultCode:\r
-            msg = str(e.faultCode)\r
-        elif hasattr(e, 'faultString') and e.faultString:\r
-            msg = e.faultString\r
-        elif hasattr(e, 'message') and e.message:\r
-            msg = e.message\r
-    return msg\r
-\r
-class OKButtonProcessor(ButtonProcessor):\r
-    def __init__(self, window, control_ids):\r
-        self.mngr = window.manager\r
-        ControlProcessor.__init__(self, window, control_ids)\r
-\r
-    def OnClicked(self, id):\r
-        server = win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[0])\r
-        try:\r
-            port = int(win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[1]))\r
-        except ValueError, e:\r
-            print "Exception : %s"%str(e)\r
-            win32ui.MessageBox("Port should be an integer", "Error", flag_excl)\r
-            return\r
-        except Exception,e:\r
-            msg = getMessage(e)\r
-            win32ui.MessageBox(msg, "Error", flag_excl)\r
-            return\r
-        setConnAttribs(server, port, self.mngr)\r
-        if str(NewConn.getitem('_running')) == 'False':\r
-               msg = "No server running on host '%s' at port '%d'. Press ignore to still continue with this configuration?"%(server,port)\r
-               r=win32ui.MessageBox(msg, "Server Connection", win32con.MB_ABORTRETRYIGNORE | win32con.MB_ICONQUESTION)\r
-               if r==3:\r
-                               resetConnAttribs(self.window)\r
-                               return\r
-               elif r==4:\r
-                       self.OnClicked(id)\r
-               elif r==5:\r
-                       setConnAttribs(server, port, self.mngr)\r
-        win32gui.EndDialog(self.window.hwnd, id)\r
-\r
-class DoneButtonProcessor(ButtonProcessor):\r
-    def OnClicked(self, id):\r
-        getConnAttributes(self.window.manager)\r
-        self.window.manager.SaveConfig()\r
-        win32gui.EndDialog(self.window.hwnd, id)\r
-\r
-class MessageProcessor(ControlProcessor):\r
-    def Init(self):\r
-        text = "This Outlook Plugin for OpenERP s.a. has been developed by TinyERP \n\n \\r
-                For more information, please visit our website \n \\r
-                 http://www.openerp.com \n\n \\r
-                Contact Us :\n \\r
-                sales@openerp.com \n\n \\r
-                2001-TODAY OpenERP s.a.. All rights reserved. \n"\r
-        win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, text)\r
-\r
-    def GetPopupHelpText(self, cid):\r
-        return "Displays details on this plugin"\r
-\r
-class TabProcessor(ControlProcessor):\r
-    def __init__(self, window, control_ids, page_ids):\r
-        ControlProcessor.__init__(self, window, control_ids)\r
-        self.page_ids = page_ids.split()\r
-\r
-    def Init(self):\r
-        self.pages = {}\r
-        self.currentPage = None\r
-        self.currentPageIndex = -1\r
-        self.currentPageHwnd = None\r
-        for index, page_id in enumerate(self.page_ids):\r
-            template = self.window.manager.dialog_parser.dialogs[page_id]\r
-            self.addPage(index, page_id, template[0][0])\r
-        server = self.window.manager.config['server']\r
-        port = self.window.manager.config['port']\r
-        setConnAttribs(server, port, self.window.manager)\r
-        self.switchToPage(0)\r
-\r
-    def Done(self):\r
-        if self.currentPageHwnd is not None:\r
-            if not self.currentPage.SaveAllControls():\r
-                win32gui.SendMessage(self.GetControl(), commctrl.TCM_SETCURSEL, self.currentPageIndex,0)\r
-                return False\r
-        return True\r
-\r
-    def OnNotify(self, nmhdr, wparam, lparam):\r
-        selChangedCode =  5177342\r
-        code = nmhdr[2]\r
-        if code==selChangedCode:\r
-            index = win32gui.SendMessage(self.GetControl(), commctrl.TCM_GETCURSEL, 0,0)\r
-            if index!=self.currentPageIndex:\r
-                self.switchToPage(index)\r
-\r
-    def switchToPage(self, index):\r
-        if self.currentPageHwnd is not None:\r
-            if not self.currentPage.SaveAllControls():\r
-                win32gui.SendMessage(self.GetControl(), commctrl.TCM_SETCURSEL, self.currentPageIndex,0)\r
-                return 1\r
-            win32gui.DestroyWindow(self.currentPageHwnd)\r
-        self.currentPage = MakePropertyPage(self.GetControl(), self.window.manager, self.window.config, self.pages[index])\r
-        self.currentPageHwnd = self.currentPage.CreateWindow()\r
-        self.currentPageIndex = index\r
-        return 0\r
-#\r
-    def addPage(self, item, idName, label):\r
-        format = "iiiiiii"\r
-        lbuf = win32gui.PyMakeBuffer(len(label)+1)\r
-        address,l = win32gui.PyGetBufferAddressAndLen(lbuf)\r
-        win32gui.PySetString(address, label)\r
-\r
-        buf = struct.pack(format,\r
-            commctrl.TCIF_TEXT, # mask\r
-            0, # state\r
-            0, # state mask\r
-            address,\r
-            0, #unused\r
-            0, #image\r
-            item\r
-            )\r
-        item = win32gui.SendMessage(self.GetControl(),\r
-                             commctrl.TCM_INSERTITEM,\r
-                             item,\r
-                             buf)\r
-        self.pages[item] = idName\r
-\r
-class DialogCommand(ButtonProcessor):\r
-    def __init__(self, window, control_ids, idd, func=None, args=()):\r
-        self.idd = idd\r
-        self.func = func\r
-        self.args = args\r
-        ButtonProcessor.__init__(self, window, control_ids)\r
-\r
-    def OnClicked(self, id):\r
-        self.id = id\r
-        if self.func:\r
-            args = (self, ) + self.args\r
-            self.func(*args)\r
-        parent = self.window.hwnd\r
-        self.window.SaveAllControls()\r
-        ShowDialog(parent, self.window.manager, self.window.config, self.idd)\r
-        self.window.LoadAllControls()\r
-\r
-    def GetPopupHelpText(self, id):\r
-        dd = self.window.manager.dialog_parser.dialogs[self.idd]\r
-        return "Displays the %s dialog" % dd.caption\r
-\r
-def ReloadAllControls(btnProcessor,*args):\r
-    server = NewConn.getitem('_server')\r
-    port = NewConn.getitem('_port')\r
-    btnProcessor.window.LoadAllControls()\r
-    if str(NewConn.getitem('_running')) == 'False':\r
-        win32ui.MessageBox("No server running on host "+ server+" at port "+str(port), "Server Connection", flag_excl)\r
-    return\r
-\r
-def TestConnection(btnProcessor,*args):\r
-    server = NewConn.getitem('_server')\r
-    port = NewConn.getitem('_port')\r
-    url = NewConn.getitem('_uri')\r
-    NewConn.GetDBList()\r
-    if str(NewConn.getitem('_running')) == 'False':\r
-        btnProcessor.window.LoadAllControls()\r
-        win32ui.MessageBox("No server running on host "+ server+" at port "+str(port), "OpenERP Connection", flag_excl)\r
-        return\r
-    try:\r
-        dbname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, 7000)\r
-        if not dbname:\r
-            win32ui.MessageBox("Authentication Error !\nBad Database Name !", "OpenERP Connection", flag_excl)\r
-            return\r
-    except Exception,e:\r
-        print "Exception %s: %s"%(type(e),str(e))\r
-    dbname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-    if not dbname:\r
-        win32ui.MessageBox("No database found on host "+ server+" at port "+str(port), "OpenERP Connection", flag_excl)\r
-        return\r
-\r
-    uname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])\r
-    pwd = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])\r
-\r
-    if not uname:\r
-        win32ui.MessageBox("Authentication Error !\nBad User Name !", "OpenERP Connection", flag_excl)\r
-        return\r
-    if not pwd:\r
-        win32ui.MessageBox("Authentication Error !\nBad Password !", "OpenERP Connection", flag_excl)\r
-        return\r
-\r
-    #Establish Connection\r
-    try:\r
-        uid = NewConn.login(dbname, uname, pwd)\r
-        if uid:\r
-            msg = "Connection Successful"\r
-            NewConn.setitem('_login', 'True')\r
-            NewConn.setitem('_uname', uname)\r
-            NewConn.setitem('_pwd', pwd)\r
-            NewConn.setitem('_uid', uid)\r
-            flag = flag_info\r
-            if not NewConn.IsCRMInstalled():\r
-                msg+= '\n\n'+" 'CRM' module is not installed. So CRM cases cannot be created."\r
-                NewConn.setitem('_iscrm', 'False')\r
-            else:\r
-                NewConn.setitem('_iscrm', 'True')\r
-        else:\r
-            msg = "Authentication Error !\nBad UserName or Password"\r
-            flag = flag_stop\r
-            NewConn.setitem('_login', 'False')\r
-    except Exception,e:\r
-        msg = "Authentication Error !\n\n" + getMessage(e)\r
-        flag = flag_error\r
-    win32ui.MessageBox(msg, "OpenERP Connection", flag)\r
-    return\r
-\r
-def BrowseCallbackProc(hwnd, msg, lp, data):\r
-    from win32com.shell import shell, shellcon\r
-    if msg== shellcon.BFFM_INITIALIZED:\r
-        win32gui.SendMessage(hwnd, shellcon.BFFM_SETSELECTION, 1, data)\r
-        win32gui.SendMessage(hwnd, shellcon.BFFM_ENABLEOK, 0, 0)\r
-    elif msg == shellcon.BFFM_SELCHANGED:\r
-        # Set the status text of the\r
-        # For this message, 'lp' is the address of the PIDL.\r
-        pidl = shell.AddressAsPIDL(lp)\r
-        try:\r
-            path = shell.SHGetPathFromIDList(pidl)\r
-            if os.path.isdir(path):\r
-                win32gui.SendMessage(hwnd, shellcon.BFFM_ENABLEOK, 0, 0)\r
-            else:\r
-                ext = path.split('.')[-1]\r
-                if ext not in ['gif', 'bmp', 'jpg', 'tif', 'ico', 'png']:\r
-                        win32gui.SendMessage(hwnd, shellcon.BFFM_ENABLEOK, 0, 0)\r
-\r
-                else:\r
-                    win32gui.SendMessage(hwnd, shellcon.BFFM_ENABLEOK, 0, 1)\r
-        except shell.error:\r
-            # No path for this PIDL\r
-            pass\r
-\r
-def GetImagePath(btnProcessor,*args):\r
-    from win32com.shell import shell, shellcon\r
-    ulFlags = shellcon.BIF_BROWSEINCLUDEFILES | BIF_NEWDIALOGSTYLE | BIF_NONEWFOLDERBUTTON\r
-    pidl, display_name, image_list=shell.SHBrowseForFolder(btnProcessor.window.hwnd, # parent HWND\r
-                            None, # root PIDL.\r
-                            "Get the image path", # title\r
-                            ulFlags, # flags\r
-                            BrowseCallbackProc, # callback function\r
-                            os.getcwd() # 'data' param for the callback\r
-                            )\r
-    if (pidl, display_name, image_list) == (None, None, None):\r
-      return\r
-    else:\r
-      path = shell.SHGetPathFromIDList (pidl)\r
-      win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], path)\r
-\r
-def AddNewObject(btnProcessor,*args):\r
-    #Check if server running or user logged in\r
-    b = check()\r
-    if not b:\r
-        return\r
-\r
-    #Check if title or object not specified\r
-    obj_title = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-    obj_name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])\r
-    if not obj_title:\r
-        win32ui.MessageBox("No Title specified", "Documents Setting", flag_excl)\r
-        return\r
-    if not obj_name:\r
-        win32ui.MessageBox("No Document specified", "Documents Setting", flag_excl)\r
-        return\r
-\r
-    #Check if object does not exist in the database or it already exist in the list\r
-    try:\r
-        all_obj_list = NewConn.GetAllObjects()\r
-        curr_obj_list = [obj[1] for obj in NewConn.GetObjList()]\r
-        curr_title_list = [obj[0] for obj in NewConn.GetObjList()]\r
-        if obj_name not in all_obj_list:\r
-            win32ui.MessageBox("No such Document exists", "Documents Setting", flag_excl)\r
-            return\r
-        elif obj_name in curr_obj_list:\r
-            win32ui.MessageBox("Document already in the list", "Documents Setting", flag_info)\r
-            return\r
-        elif obj_title in curr_title_list:\r
-            win32ui.MessageBox("Title already in the list. Please give different title", "Documents Setting", flag_excl)\r
-            return\r
-\r
-        #extract image path and load the image\r
-        image_path=''\r
-        image_path = os.path.join(btnProcessor.window.manager.application_directory, "dialogs\\resources\\openerp_logo1.bmp")\r
-        path=win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])\r
-        if path:\r
-            image_path = path\r
-        load_bmp_flags=win32con.LR_LOADFROMFILE | win32con.LR_LOADTRANSPARENT\r
-        try:\r
-            hicon = win32gui.LoadImage(0, image_path,win32con.IMAGE_BITMAP, 40, 40, load_bmp_flags)\r
-        except Exception,e:\r
-            msg=getMessage(e)\r
-            hicon=None\r
-            win32ui.MessageBox(msg, "Load Image", flag_error)\r
-\r
-        #Add the object in the list\r
-        win32gui.ImageList_Add(il,hicon,0)\r
-        cnt = win32gui.ImageList_GetImageCount(il)\r
-\r
-        hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[3])\r
-        num_items = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMCOUNT)\r
-\r
-        item = LVITEM(text=obj_title, iImage=cnt-2, iItem = num_items)\r
-        new_index = win32gui.SendMessage(hwndList, commctrl.LVM_INSERTITEM, 0, item.toparam())\r
-\r
-        win32gui.SendMessage(hwndList, commctrl.LVM_SETIMAGELIST, commctrl.LVSIL_SMALL, il)\r
-\r
-        item = LVITEM(text=obj_name, iItem = new_index, iSubItem = 1)\r
-        win32gui.SendMessage(hwndList, commctrl.LVM_SETITEM, 0, item.toparam())\r
-\r
-        NewConn.InsertObj(obj_title,obj_name,image_path)\r
-    except Exception, e:\r
-        msg = "Document not added\n\n" + getMessage(e)\r
-        win32ui.MessageBox(msg,"Documents Setting",flag_excl)\r
-        return\r
-\r
-    #Empty all the text controls\r
-    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], '')\r
-    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1], '')\r
-    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2], '')\r
-\r
-def DeleteSelectedObjects(btnProcessor,*args):\r
-    #Check if server running or user logged in\r
-    b = check()\r
-    if not b:\r
-        return\r
-\r
-    #Delete selected items\r
-    hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-    sel_count = win32gui.SendMessage(hwndList, commctrl.LVM_GETSELECTEDCOUNT)\r
-    for i in range(0,sel_count):\r
-        sel = win32gui.SendMessage(hwndList, commctrl.LVM_GETNEXTITEM, -1, commctrl.LVNI_SELECTED)\r
-        buf,extra = win32gui_struct.EmptyLVITEM(1, 0)\r
-        r = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMTEXT, sel, buf)\r
-        sel_text = ''\r
-        for n in extra:\r
-            nombre = n.tostring()\r
-            sel_text = nombre[0:r]\r
-        s = win32gui.SendMessage(hwndList, commctrl.LVM_DELETEITEM, sel)\r
-        try:\r
-            NewConn.DeleteObject(sel_text)\r
-        except Exception,e:\r
-            msg = "Documents '%s' not deleted\n\n"%sel_text + getMessage(e)\r
-            win32ui.MessageBox(msg,"Documents Setting",flag_excl)\r
-\r
-def GetMail(processor):\r
-    ex = processor.window.manager.outlook.ActiveExplorer()\r
-    assert ex.Selection.Count == 1\r
-    mail = ex.Selection.Item(1)\r
-    return mail\r
-#get selected records from list\r
-def GetSelectedItems(hwndList):\r
-    r=[]\r
-    sel_count = win32gui.SendMessage(hwndList, commctrl.LVM_GETSELECTEDCOUNT)\r
-    sel=-1\r
-    for i in range(0,sel_count):\r
-        sel = win32gui.SendMessage(hwndList, commctrl.LVM_GETNEXTITEM, sel, commctrl.LVNI_SELECTED)\r
-        buf,extra = win32gui_struct.EmptyLVITEM(1, 0)\r
-        size = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMTEXT, sel, buf)\r
-        sel_text = ''\r
-        for n in extra:\r
-            nombre = n.tostring()\r
-            sel_text = nombre[0:size]\r
-        for item in objects_with_match:\r
-            if item[2] == sel_text:\r
-                 r.append(item)\r
-    return r\r
-\r
-def MakeAttachment(btnProcessor,*args):\r
-    #Check if server running or user logged in\r
-    b = check()\r
-    if not b:\r
-        return\r
-    ex = btnProcessor.window.manager.outlook.ActiveExplorer()\r
-    assert ex.Selection.Count == 1\r
-    mail = ex.Selection.Item(1)\r
-    mail = GetMail(btnProcessor)\r
-\r
-    #get selected records\r
-    hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-    r = GetSelectedItems(hwndList)\r
-    if not r:\r
-        win32ui.MessageBox("No records selected", "Make Attachment", flag_info)\r
-        return\r
-    try:\r
-        flg = NewConn.ArchiveToOpenERP(r,mail)\r
-        if flg:\r
-            win32gui.EndDialog(btnProcessor.window.hwnd, btnProcessor.other_ids[1])\r
-            return\r
-    except Exception,e:\r
-        msg = "Attachment not created \n\n" + getMessage(e)\r
-        flag = flag_error\r
-        win32ui.MessageBox(msg, "Make Attachment", flag)\r
-    return\r
-\r
-def CreateCase(btnProcessor,*args):\r
-    try:\r
-        #Check if server running or user logged in\r
-        b = check()\r
-        if not b:\r
-            return\r
-\r
-        if str(NewConn.getitem('_iscrm')) == 'True':\r
-        #    Get the selected mail\r
-            ex = btnProcessor.window.manager.outlook.ActiveExplorer()\r
-            assert ex.Selection.Count == 1\r
-            mail = ex.Selection.Item(1)\r
-            section = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-            section = str(section)\r
-            section=section.lower().replace(' ','.')\r
-            if not section:\r
-                win32ui.MessageBox("Documents can not be created.", "Documents Setting", flag_excl)\r
-                return\r
-\r
-            hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])\r
-            partner_ids=[]\r
-            r = GetSelectedItems(hwndList)\r
-            for rec in r:\r
-                if rec[0] == 'res.partner':\r
-                    partner_ids.append(rec[1])\r
-\r
-            #Create new case\r
-            try:\r
-                with_attachments=True\r
-                if  mail.Attachments.Count > 0:\r
-                    msg="The mail contains attachments. Do you want to create case with attachments?"\r
-                    r=win32ui.MessageBox(msg, "Create Case", win32con.MB_YESNOCANCEL | win32con.MB_ICONQUESTION)\r
-                    if r == 2:\r
-                        return\r
-                    elif r == 7:\r
-                       with_attachments=False\r
-\r
-                NewConn.CreateCase(str(section), mail, partner_ids, with_attachments)\r
-                msg="New Document created."\r
-                flag=flag_info\r
-            except Exception,e:\r
-                msg="New Document not created \n\n"+str(e)\r
-                flag=flag_error\r
-            win32ui.MessageBox(msg, "Create Document", flag)\r
-            return\r
-        else:\r
-            win32ui.MessageBox("Document can not be created. CRM not installed", "Create Object", flag_info)\r
-    except Exception, e:\r
-        win32ui.MessageBox(str(e), 'New Document')\r
-\r
-def GetSearchText(txtProcessor,*args):\r
-    #Check if server running or user logged in\r
-    b = check()\r
-    if not b:\r
-        return\r
-\r
-    search_box = txtProcessor.GetControl()\r
-    global search_text\r
-    if txtProcessor.init_done:\r
-        win32gui.SendMessage(search_box, win32con.WM_SETTEXT, 0,search_text)\r
-        return\r
-\r
-    # Get the selected mail and set the default value for search_text_control to mail.SenderEmailAddress\r
-    ex = txtProcessor.window.manager.outlook.ActiveExplorer()\r
-    assert ex.Selection.Count == 1\r
-    mail = ex.Selection.Item(1)\r
-    try:\r
-        search_text = ustr(mail.SenderEmailAddress).encode('iso-8859-1')\r
-    except Exception,e:\r
-        pass\r
-    win32gui.SendMessage(search_box, win32con.WM_SETTEXT, 0, search_text)\r
-    txtProcessor.init_done=True\r
-\r
-def SetNameColumn(listProcessor,*args):\r
-    hwndList = listProcessor.GetControl()\r
-    child_ex_style = win32gui.SendMessage(hwndList, commctrl.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)\r
-    child_ex_style |= commctrl.LVS_EX_FULLROWSELECT\r
-    win32gui.SendMessage(hwndList, commctrl.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, child_ex_style)\r
-\r
-    # set header row\r
-    lvc =  LVCOLUMN(\r
-                    mask = commctrl.LVCF_FMT | commctrl.LVCF_WIDTH | \\r
-                    commctrl.LVCF_TEXT | commctrl.LVCF_SUBITEM\r
-                    )\r
-    lvc.fmt = commctrl.LVCFMT_LEFT\r
-    lvc.iSubItem = 1\r
-    lvc.text = "Document Type"\r
-    lvc.cx = 100\r
-    win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())\r
-    lvc.iSubItem = 0\r
-    lvc.text = "Name"\r
-    lvc.cx = 240\r
-    win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())\r
-    listProcessor.init_done = True\r
-\r
-def setList(list_hwnd):\r
-    # Set default list of objects\r
-    win32gui.SendMessage(list_hwnd, commctrl.LVM_DELETEALLITEMS)\r
-    for obj in objects_with_match:\r
-        num_items = win32gui.SendMessage(list_hwnd, commctrl.LVM_GETITEMCOUNT)\r
-        item = LVITEM(text=obj[2],iItem = num_items)\r
-        new = win32gui.SendMessage(list_hwnd, commctrl.LVM_INSERTITEM, 0, item.toparam())\r
-        item = LVITEM(text=obj[3],iItem = new,  iSubItem = 1)\r
-        win32gui.SendMessage(list_hwnd, commctrl.LVM_SETITEM, 0, item.toparam())\r
-\r
-def SearchObjectsForText(btnProcessor,*args):\r
-    #Check if server running or user logged in\r
-    b = check()\r
-    if not b:\r
-        return\r
-\r
-    search_txt = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-    if not search_txt:\r
-        win32ui.MessageBox("Enter text to search for", "Archive to OpenERP", flag_info)\r
-        return\r
-    # Get titles from list\r
-    obj_titles=[]\r
-    for ch in hwndChk_list:\r
-        id = ch[0]\r
-        hwnd = ch[1]\r
-        chk = win32gui.SendMessage(hwnd, win32con.BM_GETCHECK)\r
-        if chk:\r
-            txt = win32gui.GetDlgItemText(btnProcessor.window.hwnd,id)\r
-            obj_titles.append(txt)\r
-\r
-    # Prepare list of objects to search for the seach_keyword\r
-    obj_list = btnProcessor.window.manager.config['objects']\r
-    search_list = []\r
-    try:\r
-        all_obj_list = NewConn.GetAllObjects()\r
-        for title in obj_titles:\r
-            objname = [obj[1] for obj in obj_list if obj[0] == title]\r
-            if objname:\r
-                assert len(objname) == 1\r
-                if objname[0] in all_obj_list:\r
-                     search_list.append(objname[0])\r
-                else:\r
-                    win32ui.MessageBox("Module %s (%s) not installed. Please install it." \\r
-                                       %(title,objname[0]), "Archive to OpenERP", flag_excl)\r
-                    return\r
-\r
-        #  Get the records by searching the objects in search_list for the search_keyword as objects_with_match\r
-        global objects_with_match\r
-        list_hwnd = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])\r
-        if search_list:\r
-            objects_with_match = NewConn.GetObjectItems(search_list, search_txt)\r
-            if not objects_with_match:\r
-                win32ui.MessageBox("No matching records found in checked objects", "Archive to OpenERP", flag_info)\r
-        else:\r
-            win32ui.MessageBox("No object selected", "Archive to OpenERP", flag_info)\r
-            objects_with_match=[]\r
-        # Display the objects_with_match records in list\r
-        setList(list_hwnd)\r
-    except Exception,e:\r
-        msg=getMessage(e)\r
-        win32ui.MessageBox(msg, "Search Text", flag_error)\r
-\r
-def CreateContact(btnProcessor,*args):\r
-    b = check()\r
-    if not b:\r
-        return\r
-\r
-    partner = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9])\r
-    combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[9])\r
-    sel = win32gui.SendMessage(combo, win32con.CB_GETCURSEL)\r
-    state_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[10])\r
-    state_sel = win32gui.SendMessage(state_combo, win32con.CB_GETCURSEL)\r
-    coun_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[11])\r
-    country_sel = win32gui.SendMessage(coun_combo, win32con.CB_GETCURSEL)\r
-    name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-    email = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])\r
-    office_no = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])\r
-    mobile_no = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3])\r
-    fax = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[4])\r
-    street = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[5])\r
-    street2 = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[6])\r
-    city = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[7])\r
-    zip = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[8])\r
-    if not name:\r
-        win32ui.MessageBox("Please enter name.", "Create Contact", flag_stop)\r
-        return\r
-\r
-    res = {\r
-           'name':ustr(name),\r
-           'email':ustr(email),\r
-           'phone':ustr(office_no),\r
-           'mobile':ustr(mobile_no),\r
-           'fax':ustr(fax),\r
-           'street':ustr(street),\r
-           'street2':ustr(street2),\r
-           'city':ustr(city),\r
-           'zip':ustr(zip)\r
-       }\r
-\r
-    fs_id = c_id = -1\r
-    if not state_sel == -1 :\r
-        try:\r
-            temp = NewConn.GetAllState()\r
-            i = -1\r
-            for t in temp:\r
-                i+=1\r
-                if i == state_sel:\r
-                    fs_id = t[0]\r
-                    break;\r
-            res ['state_id'] = fs_id\r
-        except Exception, e:\r
-            msg = getMessage(e)\r
-            win32ui.MessageBox(msg, "New Partner", flag_error)\r
-            pass\r
-    if not country_sel == -1 :\r
-        try:\r
-            temp = NewConn.GetAllCountry()\r
-            i = -1\r
-            for t in temp:\r
-                i+=1\r
-                if i == country_sel:\r
-                    c_id = t[0]\r
-                    break;\r
-            res ['country_id'] = c_id\r
-        except Exception, e:\r
-            msg = getMessage(e)\r
-            win32ui.MessageBox(msg, "Open Contact", flag_error)\r
-            pass\r
-    try:\r
-        id = NewConn.CreateContact(sel, str(res))\r
-        if not partner:\r
-            msg="New contact created."\r
-        else:\r
-            msg="New contact created for partner '%s'."%partner\r
-    except Exception,e:\r
-        msg="Contact not created \n\n" + getMessage(e)\r
-        win32ui.MessageBox(msg, "Create Contact", flag_error)\r
-        return\r
-    win32ui.MessageBox(msg, "Create Contact", flag_info)\r
-    for i in range(0,9):\r
-        win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], '')\r
-    win32gui.SendMessage(combo, win32con.CB_SETCURSEL, -1 )\r
-    win32gui.SendMessage(state_combo, win32con.CB_SETCURSEL, -1 )\r
-    win32gui.SendMessage(coun_combo, win32con.CB_SETCURSEL, -1 )\r
-\r
-def SetAllText(txtProcessor,*args):\r
-    # Set values for url, uname, pwd from config file\r
-    url = NewConn.getitem('_uri')\r
-    tbox = txtProcessor.GetControl()\r
-    win32gui.SendMessage(tbox, win32con.WM_SETTEXT, 0, str(url))\r
-    k=win32gui.GetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id)\r
-    uname = NewConn.getitem('_uname')\r
-    tbox = txtProcessor.GetControl(txtProcessor.other_ids[0])\r
-    win32gui.SendMessage(tbox, win32con.WM_SETTEXT, 0, str(uname))\r
-\r
-def SetDefaultList(listProcessor,*args):\r
-    import win32api\r
-    hwndList = listProcessor.GetControl()\r
-\r
-    # set full row select style\r
-    child_ex_style = win32gui.SendMessage(hwndList, commctrl.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)\r
-    child_ex_style |= commctrl.LVS_EX_FULLROWSELECT\r
-    win32gui.SendMessage(hwndList, commctrl.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, child_ex_style)\r
-\r
-    # set header row\r
-    lvc =  LVCOLUMN(\r
-                    mask = commctrl.LVCF_FMT | commctrl.LVCF_WIDTH | \\r
-                    commctrl.LVCF_TEXT | commctrl.LVCF_SUBITEM\r
-                    )\r
-    lvc.fmt = commctrl.LVCFMT_LEFT\r
-    lvc.iSubItem = 1\r
-    lvc.text = "Object Name"\r
-    lvc.cx = 315\r
-    win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())\r
-    lvc.iSubItem = 0\r
-    lvc.text = "Document Title"\r
-    lvc.cx = 315\r
-    win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())\r
-\r
-    #create imagelist\r
-    global il\r
-    il = win32gui.ImageList_Create(\r
-                        win32api.GetSystemMetrics(win32con.SM_CXSMICON),\r
-                        win32api.GetSystemMetrics(win32con.SM_CYSMICON),\r
-                        commctrl.ILC_COLOR32 | commctrl.ILC_MASK,\r
-                        1, # initial size\r
-                        0) # cGrow\r
-\r
-    win32gui.SendMessage(hwndList, commctrl.LVM_SETIMAGELIST,\\r
-                                 commctrl.LVSIL_SMALL, il)\r
-    # Set objects from config\r
-    objs = eval(NewConn.getitem('_obj_list'))\r
-    load_bmp_flags=win32con.LR_LOADFROMFILE | win32con.LR_LOADTRANSPARENT\r
-    for obj in objs:\r
-        image_path = os.path.join(listProcessor.window.manager.application_directory, "dialogs\\resources\\openerp_logo1.bmp")\r
-        path=obj[2]\r
-        if path:\r
-            image_path = path\r
-        try:\r
-            hicon = win32gui.LoadImage(0, image_path,win32con.IMAGE_BITMAP, 40, 40, load_bmp_flags)\r
-        except Exception, e:\r
-            msg = "Problem loading the image \n\n" + getMessage(e)\r
-            hicon = None\r
-            win32ui.MessageBox(msg, "Load Image", flag_error)\r
-\r
-        #Add the object in the list\r
-        win32gui.ImageList_Add(il,hicon,0)\r
-        cnt = win32gui.ImageList_GetImageCount(il)\r
-        num_items = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMCOUNT)\r
-        item = LVITEM(text=obj[0],iImage=cnt-2, iItem = num_items)\r
-        new_index = win32gui.SendMessage(hwndList, commctrl.LVM_INSERTITEM, 0, item.toparam())\r
-        item = LVITEM(text=obj[1], iItem = new_index, iSubItem = 1)\r
-        win32gui.SendMessage(hwndList, commctrl.LVM_SETITEM, 0, item.toparam())\r
-\r
-def SetDefaultContact(txtProcessor,*args):\r
-    # Acquiring the control of the text box\r
-    txt_name = txtProcessor.GetControl()\r
-    txt_email = txtProcessor.GetControl(txtProcessor.other_ids[0])\r
-\r
-    global name\r
-    global email\r
-    if txtProcessor.init_done:\r
-        win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id,name)\r
-        win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0],email)\r
-        return\r
-    #\r
-    try:\r
-        mail = GetMail(txtProcessor)\r
-        name = ustr(mail.SenderName).encode('iso-8859-1')\r
-        email = ustr(mail.SenderEmailAddress).encode('iso-8859-1')\r
-    except Exception,e:\r
-        pass\r
-\r
-    fs_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[1])\r
-    c_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[2])\r
-    win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )\r
-    win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )\r
-    win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id,name)\r
-    win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0],email)\r
-    txtProcessor.init_done = True\r
-\r
-def setCheckList(groupProcessor,*args):\r
-    try:\r
-        child_style = win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP\r
-        hinst = win32gui.dllhandle\r
-        objs = groupProcessor.window.manager.config['objects']\r
-        ins_objs = NewConn.GetAllObjects()\r
-        left = 20\r
-        top = 60\r
-        cnt=0\r
-        id=4001\r
-        id1=6001\r
-        load_bmp_flags=win32con.LR_LOADFROMFILE | win32con.LR_LOADTRANSPARENT\r
-        if groupProcessor.init_done:\r
-           return\r
-        else:\r
-           for obj in objs:\r
-             if obj[1] in ins_objs:\r
-                groupProcessor.init_done = True\r
-                #Add image\r
-                hwndImg = win32gui.CreateWindowEx(0, "STATIC","",\r
-                                            win32con.SS_CENTERIMAGE | win32con.SS_REALSIZEIMAGE | win32con.SS_BITMAP | win32con.WS_CHILD | win32con.WS_VISIBLE,\r
-                                            left,top+3,13,13,\r
-                                            groupProcessor.window.hwnd,\r
-                                            id,\r
-                                            0,\r
-                                            None\r
-                                            );\r
-                image_path = os.path.join(groupProcessor.window.manager.application_directory, "dialogs\\resources\\openerp_logo1.bmp")\r
-                if obj[2]:\r
-                    image_path = obj[2]\r
-                try:\r
-                    hicon = win32gui.LoadImage(0, image_path, win32con.IMAGE_BITMAP, 40, 40, load_bmp_flags)\r
-                except Exception,e:\r
-                    msg="Problem loading the image \n\n" + getMessage(e)\r
-                    hicon = None\r
-                    win32ui.MessageBox(msg, "Load Image", flag_error)\r
-\r
-                win32gui.SendMessage(hwndImg, win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, hicon);\r
-                #Add Checkbox\r
-                left+= 17\r
-                hwndChk = win32gui.CreateWindowEx(\r
-                                                    0,"BUTTON",obj[0],win32con.WS_VISIBLE | win32con.WS_CHILD | \\r
-                                                    win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP | win32con.BST_CHECKED, \\r
-                                                    left, top, 130,20,groupProcessor.window.hwnd,id1,hinst,None\r
-                                                  )\r
-                if obj[1] in ['res.partner','res.partner.address']:\r
-                    win32gui.SendMessage(hwndChk , win32con.BM_SETCHECK, 1, 0);\r
-                hwndChk_list.append((id1,hwndChk))\r
-\r
-                cnt=cnt+1\r
-                id+=1\r
-                id1+=1\r
-                left+=17\r
-                win32gui.UpdateWindow(hwndImg)\r
-                left+=140\r
-                if cnt > 1:\r
-                    left = 20\r
-                    top+=18\r
-                    cnt=0\r
-    except Exception, e:\r
-        win32ui.MessageBox(str(e), 'Document List')\r
-\r
-def CreatePartner(btnProcessor,*args):\r
-    #Check if server running or user logged in\r
-    b = check()\r
-    if not b:\r
-        return\r
-\r
-    partner_name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-    if not partner_name:\r
-        win32ui.MessageBox("Please enter Partner name.", "Create Partner", flag_excl)\r
-        return\r
-    res = {'name':ustr(partner_name)}\r
-    try:\r
-        id = NewConn.CreatePartner(str(res))\r
-    except Exception,e:\r
-        msg="Partner not created \n\n" + getMessage(e)\r
-        win32ui.MessageBox(msg, "Create Partner", flag_error)\r
-        return\r
-    if id:\r
-        win32ui.MessageBox("New Partner '%s' created."%partner_name, "Create Partner", flag_info)\r
-        win32gui.EndDialog(btnProcessor.window.hwnd, btnProcessor.id)\r
-    else:\r
-        win32ui.MessageBox("Partner '%s' already Exists."%partner_name, "Create Partner", flag_info)\r
-    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0],'')\r
-\r
-def set_search_text(dialogProcessor,*args):\r
-    global search_text\r
-    search_text = win32gui.GetDlgItemText(dialogProcessor.window.hwnd, dialogProcessor.other_ids[0])\r
-    return\r
-\r
-def set_name_email(dialogProcessor,*args):\r
-    global name\r
-    global email\r
-    name = win32gui.GetDlgItemText(dialogProcessor.window.hwnd, dialogProcessor.other_ids[0])\r
-    email = win32gui.GetDlgItemText(dialogProcessor.window.hwnd, dialogProcessor.other_ids[1])\r
-\r
-def GetDefaultEmail(txtProcessor,*args):\r
-\r
-    from win32com.client import Dispatch\r
-    import win32con\r
-    b = check()\r
-    if not b:\r
-        return\r
-    #Acquiring control of the text box\r
-    search_partner_box = txtProcessor.GetControl()\r
-    global search_partner_text\r
-    if txtProcessor.init_done:\r
-        win32gui.SendMessage(search_partner_box, win32con.WM_SETTEXT, 0,search_partner_text)\r
-        return\r
-    #Reading Current Selected Email.\r
-    ex = txtProcessor.window.manager.outlook.ActiveExplorer()\r
-    assert ex.Selection.Count == 1\r
-    mail = ex.Selection.Item(1)\r
-    #Fetching Sender MailID from Selected Mail\r
-    try:\r
-        search_partner_text = ustr(mail.SenderEmailAddress).encode('iso-8859-1')\r
-    except Exception,e:\r
-        win32ui.MessageBox("Error In reading email ID from Email ","Open Contact", flag_error)\r
-        pass\r
-    win32gui.SendMessage(search_partner_box, win32con.WM_SETTEXT, 0, search_partner_text)\r
-\r
-    fs_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[10])\r
-    c_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[11])\r
-    partner_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[0])\r
-    vals = []\r
-    #Searching the res.partner.address for contact based on Sender Mail ID.\r
-    vals = NewConn.SearchPartnerDetail(search_partner_text)\r
-    #If no user Found.\r
-    if vals == None:\r
-        for i in range(1,10):\r
-            win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[i], "")\r
-        win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )\r
-        win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )\r
-        win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )\r
-        win32ui.MessageBox("No matching records found for  : "+str(search_partner)+".","Open Contact", flag_excl)\r
-        return\r
-    else:\r
-        #If user Found than Setting the Value for the contact in fields.\r
-        for i in range(1,10):\r
-            win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[i], "")\r
-        win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )\r
-        win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )\r
-        win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )\r
-\r
-        for val in vals:\r
-\r
-            if val[0] == 'partner_id':\r
-                    temp = list (NewConn.GetPartners())\r
-                    i = -1\r
-                    for t in temp:\r
-                        i+=1\r
-                        if t[1] == val[1][1] :\r
-                            win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, i )\r
-            if val[0] == 'name' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[1], str(val[1]))\r
-\r
-            if val[0] == 'street' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[2], str(val[1]))\r
-\r
-            if val[0] == 'street2' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[3], str(val[1]))\r
-\r
-            if val[0] == 'zip' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[9], str(val[1]))\r
-\r
-            if val[0] == 'city' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[4], str(val[1]))\r
-\r
-            if val[0] == 'state_id' and val[1] != False :\r
-                id = i = -1\r
-                temp = list(NewConn.GetAllState())\r
-                for t in temp:\r
-                    i+=1\r
-                    if str(t[1]) ==  str(val[1][1]):\r
-                        id = i\r
-                        break;\r
-                sel = win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, id )\r
-\r
-            if val[0] == 'country_id' and val[1] != False :\r
-                id = i = -1\r
-                temp = list(NewConn.GetAllCountry())\r
-                for t in temp:\r
-                    i+=1\r
-                    if str(t[1]) ==  str(val[1][1]):\r
-                        id = i\r
-                        break;\r
-                sel = win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, id )\r
-\r
-            if val[0] == 'phone' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[5], str(val[1]))\r
-\r
-            if val[0] == 'mobile' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[6], str(val[1]))\r
-\r
-            if val[0] == 'fax' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[7], str(val[1]))\r
-\r
-            if val[0] == 'email' and val[1] != False :\r
-                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[8], str(val[1]))\r
-\r
-    txtProcessor.init_done=True\r
-\r
-def SearchPartner(btnProcessor,*args):\r
-    b = check()\r
-    if not b:\r
-        return\r
-    #hwnd For the List box\r
-    fs_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[11])\r
-    c_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[12])\r
-    partner_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])\r
-    try :\r
-        search_partner = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-        if not search_partner:\r
-            win32ui.MessageBox("Please enter email id to search for.", "Open Contact", flag_excl)\r
-            return\r
-        vals = []\r
-        #Searching the contact.\r
-        vals = NewConn.SearchPartnerDetail(search_partner)\r
-        #if contact not found resetting all field to blank\r
-        if vals == None:\r
-            for i in range(2,11):\r
-                win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], "")\r
-            win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )\r
-            win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )\r
-            win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )\r
-            win32ui.MessageBox("No matching records found for  : "+str(search_partner)+".","Open Contact", flag_excl)\r
-            win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], "<enter new search>")\r
-            return\r
-        #if contact found than setting the values for the contact.\r
-        else:\r
-            for i in range(2,11):\r
-                win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], "")\r
-            win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )\r
-            win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )\r
-            win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )\r
-            for val in vals:\r
-                if val[0] == 'partner_id':\r
-                    #Finding the partner index in list and setting it.\r
-                    temp = list (NewConn.GetPartners())\r
-                    i = -1\r
-                    for t in temp:\r
-                        i+=1\r
-                        if t[1] == val[1][1] :\r
-                            win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, i )\r
-\r
-                if val[0] == 'name' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2], str(val[1]))\r
-\r
-                if val[0] == 'street' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3], str(val[1]))\r
-\r
-                if val[0] == 'street2' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[4], str(val[1]))\r
-\r
-                if val[0] == 'zip' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[10], str(val[1]))\r
-\r
-                if val[0] == 'city' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[5], str(val[1]))\r
-\r
-                if val[0] == 'state_id' and val[1] != False :\r
-                    #Finding the state index in list and setting it.\r
-                    id = i = -1\r
-                    temp = list(NewConn.GetAllState())\r
-                    for t in temp:\r
-                        i+=1\r
-                        if str(t[1]) ==  str(val[1][1]):\r
-                            id = i\r
-                            break;\r
-                    sel = win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, id )\r
-\r
-                if val[0] == 'country_id' and val[1] != False :\r
-                    #Finding the country index in list and setting it.\r
-                    id = i = -1\r
-                    temp = list(NewConn.GetAllCountry())\r
-                    for t in temp:\r
-                        i+=1\r
-                        if str(t[1]) ==  str(val[1][1]):\r
-                            id = i\r
-                            break;\r
-                    sel = win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, id )\r
-\r
-                if val[0] == 'phone' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[6], str(val[1]))\r
-\r
-                if val[0] == 'mobile' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[7], str(val[1]))\r
-\r
-                if val[0] == 'fax' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[8], str(val[1]))\r
-\r
-                if val[0] == 'email' and val[1] != False :\r
-                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9], str(val[1]))\r
-\r
-            win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], "<Enter  new search>")\r
-    except Exception,e:\r
-        msg = getMessage(e)\r
-        win32ui.MessageBox(msg, "Open Contact", flag_error)\r
-        pass\r
-\r
-def WritePartner(btnProcessor,*args):\r
-    new_vals=[]\r
-    #Reading new value of the fields.\r
-    contect_name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])\r
-    street = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])\r
-    street2 = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3])\r
-    city = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[4])\r
-    phone = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[7])\r
-    mobile = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[8])\r
-    fax = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9])\r
-    email = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[10])\r
-    zip = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[11])\r
-    country_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[6])\r
-    country_sel = win32gui.SendMessage(country_combo, win32con.CB_GETCURSEL)\r
-    state_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[5])\r
-    state_sel = win32gui.SendMessage(state_combo, win32con.CB_GETCURSEL)\r
-    partner_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])\r
-    partner_sel = win32gui.SendMessage(partner_combo, win32con.CB_GETCURSEL)\r
-    #Checking that record not being saved without name or Partner\r
-    if contect_name.strip() == "":\r
-        win32ui.MessageBox("Please enter partner Contact Name name.", "Open Contact", flag_excl)\r
-        return\r
-    if partner_sel < 1:\r
-        win32ui.MessageBox("Please Select Partner From list.", "Open Contact", flag_excl)\r
-        return\r
-    fs_id = c_id = p_id = -1\r
-    #Finding the partner index in list finding it record ID.\r
-    if not partner_sel < 0 :\r
-        try:\r
-            temp = NewConn.GetPartners()\r
-            i = -1\r
-            for t in temp:\r
-                i+=1\r
-                if i == partner_sel:\r
-                    p_id = t[0]\r
-                    break;\r
-        except Exception, e:\r
-            msg = getMessage(e)\r
-            win32ui.MessageBox(msg, "Open Contact", flag_error)\r
-            pass\r
-    #Finding the State index in list finding it record ID.\r
-    if not state_sel == -1 :\r
-        try:\r
-            temp = NewConn.GetAllState()\r
-            i = -1\r
-            for t in temp:\r
-                i+=1\r
-                if i == state_sel:\r
-                    fs_id = t[0]\r
-                    break;\r
-        except Exception, e:\r
-            msg = getMessage(e)\r
-            win32ui.MessageBox(msg, "Open Contact", flag_error)\r
-            pass\r
-    #Finding the country index in list finding it record ID.\r
-    if not country_sel == -1 :\r
-        try:\r
-            temp = NewConn.GetAllCountry()\r
-            i = -1\r
-            for t in temp:\r
-                i+=1\r
-                if i == country_sel:\r
-                    c_id = t[0]\r
-                    break;\r
-        except Exception, e:\r
-            msg = getMessage(e)\r
-            win32ui.MessageBox(msg, "Open Contact", flag_error)\r
-            pass\r
-    # Creating a list to write the values to the OpenERP\r
-    new_vals.append(['partner_id',p_id])\r
-    new_vals.append(['name',contect_name])\r
-    new_vals.append(['street',street])\r
-    new_vals.append(['street2',street2])\r
-    new_vals.append(['city',city])\r
-    new_vals.append(['state_id',fs_id])\r
-    new_vals.append(['country_id',c_id])\r
-    new_vals.append(['phone',phone])\r
-    new_vals.append(['mobile',mobile])\r
-    new_vals.append(['email',email])\r
-    new_vals.append(['fax',fax])\r
-    new_vals.append(['zip',zip])\r
-    flag = 0\r
-    try:\r
-        #writing the updated values to the Server.\r
-        flag = NewConn.WritePartnerValues(new_vals)\r
-    except Exception,e:\r
-        msg = getMessage(e)\r
-        win32ui.MessageBox(msg, "Open Contact", flag_error)\r
-        pass\r
-    if flag == 1:\r
-        win32ui.MessageBox("Changes have been Updated Successfully.", "Open Contact", flag_info)\r
-    elif flag == 0:\r
-        win32ui.MessageBox("Error in Updating the Changes.\n Please check the Database Connection.", "Open Contact", flag_error)\r
-    elif flag == -1:\r
-        win32ui.MessageBox("Contact can not be Save.\nFirst select contact using Search.","Open Contact", flag_info)\r
-\r
-\r
-\r
-dialog_map = {\r
-            "IDD_MANAGER" :            (\r
-                (CancelButtonProcessor,    "IDCANCEL", resetConnAttribs, ()),\r
-                (TabProcessor,             "IDC_TAB IDC_LIST",\r
-                                           """IDD_GENERAL IDD_OBJECT_SETTINGS IDD_ABOUT"""),\r
-                (DoneButtonProcessor,      "ID_DONE"),\r
-            ),\r
-\r
-            "IDD_GENERAL":             (\r
-                (DBComboProcessor,          "ID_DB_DROPDOWNLIST", GetConn, ()),\r
-                (TextProcessor,             "ID_SERVER_PORT ID_USERNAME ID_PASSWORD", SetAllText, ()),\r
-                (CommandButtonProcessor,    "ID_BUT_TESTCONNECTION ID_DB_DROPDOWNLIST ID_USERNAME \\r
-                                            ID_PASSWORD", TestConnection, ()),\r
-                (CommandButtonProcessor,    "IDC_RELOAD", ReloadAllControls, ()),\r
-                (DialogCommand,             "IDC_BUT_SET_SERVER_PORT", "IDD_SERVER_PORT_DIALOG"),\r
-            ),\r
-\r
-            "IDD_OBJECT_SETTINGS" :    (\r
-                (CommandButtonProcessor,   "IDC_BUT_LOAD_IMAGE IDC_IMAGE_PATH", GetImagePath, ()),\r
-                (CommandButtonProcessor,   "IDC_BUT_SAVE_OBJECT IDC_OBJECT_TITLE IDC_OBJECT_NAME \\r
-                                            IDC_IMAGE_PATH IDC_LIST", AddNewObject, ()),\r
-                (CommandButtonProcessor,   "IDC_BUT_DEL_OBJECT IDC_LIST", DeleteSelectedObjects, ()),\r
-                (ListBoxProcessor,         "IDC_LIST", SetDefaultList, ())\r
-            ),\r
-\r
-            "IDD_ABOUT" :              (\r
-                (ImageProcessor,          "IDB_OPENERPLOGO"),\r
-                (MessageProcessor,        "IDC_ABOUT"),\r
-            ),\r
-\r
-            "IDD_SERVER_PORT_DIALOG" : (\r
-                (CloseButtonProcessor,    "IDCANCEL"),\r
-                (OKButtonProcessor,  "IDOK ID_SERVER ID_PORT IDR_XML_PROTOCOL"),\r
-                (RadioButtonProcessor, "IDR_XML_PROTOCOL", GetConn, ()),\r
-                (RadioButtonProcessor, "IDR_XMLS_PROTOCOL", GetConn, ()),\r
-                (RadioButtonProcessor, "IDR_NETRPC_PROTOCOL", GetConn, ()),\r
-            ),\r
-\r
-            "IDD_SYNC" :               (\r
-                (CommandButtonProcessor,    "ID_SEARCH ID_SEARCH_TEXT IDC_NAME_LIST", SearchObjectsForText,()),\r
-                (GroupProcessor,            "IDC_STATIC_GROUP", setCheckList, ()),\r
-                (CSComboProcessor,          "ID_ATT_METHOD_DROPDOWNLIST", GetConn,()),\r
-                (TextProcessor,             "ID_SEARCH_TEXT", GetSearchText, ()),\r
-                (DialogCommand,             "ID_CREATE_CONTACT ID_SEARCH_TEXT", "IDD_NEW_CONTACT_DIALOG", set_search_text, ()),\r
-                (CloseButtonProcessor,      "IDCANCEL"),\r
-                (CommandButtonProcessor,    "ID_MAKE_ATTACHMENT IDC_NAME_LIST IDD_SYNC", MakeAttachment, ()),\r
-                (CommandButtonProcessor,    "ID_CREATE_CASE ID_ATT_METHOD_DROPDOWNLIST IDC_NAME_LIST", CreateCase, ()),\r
-                (ListBoxProcessor,          "IDC_NAME_LIST", SetNameColumn, ())\r
-            ),\r
-\r
-            "IDD_NEW_CONTACT_DIALOG" : (\r
-                (PartnersComboProcessor,    "ID_PARTNER_DROPDOWNLIST", GetConn, ()),\r
-                (CountryComboProcessor,     "ID_COUNTRY_DROPLIST", GetConn, ()),\r
-                (StateComboProcessor,       "ID_FED_STATE_DROPLIST", GetConn, ()),\r
-                (CloseButtonProcessor,      "IDCANCEL"),\r
-                (CommandButtonProcessor,    "ID_CONTACT_SAVE_BUTTON ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT ID_CONTACT_OFFICE_TEXT ID_CONTACT_MOBILE_TEXT ID_FAX_TEXT ID_STREET_TEXT ID_STREET2_TEXT ID_PARTNER_CITY_TEXT ID_ZIP_TEXT ID_PARTNER_DROPDOWNLIST ID_FED_STATE_DROPLIST ID_COUNTRY_DROPLIST", CreateContact, ()),\r
-                (TextProcessor,             "ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT ID_FED_STATE_DROPLIST ID_COUNTRY_DROPLIST" , SetDefaultContact, ()),\r
-                (DialogCommand,             "ID_NEW_PARTNER_BUTTON ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT", "IDD_NEW_PARTNER_DIALOG", set_name_email, ()),\r
-            ),\r
-\r
-            "IDD_NEW_PARTNER_DIALOG" : (\r
-                (CloseButtonProcessor,      "IDCANCEL"),\r
-                (CommandButtonProcessor,    "ID_SAVE_PARTNER_BUTTON ID_PARTNER_NAME_TEXT", CreatePartner, ()),\r
-            ),\r
-\r
-            "IDD_VIEW_PARTNER_DIALOG" : (\r
-                (PartnersComboProcessor,    "ID_PARTNER_DROPLIST", GetConn, ()),\r
-                (StateComboProcessor,       "ID_ALL_STATE_DROPDOWNLIST", GetConn, ()),\r
-                (CountryComboProcessor,     "ID_ALL_COUNTRY_DROPDOWNLIST", GetConn, ()),\r
-                (TextProcessor,             "IDET_SEARCH_PARTNER ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST", GetDefaultEmail, ()),\r
-                (CommandButtonProcessor,    "IDPB_SEARCH_PARTNER IDET_SEARCH_PARTNER ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST", SearchPartner, ()),\r
-                (CommandButtonProcessor,    "IDPB_WRITE_CHANGES ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP", WritePartner, ()),\r
-                (CloseButtonProcessor,      "IDCANCEL"),\r
-                (DialogCommand,             "ID_NEW_PART_BUTTON", "IDD_NEW_PARTNER_DIALOG" ),\r
-                (DialogCommand,             "IDPB_NEWPARTNER_BUTTON" , "IDD_NEW_CONTACT_DIALOG")\r
-            ),\r
-}\r
+ #!/usr/bin/python
+ #-*- encoding: utf-8 -*-
+
+from processors import *
+from opt_processors import *
+import sys
+import os
+import addin
+from dialogs import ShowDialog, MakePropertyPage
+import win32ui
+import commctrl
+import win32con
+import win32gui
+import win32gui_struct
+import xmlrpclib
+from manager import ustr
+import chilkat
+
+try:
+    enumerate
+except NameError:   # enumerate new in 2.3
+    def enumerate(seq):
+        return [(i, seq[i]) for i in xrange(len(seq))]
+
+BIF_NEWDIALOGSTYLE = 0x00000040
+BIF_NONEWFOLDERBUTTON = 0x0000200
+CSIDL_COMMONMYPICTURES = 0x00000036
+
+class _WIN32MASKEDSTRUCT:
+    def __init__(self, **kw):
+        full_fmt = ""
+        for name, fmt, default, mask in self._struct_items_:
+            self.__dict__[name] = None
+            if fmt == "z":
+                full_fmt += "pi"
+            else:
+                full_fmt += fmt
+        for name, val in kw.iteritems():
+            if name not in self.__dict__:
+                raise ValueError("LVITEM structures do not have an item '%s'" % (name,))
+            self.__dict__[name] = val
+
+    def __setattr__(self, attr, val):
+        if not attr.startswith("_") and attr not in self.__dict__:
+            raise AttributeError(attr)
+        self.__dict__[attr] = val
+
+    def toparam(self):
+        self._buffs = []
+        full_fmt = ""
+        vals = []
+        mask = 0
+        # calc the mask
+        for name, fmt, default, this_mask in self._struct_items_:
+            if this_mask is not None and self.__dict__.get(name) is not None:
+                mask |= this_mask
+        self.mask = mask
+        for name, fmt, default, this_mask in self._struct_items_:
+            val = self.__dict__[name]
+            if fmt == "z":
+                fmt = "Pi"
+                if val is None:
+                    vals.append(0)
+                    vals.append(0)
+                else:
+                    # Note this demo still works with byte strings.  An
+                    # alternate strategy would be to use unicode natively
+                    # and use the 'W' version of the messages - eg,
+                    # LVM_SETITEMW etc.
+                    val = val + "\0"
+                    if isinstance(val, unicode):
+                        val = val.encode("mbcs")
+                    str_buf = array.array("b", val)
+                    vals.append(str_buf.buffer_info()[0])
+                    vals.append(len(val))
+                    self._buffs.append(str_buf) # keep alive during the call.
+            else:
+                if val is None:
+                    val = default
+                vals.append(val)
+            full_fmt += fmt
+        return struct.pack(*(full_fmt,) + tuple(vals))
+
+
+# NOTE: See the win32gui_struct module for an alternative way of dealing
+# with these structures
+class LVITEM(_WIN32MASKEDSTRUCT):
+    _struct_items_ = [
+        ("mask", "I", 0, None),
+        ("iItem", "i", 0, None),
+        ("iSubItem", "i", 0, None),
+        ("state", "I", 0, commctrl.LVIF_STATE),
+        ("stateMask", "I", 0, None),
+        ("text", "z", None, commctrl.LVIF_TEXT),
+        ("iImage", "i", 0, commctrl.LVIF_IMAGE),
+        ("lParam", "i", 0, commctrl.LVIF_PARAM),
+        ("iIdent", "i", 0, None),
+        ("cchTextMax", "i", 0, 255),
+        ("pszText", "i", 0, None),
+        ("flags", "i", 0, None),
+    ]
+
+class LVCOLUMN(_WIN32MASKEDSTRUCT):
+    _struct_items_ = [
+        ("mask", "I", 0, None),
+        ("fmt", "i", 0, commctrl.LVCF_FMT),
+        ("cx", "i", 0, commctrl.LVCF_WIDTH),
+        ("text", "z", None, commctrl.LVCF_TEXT),
+        ("iSubItem", "i", 0, commctrl.LVCF_SUBITEM),
+        ("iImage", "i", 0, commctrl.LVCF_IMAGE),
+        ("iOrder", "i", 0, commctrl.LVCF_ORDER),
+    ]
+
+global flag_stop
+flag_stop=win32con.MB_ICONSTOP
+
+global flag_error
+flag_error=win32con.MB_ICONERROR
+
+global flag_info
+flag_info=win32con.MB_ICONINFORMATION
+
+global flag_excl
+flag_excl=win32con.MB_ICONEXCLAMATION
+
+#global NewConn
+NewConn=addin.GetConn()
+## Retrieves current registered XMLRPC connection
+def GetConn():
+    return NewConn
+
+global objects_with_match
+objects_with_match=[]
+
+global hwndChk_list
+hwndChk_list=[]
+
+global search_text
+search_text='search_text'
+
+global name
+name=''
+global email
+email=''
+
+def check():
+    server = NewConn.getitem('_server')
+    port = NewConn.getitem('_port')
+    NewConn.GetDBList()
+    if str(NewConn.getitem('_running')) == 'False':
+        win32ui.MessageBox("No server running on host "+ server+" at port "+str(port), "Server Connection", flag_excl)
+        return False
+    if str(NewConn.getitem('_login')) == 'False':
+        win32ui.MessageBox("Please login to the database first", "Database Connection", flag_excl)
+        return False
+    return True
+def resetConnAttribs(window):
+    config = window.manager.LoadConfig()
+    NewConn.setitem('_server', config['server'])
+    NewConn.setitem('_port', config['port'])
+    NewConn.setitem('protocol', config['protocol'])
+    NewConn.setitem('_uri', "http://" + config['server'] + ":" + str(config['port']))
+    NewConn.setitem('_obj_list', config['objects'])
+    NewConn.setitem('_dbname', config['database'])
+    NewConn.setitem('_uname', config['uname'])
+    NewConn.setitem('_pwd', config['pwd'])
+    NewConn.setitem('_login', str(config['login']))
+    return
+
+def setConnAttribs(server, port, manager):
+    protocol = NewConn.getitem('protocol')
+    if protocol=='XML-RPCS':
+        protocol='https://'
+    else:
+        protocol='http://'
+    uri = protocol + server + ":" + str(port)
+    NewConn.setitem('_server',server)
+    NewConn.setitem('_port',port)
+    NewConn.setitem('_uri',uri)
+    NewConn.GetDBList()
+    manager.config = manager.LoadConfig()
+    NewConn.setitem('_dbname',manager.config['database'])
+    NewConn.setitem('_uname', manager.config['uname'])
+    NewConn.setitem('_pwd', manager.config['pwd'])
+    NewConn.setitem('_login', str(manager.config['login']))
+    NewConn.setitem('_obj_list', manager.config['objects'])
+    return
+
+def getConnAttributes(manager):
+    manager.config['server'] = NewConn.getitem('_server')
+    manager.config['port'] = NewConn.getitem('_port')
+    manager.config['protocol'] = NewConn.getitem('protocol')
+    manager.config['objects'] = eval(NewConn.getitem('_obj_list'))
+    manager.config['database'] = NewConn.getitem('_dbname')
+    manager.config['uname'] = NewConn.getitem('_uname')
+    manager.config['pwd'] = NewConn.getitem('_pwd')
+    manager.config['login'] = NewConn.getitem('_login')
+    return
+
+def getMessage(e):
+    import pywintypes
+    print "Exception %s: %s"%(type(e),str(e))
+    msg = str(e)
+    if type(e) == pywintypes.com_error:
+        msg=str(e)
+    elif type(e) == xmlrpclib.Fault:
+        msg = str(e.faultCode) or e.faultString or e.message or str(e)
+    else:
+        if hasattr(e, 'faultCode') and e.faultCode:
+            msg = str(e.faultCode)
+        elif hasattr(e, 'faultString') and e.faultString:
+            msg = e.faultString
+        elif hasattr(e, 'message') and e.message:
+            msg = e.message
+    return msg
+
+class OKButtonProcessor(ButtonProcessor):
+    def __init__(self, window, control_ids):
+        self.mngr = window.manager
+        ControlProcessor.__init__(self, window, control_ids)
+
+    def OnClicked(self, id):
+        server = win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[0])
+        try:
+            port = int(win32gui.GetDlgItemText(self.window.hwnd, self.other_ids[1]))
+        except ValueError, e:
+            print "Exception : %s"%str(e)
+            win32ui.MessageBox("Port should be an integer", "Error", flag_excl)
+            return
+        except Exception,e:
+            msg = getMessage(e)
+            win32ui.MessageBox(msg, "Error", flag_excl)
+            return
+        setConnAttribs(server, port, self.mngr)
+        if str(NewConn.getitem('_running')) == 'False':
+               msg = "No server running on host '%s' at port '%d'. Press ignore to still continue with this configuration?"%(server,port)
+               r=win32ui.MessageBox(msg, "Server Connection", win32con.MB_ABORTRETRYIGNORE | win32con.MB_ICONQUESTION)
+               if r==3:
+                               resetConnAttribs(self.window)
+                               return
+               elif r==4:
+                       self.OnClicked(id)
+               elif r==5:
+                       setConnAttribs(server, port, self.mngr)
+        win32gui.EndDialog(self.window.hwnd, id)
+
+class DoneButtonProcessor(ButtonProcessor):
+    def OnClicked(self, id):
+        getConnAttributes(self.window.manager)
+        self.window.manager.SaveConfig()
+        win32gui.EndDialog(self.window.hwnd, id)
+
+class MessageProcessor(ControlProcessor):
+    def Init(self):
+        text = "This Outlook Plugin for OpenERP s.a. has been developed by TinyERP \n\n \
+                For more information, please visit our website \n \
+                 http://www.openerp.com \n\n \
+                Contact Us :\n \
+                sales@openerp.com \n\n \
+                2001-TODAY OpenERP s.a.. All rights reserved. \n"
+        win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, text)
+
+    def GetPopupHelpText(self, cid):
+        return "Displays details on this plugin"
+
+class TabProcessor(ControlProcessor):
+    def __init__(self, window, control_ids, page_ids):
+        ControlProcessor.__init__(self, window, control_ids)
+        self.page_ids = page_ids.split()
+
+    def Init(self):
+        self.pages = {}
+        self.currentPage = None
+        self.currentPageIndex = -1
+        self.currentPageHwnd = None
+        for index, page_id in enumerate(self.page_ids):
+            template = self.window.manager.dialog_parser.dialogs[page_id]
+            self.addPage(index, page_id, template[0][0])
+        server = self.window.manager.config['server']
+        port = self.window.manager.config['port']
+        setConnAttribs(server, port, self.window.manager)
+        self.switchToPage(0)
+
+    def Done(self):
+        if self.currentPageHwnd is not None:
+            if not self.currentPage.SaveAllControls():
+                win32gui.SendMessage(self.GetControl(), commctrl.TCM_SETCURSEL, self.currentPageIndex,0)
+                return False
+        return True
+
+    def OnNotify(self, nmhdr, wparam, lparam):
+        selChangedCode =  5177342
+        code = nmhdr[2]
+        if code==selChangedCode:
+            index = win32gui.SendMessage(self.GetControl(), commctrl.TCM_GETCURSEL, 0,0)
+            if index!=self.currentPageIndex:
+                self.switchToPage(index)
+
+    def switchToPage(self, index):
+        if self.currentPageHwnd is not None:
+            if not self.currentPage.SaveAllControls():
+                win32gui.SendMessage(self.GetControl(), commctrl.TCM_SETCURSEL, self.currentPageIndex,0)
+                return 1
+            win32gui.DestroyWindow(self.currentPageHwnd)
+        self.currentPage = MakePropertyPage(self.GetControl(), self.window.manager, self.window.config, self.pages[index])
+        self.currentPageHwnd = self.currentPage.CreateWindow()
+        self.currentPageIndex = index
+        return 0
+#
+    def addPage(self, item, idName, label):
+        format = "iiiiiii"
+        lbuf = win32gui.PyMakeBuffer(len(label)+1)
+        address,l = win32gui.PyGetBufferAddressAndLen(lbuf)
+        win32gui.PySetString(address, label)
+
+        buf = struct.pack(format,
+            commctrl.TCIF_TEXT, # mask
+            0, # state
+            0, # state mask
+            address,
+            0, #unused
+            0, #image
+            item
+            )
+        item = win32gui.SendMessage(self.GetControl(),
+                             commctrl.TCM_INSERTITEM,
+                             item,
+                             buf)
+        self.pages[item] = idName
+
+class DialogCommand(ButtonProcessor):
+    def __init__(self, window, control_ids, idd, func=None, args=()):
+        self.idd = idd
+        self.func = func
+        self.args = args
+        ButtonProcessor.__init__(self, window, control_ids)
+
+    def OnClicked(self, id):
+        self.id = id
+        if self.func:
+            args = (self, ) + self.args
+            self.func(*args)
+        parent = self.window.hwnd
+        self.window.SaveAllControls()
+        ShowDialog(parent, self.window.manager, self.window.config, self.idd)
+        self.window.LoadAllControls()
+
+    def GetPopupHelpText(self, id):
+        dd = self.window.manager.dialog_parser.dialogs[self.idd]
+        return "Displays the %s dialog" % dd.caption
+
+def ReloadAllControls(btnProcessor,*args):
+    server = NewConn.getitem('_server')
+    port = NewConn.getitem('_port')
+    btnProcessor.window.LoadAllControls()
+    if str(NewConn.getitem('_running')) == 'False':
+        win32ui.MessageBox("No server running on host "+ server+" at port "+str(port), "Server Connection", flag_excl)
+    return
+
+def TestConnection(btnProcessor,*args):
+    server = NewConn.getitem('_server')
+    port = NewConn.getitem('_port')
+    url = NewConn.getitem('_uri')
+    NewConn.GetDBList()
+    if str(NewConn.getitem('_running')) == 'False':
+        btnProcessor.window.LoadAllControls()
+        win32ui.MessageBox("No server running on host "+ server+" at port "+str(port), "OpenERP Connection", flag_excl)
+        return
+    try:
+        dbname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, 7000)
+        if not dbname:
+            win32ui.MessageBox("Authentication Error !\nBad Database Name !", "OpenERP Connection", flag_excl)
+            return
+    except Exception,e:
+        print "Exception %s: %s"%(type(e),str(e))
+    dbname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+    if not dbname:
+        win32ui.MessageBox("No database found on host "+ server+" at port "+str(port), "OpenERP Connection", flag_excl)
+        return
+
+    uname = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
+    pwd = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])
+
+    if not uname:
+        win32ui.MessageBox("Authentication Error !\nBad User Name !", "OpenERP Connection", flag_excl)
+        return
+    if not pwd:
+        win32ui.MessageBox("Authentication Error !\nBad Password !", "OpenERP Connection", flag_excl)
+        return
+
+    #Establish Connection
+    try:
+        uid = NewConn.login(dbname, uname, pwd)
+        if uid:
+            msg = "Connection Successful"
+            NewConn.setitem('_login', 'True')
+            NewConn.setitem('_uname', uname)
+            NewConn.setitem('_pwd', pwd)
+            NewConn.setitem('_uid', uid)
+            flag = flag_info
+            if not NewConn.IsCRMInstalled():
+                msg+= '\n\n'+" 'CRM' module is not installed. So CRM cases cannot be created."
+                NewConn.setitem('_iscrm', 'False')
+            else:
+                NewConn.setitem('_iscrm', 'True')
+        else:
+            msg = "Authentication Error !\nBad UserName or Password"
+            flag = flag_stop
+            NewConn.setitem('_login', 'False')
+    except Exception,e:
+        msg = "Authentication Error !\n\n" + getMessage(e)
+        flag = flag_error
+    win32ui.MessageBox(msg, "OpenERP Connection", flag)
+    return
+
+def BrowseCallbackProc(hwnd, msg, lp, data):
+    from win32com.shell import shell, shellcon
+    if msg== shellcon.BFFM_INITIALIZED:
+        win32gui.SendMessage(hwnd, shellcon.BFFM_SETSELECTION, 1, data)
+        win32gui.SendMessage(hwnd, shellcon.BFFM_ENABLEOK, 0, 0)
+    elif msg == shellcon.BFFM_SELCHANGED:
+        # Set the status text of the
+        # For this message, 'lp' is the address of the PIDL.
+        pidl = shell.AddressAsPIDL(lp)
+        try:
+            path = shell.SHGetPathFromIDList(pidl)
+            if os.path.isdir(path):
+                win32gui.SendMessage(hwnd, shellcon.BFFM_ENABLEOK, 0, 0)
+            else:
+                ext = path.split('.')[-1]
+                if ext not in ['gif', 'bmp', 'jpg', 'tif', 'ico', 'png']:
+                        win32gui.SendMessage(hwnd, shellcon.BFFM_ENABLEOK, 0, 0)
+
+                else:
+                    win32gui.SendMessage(hwnd, shellcon.BFFM_ENABLEOK, 0, 1)
+        except shell.error:
+            # No path for this PIDL
+            pass
+
+def GetImagePath(btnProcessor,*args):
+    from win32com.shell import shell, shellcon
+    ulFlags = shellcon.BIF_BROWSEINCLUDEFILES | BIF_NEWDIALOGSTYLE | BIF_NONEWFOLDERBUTTON
+    pidl, display_name, image_list=shell.SHBrowseForFolder(btnProcessor.window.hwnd, # parent HWND
+                            None, # root PIDL.
+                            "Get the image path", # title
+                            ulFlags, # flags
+                            BrowseCallbackProc, # callback function
+                            os.getcwd() # 'data' param for the callback
+                            )
+    if (pidl, display_name, image_list) == (None, None, None):
+      return
+    else:
+      path = shell.SHGetPathFromIDList (pidl)
+      win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], path)
+
+def AddNewObject(btnProcessor,*args):
+    #Check if server running or user logged in
+    b = check()
+    if not b:
+        return
+
+    #Check if title or object not specified
+    obj_title = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+    obj_name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
+    if not obj_title:
+        win32ui.MessageBox("No Title specified", "Documents Setting", flag_excl)
+        return
+    if not obj_name:
+        win32ui.MessageBox("No Document specified", "Documents Setting", flag_excl)
+        return
+
+    #Check if object does not exist in the database or it already exist in the list
+    try:
+        all_obj_list = NewConn.GetAllObjects()
+        curr_obj_list = [obj[1] for obj in NewConn.GetObjList()]
+        curr_title_list = [obj[0] for obj in NewConn.GetObjList()]
+        if obj_name not in all_obj_list:
+            win32ui.MessageBox("No such Document exists", "Documents Setting", flag_excl)
+            return
+        elif obj_name in curr_obj_list:
+            win32ui.MessageBox("Document already in the list", "Documents Setting", flag_info)
+            return
+        elif obj_title in curr_title_list:
+            win32ui.MessageBox("Title already in the list. Please give different title", "Documents Setting", flag_excl)
+            return
+
+        #extract image path and load the image
+        image_path=''
+        image_path = os.path.join(btnProcessor.window.manager.application_directory, "dialogs\\resources\\openerp_logo1.bmp")
+        path=win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])
+        if path:
+            image_path = path
+        load_bmp_flags=win32con.LR_LOADFROMFILE | win32con.LR_LOADTRANSPARENT
+        try:
+            hicon = win32gui.LoadImage(0, image_path,win32con.IMAGE_BITMAP, 40, 40, load_bmp_flags)
+        except Exception,e:
+            msg=getMessage(e)
+            hicon=None
+            win32ui.MessageBox(msg, "Load Image", flag_error)
+
+        #Add the object in the list
+        win32gui.ImageList_Add(il,hicon,0)
+        cnt = win32gui.ImageList_GetImageCount(il)
+
+        hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[3])
+        num_items = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMCOUNT)
+
+        item = LVITEM(text=obj_title, iImage=cnt-2, iItem = num_items)
+        new_index = win32gui.SendMessage(hwndList, commctrl.LVM_INSERTITEM, 0, item.toparam())
+
+        win32gui.SendMessage(hwndList, commctrl.LVM_SETIMAGELIST, commctrl.LVSIL_SMALL, il)
+
+        item = LVITEM(text=obj_name, iItem = new_index, iSubItem = 1)
+        win32gui.SendMessage(hwndList, commctrl.LVM_SETITEM, 0, item.toparam())
+
+        NewConn.InsertObj(obj_title,obj_name,image_path)
+    except Exception, e:
+        msg = "Document not added\n\n" + getMessage(e)
+        win32ui.MessageBox(msg,"Documents Setting",flag_excl)
+        return
+
+    #Empty all the text controls
+    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], '')
+    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1], '')
+    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2], '')
+
+def DeleteSelectedObjects(btnProcessor,*args):
+    #Check if server running or user logged in
+    b = check()
+    if not b:
+        return
+
+    #Delete selected items
+    hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+    sel_count = win32gui.SendMessage(hwndList, commctrl.LVM_GETSELECTEDCOUNT)
+    for i in range(0,sel_count):
+        sel = win32gui.SendMessage(hwndList, commctrl.LVM_GETNEXTITEM, -1, commctrl.LVNI_SELECTED)
+        buf,extra = win32gui_struct.EmptyLVITEM(1, 0)
+        r = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMTEXT, sel, buf)
+        sel_text = ''
+        for n in extra:
+            nombre = n.tostring()
+            sel_text = nombre[0:r]
+        s = win32gui.SendMessage(hwndList, commctrl.LVM_DELETEITEM, sel)
+        try:
+            NewConn.DeleteObject(sel_text)
+        except Exception,e:
+            msg = "Documents '%s' not deleted\n\n"%sel_text + getMessage(e)
+            win32ui.MessageBox(msg,"Documents Setting",flag_excl)
+
+def GetMail(processor):
+    ex = processor.window.manager.outlook.ActiveExplorer()
+    assert ex.Selection.Count == 1
+    mail = ex.Selection.Item(1)
+    return mail
+#get selected records from list
+def GetSelectedItems(hwndList):
+    r=[]
+    sel_count = win32gui.SendMessage(hwndList, commctrl.LVM_GETSELECTEDCOUNT)
+    sel=-1
+    for i in range(0,sel_count):
+        sel = win32gui.SendMessage(hwndList, commctrl.LVM_GETNEXTITEM, sel, commctrl.LVNI_SELECTED)
+        buf,extra = win32gui_struct.EmptyLVITEM(1, 0)
+        size = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMTEXT, sel, buf)
+        sel_text = ''
+        for n in extra:
+            nombre = n.tostring()
+            sel_text = nombre[0:size]
+        for item in objects_with_match:
+            if item[2] == sel_text:
+                 r.append(item)
+    return r
+
+def MakeAttachment(btnProcessor,*args):
+    #Check if server running or user logged in
+    b = check()
+    if not b:
+        return
+    ex = btnProcessor.window.manager.outlook.ActiveExplorer()
+    assert ex.Selection.Count == 1
+    mail = ex.Selection.Item(1)
+    mail = GetMail(btnProcessor)
+
+    #get selected records
+    hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+    r = GetSelectedItems(hwndList)
+    if not r:
+        win32ui.MessageBox("No records selected", "Make Attachment", flag_info)
+        return
+    try:
+        flg = NewConn.ArchiveToOpenERP(r,mail)
+        if flg:
+            win32gui.EndDialog(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
+            return
+    except Exception,e:
+        msg = "Attachment not created \n\n" + getMessage(e)
+        flag = flag_error
+        win32ui.MessageBox(msg, "Make Attachment", flag)
+    return
+
+def CreateCase(btnProcessor,*args):
+    try:
+        #Check if server running or user logged in
+        b = check()
+        if not b:
+            return
+
+        if str(NewConn.getitem('_iscrm')) == 'True':
+        #    Get the selected mail
+            ex = btnProcessor.window.manager.outlook.ActiveExplorer()
+            assert ex.Selection.Count == 1
+            mail = ex.Selection.Item(1)
+            section = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+            section = str(section)
+            section=section.lower().replace(' ','.')
+            if not section:
+                win32ui.MessageBox("Documents can not be created.", "Documents Setting", flag_excl)
+                return
+
+            hwndList = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
+            partner_ids=[]
+            r = GetSelectedItems(hwndList)
+            for rec in r:
+                if rec[0] == 'res.partner':
+                    partner_ids.append(rec[1])
+
+            #Create new case
+            try:
+
+#                if  mail.Attachments.Count > 0:
+#                    msg="The mail contains attachments. Do you want to create case with attachments?"
+#                    r=win32ui.MessageBox(msg, "Create Case", win32con.MB_YESNOCANCEL | win32con.MB_ICONQUESTION)
+#                    if r == 2:
+#                        return
+#                    elif r == 7:
+#                       with_attachments=False
+
+                NewConn.CreateCase(str(section), mail, partner_ids)
+                msg="New Document created."
+                flag=flag_info
+            except Exception,e:
+                msg="New Document not created \n\n"+str(e)
+                flag=flag_error
+            win32ui.MessageBox(msg, "Create Document", flag)
+            return
+        else:
+            win32ui.MessageBox("Document can not be created. CRM not installed", "Create Object", flag_info)
+    except Exception, e:
+        win32ui.MessageBox(str(e), 'New Document')
+
+def GetSearchText(txtProcessor,*args):
+    #Check if server running or user logged in
+    b = check()
+    if not b:
+        return
+
+    search_box = txtProcessor.GetControl()
+    global search_text
+    if txtProcessor.init_done:
+        win32gui.SendMessage(search_box, win32con.WM_SETTEXT, 0,search_text)
+        return
+
+    # Get the selected mail and set the default value for search_text_control to mail.SenderEmailAddress
+    ex = txtProcessor.window.manager.outlook.ActiveExplorer()
+    assert ex.Selection.Count == 1
+    mail = ex.Selection.Item(1)
+    try:
+        search_text = ustr(mail.SenderEmailAddress).encode('iso-8859-1')
+    except Exception,e:
+        pass
+    win32gui.SendMessage(search_box, win32con.WM_SETTEXT, 0, search_text)
+    txtProcessor.init_done=True
+
+def SetNameColumn(listProcessor,*args):
+    hwndList = listProcessor.GetControl()
+    child_ex_style = win32gui.SendMessage(hwndList, commctrl.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
+    child_ex_style |= commctrl.LVS_EX_FULLROWSELECT
+    win32gui.SendMessage(hwndList, commctrl.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, child_ex_style)
+
+    # set header row
+    lvc =  LVCOLUMN(
+                    mask = commctrl.LVCF_FMT | commctrl.LVCF_WIDTH | \
+                    commctrl.LVCF_TEXT | commctrl.LVCF_SUBITEM
+                    )
+    lvc.fmt = commctrl.LVCFMT_LEFT
+    lvc.iSubItem = 1
+    lvc.text = "Document Type"
+    lvc.cx = 100
+    win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())
+    lvc.iSubItem = 0
+    lvc.text = "Name"
+    lvc.cx = 240
+    win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())
+    listProcessor.init_done = True
+
+def setList(list_hwnd):
+    # Set default list of objects
+    win32gui.SendMessage(list_hwnd, commctrl.LVM_DELETEALLITEMS)
+    for obj in objects_with_match:
+        num_items = win32gui.SendMessage(list_hwnd, commctrl.LVM_GETITEMCOUNT)
+        item = LVITEM(text=obj[2],iItem = num_items)
+        new = win32gui.SendMessage(list_hwnd, commctrl.LVM_INSERTITEM, 0, item.toparam())
+        item = LVITEM(text=obj[3],iItem = new,  iSubItem = 1)
+        win32gui.SendMessage(list_hwnd, commctrl.LVM_SETITEM, 0, item.toparam())
+
+def SearchObjectsForText(btnProcessor,*args):
+    #Check if server running or user logged in
+    b = check()
+    if not b:
+        return
+
+    search_txt = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+    if not search_txt:
+        win32ui.MessageBox("Enter text to search for", "Archive to OpenERP", flag_info)
+        return
+    # Get titles from list
+    obj_titles=[]
+    for ch in hwndChk_list:
+        id = ch[0]
+        hwnd = ch[1]
+        chk = win32gui.SendMessage(hwnd, win32con.BM_GETCHECK)
+        if chk:
+            txt = win32gui.GetDlgItemText(btnProcessor.window.hwnd,id)
+            obj_titles.append(txt)
+
+    # Prepare list of objects to search for the seach_keyword
+    obj_list = btnProcessor.window.manager.config['objects']
+    search_list = []
+    try:
+        all_obj_list = NewConn.GetAllObjects()
+        for title in obj_titles:
+            objname = [obj[1] for obj in obj_list if obj[0] == title]
+            if objname:
+                assert len(objname) == 1
+                if objname[0] in all_obj_list:
+                     search_list.append(objname[0])
+                else:
+                    win32ui.MessageBox("Module %s (%s) not installed. Please install it." \
+                                       %(title,objname[0]), "Archive to OpenERP", flag_excl)
+                    return
+
+        #  Get the records by searching the objects in search_list for the search_keyword as objects_with_match
+        global objects_with_match
+        list_hwnd = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
+        if search_list:
+            objects_with_match = NewConn.GetObjectItems(search_list, search_txt)
+            if not objects_with_match:
+                win32ui.MessageBox("No matching records found in checked objects", "Archive to OpenERP", flag_info)
+        else:
+            win32ui.MessageBox("No object selected", "Archive to OpenERP", flag_info)
+            objects_with_match=[]
+        # Display the objects_with_match records in list
+        setList(list_hwnd)
+    except Exception,e:
+        msg=getMessage(e)
+        win32ui.MessageBox(msg, "Search Text", flag_error)
+
+def CreateContact(btnProcessor,*args):
+    b = check()
+    if not b:
+        return
+
+    partner = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9])
+    combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[9])
+    sel = win32gui.SendMessage(combo, win32con.CB_GETCURSEL)
+    state_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[10])
+    state_sel = win32gui.SendMessage(state_combo, win32con.CB_GETCURSEL)
+    coun_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[11])
+    country_sel = win32gui.SendMessage(coun_combo, win32con.CB_GETCURSEL)
+    name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+    email = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
+    office_no = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])
+    mobile_no = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3])
+    fax = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[4])
+    street = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[5])
+    street2 = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[6])
+    city = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[7])
+    zip = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[8])
+    if not name:
+        win32ui.MessageBox("Please enter name.", "Create Contact", flag_stop)
+        return
+
+    res = {
+           'name':ustr(name),
+           'email':ustr(email),
+           'phone':ustr(office_no),
+           'mobile':ustr(mobile_no),
+           'fax':ustr(fax),
+           'street':ustr(street),
+           'street2':ustr(street2),
+           'city':ustr(city),
+           'zip':ustr(zip)
+       }
+
+    fs_id = c_id = -1
+    if not state_sel == -1 :
+        try:
+            temp = NewConn.GetAllState()
+            i = -1
+            for t in temp:
+                i+=1
+                if i == state_sel:
+                    fs_id = t[0]
+                    break;
+            res ['state_id'] = fs_id
+        except Exception, e:
+            msg = getMessage(e)
+            win32ui.MessageBox(msg, "New Partner", flag_error)
+            pass
+    if not country_sel == -1 :
+        try:
+            temp = NewConn.GetAllCountry()
+            i = -1
+            for t in temp:
+                i+=1
+                if i == country_sel:
+                    c_id = t[0]
+                    break;
+            res ['country_id'] = c_id
+        except Exception, e:
+            msg = getMessage(e)
+            win32ui.MessageBox(msg, "Open Contact", flag_error)
+            pass
+    try:
+        id = NewConn.CreateContact(sel, str(res))
+        if not partner:
+            msg="New contact created."
+        else:
+            msg="New contact created for partner '%s'."%partner
+    except Exception,e:
+        msg="Contact not created \n\n" + getMessage(e)
+        win32ui.MessageBox(msg, "Create Contact", flag_error)
+        return
+    win32ui.MessageBox(msg, "Create Contact", flag_info)
+    for i in range(0,9):
+        win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], '')
+    win32gui.SendMessage(combo, win32con.CB_SETCURSEL, -1 )
+    win32gui.SendMessage(state_combo, win32con.CB_SETCURSEL, -1 )
+    win32gui.SendMessage(coun_combo, win32con.CB_SETCURSEL, -1 )
+
+def SetAllText(txtProcessor,*args):
+    # Set values for url, uname, pwd from config file
+    url = NewConn.getitem('_uri')
+    tbox = txtProcessor.GetControl()
+    win32gui.SendMessage(tbox, win32con.WM_SETTEXT, 0, str(url))
+    k=win32gui.GetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id)
+    uname = NewConn.getitem('_uname')
+    tbox = txtProcessor.GetControl(txtProcessor.other_ids[0])
+    win32gui.SendMessage(tbox, win32con.WM_SETTEXT, 0, str(uname))
+
+def SetDefaultList(listProcessor,*args):
+    import win32api
+    hwndList = listProcessor.GetControl()
+
+    # set full row select style
+    child_ex_style = win32gui.SendMessage(hwndList, commctrl.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
+    child_ex_style |= commctrl.LVS_EX_FULLROWSELECT
+    win32gui.SendMessage(hwndList, commctrl.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, child_ex_style)
+
+    # set header row
+    lvc =  LVCOLUMN(
+                    mask = commctrl.LVCF_FMT | commctrl.LVCF_WIDTH | \
+                    commctrl.LVCF_TEXT | commctrl.LVCF_SUBITEM
+                    )
+    lvc.fmt = commctrl.LVCFMT_LEFT
+    lvc.iSubItem = 1
+    lvc.text = "Object Name"
+    lvc.cx = 315
+    win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())
+    lvc.iSubItem = 0
+    lvc.text = "Document Title"
+    lvc.cx = 315
+    win32gui.SendMessage(hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam())
+
+    #create imagelist
+    global il
+    il = win32gui.ImageList_Create(
+                        win32api.GetSystemMetrics(win32con.SM_CXSMICON),
+                        win32api.GetSystemMetrics(win32con.SM_CYSMICON),
+                        commctrl.ILC_COLOR32 | commctrl.ILC_MASK,
+                        1, # initial size
+                        0) # cGrow
+
+    win32gui.SendMessage(hwndList, commctrl.LVM_SETIMAGELIST,\
+                                 commctrl.LVSIL_SMALL, il)
+    # Set objects from config
+    objs = eval(NewConn.getitem('_obj_list'))
+    load_bmp_flags=win32con.LR_LOADFROMFILE | win32con.LR_LOADTRANSPARENT
+    for obj in objs:
+        image_path = os.path.join(listProcessor.window.manager.application_directory, "dialogs\\resources\\openerp_logo1.bmp")
+        path=obj[2]
+        if path:
+            image_path = path
+        try:
+            hicon = win32gui.LoadImage(0, image_path,win32con.IMAGE_BITMAP, 40, 40, load_bmp_flags)
+        except Exception, e:
+            msg = "Problem loading the image \n\n" + getMessage(e)
+            hicon = None
+            win32ui.MessageBox(msg, "Load Image", flag_error)
+
+        #Add the object in the list
+        win32gui.ImageList_Add(il,hicon,0)
+        cnt = win32gui.ImageList_GetImageCount(il)
+        num_items = win32gui.SendMessage(hwndList, commctrl.LVM_GETITEMCOUNT)
+        item = LVITEM(text=obj[0],iImage=cnt-2, iItem = num_items)
+        new_index = win32gui.SendMessage(hwndList, commctrl.LVM_INSERTITEM, 0, item.toparam())
+        item = LVITEM(text=obj[1], iItem = new_index, iSubItem = 1)
+        win32gui.SendMessage(hwndList, commctrl.LVM_SETITEM, 0, item.toparam())
+
+def SetDefaultContact(txtProcessor,*args):
+    # Acquiring the control of the text box
+    txt_name = txtProcessor.GetControl()
+    txt_email = txtProcessor.GetControl(txtProcessor.other_ids[0])
+
+    global name
+    global email
+    if txtProcessor.init_done:
+        win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id,name)
+        win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0],email)
+        return
+    #
+    try:
+        mail = GetMail(txtProcessor)
+        name = ustr(mail.SenderName).encode('iso-8859-1')
+        email = ustr(mail.SenderEmailAddress).encode('iso-8859-1')
+    except Exception,e:
+        pass
+
+    fs_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[1])
+    c_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[2])
+    win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
+    win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
+    win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.control_id,name)
+    win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[0],email)
+    txtProcessor.init_done = True
+
+def setCheckList(groupProcessor,*args):
+    try:
+        child_style = win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP
+        hinst = win32gui.dllhandle
+        objs = groupProcessor.window.manager.config['objects']
+        ins_objs = NewConn.GetAllObjects()
+        left = 20
+        top = 60
+        cnt=0
+        id=4001
+        id1=6001
+        load_bmp_flags=win32con.LR_LOADFROMFILE | win32con.LR_LOADTRANSPARENT
+        if groupProcessor.init_done:
+           return
+        else:
+           for obj in objs:
+             if obj[1] in ins_objs:
+                groupProcessor.init_done = True
+                #Add image
+                hwndImg = win32gui.CreateWindowEx(0, "STATIC","",
+                                            win32con.SS_CENTERIMAGE | win32con.SS_REALSIZEIMAGE | win32con.SS_BITMAP | win32con.WS_CHILD | win32con.WS_VISIBLE,
+                                            left,top+3,13,13,
+                                            groupProcessor.window.hwnd,
+                                            id,
+                                            0,
+                                            None
+                                            );
+                image_path = os.path.join(groupProcessor.window.manager.application_directory, "dialogs\\resources\\openerp_logo1.bmp")
+                if obj[2]:
+                    image_path = obj[2]
+                try:
+                    hicon = win32gui.LoadImage(0, image_path, win32con.IMAGE_BITMAP, 40, 40, load_bmp_flags)
+                except Exception,e:
+                    msg="Problem loading the image \n\n" + getMessage(e)
+                    hicon = None
+                    win32ui.MessageBox(msg, "Load Image", flag_error)
+
+                win32gui.SendMessage(hwndImg, win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, hicon);
+                #Add Checkbox
+                left+= 17
+                hwndChk = win32gui.CreateWindowEx(
+                                                    0,"BUTTON",obj[0],win32con.WS_VISIBLE | win32con.WS_CHILD | \
+                                                    win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP | win32con.BST_CHECKED, \
+                                                    left, top, 130,20,groupProcessor.window.hwnd,id1,hinst,None
+                                                  )
+                if obj[1] in ['res.partner','res.partner.address']:
+                    win32gui.SendMessage(hwndChk , win32con.BM_SETCHECK, 1, 0);
+                hwndChk_list.append((id1,hwndChk))
+
+                cnt=cnt+1
+                id+=1
+                id1+=1
+                left+=17
+                win32gui.UpdateWindow(hwndImg)
+                left+=140
+                if cnt > 1:
+                    left = 20
+                    top+=18
+                    cnt=0
+    except Exception, e:
+        win32ui.MessageBox(str(e), 'Document List')
+
+def CreatePartner(btnProcessor,*args):
+    #Check if server running or user logged in
+    b = check()
+    if not b:
+        return
+
+    partner_name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+    if not partner_name:
+        win32ui.MessageBox("Please enter Partner name.", "Create Partner", flag_excl)
+        return
+    res = {'name':ustr(partner_name)}
+    try:
+        id = NewConn.CreatePartner(str(res))
+    except Exception,e:
+        msg="Partner not created \n\n" + getMessage(e)
+        win32ui.MessageBox(msg, "Create Partner", flag_error)
+        return
+    if id:
+        win32ui.MessageBox("New Partner '%s' created."%partner_name, "Create Partner", flag_info)
+        win32gui.EndDialog(btnProcessor.window.hwnd, btnProcessor.id)
+    else:
+        win32ui.MessageBox("Partner '%s' already Exists."%partner_name, "Create Partner", flag_info)
+    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0],'')
+
+def set_search_text(dialogProcessor,*args):
+    global search_text
+    search_text = win32gui.GetDlgItemText(dialogProcessor.window.hwnd, dialogProcessor.other_ids[0])
+    return
+
+def set_name_email(dialogProcessor,*args):
+    global name
+    global email
+    name = win32gui.GetDlgItemText(dialogProcessor.window.hwnd, dialogProcessor.other_ids[0])
+    email = win32gui.GetDlgItemText(dialogProcessor.window.hwnd, dialogProcessor.other_ids[1])
+
+def GetDefaultEmail(txtProcessor,*args):
+
+    from win32com.client import Dispatch
+    import win32con
+    b = check()
+    if not b:
+        return
+    #Acquiring control of the text box
+    search_partner_box = txtProcessor.GetControl()
+    global search_partner_text
+    if txtProcessor.init_done:
+        win32gui.SendMessage(search_partner_box, win32con.WM_SETTEXT, 0,search_partner_text)
+        return
+    #Reading Current Selected Email.
+    ex = txtProcessor.window.manager.outlook.ActiveExplorer()
+    assert ex.Selection.Count == 1
+    mail = ex.Selection.Item(1)
+    #Fetching Sender MailID from Selected Mail
+    try:
+        search_partner_text = ustr(mail.SenderEmailAddress).encode('iso-8859-1')
+    except Exception,e:
+        win32ui.MessageBox("Error In reading email ID from Email ","Open Contact", flag_error)
+        pass
+    win32gui.SendMessage(search_partner_box, win32con.WM_SETTEXT, 0, search_partner_text)
+
+    fs_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[10])
+    c_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[11])
+    partner_combo = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[0])
+    vals = []
+    #Searching the res.partner.address for contact based on Sender Mail ID.
+    vals = NewConn.SearchPartnerDetail(search_partner_text)
+    #If no user Found.
+    if vals == None:
+        for i in range(1,10):
+            win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[i], "")
+        win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
+        win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
+        win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )
+        win32ui.MessageBox("No matching records found for  : "+str(search_partner)+".","Open Contact", flag_excl)
+        return
+    else:
+        #If user Found than Setting the Value for the contact in fields.
+        for i in range(1,10):
+            win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[i], "")
+        win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
+        win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
+        win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )
+
+        for val in vals:
+
+            if val[0] == 'partner_id':
+                    temp = list (NewConn.GetPartners())
+                    i = -1
+                    for t in temp:
+                        i+=1
+                        if t[1] == val[1][1] :
+                            win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, i )
+            if val[0] == 'name' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[1], str(val[1]))
+
+            if val[0] == 'street' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[2], str(val[1]))
+
+            if val[0] == 'street2' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[3], str(val[1]))
+
+            if val[0] == 'zip' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[9], str(val[1]))
+
+            if val[0] == 'city' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[4], str(val[1]))
+
+            if val[0] == 'state_id' and val[1] != False :
+                id = i = -1
+                temp = list(NewConn.GetAllState())
+                for t in temp:
+                    i+=1
+                    if str(t[1]) ==  str(val[1][1]):
+                        id = i
+                        break;
+                sel = win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, id )
+
+            if val[0] == 'country_id' and val[1] != False :
+                id = i = -1
+                temp = list(NewConn.GetAllCountry())
+                for t in temp:
+                    i+=1
+                    if str(t[1]) ==  str(val[1][1]):
+                        id = i
+                        break;
+                sel = win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, id )
+
+            if val[0] == 'phone' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[5], str(val[1]))
+
+            if val[0] == 'mobile' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[6], str(val[1]))
+
+            if val[0] == 'fax' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[7], str(val[1]))
+
+            if val[0] == 'email' and val[1] != False :
+                win32gui.SetDlgItemText(txtProcessor.window.hwnd, txtProcessor.other_ids[8], str(val[1]))
+
+    txtProcessor.init_done=True
+
+def SearchPartner(btnProcessor,*args):
+    b = check()
+    if not b:
+        return
+    #hwnd For the List box
+    fs_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[11])
+    c_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[12])
+    partner_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
+    try :
+        search_partner = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+        if not search_partner:
+            win32ui.MessageBox("Please enter email id to search for.", "Open Contact", flag_excl)
+            return
+        vals = []
+        #Searching the contact.
+        vals = NewConn.SearchPartnerDetail(search_partner)
+        #if contact not found resetting all field to blank
+        if vals == None:
+            for i in range(2,11):
+                win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], "")
+            win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
+            win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
+            win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )
+            win32ui.MessageBox("No matching records found for  : "+str(search_partner)+".","Open Contact", flag_excl)
+            win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], "<enter new search>")
+            return
+        #if contact found than setting the values for the contact.
+        else:
+            for i in range(2,11):
+                win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[i], "")
+            win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, -1 )
+            win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, -1 )
+            win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, -1 )
+            for val in vals:
+                if val[0] == 'partner_id':
+                    #Finding the partner index in list and setting it.
+                    temp = list (NewConn.GetPartners())
+                    i = -1
+                    for t in temp:
+                        i+=1
+                        if t[1] == val[1][1] :
+                            win32gui.SendMessage(partner_combo, win32con.CB_SETCURSEL, i )
+
+                if val[0] == 'name' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2], str(val[1]))
+
+                if val[0] == 'street' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3], str(val[1]))
+
+                if val[0] == 'street2' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[4], str(val[1]))
+
+                if val[0] == 'zip' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[10], str(val[1]))
+
+                if val[0] == 'city' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[5], str(val[1]))
+
+                if val[0] == 'state_id' and val[1] != False :
+                    #Finding the state index in list and setting it.
+                    id = i = -1
+                    temp = list(NewConn.GetAllState())
+                    for t in temp:
+                        i+=1
+                        if str(t[1]) ==  str(val[1][1]):
+                            id = i
+                            break;
+                    sel = win32gui.SendMessage(fs_combo, win32con.CB_SETCURSEL, id )
+
+                if val[0] == 'country_id' and val[1] != False :
+                    #Finding the country index in list and setting it.
+                    id = i = -1
+                    temp = list(NewConn.GetAllCountry())
+                    for t in temp:
+                        i+=1
+                        if str(t[1]) ==  str(val[1][1]):
+                            id = i
+                            break;
+                    sel = win32gui.SendMessage(c_combo, win32con.CB_SETCURSEL, id )
+
+                if val[0] == 'phone' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[6], str(val[1]))
+
+                if val[0] == 'mobile' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[7], str(val[1]))
+
+                if val[0] == 'fax' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[8], str(val[1]))
+
+                if val[0] == 'email' and val[1] != False :
+                    win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9], str(val[1]))
+
+            win32gui.SetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[0], "<Enter  new search>")
+    except Exception,e:
+        msg = getMessage(e)
+        win32ui.MessageBox(msg, "Open Contact", flag_error)
+        pass
+
+def WritePartner(btnProcessor,*args):
+    new_vals=[]
+    #Reading new value of the fields.
+    contect_name = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[1])
+    street = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[2])
+    street2 = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[3])
+    city = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[4])
+    phone = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[7])
+    mobile = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[8])
+    fax = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[9])
+    email = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[10])
+    zip = win32gui.GetDlgItemText(btnProcessor.window.hwnd, btnProcessor.other_ids[11])
+    country_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[6])
+    country_sel = win32gui.SendMessage(country_combo, win32con.CB_GETCURSEL)
+    state_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[5])
+    state_sel = win32gui.SendMessage(state_combo, win32con.CB_GETCURSEL)
+    partner_combo = win32gui.GetDlgItem(btnProcessor.window.hwnd, btnProcessor.other_ids[0])
+    partner_sel = win32gui.SendMessage(partner_combo, win32con.CB_GETCURSEL)
+    #Checking that record not being saved without name or Partner
+    if contect_name.strip() == "":
+        win32ui.MessageBox("Please enter partner Contact Name name.", "Open Contact", flag_excl)
+        return
+    if partner_sel < 1:
+        win32ui.MessageBox("Please Select Partner From list.", "Open Contact", flag_excl)
+        return
+    fs_id = c_id = p_id = -1
+    #Finding the partner index in list finding it record ID.
+    if not partner_sel < 0 :
+        try:
+            temp = NewConn.GetPartners()
+            i = -1
+            for t in temp:
+                i+=1
+                if i == partner_sel:
+                    p_id = t[0]
+                    break;
+        except Exception, e:
+            msg = getMessage(e)
+            win32ui.MessageBox(msg, "Open Contact", flag_error)
+            pass
+    #Finding the State index in list finding it record ID.
+    if not state_sel == -1 :
+        try:
+            temp = NewConn.GetAllState()
+            i = -1
+            for t in temp:
+                i+=1
+                if i == state_sel:
+                    fs_id = t[0]
+                    break;
+        except Exception, e:
+            msg = getMessage(e)
+            win32ui.MessageBox(msg, "Open Contact", flag_error)
+            pass
+    #Finding the country index in list finding it record ID.
+    if not country_sel == -1 :
+        try:
+            temp = NewConn.GetAllCountry()
+            i = -1
+            for t in temp:
+                i+=1
+                if i == country_sel:
+                    c_id = t[0]
+                    break;
+        except Exception, e:
+            msg = getMessage(e)
+            win32ui.MessageBox(msg, "Open Contact", flag_error)
+            pass
+    # Creating a list to write the values to the OpenERP
+    new_vals.append(['partner_id',p_id])
+    new_vals.append(['name',contect_name])
+    new_vals.append(['street',street])
+    new_vals.append(['street2',street2])
+    new_vals.append(['city',city])
+    new_vals.append(['state_id',fs_id])
+    new_vals.append(['country_id',c_id])
+    new_vals.append(['phone',phone])
+    new_vals.append(['mobile',mobile])
+    new_vals.append(['email',email])
+    new_vals.append(['fax',fax])
+    new_vals.append(['zip',zip])
+    flag = 0
+    try:
+        #writing the updated values to the Server.
+        flag = NewConn.WritePartnerValues(new_vals)
+    except Exception,e:
+        msg = getMessage(e)
+        win32ui.MessageBox(msg, "Open Contact", flag_error)
+        pass
+    if flag == 1:
+        win32ui.MessageBox("Changes have been Updated Successfully.", "Open Contact", flag_info)
+    elif flag == 0:
+        win32ui.MessageBox("Error in Updating the Changes.\n Please check the Database Connection.", "Open Contact", flag_error)
+    elif flag == -1:
+        win32ui.MessageBox("Contact can not be Save.\nFirst select contact using Search.","Open Contact", flag_info)
+
+
+
+dialog_map = {
+            "IDD_MANAGER" :            (
+                (CancelButtonProcessor,    "IDCANCEL", resetConnAttribs, ()),
+                (TabProcessor,             "IDC_TAB IDC_LIST",
+                                           """IDD_GENERAL IDD_OBJECT_SETTINGS IDD_ABOUT"""),
+                (DoneButtonProcessor,      "ID_DONE"),
+            ),
+
+            "IDD_GENERAL":             (
+                (DBComboProcessor,          "ID_DB_DROPDOWNLIST", GetConn, ()),
+                (TextProcessor,             "ID_SERVER_PORT ID_USERNAME ID_PASSWORD", SetAllText, ()),
+                (CommandButtonProcessor,    "ID_BUT_TESTCONNECTION ID_DB_DROPDOWNLIST ID_USERNAME \
+                                            ID_PASSWORD", TestConnection, ()),
+                (CommandButtonProcessor,    "IDC_RELOAD", ReloadAllControls, ()),
+                (DialogCommand,             "IDC_BUT_SET_SERVER_PORT", "IDD_SERVER_PORT_DIALOG"),
+            ),
+
+            "IDD_OBJECT_SETTINGS" :    (
+                (CommandButtonProcessor,   "IDC_BUT_LOAD_IMAGE IDC_IMAGE_PATH", GetImagePath, ()),
+                (CommandButtonProcessor,   "IDC_BUT_SAVE_OBJECT IDC_OBJECT_TITLE IDC_OBJECT_NAME \
+                                            IDC_IMAGE_PATH IDC_LIST", AddNewObject, ()),
+                (CommandButtonProcessor,   "IDC_BUT_DEL_OBJECT IDC_LIST", DeleteSelectedObjects, ()),
+                (ListBoxProcessor,         "IDC_LIST", SetDefaultList, ())
+            ),
+
+            "IDD_ABOUT" :              (
+                (ImageProcessor,          "IDB_OPENERPLOGO"),
+                (MessageProcessor,        "IDC_ABOUT"),
+            ),
+
+            "IDD_SERVER_PORT_DIALOG" : (
+                (CloseButtonProcessor,    "IDCANCEL"),
+                (OKButtonProcessor,  "IDOK ID_SERVER ID_PORT IDR_XML_PROTOCOL"),
+                (RadioButtonProcessor, "IDR_XML_PROTOCOL", GetConn, ()),
+                (RadioButtonProcessor, "IDR_XMLS_PROTOCOL", GetConn, ()),
+                (RadioButtonProcessor, "IDR_NETRPC_PROTOCOL", GetConn, ()),
+            ),
+
+            "IDD_SYNC" :               (
+                (CommandButtonProcessor,    "ID_SEARCH ID_SEARCH_TEXT IDC_NAME_LIST", SearchObjectsForText,()),
+                (GroupProcessor,            "IDC_STATIC_GROUP", setCheckList, ()),
+                (CSComboProcessor,          "ID_ATT_METHOD_DROPDOWNLIST", GetConn,()),
+                (TextProcessor,             "ID_SEARCH_TEXT", GetSearchText, ()),
+                (DialogCommand,             "ID_CREATE_CONTACT ID_SEARCH_TEXT", "IDD_NEW_CONTACT_DIALOG", set_search_text, ()),
+                (CloseButtonProcessor,      "IDCANCEL"),
+                (CommandButtonProcessor,    "ID_MAKE_ATTACHMENT IDC_NAME_LIST IDD_SYNC", MakeAttachment, ()),
+                (CommandButtonProcessor,    "ID_CREATE_CASE ID_ATT_METHOD_DROPDOWNLIST IDC_NAME_LIST", CreateCase, ()),
+                (ListBoxProcessor,          "IDC_NAME_LIST", SetNameColumn, ())
+            ),
+
+            "IDD_NEW_CONTACT_DIALOG" : (
+                (PartnersComboProcessor,    "ID_PARTNER_DROPDOWNLIST", GetConn, ()),
+                (CountryComboProcessor,     "ID_COUNTRY_DROPLIST", GetConn, ()),
+                (StateComboProcessor,       "ID_FED_STATE_DROPLIST", GetConn, ()),
+                (CloseButtonProcessor,      "IDCANCEL"),
+                (CommandButtonProcessor,    "ID_CONTACT_SAVE_BUTTON ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT ID_CONTACT_OFFICE_TEXT ID_CONTACT_MOBILE_TEXT ID_FAX_TEXT ID_STREET_TEXT ID_STREET2_TEXT ID_PARTNER_CITY_TEXT ID_ZIP_TEXT ID_PARTNER_DROPDOWNLIST ID_FED_STATE_DROPLIST ID_COUNTRY_DROPLIST", CreateContact, ()),
+                (TextProcessor,             "ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT ID_FED_STATE_DROPLIST ID_COUNTRY_DROPLIST" , SetDefaultContact, ()),
+                (DialogCommand,             "ID_NEW_PARTNER_BUTTON ID_CONTACT_NAME_TEXT ID_CONTACT_EMAIL_TEXT", "IDD_NEW_PARTNER_DIALOG", set_name_email, ()),
+            ),
+
+            "IDD_NEW_PARTNER_DIALOG" : (
+                (CloseButtonProcessor,      "IDCANCEL"),
+                (CommandButtonProcessor,    "ID_SAVE_PARTNER_BUTTON ID_PARTNER_NAME_TEXT", CreatePartner, ()),
+            ),
+
+            "IDD_VIEW_PARTNER_DIALOG" : (
+                (PartnersComboProcessor,    "ID_PARTNER_DROPLIST", GetConn, ()),
+                (StateComboProcessor,       "ID_ALL_STATE_DROPDOWNLIST", GetConn, ()),
+                (CountryComboProcessor,     "ID_ALL_COUNTRY_DROPDOWNLIST", GetConn, ()),
+                (TextProcessor,             "IDET_SEARCH_PARTNER ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST", GetDefaultEmail, ()),
+                (CommandButtonProcessor,    "IDPB_SEARCH_PARTNER IDET_SEARCH_PARTNER ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST", SearchPartner, ()),
+                (CommandButtonProcessor,    "IDPB_WRITE_CHANGES ID_PARTNER_DROPLIST IDET_PARTNER_CONTACT_NAME IDET_PARTNER_STREET IDET_PARTNER_STREET2 IDET_PARTNER_CITY ID_ALL_STATE_DROPDOWNLIST ID_ALL_COUNTRY_DROPDOWNLIST IDET_PARTNER_OFFICENO IDET_PARTNER_MOBILENO IDET_PARTNER_EMAIL IDET_PARTNER_FAX IDET_ZIP", WritePartner, ()),
+                (CloseButtonProcessor,      "IDCANCEL"),
+                (DialogCommand,             "ID_NEW_PART_BUTTON", "IDD_NEW_PARTNER_DIALOG" ),
+                (DialogCommand,             "IDPB_NEWPARTNER_BUTTON" , "IDD_NEW_CONTACT_DIALOG")
+            ),
+}
index a6ac908..d5dbe9b 100755 (executable)
-# -*- coding: utf-8 -*-\r
-##############################################################################\r
-#\r
-#    OpenERP, Open Source Management Solution\r
-#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).\r
-#\r
-#    This program is free software: you can redistribute it and/or modify\r
-#    it under the terms of the GNU Affero General Public License as\r
-#    published by the Free Software Foundation, either version 3 of the\r
-#    License, or (at your option) any later version.\r
-#\r
-#    This program is distributed in the hope that it will be useful,\r
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-#    GNU Affero General Public License for more details.\r
-#\r
-#    You should have received a copy of the GNU Affero General Public License\r
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
-#\r
-##############################################################################\r
-\r
-import xmlrpclib\r
-import sys\r
-import socket\r
-import os\r
-import pythoncom\r
-import time\r
-from manager import ustr\r
-waittime = 10\r
-wait_count = 0\r
-wait_limit = 12\r
-import binascii\r
-import base64\r
-def execute(connector, method, *args):\r
-    global wait_count\r
-    res = False\r
-    try:\r
-        res = getattr(connector,method)(*args)\r
-    except socket.error,e:\r
-        if e.args[0] == 111:\r
-            if wait_count > wait_limit:\r
-                print "Server is taking too long to start, it has exceeded the maximum limit of %d seconds."%(wait_limit)\r
-                clean()\r
-                sys.exit(1)\r
-            print 'Please wait %d sec to start server....'%(waittime)\r
-            wait_count += 1\r
-            time.sleep(waittime)\r
-            res = execute(connector, method, *args)\r
-        else:\r
-            return res\r
-    wait_count = 0\r
-    return res\r
-\r
-class XMLRpcConn(object):\r
-    __name__ = 'XMLRpcConn'\r
-    _com_interfaces_ = ['_IDTExtensibility2']\r
-    _public_methods_ = ['GetDBList', 'login', 'GetAllObjects', 'GetObjList', 'InsertObj', 'DeleteObject', \\r
-                        'ArchiveToOpenERP', 'IsCRMInstalled', 'GetPartners', 'GetObjectItems', \\r
-                        'CreateCase', 'MakeAttachment', 'CreateContact', 'CreatePartner', 'getitem', 'setitem', \\r
-                        'SearchPartnerDetail', 'WritePartnerValues', 'GetAllState', 'GetAllCountry' ]\r
-    _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER\r
-    _reg_clsid_ = "{C6399AFD-763A-400F-8191-7F9D0503CAE2}"\r
-    _reg_progid_ = "Python.OpenERP.XMLRpcConn"\r
-    _reg_policy_spec_ = "win32com.server.policy.EventHandlerPolicy"\r
-    def __init__(self,server='localhost',port=8069,uri='http://localhost:8069'):\r
-        self._server=server\r
-        self._port=port\r
-        self._uri=uri\r
-        self._obj_list=[]\r
-        self._dbname=''\r
-        self._uname='admin'\r
-        self._pwd='a'\r
-        self._login=False\r
-        self._running=False\r
-        self._uid=False\r
-        self._iscrm=True\r
-        self.partner_id_list=None\r
-        self.protocol=None\r
-    def getitem(self, attrib):\r
-        v=self.__getattribute__(attrib)\r
-        return str(v)\r
-\r
-    def setitem(self, attrib, value):\r
-        return self.__setattr__(attrib, value)\r
-\r
-    def GetDBList(self):\r
-        conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/db')\r
-        try:\r
-            db_list = execute(conn, 'list')\r
-            if db_list == False:\r
-                self._running=False\r
-                return []\r
-            else:\r
-                self._running=True\r
-        except:\r
-            db_list=-1\r
-            self._running=True\r
-        return db_list\r
-\r
-    def login(self,dbname, user, pwd):\r
-        self._dbname = dbname\r
-        self._uname = user\r
-        self._pwd = pwd\r
-        conn = xmlrpclib.ServerProxy(str(self._uri) + '/xmlrpc/common')\r
-        uid = execute(conn,'login',dbname, ustr(user), ustr(pwd))\r
-        return uid\r
-\r
-    def GetAllObjects(self):\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[])\r
-        objects = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',ids,['model'])\r
-        obj_list = [item['model'] for item in objects]\r
-        return obj_list\r
-\r
-    def GetObjList(self):\r
-        self._obj_list=list(self._obj_list)\r
-        self._obj_list.sort(reverse=True)\r
-        return self._obj_list\r
-\r
-    def InsertObj(self, obj_title,obj_name,image_path):\r
-        self._obj_list=list(self._obj_list)\r
-        self._obj_list.append((obj_title,obj_name,ustr(image_path)))\r
-        self._obj_list.sort(reverse=True)\r
-\r
-    def DeleteObject(self,sel_text):\r
-        self._obj_list=list(self._obj_list)\r
-        for obj in self._obj_list:\r
-            if obj[0] == sel_text:\r
-                self._obj_list.remove(obj)\r
-                break\r
-\r
-    def ArchiveToOpenERP(self, recs, mail):\r
-        import win32ui, win32con\r
-        conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/object')\r
-        import eml\r
-        new_msg = files = ext_msg =""\r
-        eml_path=eml.generateEML(mail)\r
-        att_name = ustr(eml_path.split('\\')[-1])\r
-        flag=False\r
-        attachments=mail.Attachments\r
-\r
-        for rec in recs: #[('res.partner', 3, 'Agrolait')]\r
-            model = rec[0]\r
-            res_id = rec[1]\r
-\r
-            object_ids = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=',model)])\r
-            object_name  = execute( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',object_ids,['name'])[0]['name']\r
-\r
-\r
-            #Reading the Object ir.model Name\r
-\r
-            ext_ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'mailgate.message','search',[('message_id','=',mail.EntryID),('model','=',model),('res_id','=',res_id)])\r
-            if ext_ids:\r
-                name = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,model,'read',res_id,['name'])['name']\r
-                ext_msg += """This mail is already archived to {1} '{2}'.\r
-""".format(object_name,name)\r
-                continue\r
-\r
-            msg = {\r
-                'subject':mail.Subject,\r
-                'date':str(mail.ReceivedTime),\r
-                'body':mail.Body,\r
-                'cc':mail.CC,\r
-                'from':mail.SenderEmailAddress,\r
-                'to':mail.To,\r
-                'message-id':str(mail.EntryID),## we are use Entry_Id as a MessageID Because MessageID is not provided by Outlook API, http://msdn.microsoft.com/en-us/library/bb176688%28v=office.12%29.aspx\r
-                'references':False,\r
-            }\r
-            result = {}\r
-            if attachments:\r
-                result = self.MakeAttachment([rec], mail)\r
-\r
-            attachment_ids = result.get(model, {}).get(res_id, [])\r
-            ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'email.server.tools','history',model, res_id, msg, attachment_ids)\r
-\r
-            new_msg += """- {0} : {1}\n""".format(object_name,str(rec[2]))\r
-            flag = True\r
-\r
-        if flag:\r
-            t = ext_msg\r
-            t += """Mail archived Successfully with attachments.\n"""+new_msg\r
-            win32ui.MessageBox(t,"Archived to OpenERP",win32con.MB_ICONINFORMATION)\r
-        return flag\r
-\r
-    def IsCRMInstalled(self):\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=','crm.lead')])\r
-        return id\r
-\r
-    def GetPartners(self):\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        ids=[]\r
-        ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','search',[])\r
-        ids.sort()\r
-        obj_list=[]\r
-        obj_list.append((-999, ustr('')))\r
-        for id in ids:\r
-            object = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','read',[id],['id','name'])[0]\r
-            obj_list.append((object['id'], ustr(object['name'])))\r
-        return obj_list\r
-\r
-    def GetObjectItems(self, search_list=[], search_text=''):\r
-        import win32ui\r
-        res = []\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        for obj in search_list:\r
-            object_ids = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=',obj)])\r
-            object_name = execute( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',object_ids,['name'])[0]['name']\r
-            if obj == "res.partner.address":\r
-                ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',['|',('name','ilike',ustr(search_text)),('email','ilike',ustr(search_text))])\r
-                recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name','street','city'])\r
-                for rec in recs:\r
-                    name = ustr(rec['name'])\r
-                    if rec['street']:\r
-                        name += ', ' + ustr(rec['street'])\r
-                    if rec['city']:\r
-                        name += ', ' + ustr(rec['city'])\r
-                    res.append((obj,rec['id'],name,object_name))\r
-            else:\r
-                ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',[('name','ilike',ustr(search_text))])\r
-                recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name'])\r
-                for rec in recs:\r
-                    name = ustr(rec['name'])\r
-                    res.append((obj,rec['id'],name,object_name))\r
-        return res\r
-\r
-    def CreateCase(self, section, mail, partner_ids, with_attachments=True):\r
-        res={}\r
-        import win32ui\r
-        section=str(section)\r
-        partner_ids=eval(str(partner_ids))\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        res['name'] = ustr(mail.Subject)\r
-        res['description'] = ustr(mail.Body)\r
-        res['partner_name'] = ustr(mail.SenderName)\r
-        res['email_from'] = ustr(mail.SenderEmailAddress)\r
-\r
-        if partner_ids:\r
-            for partner_id in partner_ids:\r
-                res['partner_id'] = partner_id\r
-                partner_addr = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','address_get',[partner_id])\r
-                res['partner_address_id'] = partner_addr['default']\r
-                id=execute(conn,'execute',self._dbname,int(self._uid),self._pwd,section,'create',res)\r
-                if section == 'project.issue':\r
-                    execute(conn,'execute',self._dbname,int(self._uid),self._pwd,section,'convert_to_bug',[id])\r
-                recs=[(section,id,'')]\r
-                if with_attachments:\r
-                    self.MakeAttachment(recs, mail)\r
-        else:\r
-            id=execute(conn,'execute',self._dbname,int(self._uid),self._pwd,section,'create',res)\r
-            recs=[(section,id,'')]\r
-            if with_attachments:\r
-                self.MakeAttachment(recs, mail)\r
-\r
-    def MakeAttachment(self, recs, mail):\r
-        attachments = mail.Attachments\r
-        result = {}\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        att_folder_path = os.path.abspath(os.path.dirname(__file__)+"\\dialogs\\resources\\attachments\\")\r
-        if not os.path.exists(att_folder_path):\r
-            os.makedirs(att_folder_path)\r
-        for rec in recs: #[('res.partner', 3, 'Agrolait')]\r
-\r
-            obj = rec[0]\r
-            obj_id = rec[1]\r
-            res={}\r
-            res['res_model'] = obj\r
-            attachment_ids = []\r
-            if obj not in result:\r
-                result[obj] = {}\r
-            for i in xrange(1, attachments.Count+1):\r
-                fn = ustr(attachments[i].FileName)\r
-                if len(fn) > 64:\r
-                    l = 64 - len(fn)\r
-                    f = fn.split('.')\r
-                    fn = f[0][0:l] + '.' + f[-1]\r
-                att_path = os.path.join(att_folder_path,fn)\r
-                attachments[i].SaveAsFile(att_path)\r
-                f=open(att_path,"rb")\r
-                content = "".join(f.readlines()).encode('base64')\r
-                f.close()\r
-                res['name'] = ustr(attachments[i].DisplayName)\r
-                res['datas_fname'] = ustr(fn)\r
-                res['datas'] = content\r
-                res['res_id'] = obj_id\r
-                id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','create',res)\r
-                attachment_ids.append(id)\r
-            result[obj].update({obj_id: attachment_ids})\r
-        return result\r
-\r
-    def CreateContact(self, sel=None, res=None):\r
-        res=eval(str(res))\r
-\r
-        self.partner_id_list=eval(str(self.partner_id_list))\r
-        if self.partner_id_list.get(sel,-999) != -999:\r
-            res['partner_id'] = self.partner_id_list[sel]\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner.address','create',res)\r
-        return id\r
-\r
-    def CreatePartner(self, res):\r
-        res=eval(str(res))\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','search',[('name','=',res['name'])])\r
-        if ids:\r
-            return False\r
-        id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','create',res)\r
-        return id\r
-\r
-    def SearchPartnerDetail(self, search_email_id):\r
-        import win32ui\r
-        res_vals = []\r
-        address = {}\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        address_id = execute(conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','ilike',ustr(search_email_id))])\r
-        if not address_id :\r
-            return\r
-        address = execute(conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address','read',address_id[0],['id','partner_id','name','street','street2','city','state_id','country_id','phone','mobile','email','fax','zip'])\r
-        for key, vals in address.items():\r
-            res_vals.append([key,vals])\r
-        return res_vals\r
-\r
-    def WritePartnerValues(self, new_vals):\r
-        import win32ui\r
-        flag = -1\r
-        new_dict = dict(new_vals)\r
-        email=new_dict['email']\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        address_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','=',ustr(email))])\r
-        if not address_id:\r
-            return flag\r
-        address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address','read',address_id[0],['id','partner_id','state_id','country_id'])\r
-        vals_res_address={ 'name' : new_dict['name'],\r
-                           'street':new_dict['street'],\r
-                           'street2' : new_dict['street2'],\r
-                           'city' : new_dict['city'],\r
-                           'phone' : new_dict['phone'],\r
-                           'mobile' : new_dict['mobile'],\r
-                           'fax' : new_dict['fax'],\r
-                           'zip' : new_dict['zip'],\r
-                         }\r
-        if new_dict['partner_id'] != -1:\r
-            vals_res_address['partner_id'] = new_dict['partner_id']\r
-        if new_dict['state_id'] != -1:\r
-            vals_res_address['state_id'] = new_dict['state_id']\r
-        if new_dict['country_id'] != -1:\r
-            vals_res_address['country_id'] = new_dict['country_id']\r
-        temp = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'write', address_id, vals_res_address)\r
-        if temp:\r
-            flag=1\r
-        else:\r
-            flag=0\r
-        return flag\r
-\r
-    def GetAllState(self):\r
-        import win32ui\r
-        state_list = []\r
-        state_ids = []\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        state_ids = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'search', [])\r
-        for state_id in state_ids:\r
-            obj = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'read', [state_id],['id','name'])[0]\r
-            state_list.append((obj['id'], ustr(obj['name'])))\r
-        return state_list\r
-\r
-    def GetAllCountry(self):\r
-        import win32ui\r
-        country_list = []\r
-        country_ids = []\r
-        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')\r
-        country_ids = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country', 'search', [])\r
-        for country_id in country_ids:\r
-            obj = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country','read', [country_id], ['id','name'])[0]\r
-            country_list.append((obj['id'], ustr(obj['name'])))\r
-        return country_list\r
+# -*- 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/>.
+#
+##############################################################################
+
+import xmlrpclib
+import sys
+import socket
+import os
+import pythoncom
+import time
+from manager import ustr
+
+import smtplib
+from email.mime.text import MIMEText
+from email.parser import*
+import email
+
+waittime = 10
+wait_count = 0
+wait_limit = 12
+import binascii
+import base64
+def execute(connector, method, *args):
+    global wait_count
+    res = False
+    try:
+        res = getattr(connector,method)(*args)
+    except socket.error,e:
+        if e.args[0] == 111:
+            if wait_count > wait_limit:
+                print "Server is taking too long to start, it has exceeded the maximum limit of %d seconds."%(wait_limit)
+                clean()
+                sys.exit(1)
+            print 'Please wait %d sec to start server....'%(waittime)
+            wait_count += 1
+            time.sleep(waittime)
+            res = execute(connector, method, *args)
+        else:
+            return res
+    wait_count = 0
+    return res
+
+class XMLRpcConn(object):
+    __name__ = 'XMLRpcConn'
+    _com_interfaces_ = ['_IDTExtensibility2']
+    _public_methods_ = ['GetDBList', 'login', 'GetAllObjects', 'GetObjList', 'InsertObj', 'DeleteObject', \
+                        'ArchiveToOpenERP', 'IsCRMInstalled', 'GetPartners', 'GetObjectItems', \
+                        'CreateCase', 'MakeAttachment', 'CreateContact', 'CreatePartner', 'getitem', 'setitem', \
+                        'SearchPartnerDetail', 'WritePartnerValues', 'GetAllState', 'GetAllCountry' ]
+    _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
+    _reg_clsid_ = "{C6399AFD-763A-400F-8191-7F9D0503CAE2}"
+    _reg_progid_ = "Python.OpenERP.XMLRpcConn"
+    _reg_policy_spec_ = "win32com.server.policy.EventHandlerPolicy"
+    def __init__(self,server='localhost',port=8069,uri='http://localhost:8069'):
+        self._server=server
+        self._port=port
+        self._uri=uri
+        self._obj_list=[]
+        self._dbname=''
+        self._uname='admin'
+        self._pwd='a'
+        self._login=False
+        self._running=False
+        self._uid=False
+        self._iscrm=True
+        self.partner_id_list=None
+        self.protocol=None
+    def getitem(self, attrib):
+        v=self.__getattribute__(attrib)
+        return str(v)
+
+    def setitem(self, attrib, value):
+        return self.__setattr__(attrib, value)
+
+    def GetDBList(self):
+        conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/db')
+        try:
+            db_list = execute(conn, 'list')
+            if db_list == False:
+                self._running=False
+                return []
+            else:
+                self._running=True
+        except:
+            db_list=-1
+            self._running=True
+        return db_list
+
+    def login(self,dbname, user, pwd):
+        self._dbname = dbname
+        self._uname = user
+        self._pwd = pwd
+        conn = xmlrpclib.ServerProxy(str(self._uri) + '/xmlrpc/common')
+        uid = execute(conn,'login',dbname, ustr(user), ustr(pwd))
+        return uid
+
+    def GetAllObjects(self):
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[])
+        objects = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',ids,['model'])
+        obj_list = [item['model'] for item in objects]
+        return obj_list
+
+    def GetObjList(self):
+        self._obj_list=list(self._obj_list)
+        self._obj_list.sort(reverse=True)
+        return self._obj_list
+
+    def InsertObj(self, obj_title,obj_name,image_path):
+        self._obj_list=list(self._obj_list)
+        self._obj_list.append((obj_title,obj_name,ustr(image_path)))
+        self._obj_list.sort(reverse=True)
+
+    def DeleteObject(self,sel_text):
+        self._obj_list=list(self._obj_list)
+        for obj in self._obj_list:
+            if obj[0] == sel_text:
+                self._obj_list.remove(obj)
+                break
+
+    def ArchiveToOpenERP(self, recs, mail):
+        import win32ui, win32con
+        conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/object')
+        import eml
+        new_msg = files = ext_msg =""
+        eml_path=eml.generateEML(mail)
+        att_name = ustr(eml_path.split('\\')[-1])
+        flag=False
+        attachments=mail.Attachments
+
+        try:
+            fp = open(eml_path, 'rb')
+            msg =fp.read()
+            fp.close()
+            new_mail =  email.message_from_string(str(msg))
+        except Exception,e:
+            win32ui.MessageBox(str(e),"Reading Error Mail")
+
+        for rec in recs: #[('res.partner', 3, 'Agrolait')]
+            model = rec[0]
+            res_id = rec[1]
+            object_ids = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=',model)])
+            object_name  = execute( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',object_ids,['name'])[0]['name']
+
+            #Reading the Object ir.model Name
+
+            ext_ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'mailgate.message','search',[('message_id','=',mail.EntryID),('model','=',model),('res_id','=',res_id)])
+            if ext_ids:
+                name = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,model,'read',res_id,['name'])['name']
+                ext_msg += """This mail is already archived to {1} '{2}'.
+""".format(object_name,name)
+                continue
+
+            msg = {
+                'subject':mail.Subject,
+                'date':str(mail.ReceivedTime),
+                'body':mail.Body,
+                'cc':mail.CC,
+                'from':mail.SenderEmailAddress,
+                'to':mail.To,
+                'message-id':str(new_mail.get('Message-Id')),
+                'references':str(new_mail.get('References')),
+            }
+            result = {}
+            if attachments:
+                result = self.MakeAttachment([rec], mail)
+
+            attachment_ids = result.get(model, {}).get(res_id, [])
+            ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'email.server.tools','history',model, res_id, msg, attachment_ids)
+
+            new_msg += """- {0} : {1}\n""".format(object_name,str(rec[2]))
+            flag = True
+
+        if flag:
+            t = ext_msg
+            t += """Mail archived Successfully with attachments.\n"""+new_msg
+            win32ui.MessageBox(t,"Archived to OpenERP",win32con.MB_ICONINFORMATION)
+        return flag
+
+    def IsCRMInstalled(self):
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=','crm.lead')])
+        return id
+
+    def GetPartners(self):
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        ids=[]
+        ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','search',[])
+        ids.sort()
+        obj_list=[]
+        obj_list.append((-999, ustr('')))
+        for id in ids:
+            object = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','read',[id],['id','name'])[0]
+            obj_list.append((object['id'], ustr(object['name'])))
+        return obj_list
+
+    def GetObjectItems(self, search_list=[], search_text=''):
+        import win32ui
+        res = []
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        for obj in search_list:
+            object_ids = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=',obj)])
+            object_name = execute( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',object_ids,['name'])[0]['name']
+            if obj == "res.partner.address":
+                ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',['|',('name','ilike',ustr(search_text)),('email','ilike',ustr(search_text))])
+                recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name','street','city'])
+                for rec in recs:
+                    name = ustr(rec['name'])
+                    if rec['street']:
+                        name += ', ' + ustr(rec['street'])
+                    if rec['city']:
+                        name += ', ' + ustr(rec['city'])
+                    res.append((obj,rec['id'],name,object_name))
+            else:
+                ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',[('name','ilike',ustr(search_text))])
+                recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name'])
+                for rec in recs:
+                    name = ustr(rec['name'])
+                    res.append((obj,rec['id'],name,object_name))
+        return res
+
+    def CreateCase(self, section, mail, partner_ids, with_attachments=True):
+        res={}
+        import win32ui
+        import eml
+        section=str(section)
+        partner_ids=eval(str(partner_ids))
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        try:
+            eml_path=eml.generateEML(mail)
+            fp = open(eml_path, 'rb')
+            msg =fp.read()
+            fp.close()
+            new_mail =  email.message_from_string(str(msg))
+        except Exception,e:
+            win32ui.MessageBox(str(e),"Mail Reading Error")
+        execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'email.server.tools','process_email',section, str(new_mail))
+
+    def MakeAttachment(self, recs, mail):
+        attachments = mail.Attachments
+        result = {}
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        att_folder_path = os.path.abspath(os.path.dirname(__file__)+"\\dialogs\\resources\\mails\\attachments\\")
+        if not os.path.exists(att_folder_path):
+            os.makedirs(att_folder_path)
+        for rec in recs: #[('res.partner', 3, 'Agrolait')]
+
+            obj = rec[0]
+            obj_id = rec[1]
+            res={}
+            res['res_model'] = obj
+            attachment_ids = []
+            if obj not in result:
+                result[obj] = {}
+            for i in xrange(1, attachments.Count+1):
+                fn = ustr(attachments[i].FileName)
+                if len(fn) > 64:
+                    l = 64 - len(fn)
+                    f = fn.split('.')
+                    fn = f[0][0:l] + '.' + f[-1]
+                att_path = os.path.join(att_folder_path,fn)
+                attachments[i].SaveAsFile(att_path)
+                f=open(att_path,"rb")
+                content = "".join(f.readlines()).encode('base64')
+                f.close()
+                res['name'] = ustr(attachments[i].DisplayName)
+                res['datas_fname'] = ustr(fn)
+                res['datas'] = content
+                res['res_id'] = obj_id
+                id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','create',res)
+                attachment_ids.append(id)
+            result[obj].update({obj_id: attachment_ids})
+        return result
+
+    def CreateContact(self, sel=None, res=None):
+        res=eval(str(res))
+
+        self.partner_id_list=eval(str(self.partner_id_list))
+        if self.partner_id_list.get(sel,-999) != -999:
+            res['partner_id'] = self.partner_id_list[sel]
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner.address','create',res)
+        return id
+
+    def CreatePartner(self, res):
+        res=eval(str(res))
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','search',[('name','=',res['name'])])
+        if ids:
+            return False
+        id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','create',res)
+        return id
+
+    def SearchPartnerDetail(self, search_email_id):
+        import win32ui
+        res_vals = []
+        address = {}
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        address_id = execute(conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','ilike',ustr(search_email_id))])
+        if not address_id :
+            return
+        address = execute(conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address','read',address_id[0],['id','partner_id','name','street','street2','city','state_id','country_id','phone','mobile','email','fax','zip'])
+        for key, vals in address.items():
+            res_vals.append([key,vals])
+        return res_vals
+
+    def WritePartnerValues(self, new_vals):
+        import win32ui
+        flag = -1
+        new_dict = dict(new_vals)
+        email=new_dict['email']
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        address_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','=',ustr(email))])
+        if not address_id:
+            return flag
+        address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address','read',address_id[0],['id','partner_id','state_id','country_id'])
+        vals_res_address={ 'name' : new_dict['name'],
+                           'street':new_dict['street'],
+                           'street2' : new_dict['street2'],
+                           'city' : new_dict['city'],
+                           'phone' : new_dict['phone'],
+                           'mobile' : new_dict['mobile'],
+                           'fax' : new_dict['fax'],
+                           'zip' : new_dict['zip'],
+                         }
+        if new_dict['partner_id'] != -1:
+            vals_res_address['partner_id'] = new_dict['partner_id']
+        if new_dict['state_id'] != -1:
+            vals_res_address['state_id'] = new_dict['state_id']
+        if new_dict['country_id'] != -1:
+            vals_res_address['country_id'] = new_dict['country_id']
+        temp = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'write', address_id, vals_res_address)
+        if temp:
+            flag=1
+        else:
+            flag=0
+        return flag
+
+    def GetAllState(self):
+        import win32ui
+        state_list = []
+        state_ids = []
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        state_ids = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'search', [])
+        for state_id in state_ids:
+            obj = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'read', [state_id],['id','name'])[0]
+            state_list.append((obj['id'], ustr(obj['name'])))
+        return state_list
+
+    def GetAllCountry(self):
+        import win32ui
+        country_list = []
+        country_ids = []
+        conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+        country_ids = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country', 'search', [])
+        for country_id in country_ids:
+            obj = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country','read', [country_id], ['id','name'])[0]
+            country_list.append((obj['id'], ustr(obj['name'])))
+        return country_list
index 95ad5ab..a5ff3a6 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 08:44+0000\n"
+"PO-Revision-Date: 2010-08-07 00:29+0000\n"
 "Last-Translator: Fabien (Open ERP) <fp@tinyerp.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: 2010-08-04 03:38+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:42+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: point_of_sale
index 55b8d33..491497f 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.4\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 08:49+0000\n"
+"PO-Revision-Date: 2010-08-07 03:20+0000\n"
 "Last-Translator: Fabien (Open ERP) <fp@tinyerp.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: 2010-08-04 03:39+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: process
index 7a707bc..31f2903 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 09:07+0000\n"
+"PO-Revision-Date: 2010-08-07 03:27+0000\n"
 "Last-Translator: Angel Spy <melissadilara@yahoo.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: 2010-08-04 03:43+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: product
index 1f3ba34..980deff 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.6\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 09:08+0000\n"
+"PO-Revision-Date: 2010-08-06 20:05+0000\n"
 "Last-Translator: Black Jack <onetimespeed@hotmail.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: 2010-08-04 03:43+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: product
index 1dd0bca..155e759 100644 (file)
@@ -2,8 +2,8 @@
 <openerp>
     <data noupdate="1">
         <!-- 
-       Resource: product.category 
-       -->
+    Resource: product.category 
+    -->
         
         <record id="cat0" model="product.category">
             <field name="parent_id" ref="null"/>
             <field name="parent_id" ref="product_category_3"/>
             <field name="name">IT components kits</field>
         </record>
+
+
+
+    <record id="product_category_marketableproduct0" model="product.category">
+            <field name="name">Marketable Products</field>
+    </record>
+    
+    
+    <record id="product_category_shelves0" model="product.category">
+        <field name="parent_id" ref="product_category_marketableproduct0"/>
+            <field name="name">Shelves</field>
+    </record>
+    
+    
+    <record id="product_category_otherproducts0" model="product.category">
+            <field name="name">Other Products</field>
+    </record>
+    
+    
+    <record id="product_category_rawmaterial0" model="product.category">
+        <field name="parent_id" ref="product_category_otherproducts0"/>
+            <field name="name">Raw Materials</field>
+    </record>
+    
+    
+    <record id="product_category_services0" model="product.category">
+        <field name="parent_id" ref="product_category_marketableproduct0"/>
+            <field name="name">Marketable Services</field>
+    </record>
+    
+    
+    <record id="product_category_misc0" model="product.category">
+        <field name="parent_id" ref="product_category_otherproducts0"/>
+            <field name="name">Misc</field>
+    </record>
+
         
         <record id="product_ul_box" model="product.ul">
             <field name="name">Box 20x20x40</field>
         </record>
         
         <!--
-       Resource: product.product
-       -->
+    Resource: product.product
+    -->
         
         <record id="product_product_0" model="product.product">
             <field name="list_price">38.25</field>
             <field name="name">Kit Keyboard + Mouse</field>
             <field name="categ_id" ref="product_category_11"/>
         </record>
-        
+
+        <!--
+    Resource: product.product NEW EVV
+    -->
+
+    <record id="product_product_shelfofcm0" model="product.product">
+            <field name="default_code">SHE100</field>
+            <field name="supply_method">produce</field>
+            <field name="list_price">130.0</field>
+            <field name="standard_price">50.0</field>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Shelf of 100cm</field>
+            <field name="categ_id" ref="product_category_shelves0"/>
+    </record>
+    
+    <record id="product_product_shelfofcm1" model="product.product">
+            <field name="default_code">SHE200</field>
+            <field name="supply_method">produce</field>
+            <field eval="'make_to_order'" name="procure_method"/>
+            <field name="list_price">210.0</field>
+            <field name="standard_price">80.0</field>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Shelf of 200cm</field>
+            <field name="categ_id" ref="product_category_shelves0"/>
+    </record>
+    <record id="product_product_woodmm0" model="product.product">
+            <field name="default_code">WOOD002</field>
+            <field name="supply_method">buy</field>
+            <field name="standard_price">5.0</field>
+        <field name="uom_id" ref="product_uom_meter"/>
+        <field name="uom_po_id" ref="product_uom_meter"/>
+        <field name="name">Wood 2mm</field>
+        <field eval="10" name="seller_delay"/>
+        <field eval="7.0" name="sale_delay"/>
+        <field name="categ_id" ref="product_category_rawmaterial0"/>
+    </record>
+
+    <record id="product_product_kitchendesignproject0" model="product.product">
+            <field name="default_code">PROJ</field>
+            <field name="supply_method">produce</field>
+            <field eval="'make_to_order'" name="procure_method"/>
+            <field name="type">service</field>
+            <field name="list_price">90.0</field>
+            <field name="standard_price">20.0</field>
+        <field name="uom_id" ref="uom_hour"/>
+        <field name="uom_po_id" ref="uom_hour"/>
+        <field name="name">Kitchen Design Project</field>
+        <field name="categ_id" ref="product_category_services0"/>
+    </record>
+
+    <record id="product_product_employee0" model="product.product">
+            <field name="default_code">EMPL</field>
+            <field name="supply_method">produce</field>
+            <field eval="'make_to_order'" name="procure_method"/>
+            <field name="type">service</field>
+            <field name="list_price">200.0</field>
+            <field name="standard_price">50.0</field>
+        <field name="uom_id" ref="uom_hour"/>
+        <field name="uom_po_id" ref="uom_hour"/>
+        <field name="name">Employee</field>
+        <field name="categ_id" ref="product_category_services0"/>
+    </record>
+
+    <record id="product_product_restaurantexpenses0" model="product.product">
+            <field name="default_code">REST</field>
+            <field name="supply_method">produce</field>
+            <field eval="'make_to_order'" name="procure_method"/>
+            <field name="type">consu</field>
+            <field name="list_price">1.0</field>
+            <field name="standard_price">1.0</field>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Restaurant Expenses</field>
+            <field eval="1" name="hr_expense_ok"/>
+        <field name="categ_id" ref="product_category_otherproducts0"/>
+    </record>
+
+    <record id="product_product_worker0" model="product.product">
+            <field name="default_code">WORK</field>
+            <field name="supply_method">produce</field>
+            <field name="type">service</field>
+            <field eval="'make_to_order'" name="procure_method"/>
+        <field eval="0" name="sale_ok"/>
+        <field eval="1" name="purchase_ok"/> 
+            <field name="standard_price">20.0</field>
+        <field name="uom_id" ref="uom_hour"/>
+        <field name="uom_po_id" ref="uom_hour"/>
+        <field name="name">Worker</field>
+        <field name="categ_id" ref="product_category_services0"/>
+    </record>
+
+    <record id="product_product_rearpanelarm0" model="product.product">
+            <field name="default_code">RPAN100</field>
+            <field name="supply_method">buy</field>
+            <field name="standard_price">10.0</field>
+            <field eval="0" name="sale_ok"/>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Rear Panel SHE100</field>
+            <field eval="'Public Pricelist (0.00) : 1.00
+One-shot customers (0.00) : 1.00
+Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
+            <field eval="5" name="seller_delay"/>
+        <field name="categ_id" ref="product_category_misc0"/>
+    </record>
+
+    <record id="product_product_rearpanelarm1" model="product.product">
+            <field name="default_code">RPAN200</field>
+            <field name="supply_method">buy</field>
+            <field name="standard_price">13.0</field>
+            <field eval="0" name="sale_ok"/>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Rear Panel SHE200</field>
+            <field eval="'Public Pricelist (0.00) : 1.00
+One-shot customers (0.00) : 1.00
+Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
+            <field eval="5" name="seller_delay"/>
+        <field name="categ_id" ref="product_category_misc0"/>
+    </record>
+
+    <record id="product_product_sidepanel0" model="product.product">
+            <field name="default_code">SIDEPAN</field>
+            <field name="supply_method">buy</field>
+            <field name="standard_price">3.0</field>
+            <field eval="0" name="sale_ok"/>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Side Panel</field>
+            <field eval="'Public Pricelist (0.00) : 1.00
+One-shot customers (0.00) : 1.00
+Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
+            <field eval="5" name="seller_delay"/>
+        <field name="categ_id" ref="product_category_misc0"/>
+    </record>
+
+    <record id="product_product_shelf0" model="product.product">
+            <field name="default_code">RCK100</field>
+            <field name="supply_method">buy</field>
+            <field name="standard_price">5.0</field>
+            <field eval="0" name="sale_ok"/>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Rack 100cm</field>
+            <field eval="'Public Pricelist (0.00) : 1.00
+One-shot customers (0.00) : 1.00
+Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
+            <field eval="8" name="seller_delay"/>
+        <field name="categ_id" ref="product_category_misc0"/>
+    </record>
+
+    <record id="product_product_shelf1" model="product.product">
+            <field name="default_code">RCK200</field>
+            <field name="supply_method">buy</field>
+            <field name="standard_price">4.0</field>
+            <field eval="0" name="sale_ok"/>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Rack 200cm</field>
+            <field eval="'Public Pricelist (0.00) : 1.00
+One-shot customers (0.00) : 1.00
+Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
+            <field eval="8" name="seller_delay"/>
+        <field name="categ_id" ref="product_category_misc0"/>
+    </record>
+
+
+    <record id="product_product_assemblysection0" model="product.product">
+            <field name="default_code">PROFIL</field>
+            <field name="supply_method">produce</field>
+            <field name="list_price">1.0</field>
+            <field name="standard_price">2.0</field>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Assembly Section</field>
+            <field name="categ_id" ref="product_category_misc0"/>
+    </record>
+
+    <record id="product_product_woodlintelm0" model="product.product">
+            <field name="default_code">LIN40</field>
+            <field name="supply_method">buy</field>
+            <field name="standard_price">8.0</field>
+            <field eval="0" name="sale_ok"/>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Wood Lintel 4m</field>
+            <field eval="'Public Pricelist (0.00) : 1.00
+One-shot customers (0.00) : 1.00
+Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
+            <field eval="10" name="seller_delay"/>
+        <field name="categ_id" ref="product_category_misc0"/>
+    </record>
+
+    <record id="product_product_metalcleats0" model="product.product">
+            <field name="default_code">METC000</field>
+            <field name="supply_method">buy</field>
+            <field eval="0" name="sale_ok"/>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Metal Cleats</field>
+            <field eval="'Public Pricelist (0.00) : 1.00
+One-shot customers (0.00) : 1.00
+Returning customers (0.00) : 0.99'" name="pricelist_sale"/>
+            <field eval="20" name="seller_delay"/>
+        <field name="categ_id" ref="product_category_misc0"/>
+    </record>
+
+    <record id="product_product_hotelexpenses0" model="product.product">
+            <field name="default_code">HOT</field>
+            <field name="supply_method">produce</field>
+            <field eval="'make_to_order'" name="procure_method"/>
+            <field name="type">consu</field>
+            <field name="list_price">1.0</field>
+            <field name="standard_price">1.0</field>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">Hotel Expenses</field>
+            <field eval="1" name="hr_expense_ok"/>
+        <field name="categ_id" ref="product_category_otherproducts0"/>
+    </record>
+
+    <record id="product_product_kitshelfofcm0" model="product.product">
+            <field name="default_code">SHE100KIT</field>
+            <field name="supply_method">produce</field>
+            <field eval="'make_to_order'" name="procure_method"/>
+            <field name="list_price">110.0</field>
+            <field name="standard_price">48.0</field>
+        <field name="uom_id" ref="product_uom_unit"/>
+        <field name="uom_po_id" ref="product_uom_unit"/>
+        <field name="name">KIT Shelf of 100cm</field>
+            <field eval="0" name="purchase_ok"/>
+        <field name="categ_id" ref="product_category_shelves0"/>
+    </record>
+
+        <!--
+    Resource: product.supplierinfo
+    -->
+
         <record id="supplierinfo1" model="product.supplierinfo">
             <field name="name" ref="base.res_partner_asus"/>
             <field name="qty">10</field>
             <field name="name" ref="base.res_partner_seagate"/>
             <field name="qty">10</field>
             <field name="min_qty">1</field>
+            <field name="sequence">5</field>
             <field name="product_id" ref="product_product_hdd1"/>
             <field name="delay">10</field>
         </record>
             <field name="name" ref="base.res_partner_seagate"/>
             <field name="qty">10</field>
             <field name="min_qty">1</field>
+            <field name="sequence">5</field>
             <field name="product_id" ref="product_product_hdd2"/>
             <field name="delay">10</field>
         </record>
             <field name="name" ref="base.res_partner_4"/>
             <field name="qty">10</field>
             <field name="min_qty">1</field>
+            <field name="sequence">5</field>
             <field name="product_id" ref="product_product_hdd3"/>
             <field name="delay">10</field>
         </record>
-        
+
+        <!--
+    Resource: product.supplierinfo NEW for training
+    -->
+
+    <record id="product_supplierinfo_0" model="product.supplierinfo">
+            <field name="product_id" ref="product_product_rearpanelarm0"/>
+            <field name="delay">10</field>
+            <field name="min_qty">1</field>
+            <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+    <record id="product_supplierinfo_1" model="product.supplierinfo">
+            <field name="product_id" ref="product_product_rearpanelarm0"/>
+            <field name="delay">5</field>
+            <field name="min_qty">1</field>
+        <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+    <record id="product_supplierinfo_2" model="product.supplierinfo">
+        <field name="product_id" ref="product_product_rearpanelarm1"/>
+            <field name="delay">5</field>
+            <field name="min_qty">1</field>
+        <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+    <record id="product_supplierinfo_3" model="product.supplierinfo">
+         <field name="product_id" ref="product_product_sidepanel0"/>
+            <field name="delay">5</field>
+            <field name="min_qty">1</field>
+        <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+    <record id="product_supplierinfo_4" model="product.supplierinfo">
+        <field name="product_id" ref="product_product_shelfofcm0"/>
+            <field name="delay">8</field>
+            <field name="min_qty">1</field>
+        <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+    <record id="product_supplierinfo_5" model="product.supplierinfo">
+        <field name="product_id" ref="product_product_shelfofcm1"/>
+            <field name="delay">8</field>
+            <field name="min_qty">1</field>
+        <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+    <record id="product_supplierinfo_6" model="product.supplierinfo">
+        <field name="product_id" ref="product_product_assemblysection0"/>
+            <field name="delay">2</field>
+            <field name="min_qty">1</field>
+        <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+    <record id="product_supplierinfo_7" model="product.supplierinfo">
+        <field name="product_id" ref="product_product_woodlintelm0"/>
+            <field name="delay">10</field>
+            <field name="min_qty">1</field>
+        <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+    <record id="product_supplierinfo_8" model="product.supplierinfo">
+        <field name="product_id" ref="product_product_metalcleats0"/>
+            <field name="delay">20</field>
+            <field name="min_qty">1</field>
+        <field name="name" ref="base.res_partner_woodywoodpecker0"/>
+    </record>
+
+
+
     </data>
 </openerp>
index eb4608a..c5c782a 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.4\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 09:12+0000\n"
+"PO-Revision-Date: 2010-08-06 22:28+0000\n"
 "Last-Translator: Fabien (Open ERP) <fp@tinyerp.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: 2010-08-04 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:42+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: profile_accounting
index e5e2ce0..0a4d365 100644 (file)
             <field name="fn">field</field>
         </record>
 
+        <!-- Sequence is not impemented right. 
+           See http://tools.ietf.org/html/rfc5545#section-3.8.7.4
+           Disabling..
+       
         <record model="basic.calendar.fields" id="map_todo_6">
             <field name="name" ref="caldav.field_todo_seq"/>
             <field name="type_id" ref="caldav.calendar_lines_todo" />
                <field name="field_id" search="[('name','=','sequence'),('model_id.model','=','calendar.todo')]" />
             <field name="fn">field</field>
         </record>
+        -->
 
         <record model="basic.calendar.fields" id="map_todo_7">
             <field name="name" ref="caldav.field_todo_url"/>
diff --git a/addons/purchase/i18n/mn.po b/addons/purchase/i18n/mn.po
new file mode 100644 (file)
index 0000000..0505dc0
--- /dev/null
@@ -0,0 +1,877 @@
+# Mongolian translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
+"POT-Creation-Date: 2009-08-28 16:01+0000\n"
+"PO-Revision-Date: 2010-08-06 08:44+0000\n"
+"Last-Translator: ub121 <Unknown>\n"
+"Language-Team: Mongolian <mn@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: 2010-08-07 03:42+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: purchase
+#: field:purchase.order,invoiced:0
+msgid "Invoiced & Paid"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_invoiceafterpacking0
+msgid "Supplier Invoice pre-generated on receptions for control"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,location_id:0
+msgid "Destination"
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,invoice_method:0
+msgid "From Picking"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Validated By"
+msgstr "Баталсан"
+
+#. module: purchase
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,partner_id:0
+msgid "Supplier"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Delivery"
+msgstr "Хүргэлт"
+
+#. module: purchase
+#: field:purchase.order.line,product_qty:0
+msgid "Quantity"
+msgstr "Тоо ширхэг"
+
+#. module: purchase
+#: selection:purchase.order,invoice_method:0
+msgid "From Order"
+msgstr "Захиалгаас"
+
+#. module: purchase
+#: model:process.node,name:purchase.process_node_confirmpurchaseorder0
+msgid "Confirmed Purchase"
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,state:0
+msgid "Invoice Exception"
+msgstr ""
+
+#. module: purchase
+#: model:product.pricelist,name:purchase.list0
+msgid "Default Purchase Pricelist"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition.action,name:purchase.process_transition_action_invoicefrompurchaseorder0
+msgid "Create invoice"
+msgstr "Нэхэмжлэл үүсгэх"
+
+#. module: purchase
+#: help:res.partner,property_product_pricelist_purchase:0
+msgid ""
+"This pricelist will be used, instead of the default one, for purchases from "
+"the current partner"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Fax :"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_productrecept0
+msgid "Create invoice from product recept"
+msgstr ""
+
+#. module: purchase
+#: help:purchase.order,pricelist_id:0
+msgid ""
+"The pricelist sets the currency used for this purchase order. It also "
+"computes the supplier price for the selected products/quantities."
+msgstr ""
+
+#. module: purchase
+#: model:process.process,name:purchase.process_process_purchaseprocess0
+msgid "Purchase Process"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_invoicefrompackinglist0
+msgid "Invoice from Packing list"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Approve Purchase"
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,state:0
+msgid "Approved"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.act_window,name:purchase.purchase_form_action4
+#: model:ir.ui.menu,name:purchase.menu_purchase_form_action4
+msgid "Purchase Orders in Progress"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,amount_untaxed:0
+msgid "Untaxed Amount"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+#: field:purchase.order,notes:0
+#: view:purchase.order.line:0
+#: field:purchase.order.line,notes:0
+msgid "Notes"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+#: field:purchase.order,amount_tax:0
+#: view:purchase.order.line:0
+#: field:purchase.order.line,taxes_id:0
+msgid "Taxes"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.report.xml,name:purchase.report_purchase_order
+#: model:process.node,name:purchase.process_node_purchaseorder0
+#: view:purchase.order:0
+#: model:res.request.link,name:purchase.req_link_purchase_order
+#: field:stock.picking,purchase_id:0
+msgid "Purchase Order"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.quotation:0
+msgid "Regards,"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Net Total :"
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,state:0
+msgid "Cancelled"
+msgstr ""
+
+#. module: purchase
+#: help:purchase.order,state:0
+msgid ""
+"The state of the purchase order or the quotation request. A quotation is a "
+"purchase order in a 'Draft' state. Then the order has to be confirmed by the "
+"user, the state switch to 'Confirmed'. Then the supplier must confirm the "
+"order to change the state to 'Approved'. When the purchase order is paid and "
+"received, the state becomes 'Done'. If a cancel action occurs in the invoice "
+"or in the reception of goods, the state becomes in exception."
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,origin:0
+msgid "Origin"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,name:purchase.process_node_packinglist0
+msgid "Incoming Products"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+#: rml:purchase.quotation:0
+msgid "Qty"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Manually Corrected"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Reference"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "TVA :"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.quotation:0
+msgid "Tel.:"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order.line,account_analytic_id:0
+msgid "Analytic Account"
+msgstr ""
+
+#. module: purchase
+#: model:ir.model,name:purchase.model_purchase_order_line
+msgid "Purchase Order lines"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,validator:0
+msgid "Validated by"
+msgstr ""
+
+#. module: purchase
+#: help:purchase.order,invoice_method:0
+msgid ""
+"From Order: a draft invoice will be pre-generated based on the purchase "
+"order. The accountant will just have to validate this invoice for control.\n"
+"From Picking: a draft invoice will be pre-genearted based on validated "
+"receptions.\n"
+"Manual: no invoice will be pre-generated. The accountant will have to encode "
+"manually."
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_packinginvoice0
+msgid "Invoice based on deliveries"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Net Price"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order.line:0
+msgid "Order Line"
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,state:0
+msgid "Confirmed"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,name:purchase.process_node_productrecept0
+msgid "Product Receipt"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition.action,name:purchase.process_transition_action_confirmpurchaseorder0
+msgid "Confirm"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Invoice Control"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,name:purchase.process_node_draftpurchaseorder0
+#: model:process.node,name:purchase.process_node_draftpurchaseorder1
+msgid "RFQ"
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,state:0
+msgid "Waiting"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,picking_ids:0
+msgid "Picking List"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,warehouse_id:0
+msgid "Warehouse"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,order_line:0
+msgid "Order Lines"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_confirmingpurchaseorder1
+msgid "Confirm Purchase order from Request for quotation without origin"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.quotation:0
+msgid "Fax:"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Untaxed amount"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.quotation:0
+msgid "Expected Date"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Shipping address :"
+msgstr ""
+
+#. module: purchase
+#: model:product.pricelist.type,name:purchase.pricelist_type_purchase
+#: field:res.partner,property_product_pricelist_purchase:0
+msgid "Purchase Pricelist"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,minimum_planned_date:0
+msgid "Planned Date"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Approved by Supplier"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.act_window,name:purchase.act_purchase_order_2_stock_picking
+msgid "Packing"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.wizard,name:purchase.purchase_order_merge
+msgid "Merge purchases"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order.line,move_dest_id:0
+msgid "Reservation Destination"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,name:0
+msgid "Order Reference"
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,state:0
+msgid "Done"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,pricelist_id:0
+msgid "Pricelist"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_purchaseorder0
+msgid "When controlling invoice from orders"
+msgstr ""
+
+#. module: purchase
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_invoicecontrol0
+msgid "Pre-generated supplier invoice to control based on order"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_invoicefrompurchase0
+msgid "Invoice from Purchase"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_packinglist0
+msgid "Packing is created for the products reception control."
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,invoice_method:0
+msgid "Manual"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_confirmingpurchaseorder1
+msgid "Confirming Purchase"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_approvingpurchaseorder0
+msgid "Approve Purchase order after Confirming"
+msgstr ""
+
+#. module: purchase
+#: selection:purchase.order,state:0
+msgid "Shipping Exception"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_draftpurchaseorder1
+msgid "Encoded manually by the user."
+msgstr ""
+
+#. module: purchase
+#: help:purchase.order,minimum_planned_date:0
+msgid ""
+"This is computed as the minimum scheduled date of all purchase order lines' "
+"products."
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.act_window,name:purchase.act_res_partner_2_purchase_order
+msgid "Purchase orders"
+msgstr ""
+
+#. module: purchase
+#: help:purchase.order,dest_address_id:0
+msgid ""
+"Put an address if you want to deliver directly from the supplier to the "
+"customer.In this case, it will remove the warehouse link and set the "
+"customer location."
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.quotation:0
+msgid "Request for Quotation :"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_confirmingpurchaseorder0
+msgid "Confirm Purchase order from Request for quotation"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Confirm Purchase Order"
+msgstr ""
+
+#. module: purchase
+#: help:purchase.order,picking_ids:0
+msgid ""
+"This is the list of picking list that have been generated for this purchase"
+msgstr ""
+
+#. module: purchase
+#: model:ir.module.module,shortdesc:purchase.module_meta_information
+#: model:ir.ui.menu,name:purchase.menu_purchase_root
+msgid "Purchase Management"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,partner_ref:0
+msgid "Partner Ref."
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Taxes :"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,invoiced_rate:0
+msgid "Invoiced"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,dest_address_id:0
+msgid "Destination Address"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order.line:0
+#: field:stock.move,purchase_line_id:0
+msgid "Purchase Order Line"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Calendar View"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Set to Draft"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_approvepurchaseorder0
+msgid "Purchase order is approved by supplier."
+msgstr ""
+
+#. module: purchase
+#: model:process.node,name:purchase.process_node_invoiceafterpacking0
+#: model:process.node,name:purchase.process_node_invoicecontrol0
+msgid "Draft Invoice"
+msgstr ""
+
+#. module: purchase
+#: model:ir.model,name:purchase.model_purchase_order
+msgid "Purchase order"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_draftpurchaseorder0
+msgid "Request for quotation is proposed by the system."
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_packinginvoice0
+msgid "Packing Invoice"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_invoicefrompackinglist0
+msgid "Creates invoice from packin list"
+msgstr ""
+
+#. module: purchase
+#: help:purchase.order,date_order:0
+msgid "Date on which this document has been created."
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Delivery & Invoices"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,date_order:0
+msgid "Date"
+msgstr ""
+
+#. module: purchase
+#: help:purchase.order,origin:0
+msgid "Reference of the document that generated this purchase order request."
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Tél. :"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_purchaseinvoice0
+msgid "After Purchase order , Create invoice."
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order.line,date_planned:0
+msgid "Scheduled date"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Our Order Reference"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.quotation:0
+msgid "TVA:"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Compute"
+msgstr ""
+
+#. module: purchase
+#: constraint:product.pricelist.version:0
+msgid "You cannot have 2 pricelist versions that overlap!"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Cancel Purchase Order"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_createpackinglist0
+msgid "Create Packing list"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Total :"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_createpackinglist0
+msgid "When purchase order is approved , it creates its packing list."
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order.line:0
+msgid "History"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,state:0
+msgid "Order Status"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order.line,price_subtotal:0
+msgid "Subtotal"
+msgstr ""
+
+#. module: purchase
+#: model:product.pricelist.version,name:purchase.ver0
+msgid "Default Purchase Pricelist Version"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+#: field:purchase.order.line,price_unit:0
+msgid "Unit Price"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,fiscal_position:0
+msgid "Fiscal Position"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Request for Quotation N°"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,invoice_id:0
+msgid "Invoice"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition.action,name:purchase.process_transition_action_approvingcancelpurchaseorder0
+#: model:process.transition.action,name:purchase.process_transition_action_cancelpurchaseorder0
+#: wizard_button:purchase.order.merge,init,end:0
+msgid "Cancel"
+msgstr ""
+
+#. module: purchase
+#: view:res.partner:0
+msgid "Purchases Properties"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order.line,order_id:0
+msgid "Order Ref"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.act_window,name:purchase.purchase_form_action
+#: model:ir.ui.menu,name:purchase.menu_purchase_form_action
+msgid "Purchase Orders"
+msgstr ""
+
+#. module: purchase
+#: wizard_view:purchase.order.merge,init:0
+#: wizard_button:purchase.order.merge,init,merge:0
+msgid "Merge orders"
+msgstr ""
+
+#. module: purchase
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.act_window,name:purchase.purchase_form_action_new
+#: model:ir.ui.menu,name:purchase.menu_purchase_form_action_new
+msgid "New Purchase Order"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,shipped:0
+#: field:purchase.order,shipped_rate:0
+msgid "Received"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.report.xml,name:purchase.report_purchase_quotation
+#: selection:purchase.order,state:0
+msgid "Request for Quotation"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,name:purchase.process_node_packinginvoice0
+msgid "Out Packing"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_productrecept0
+msgid "Control invoices on receptions"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Date Req."
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,date_approve:0
+msgid "Date Approved"
+msgstr ""
+
+#. module: purchase
+#: model:ir.module.module,description:purchase.module_meta_information
+msgid ""
+"Module for purchase management\n"
+"    Request for quotation, Create Supplier Invoice, Print Order..."
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order.line,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+#: field:purchase.order.line,name:0
+#: rml:purchase.quotation:0
+msgid "Description"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_productrecept0
+msgid "Product recept invoice"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.quotation:0
+msgid "Expected Delivery address:"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.act_window,name:purchase.purchase_form_action3
+#: model:ir.ui.menu,name:purchase.menu_purchase_form_action3
+msgid "Purchase Order Waiting Approval"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_confirmingpurchaseorder0
+msgid "Confirming Purchase Order"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order.line,product_uom:0
+msgid "Product UOM"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order.line,move_ids:0
+msgid "Reservation"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,note:purchase.process_node_confirmpurchaseorder0
+msgid "Purchase order is confirmed by the user."
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_purchaseinvoice0
+msgid "Purchase Invoice"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Your Order Reference"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Purchase Order Confirmation N°"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Total amount"
+msgstr ""
+
+#. module: purchase
+#: rml:purchase.order:0
+msgid "Date Ordered"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order:0
+msgid "Purchase Control"
+msgstr ""
+
+#. module: purchase
+#: model:ir.actions.act_window,name:purchase.purchase_form_action2
+#: model:ir.ui.menu,name:purchase.menu_purchase_order_draft
+msgid "Request For Quotations"
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,invoice_method:0
+msgid "Invoicing Control"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition.action,name:purchase.process_transition_action_approvingpurchaseorder0
+msgid "Approve"
+msgstr ""
+
+#. module: purchase
+#: model:process.node,name:purchase.process_node_approvepurchaseorder0
+msgid "Approved Purchase"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_packinginvoice0
+msgid "From Packing list, Create invoice."
+msgstr ""
+
+#. module: purchase
+#: field:purchase.order,amount_total:0
+msgid "Total"
+msgstr ""
+
+#. module: purchase
+#: wizard_view:purchase.order.merge,init:0
+msgid "Are you sure you want to merge these orders ?"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,name:purchase.process_transition_approvingpurchaseorder0
+msgid "Approving Purchase Order"
+msgstr ""
+
+#. module: purchase
+#: model:process.transition,note:purchase.process_transition_invoicefrompurchase0
+msgid "After approved purchase order , it comes into the supplier invoice"
+msgstr ""
+
+#. module: purchase
+#: view:purchase.order.line:0
+msgid "Stock Moves"
+msgstr ""
index 2c07d03..749c098 100644 (file)
@@ -8,14 +8,14 @@ msgstr ""
 "Project-Id-Version: pt_BR\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-04 20:16+0000\n"
+"PO-Revision-Date: 2010-08-06 22:06+0000\n"
 "Last-Translator: Renato Lima - http://www.akretion.com "
 "<renatonlima@gmail.com>\n"
 "Language-Team: <pt@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: 2010-08-05 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:42+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: purchase
@@ -822,7 +822,7 @@ msgstr "Reservation"
 #. module: purchase
 #: model:process.node,note:purchase.process_node_confirmpurchaseorder0
 msgid "Purchase order is confirmed by the user."
-msgstr ""
+msgstr "Ordem de compra confirmada pelo usuário."
 
 #. module: purchase
 #: model:process.transition,name:purchase.process_transition_purchaseinvoice0
@@ -858,7 +858,7 @@ msgstr "Controle de Compras"
 #: model:ir.actions.act_window,name:purchase.purchase_form_action2
 #: model:ir.ui.menu,name:purchase.menu_purchase_order_draft
 msgid "Request For Quotations"
-msgstr ""
+msgstr "Requisição para Cotações"
 
 #. module: purchase
 #: field:purchase.order,invoice_method:0
@@ -873,12 +873,12 @@ msgstr "Aprovar"
 #. module: purchase
 #: model:process.node,name:purchase.process_node_approvepurchaseorder0
 msgid "Approved Purchase"
-msgstr ""
+msgstr "Compra Aprovada"
 
 #. module: purchase
 #: model:process.transition,note:purchase.process_transition_packinginvoice0
 msgid "From Packing list, Create invoice."
-msgstr ""
+msgstr "A partir da Lista de Separação, criar Nota Fiscal"
 
 #. module: purchase
 #: field:purchase.order,amount_total:0
@@ -893,7 +893,7 @@ msgstr "Are you sure you want to merge these orders ?"
 #. module: purchase
 #: model:process.transition,name:purchase.process_transition_approvingpurchaseorder0
 msgid "Approving Purchase Order"
-msgstr ""
+msgstr "Aprovando Ordem de Compra"
 
 #. module: purchase
 #: model:process.transition,note:purchase.process_transition_invoicefrompurchase0
index ce5f963..1564abf 100644 (file)
@@ -17,6 +17,7 @@
       - delay: 1
         name: base.res_partner_asus
         qty: 5.0
+        min_qty: 1.0
     supply_method: buy
     type: product
     uom_id: product.product_uom_unit
      pick=self.browse(cr,uid,picking_id[0])
      move =pick.move_lines[0]
      partial_datas = {
-              'partner_id': 2,
-              'address_id': 6,
+              'partner_id': pick.address_id.partner_id.id,
+              'address_id': pick.address_id.id,
               'delivery_date' : time.strftime('%Y-%m-%d'),
            }
      partial_datas['move%s'%(move.id)]= {
-       'product_id': move.product_id,
+       'product_id': move.product_id.id,
        'product_qty': move.product_qty,
        'product_uom': move.product_uom.id,
       } 
             'delivery_date' : time.strftime('%Y-%m-%d'),
            }
       partial_datas['move%s'%(move.id)]= {
-          'product_id': move.product_id,
+          'product_id': move.product_id.id,
           'product_qty': move.product_qty,
           'product_uom': move.product_uom.id,
       } 
    picking_id = self.search(cr, uid, [('origin','=','TEST/TENDER/0001'),('type','=','out')])
    if picking_id:
       pick=self.browse(cr,uid,picking_id[0])
-      print pick.state
       assert(pick.state == 'assigned'), _('Picking  is  not in available state')
 
index 32c4783..7e798e5 100644 (file)
@@ -17,6 +17,7 @@
       - delay: 1
         name: base.res_partner_asus
         qty: 5.0
+        min_qty: 1.0        
     supply_method: buy
     type: product
     uom_id: product.product_uom_unit
   I confirm and validate the Request for Quotation of ASUStek.      
 -
  !python {model: purchase.order}: |
-    partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0]
-    req_obj = self.pool.get('purchase.requisition')
-    ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])    
-    purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0]
-    import netsvc
-    wf_service = netsvc.LocalService("workflow")  
-    if purchase_id:
-      wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_confirm', cr)
-      wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_approve', cr)  
+   partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0]
+   req_obj = self.pool.get('purchase.requisition')
+   ids =req_obj.search(cr, uid, [('origin','=','Laptop ACER1')])    
+   purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0]
+   import netsvc
+   wf_service = netsvc.LocalService("workflow")   
+   if purchase_id:
+     wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_confirm', cr)
+     wf_service.trg_validate(uid, 'purchase.order',purchase_id,'purchase_approve', cr)  
 -
   I check that Request for Quotation of DistriPC is cancelled.
 -        
index 0714e1d..f27ed57 100644 (file)
@@ -8,14 +8,14 @@ msgstr ""
 "Project-Id-Version: pt_BR\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 06:41+0000\n"
+"PO-Revision-Date: 2010-08-07 03:41+0000\n"
 "Last-Translator: Renato Lima - http://www.akretion.com "
 "<renatonlima@gmail.com>\n"
 "Language-Team: <pt@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: 2010-08-04 03:42+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: sale
index 21ca506..30f145a 100644 (file)
@@ -27,10 +27,8 @@ import netsvc
 from osv import fields, osv
 from tools import config
 from tools.translate import _
-
 import decimal_precision as dp
 
-
 class sale_shop(osv.osv):
     _name = "sale.shop"
     _description = "Sale Shop"
@@ -47,7 +45,7 @@ sale_shop()
 
 def _incoterm_get(self, cr, uid, context=None):
     if context is None:
-            context = {}
+        context = {}
     cr.execute('select code, code||\', \'||name from stock_incoterms where active')
     return cr.fetchall()
 
@@ -147,7 +145,6 @@ class sale_order(osv.osv):
             for invoice in sale.invoice_ids:
                 if invoice.state not in ('draft', 'cancel'):
                     tot += invoice.amount_untaxed
-
             if tot:
                 res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_untaxed or 1.00))
             else:
@@ -211,7 +208,6 @@ class sale_order(osv.osv):
         'shop_id': fields.many2one('sale.shop', 'Shop', required=True, readonly=True, states={'draft': [('readonly', False)]}),
         'origin': fields.char('Source document', size=64, help="Reference of the document that generated this sale order request."),
         'client_order_ref': fields.char('Customer Reference', size=64),
-
         'state': fields.selection([
             ('draft', 'Quotation'),
             ('waiting_date', 'Waiting Schedule'),
@@ -283,7 +279,7 @@ class sale_order(osv.osv):
         'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
     }
     _defaults = {
-        'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'sale.order', context=c),
+        'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'sale.order', context=c),
         'picking_policy': 'direct',
         'date_order': time.strftime('%Y-%m-%d'),
         'order_policy': 'manual',
@@ -1186,7 +1182,6 @@ class sale_config_picking_policy(osv.osv_memory):
             ir_values_obj = self.pool.get('ir.values')
             ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], o.picking_policy)
             ir_values_obj.set(cr, uid, 'default', False, 'order_policy', ['sale.order'], o.order_policy)
-
             if o.step == 'one':
                 md = self.pool.get('ir.model.data')
                 group_id = md._get_id(cr, uid, 'base', 'group_no_one')
@@ -1194,10 +1189,10 @@ class sale_config_picking_policy(osv.osv_memory):
                 menu_id = md._get_id(cr, uid, 'stock', 'menu_action_picking_tree_delivery')
                 menu_id = md.browse(cr, uid, menu_id, context=context).res_id
                 self.pool.get('ir.ui.menu').write(cr, uid, [menu_id], {'groups_id': [(6, 0, [group_id])]})
-
                 location_id = md._get_id(cr, uid, 'stock', 'stock_location_output')
                 location_id = md.browse(cr, uid, location_id, context=context).res_id
                 self.pool.get('stock.location').write(cr, uid, [location_id], {'chained_auto_packing': 'transparent'})
+
 sale_config_picking_policy()
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
index 9519156..06e90cb 100644 (file)
@@ -1,6 +1,6 @@
 -
   In order to test the Sale module in OpenERP,
-  I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice' and Invoice on 'Shipped quantities' 
+  I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Invoice from Picking' and Invoice on 'Shipped quantities' 
   in order to create an invoice based on the shipping quantity
 -
   !record {model: sale.order, id: sale_order_so6}:
@@ -17,7 +17,7 @@
         product_id: sale.product_product_slidermobile0
         product_uos_qty: 200.0
         type: make_to_order
-    order_policy: manual
+    order_policy: picking
     invoice_quantity: procurement
     partner_id: sale.res_partner_cleartrail0
     partner_invoice_id: sale.res_partner_address_2
        } 
        self.do_partial(cr, uid, [pick.id],partial_datas)
 -
- I click on Create Invoice button to create the invoice.
+  Then I create invoice from picking
 - 
-  !workflow {model: sale.order, action: manual_invoice, ref: sale_order_so6}
+  !record {model: stock.invoice.onshipping, id: stock_invoice_onshipping_6}:
+    invoice_date: '2010-07-17'
+    journal_id: account.sales_journal
+    type: out_invoice
+-
+  Then I click on 'Create Invoices' button
+-
+  !python {model: stock.invoice.onshipping}: |
+    sale_obj = self.pool.get('sale.order')  
+    sale_id = sale_obj.browse(cr, uid, ref("sale_order_so6"))
+    picking_obj = self.pool.get('stock.picking')
+    ids = picking_obj.search(cr, uid, [('origin', '=', sale_id.name)])
+    self.create_invoice(cr, uid, [ref("stock_invoice_onshipping_6")], {"lang": "en_US",
+      "search_default_available": 1, "tz": False, "active_model": "stock.picking",
+      "contact_display": "partner", "active_ids": ids, "active_id": ids[0]})
 -
   I verify whether the invoice has been generated for SO
 -
@@ -75,7 +89,7 @@
     so = self.browse(cr, uid, ref("sale_order_so6"))
     assert so.invoice_ids, "Invoices has not been generated for sale_order_so6"
 -
- I verify that an invoice is created on the basis of shipped quantity
+  I verify that an invoice is created on the basis of shipped quantity
 -
   !python {model: account.invoice}: |
     sale_order_obj = self.pool.get('sale.order')
index 3a59a69..1f10066 100644 (file)
@@ -29,6 +29,7 @@
     "author":"OpenERP SA",
     "depends":["sale"],
     "demo_xml":[],
+    'test': ['test/sale_margin.yml'],
     "update_xml":["security/ir.model.access.csv","sale_margin_view.xml","report/report_margin_view.xml"],
     "active": False,
     "installable": True,
diff --git a/addons/sale_margin/test/sale_margin.yml b/addons/sale_margin/test/sale_margin.yml
new file mode 100644 (file)
index 0000000..19a4f4a
--- /dev/null
@@ -0,0 +1,66 @@
+-
+  In order to test the sale_margin module in OpenERP,
+  I create a sale order and verify its margin
+-
+   I place a sale order for product keyboard, quantity 50
+-
+  !record {model: sale.order, id: sale_order_so11}:
+    date_order: '2010-08-04'
+    invoice_quantity: order
+    name: Test_SO011
+    order_line:
+      - name: '[KEYA] Keyboard - AZERTY'
+        price_unit: 7.0
+        product_uom: product.product_uom_unit
+        product_uom_qty: 100.0
+        state: draft
+        delay: 7.0
+        product_id: product.product_product_24
+        product_uos_qty: 100.0
+        th_weight: 0.0
+        type: make_to_stock
+    order_policy: manual
+    partner_id: base.res_partner_4
+    partner_invoice_id: base.res_partner_address_7
+    partner_order_id: base.res_partner_address_7
+    partner_shipping_id: base.res_partner_address_7
+    picking_policy: direct
+    pricelist_id: product.list0
+    shop_id: sale.shop
+-
+  I confirm the sale order
+-
+  !workflow {model: sale.order, action: order_confirm, ref: sale_order_so11}
+-
+  I verify that margin field gets bind with the value
+-
+  !python {model: sale.order}: |
+    so = self.browse(cr, uid, ref("sale_order_so11"))
+    assert so.margin, "No margin !" 
+-
+  I verify that the picking has been generated for the sale order
+-
+  !python {model: sale.order}: |
+    so = self.browse(cr, uid, ref("sale_order_so11"))
+    assert so.picking_ids,"Picking has not been generated"
+-
+  Then I click on the 'Create Invoice' button of 'Outgoing Orders'
+-
+  !python {model: stock.picking}: |
+    sale_order_obj = self.pool.get('sale.order')
+    so = sale_order_obj.browse(cr, uid, ref("sale_order_so11"))
+    ids = self.search(cr, uid, [('origin', '=', so.name),('type', '=', 'out')])
+    self.create_invoice(cr, uid, ids, {"lang": "en_US", "search_default_available":
+      1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner",
+      "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"),
+      })
+-
+  I verify that an invoice has been generated from picking
+-
+  !python {model: stock.picking}: |
+    sale_order_obj = self.pool.get('sale.order')
+    so = sale_order_obj.browse(cr, uid, ref("sale_order_so11"))
+    pick_ids = self.search(cr, uid, [('origin', '=', so.name)])
+    pick_brw = self.browse(cr, uid, pick_ids[0])
+    assert pick_brw.invoice_ids,"Invoice has not been created"
+    
\ No newline at end of file
index 0f613b5..5b7d46f 100644 (file)
@@ -1730,7 +1730,7 @@ class stock_move(osv.osv):
         accounts = product_obj.get_product_accounts(cr,uid,move.product_id.id,context)
         acc_src = accounts['stock_account_input']
         acc_dest = accounts['stock_account_output']
-        acc_variation = accounts['property_stock_variation']
+        acc_variation = accounts.get('property_stock_variation', False)
         journal_id = accounts['stock_journal']
 
         if context is None:
index 001afa5..1b1c35d 100644 (file)
@@ -7,13 +7,13 @@ msgstr ""
 "Project-Id-Version: OpenERP Server 5.0.0\n"
 "Report-Msgid-Bugs-To: support@openerp.com\n"
 "POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-08-03 21:00+0000\n"
-"Last-Translator: Jan Verlaan (Veritos) <Unknown>\n"
+"PO-Revision-Date: 2010-08-07 02:52+0000\n"
+"Last-Translator: OpenERP Administrators <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: 2010-08-04 03:47+0000\n"
+"X-Launchpad-Export-Date: 2010-08-07 03:43+0000\n"
 "X-Generator: Launchpad (build Unknown)\n"
 
 #. module: stock_invoice_directly