summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry (Open ERP) <hmo@tinyerp.com>2010-03-29 13:39:47 +0530
committerHarry (Open ERP) <hmo@tinyerp.com>2010-03-29 13:39:47 +0530
commitf03a4fe933d9472d0b0d22bc29bbfcf2076d3a18 (patch)
tree884c945ac83afd494c32b403d118f96ceabb81d9
parent836e67c9fa22c6f193dd21c8653932bc071122a8 (diff)
parent8756f1f7c4064da5011cf03ff0499085912ab382 (diff)
[MERGE] merge with trunk-addons
bzr revid: hmo@tinyerp.com-20100329080947-lojccpq7zwynyg6v
-rw-r--r--addons/account/i18n/cs.po8
-rw-r--r--addons/account/i18n/pt_BR.po2
-rw-r--r--addons/account/i18n/sv.po50
-rw-r--r--addons/account/i18n/zh_CN.po10
-rw-r--r--addons/account/security/account_security.xml8
-rw-r--r--addons/account_analytic_default/i18n/zh_CN.po8
-rw-r--r--addons/account_analytic_plans/i18n/oc.po376
-rw-r--r--addons/account_anglo_saxon/i18n/es.po66
-rw-r--r--addons/account_chart/i18n/pt_BR.po2
-rw-r--r--addons/account_date_check/i18n/pt_BR.po2
-rw-r--r--addons/account_payment/i18n/pt_BR.po2
-rw-r--r--addons/analytic_user_function/i18n/hr.po30
-rw-r--r--addons/auction/__terp__.py13
-rw-r--r--addons/auction/auction.py12
-rw-r--r--addons/auction/security/ir.model.access.csv10
-rw-r--r--addons/auction/wizard/__init__.py33
-rw-r--r--addons/auction/wizard/auction_catalog_flagey_report.py71
-rw-r--r--addons/auction/wizard/auction_catalog_flagey_view.xml32
-rw-r--r--addons/auction/wizard/auction_lots_buyer_map.py127
-rw-r--r--addons/auction/wizard/auction_lots_buyer_map_view.xml36
-rw-r--r--addons/auction/wizard/auction_lots_invoice.py124
-rw-r--r--addons/auction/wizard/auction_lots_invoice_view.xml39
-rw-r--r--addons/auction/wizard/wizard_auction_invoice_buyer.py163
-rw-r--r--addons/auction/wizard/wizard_auction_journal.py155
-rw-r--r--addons/auction/wizard/wizard_emporte.py88
-rw-r--r--addons/auction/wizard/wizard_lot_date_move.py126
-rw-r--r--addons/auction/wizard/wizard_lots_buyer_map.py107
-rw-r--r--addons/auction/wizard/wizard_lots_invoice.py106
-rw-r--r--addons/auction/wizard/wizard_lots_pay.py123
-rw-r--r--addons/auction/wizard/wizard_lots_sms.py170
-rw-r--r--addons/auction/wizard/wizard_pay.py158
-rw-r--r--addons/base_contact/i18n/hr.po136
-rw-r--r--addons/base_contact/i18n/it.po20
-rw-r--r--addons/base_contact/i18n/zh_CN.po6
-rw-r--r--addons/base_iban/i18n/hr.po31
-rw-r--r--addons/base_module_merge/i18n/hr.po66
-rw-r--r--addons/base_module_quality/i18n/hr.po72
-rw-r--r--addons/base_module_record/i18n/hr.po117
-rw-r--r--addons/base_report_designer/i18n/hr.po57
-rw-r--r--addons/base_setup/i18n/hr.po90
-rw-r--r--addons/board_crm_configuration/__init__.py (renamed from addons/board_crm/__init__.py)0
-rw-r--r--addons/board_crm_configuration/__terp__.py (renamed from addons/board_crm/__terp__.py)6
-rw-r--r--addons/board_crm_configuration/board_crm_demo.xml (renamed from addons/board_crm/board_crm_demo.xml)0
-rw-r--r--addons/board_crm_configuration/board_crm_statistical_view.xml (renamed from addons/board_crm/board_crm_statistical_view.xml)24
-rw-r--r--addons/board_crm_configuration/board_crm_view.xml (renamed from addons/board_crm/board_crm_view.xml)10
-rw-r--r--addons/board_crm_configuration/i18n/ar.po (renamed from addons/board_crm/i18n/ar.po)0
-rw-r--r--addons/board_crm_configuration/i18n/bg.po (renamed from addons/board_crm/i18n/bg.po)0
-rw-r--r--addons/board_crm_configuration/i18n/board_crm_configuration.pot (renamed from addons/board_crm/i18n/board_crm_configuration.pot)0
-rw-r--r--addons/board_crm_configuration/i18n/bs.po (renamed from addons/board_crm/i18n/bs.po)0
-rw-r--r--addons/board_crm_configuration/i18n/ca.po (renamed from addons/board_crm/i18n/ca.po)0
-rw-r--r--addons/board_crm_configuration/i18n/cs.po (renamed from addons/board_crm/i18n/cs.po)0
-rw-r--r--addons/board_crm_configuration/i18n/de.po (renamed from addons/board_crm/i18n/de.po)0
-rw-r--r--addons/board_crm_configuration/i18n/el.po (renamed from addons/board_crm/i18n/el.po)0
-rw-r--r--addons/board_crm_configuration/i18n/es.po (renamed from addons/board_crm/i18n/es.po)0
-rw-r--r--addons/board_crm_configuration/i18n/es_AR.po (renamed from addons/board_crm/i18n/es_AR.po)0
-rw-r--r--addons/board_crm_configuration/i18n/et.po (renamed from addons/board_crm/i18n/et.po)0
-rw-r--r--addons/board_crm_configuration/i18n/fr.po (renamed from addons/board_crm/i18n/fr.po)0
-rw-r--r--addons/board_crm_configuration/i18n/hr.po (renamed from addons/board_crm/i18n/hr.po)0
-rw-r--r--addons/board_crm_configuration/i18n/hu.po (renamed from addons/board_crm/i18n/hu.po)0
-rw-r--r--addons/board_crm_configuration/i18n/id.po (renamed from addons/board_crm/i18n/id.po)0
-rw-r--r--addons/board_crm_configuration/i18n/it.po (renamed from addons/board_crm/i18n/it.po)0
-rw-r--r--addons/board_crm_configuration/i18n/ko.po (renamed from addons/board_crm/i18n/ko.po)0
-rw-r--r--addons/board_crm_configuration/i18n/lt.po (renamed from addons/board_crm/i18n/lt.po)0
-rw-r--r--addons/board_crm_configuration/i18n/nl.po (renamed from addons/board_crm/i18n/nl.po)0
-rw-r--r--addons/board_crm_configuration/i18n/nl_BE.po (renamed from addons/board_crm/i18n/nl_BE.po)0
-rw-r--r--addons/board_crm_configuration/i18n/pl.po (renamed from addons/board_crm/i18n/pl.po)0
-rw-r--r--addons/board_crm_configuration/i18n/pt.po (renamed from addons/board_crm/i18n/pt.po)0
-rw-r--r--addons/board_crm_configuration/i18n/pt_BR.po (renamed from addons/board_crm/i18n/pt_BR.po)0
-rw-r--r--addons/board_crm_configuration/i18n/ro.po (renamed from addons/board_crm/i18n/ro.po)0
-rw-r--r--addons/board_crm_configuration/i18n/ru.po (renamed from addons/board_crm/i18n/ru.po)0
-rw-r--r--addons/board_crm_configuration/i18n/sk.po (renamed from addons/board_crm/i18n/sk.po)0
-rw-r--r--addons/board_crm_configuration/i18n/sl.po (renamed from addons/board_crm/i18n/sl.po)0
-rw-r--r--addons/board_crm_configuration/i18n/sq.po (renamed from addons/board_crm/i18n/sq.po)0
-rw-r--r--addons/board_crm_configuration/i18n/sv.po (renamed from addons/board_crm/i18n/sv.po)0
-rw-r--r--addons/board_crm_configuration/i18n/tlh.po (renamed from addons/board_crm/i18n/tlh.po)0
-rw-r--r--addons/board_crm_configuration/i18n/tr.po (renamed from addons/board_crm/i18n/tr.po)0
-rw-r--r--addons/board_crm_configuration/i18n/uk.po (renamed from addons/board_crm/i18n/uk.po)0
-rw-r--r--addons/board_crm_configuration/i18n/vi.po (renamed from addons/board_crm/i18n/vi.po)0
-rw-r--r--addons/board_crm_configuration/i18n/zh_CN.po (renamed from addons/board_crm/i18n/zh_CN.po)0
-rw-r--r--addons/board_crm_configuration/i18n/zh_TW.po (renamed from addons/board_crm/i18n/zh_TW.po)0
-rw-r--r--addons/board_project/board_project_view.xml4
-rw-r--r--addons/board_project/i18n/sv.po50
-rw-r--r--addons/board_project/i18n/zh_CN.po8
-rw-r--r--addons/board_sale/i18n/sv.po28
-rw-r--r--addons/crm_profiling/i18n/pt_BR.po2
-rw-r--r--addons/delivery/__terp__.py4
-rw-r--r--addons/delivery/delivery_wizard.xml8
-rw-r--r--addons/delivery/i18n/hr.po64
-rw-r--r--addons/delivery/i18n/pt_BR.po2
-rw-r--r--addons/delivery/wizard/delivery_sale_order.py145
-rw-r--r--addons/delivery/wizard/delivery_sale_order_view.xml36
-rw-r--r--addons/document/document.py2
-rw-r--r--addons/document/document_directory.py2
-rw-r--r--addons/document/i18n/hr.po31
-rw-r--r--addons/document_webdav/i18n/pt_BR.po2
-rw-r--r--addons/event/event_view.xml4
-rw-r--r--addons/hr/i18n/it.po12
-rw-r--r--addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml11
-rw-r--r--addons/idea/i18n/hr.po143
-rw-r--r--addons/l10n_be/__terp__.py27
-rw-r--r--addons/l10n_be/company.py8
-rw-r--r--addons/l10n_be/l10n_be_wizard.xml4
-rw-r--r--addons/l10n_be/wizard/__init__.py5
-rw-r--r--addons/l10n_be/wizard/l10n_be_account_vat_declaration.py (renamed from addons/l10n_be/wizard/account_vat_declaration.py)98
-rw-r--r--addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml47
-rw-r--r--addons/mrp/__init__.py2
-rw-r--r--addons/mrp/__terp__.py8
-rw-r--r--addons/mrp/i18n/zh_CN.po6
-rw-r--r--addons/mrp/mrp.py211
-rw-r--r--addons/mrp/mrp_demo.xml46
-rw-r--r--addons/mrp/mrp_view.xml57
-rw-r--r--addons/mrp/mrp_wizard.xml28
-rw-r--r--addons/mrp/product.py70
-rw-r--r--addons/mrp/report/workcenter_load.py12
-rw-r--r--addons/mrp/schedulers.py2
-rw-r--r--addons/mrp/security/ir.model.access.csv6
-rw-r--r--addons/mrp/wizard/__init__.py13
-rw-r--r--addons/mrp/wizard/change_production_qty.py106
-rw-r--r--addons/mrp/wizard/change_production_qty_view.xml35
-rw-r--r--addons/mrp/wizard/make_procurement.py176
-rw-r--r--addons/mrp/wizard/make_procurement_view.xml39
-rw-r--r--addons/mrp/wizard/mrp_price.py (renamed from addons/mrp/wizard/wizard_workcenter_load.py)57
-rw-r--r--addons/mrp/wizard/mrp_price_view.xml33
-rw-r--r--addons/mrp/wizard/mrp_product_produce.py (renamed from addons/mrp/mrp_wizard.py)23
-rw-r--r--addons/mrp/wizard/mrp_product_produce_view.xml (renamed from addons/mrp/mrp_wizard_view.xml)0
-rw-r--r--addons/mrp/wizard/mrp_workcenter_load.py57
-rw-r--r--addons/mrp/wizard/mrp_workcenter_load_view.xml35
-rw-r--r--addons/mrp/wizard/orderpoint_procurement_view.xml34
-rw-r--r--addons/mrp/wizard/schedulers_all_view.xml37
-rw-r--r--addons/mrp/wizard/wizard_change_production_qty.py117
-rw-r--r--addons/mrp/wizard/wizard_orderpoint_procurement.py78
-rw-r--r--addons/mrp/wizard/wizard_schedulers_all.py76
-rw-r--r--addons/mrp_repair/__terp__.py7
-rw-r--r--addons/mrp_repair/mrp_repair.py8
-rw-r--r--addons/mrp_repair/mrp_repair_wizard.xml22
-rw-r--r--addons/mrp_repair/report/order.rml2
-rw-r--r--addons/mrp_repair/security/ir.model.access.csv4
-rw-r--r--addons/mrp_repair/wizard/wizard_cancel_repair.py108
-rw-r--r--addons/mrp_repair/wizard/wizard_make_invoice.py87
-rw-r--r--addons/olap_crm/i18n/pt_BR.po2
-rw-r--r--addons/olap_extract/i18n/pt_BR.po2
-rw-r--r--addons/olap_sale/i18n/pt_BR.po2
-rw-r--r--addons/point_of_sale/__terp__.py38
-rw-r--r--addons/point_of_sale/account_bank_statement.py19
-rw-r--r--addons/point_of_sale/pos_view.xml55
-rw-r--r--addons/point_of_sale/pos_wizard.xml53
-rw-r--r--addons/point_of_sale/report/all_closed_cashbox_of_the_day.py4
-rw-r--r--addons/point_of_sale/report/pos_payment_report_date.py4
-rw-r--r--addons/point_of_sale/report/pos_payment_report_user.py2
-rw-r--r--addons/point_of_sale/report/pos_receipt.rml4
-rw-r--r--addons/point_of_sale/report/pos_receipt_without_remboursment.rml2
-rw-r--r--addons/point_of_sale/report/pos_sales_user.py2
-rw-r--r--addons/point_of_sale/report/pos_sales_user_today.py2
-rw-r--r--addons/point_of_sale/security/ir.model.access.csv9
-rw-r--r--addons/point_of_sale/statement_report.xml22
-rw-r--r--addons/point_of_sale/statement_view.xml28
-rw-r--r--addons/point_of_sale/statement_wizard.xml32
-rw-r--r--addons/point_of_sale/wizard/__init__.py37
-rw-r--r--addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml31
-rw-r--r--addons/point_of_sale/wizard/pos_add_product.py67
-rw-r--r--addons/point_of_sale/wizard/pos_add_product.xml34
-rw-r--r--addons/point_of_sale/wizard/pos_box_entries.py133
-rw-r--r--addons/point_of_sale/wizard/pos_box_entries.xml38
-rw-r--r--addons/point_of_sale/wizard/pos_box_out.py132
-rw-r--r--addons/point_of_sale/wizard/pos_box_out.xml38
-rw-r--r--addons/point_of_sale/wizard/pos_close_statement.py52
-rw-r--r--addons/point_of_sale/wizard/pos_close_statement.xml40
-rw-r--r--addons/point_of_sale/wizard/pos_confirm.py60
-rw-r--r--addons/point_of_sale/wizard/pos_confirm.xml41
-rw-r--r--addons/point_of_sale/wizard/pos_details.py62
-rw-r--r--addons/point_of_sale/wizard/pos_details.xml43
-rw-r--r--addons/point_of_sale/wizard/pos_discount.py111
-rw-r--r--addons/point_of_sale/wizard/pos_discount.xml34
-rw-r--r--addons/point_of_sale/wizard/pos_get_sale.py79
-rw-r--r--addons/point_of_sale/wizard/pos_get_sale.xml34
-rw-r--r--addons/point_of_sale/wizard/pos_open_statement.py90
-rw-r--r--addons/point_of_sale/wizard/pos_open_statement.xml39
-rw-r--r--addons/point_of_sale/wizard/pos_payment.py204
-rw-r--r--addons/point_of_sale/wizard/pos_payment.xml45
-rw-r--r--addons/point_of_sale/wizard/pos_payment_report.py74
-rw-r--r--addons/point_of_sale/wizard/pos_payment_report.xml35
-rw-r--r--addons/point_of_sale/wizard/pos_payment_report_date.py65
-rw-r--r--addons/point_of_sale/wizard/pos_payment_report_date_view.xml32
-rw-r--r--addons/point_of_sale/wizard/pos_payment_report_user.py56
-rw-r--r--addons/point_of_sale/wizard/pos_payment_report_user.xml40
-rw-r--r--addons/point_of_sale/wizard/pos_payment_report_user_view.xml27
-rw-r--r--addons/point_of_sale/wizard/pos_receipt.py66
-rw-r--r--addons/point_of_sale/wizard/pos_receipt_view.xml37
-rw-r--r--addons/point_of_sale/wizard/pos_return.py (renamed from addons/point_of_sale/wizard/wizard_return.py)64
-rw-r--r--addons/point_of_sale/wizard/pos_sale_user_today.xml32
-rw-r--r--addons/point_of_sale/wizard/pos_sales_user.py59
-rw-r--r--addons/point_of_sale/wizard/pos_sales_user.xml43
-rw-r--r--addons/point_of_sale/wizard/pos_sales_user_current_user.py (renamed from addons/auction/wizard/auction_catalog_flagey.py)52
-rw-r--r--addons/point_of_sale/wizard/pos_sales_user_current_user.xml40
-rw-r--r--addons/point_of_sale/wizard/pos_sales_user_today.py58
-rw-r--r--addons/point_of_sale/wizard/wizard_add_product.py88
-rw-r--r--addons/point_of_sale/wizard/wizard_all_closed_cashbox_of_the_day.py40
-rw-r--r--addons/point_of_sale/wizard/wizard_confirm.py78
-rw-r--r--addons/point_of_sale/wizard/wizard_discount.py145
-rw-r--r--addons/point_of_sale/wizard/wizard_get_sale.py95
-rw-r--r--addons/point_of_sale/wizard/wizard_open_statement.py147
-rw-r--r--addons/point_of_sale/wizard/wizard_pos_details.py67
-rw-r--r--addons/point_of_sale/wizard/wizard_pos_payment.py233
-rw-r--r--addons/point_of_sale/wizard/wizard_pos_payment_report.py40
-rw-r--r--addons/point_of_sale/wizard/wizard_pos_payment_report_date.py64
-rw-r--r--addons/point_of_sale/wizard/wizard_pos_payment_report_user.py66
-rw-r--r--addons/point_of_sale/wizard/wizard_pos_sales_user_current_user.py40
-rw-r--r--addons/point_of_sale/wizard/wizard_pos_sales_user_today.py66
-rw-r--r--addons/point_of_sale/wizard/wizard_receipt.py49
-rw-r--r--addons/point_of_sale/wizard/wizard_refund_order.py232
-rw-r--r--addons/pos_sales_user.py (renamed from addons/point_of_sale/wizard/wizard_pos_sales_user.py)0
-rw-r--r--addons/product/product.py20
-rw-r--r--addons/product/product_data.xml14
-rw-r--r--addons/product/product_demo.xml1
-rw-r--r--addons/product/product_view.xml12
-rw-r--r--addons/product/security/product_security.xml2
-rw-r--r--addons/product_margin/__terp__.py2
-rw-r--r--addons/product_margin/product_margin_view.xml10
-rw-r--r--addons/product_margin/wizard/__init__.py2
-rw-r--r--addons/product_margin/wizard/product_margin_view.xml33
-rw-r--r--addons/product_margin/wizard/wizard_product_margin.py133
-rw-r--r--addons/profile_crm/i18n/pt_BR.po2
-rw-r--r--addons/project/project_view.xml5
-rw-r--r--addons/project/report/project_report_view.xml8
-rw-r--r--addons/project/security/project_security.xml4
-rw-r--r--addons/project/wizard/compute_tasks_date.py6
-rw-r--r--addons/project/wizard/task_delegate.py6
-rw-r--r--addons/project_caldav/project_caldav_wizard.xml13
-rw-r--r--addons/project_gtd/wizard/project_gtd_fill.py6
-rw-r--r--addons/project_issue/project_issue_view.xml46
-rw-r--r--addons/project_issue/report/project_issue_report.py4
-rw-r--r--addons/project_long_term/wizard/compute_phases_date.py4
-rw-r--r--addons/project_long_term/wizard/compute_tasks_date.py7
-rw-r--r--addons/project_long_term/wizard/schedule_tasks.py2
-rw-r--r--addons/project_planning/project_planning.py43
-rw-r--r--addons/project_planning/project_planning_view.xml3
-rw-r--r--addons/purchase/__terp__.py2
-rw-r--r--addons/purchase/purchase.py112
-rw-r--r--addons/purchase/purchase_view.xml12
-rw-r--r--addons/purchase/purchase_wizard.xml2
-rw-r--r--addons/purchase/security/purchase_security.xml4
-rw-r--r--addons/purchase/wizard/__init__.py2
-rw-r--r--addons/purchase/wizard/purchase_order_group.py70
-rw-r--r--addons/purchase/wizard/purchase_order_group_view.xml39
-rw-r--r--addons/purchase/wizard/wizard_group.py173
-rw-r--r--addons/report_account/i18n/hr.po81
-rw-r--r--addons/report_analytic/i18n/hr.po32
-rw-r--r--addons/report_analytic_line/i18n/hr.po17
-rw-r--r--addons/report_analytic_planning/i18n/hr.po126
-rw-r--r--addons/report_document/i18n/hr.po92
-rw-r--r--addons/report_intrastat/i18n/hr.po108
-rw-r--r--addons/report_mrp/i18n/hr.po42
-rwxr-xr-xaddons/resource/resource_view.xml17
-rw-r--r--addons/sale/__terp__.py4
-rw-r--r--addons/sale/i18n/hr.po2
-rw-r--r--addons/sale/sale.py2
-rw-r--r--addons/sale/sale_view.xml19
-rw-r--r--addons/sale/sale_wizard.xml28
-rw-r--r--addons/sale/security/ir.model.access.csv7
-rw-r--r--addons/sale/security/sale_security.xml5
-rw-r--r--addons/sale/wizard/make_invoice_advance.py267
-rw-r--r--addons/sale/wizard/sale_line_invoice.xml28
-rw-r--r--addons/sale/wizard/sale_make_invoice_advance.xml59
-rw-r--r--addons/sale/wizard/wizard_sale_line_invoice.py177
-rw-r--r--addons/sale_analytic_plans/i18n/hr.po2
-rw-r--r--addons/sale_delivery_report/i18n/sv.po22
-rw-r--r--addons/sale_journal/i18n/hr.po2
-rw-r--r--addons/stock/__init__.py2
-rw-r--r--addons/stock/__terp__.py16
-rw-r--r--addons/stock/i18n/fr.po26
-rw-r--r--addons/stock/i18n/zh_CN.po40
-rw-r--r--addons/stock/product.py122
-rw-r--r--addons/stock/product_view.xml14
-rw-r--r--addons/stock/report/report_stock_view.xml4
-rw-r--r--addons/stock/security/ir.model.access.csv11
-rw-r--r--addons/stock/security/stock_security.xml26
-rw-r--r--addons/stock/stock.py326
-rw-r--r--addons/stock/stock_report.xml8
-rw-r--r--addons/stock/stock_sequence.xml57
-rw-r--r--addons/stock/stock_view.xml855
-rw-r--r--addons/stock/stock_wizard.xml73
-rw-r--r--addons/stock/wizard/__init__.py20
-rw-r--r--addons/stock/wizard/inventory_merge.py98
-rw-r--r--addons/stock/wizard/inventory_merge_zero.py124
-rw-r--r--addons/stock/wizard/stock_change_standard_price.py115
-rw-r--r--addons/stock/wizard/stock_change_standard_price_view.xml32
-rw-r--r--addons/stock/wizard/stock_fill_inventory_view.xml31
-rw-r--r--addons/stock/wizard/stock_inventory_line_split_view.xml46
-rw-r--r--addons/stock/wizard/stock_inventory_merge.py83
-rw-r--r--addons/stock/wizard/stock_inventory_set_stock_zero_view.xml31
-rw-r--r--addons/stock/wizard/stock_invoice_onshipping_view.xml33
-rw-r--r--addons/stock/wizard/stock_location_product_view.xml34
-rw-r--r--addons/stock/wizard/stock_move.py (renamed from addons/stock/stock_wizard.py)140
-rw-r--r--addons/stock/wizard/stock_move_view.xml (renamed from addons/stock/stock_wizard_view.xml)0
-rw-r--r--addons/stock/wizard/stock_partial_move.py217
-rw-r--r--addons/stock/wizard/stock_partial_move_view.xml25
-rw-r--r--addons/stock/wizard/stock_partial_picking.py235
-rw-r--r--addons/stock/wizard/stock_partial_picking_view.xml13
-rw-r--r--addons/stock/wizard/stock_picking_make.py (renamed from addons/stock/wizard/wizard_picking_make.py)22
-rw-r--r--addons/stock/wizard/stock_traceability.py112
-rw-r--r--addons/stock/wizard/stock_traceability_view.xml114
-rw-r--r--addons/stock/wizard/wizard_inventory.py165
-rw-r--r--addons/stock/wizard/wizard_invoice_onshipping.py246
-rwxr-xr-xaddons/stock/wizard/wizard_location_product.py87
-rw-r--r--addons/stock/wizard/wizard_partial_move.py220
-rw-r--r--addons/stock/wizard/wizard_partial_picking.py252
-rw-r--r--addons/stock/wizard/wizard_split_inventory_lots.py193
-rw-r--r--addons/stock_invoice_directly/i18n/pt_BR.po2
-rw-r--r--addons/stock_planning/__init__.py (renamed from addons/mrp/wizard/wizard_price.py)29
-rw-r--r--addons/stock_planning/__terp__.py146
-rw-r--r--addons/stock_planning/security/ir.model.access.csv7
-rw-r--r--addons/stock_planning/stock_planning.py1009
-rw-r--r--addons/stock_planning/stock_planning_view.xml432
-rw-r--r--addons/thunderbird/partner/partner.py7
-rwxr-xr-xaddons/thunderbird/plugin/tiny_plugin-2.0.xpibin65188 -> 65042 bytes
315 files changed, 10885 insertions, 6155 deletions
diff --git a/addons/account/i18n/cs.po b/addons/account/i18n/cs.po
index 932d4e3cf3d..417964044e5 100644
--- a/addons/account/i18n/cs.po
+++ b/addons/account/i18n/cs.po
@@ -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-03-17 20:55+0000\n"
+"PO-Revision-Date: 2010-03-28 20:40+0000\n"
"Last-Translator: mitev.dmitry <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-03-18 04:34+0000\n"
+"X-Launchpad-Export-Date: 2010-03-29 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -110,7 +110,7 @@ msgstr "Vytištěné reporty o daních"
#. module: account
#: field:account.account,parent_id:0
msgid "Parent"
-msgstr ""
+msgstr "Rodič"
#. module: account
#: selection:account.move,type:0
@@ -415,7 +415,7 @@ msgstr "Datum:"
#. module: account
#: selection:account.account.type,sign:0
msgid "Negative"
-msgstr ""
+msgstr "Negativ"
#. module: account
#: rml:account.partner.balance:0
diff --git a/addons/account/i18n/pt_BR.po b/addons/account/i18n/pt_BR.po
index 117d5f3975a..11692706164 100644
--- a/addons/account/i18n/pt_BR.po
+++ b/addons/account/i18n/pt_BR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
diff --git a/addons/account/i18n/sv.po b/addons/account/i18n/sv.po
index 6dfa3106b60..74c60176c3a 100644
--- a/addons/account/i18n/sv.po
+++ b/addons/account/i18n/sv.po
@@ -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-03-23 16:02+0000\n"
-"Last-Translator: djn (Xclude) <Unknown>\n"
+"PO-Revision-Date: 2010-03-24 14:33+0000\n"
+"Last-Translator: Anders Eriksson (Mobila System) <ae@mobilasystem.se>\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-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -24,7 +24,7 @@ msgstr "Internt namn"
#. module: account
#: view:account.tax.code:0
msgid "Account Tax Code"
-msgstr "Skattekontokod"
+msgstr "Konto, skattekod"
#. module: account
#: model:ir.actions.act_window,name:account.action_invoice_tree9
@@ -45,7 +45,7 @@ msgstr "Ange meddelande till rapporten försenade betalningar."
#. module: account
#: model:process.transition,name:account.process_transition_confirmstatementfromdraft0
msgid "Confirm statement from draft"
-msgstr "Bekräfta verifikat från utkast"
+msgstr "Bekräfta preliminära verifikat"
#. module: account
#: model:account.account.type,name:account.account_type_asset
@@ -55,7 +55,7 @@ msgstr "Tillgång"
#. module: account
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr "Ogiltigt modellnamn i åtgärdsdefinitionen."
+msgstr "Felaktigt namn för modell i händelsedefinitionen."
#. module: account
#: help:account.journal,currency:0
@@ -112,7 +112,7 @@ msgstr "Skriv ut momsrapport"
#. module: account
#: field:account.account,parent_id:0
msgid "Parent"
-msgstr "Ovanliggande"
+msgstr "Överliggande"
#. module: account
#: selection:account.move,type:0
@@ -141,7 +141,7 @@ msgstr "Ej avstämda transaktioner"
#. module: account
#: constraint:account.period:0
msgid "Error ! The duration of the Period(s) is/are invalid. "
-msgstr "Fel ! Varaktigheten i perioden/erna är felaktig "
+msgstr "Fel! Fel periodintervall. "
#. module: account
#: view:account.bank.statement.reconcile:0
@@ -262,7 +262,7 @@ msgstr "Summa Debet"
#. module: account
#: rml:account.tax.code.entries:0
msgid "Accounting Entries-"
-msgstr "Bokföringstransaktioner"
+msgstr "Bokföringstransaktioner-"
#. module: account
#: help:account.journal,view_id:0
@@ -272,8 +272,8 @@ msgid ""
"in which order. You can create your own view for a faster encoding in each "
"journal."
msgstr ""
-"Ger vyn som används när du skriver eller surfar poster i journalen. Vyn "
-"berättar för Open ERP vilka fält som ska synas, krävs eller skrivskyddas och "
+"Ger vyn som används när du skriver eller bläddrar poster i journalen. Vyn "
+"berättar för OpenERP vilka fält som ska synas, krävs eller skrivskyddas och "
"i vilken ordning. Du kan skapa din egen vy för en snabbare kodning i varje "
"journal."
@@ -287,8 +287,8 @@ msgid ""
"due dates, for example 50% now, 50% in one month."
msgstr ""
"Om du använder betalningsvillkor, förfallodagen kommer att beräknas "
-"automatiskt vid generering av bokföringsposter. Om du håller "
-"betalningsvillkor och förfallodagen tom betyder det direkt betalning. "
+"automatiskt vid generering av bokföringsposter. Om du lämnar "
+"betalningsvillkor och förfallodagen tomma betyder det direkt betalning. "
"Betalningsvillkor kan beräkna flera förfallodatum, till exempel 50% nu, 50% "
"efter en månad."
@@ -319,7 +319,7 @@ msgstr "Välj period"
#: field:account.invoice,origin:0
#: field:account.invoice.line,origin:0
msgid "Origin"
-msgstr "Ursprung"
+msgstr "Orginal"
#. module: account
#: rml:account.analytic.account.journal:0
@@ -364,7 +364,7 @@ msgstr "Debettransaktion"
#: field:account.move.line,analytic_account_id:0
#: field:report.hr.timesheet.invoice.journal,account_id:0
msgid "Analytic Account"
-msgstr "Objektkonto"
+msgstr "Objekt"
#. module: account
#: field:account.tax,child_depend:0
@@ -382,7 +382,7 @@ msgstr "Journalnamn"
#. module: account
#: view:account.payment.term:0
msgid "Description on invoices"
-msgstr "Beskrivning på faktura"
+msgstr "Beskrivning på fakturor"
#. module: account
#: constraint:account.analytic.account:0
@@ -434,7 +434,7 @@ msgstr "Negativ"
#. module: account
#: rml:account.partner.balance:0
msgid "(Account/Partner) Name"
-msgstr "(Konto/Företag) namn"
+msgstr "(Konto/Partner) namn"
#. module: account
#: selection:account.move,type:0
@@ -509,7 +509,7 @@ msgstr ""
#. module: account
#: view:report.hr.timesheet.invoice.journal:0
msgid "Analytic Entries Stats"
-msgstr "Objektposter"
+msgstr "Objektposter statistikKredit ber"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_tax_code_template_form
@@ -526,7 +526,7 @@ msgstr "Leverantörsfaktura"
#: model:process.transition,name:account.process_transition_reconcilepaid0
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
msgid "Reconcile Paid"
-msgstr ""
+msgstr "Kreditering betald"
#. module: account
#: wizard_field:account.chart,init,target_move:0
@@ -542,7 +542,7 @@ msgstr "Momsmallar"
#. module: account
#: field:account.invoice,reconciled:0
msgid "Paid/Reconciled"
-msgstr ""
+msgstr "Betald/Återbetald"
#. module: account
#: field:account.account.type,close_method:0
@@ -552,7 +552,7 @@ msgstr ""
#. module: account
#: field:account.tax.template,include_base_amount:0
msgid "Include in Base Amount"
-msgstr ""
+msgstr "Inkluder i basbeloppet"
#. module: account
#: field:account.tax,ref_base_code_id:0
@@ -2071,7 +2071,7 @@ msgstr "Preliminär faktura"
#. module: account
#: model:account.account.type,name:account.account_type_expense
msgid "Expense"
-msgstr "Kostnad"
+msgstr "Utgift"
#. module: account
#: field:account.journal,invoice_sequence_id:0
@@ -3268,7 +3268,7 @@ msgstr "Kod"
#. module: account
#: model:ir.ui.menu,name:account.menu_finance
msgid "Financial Management"
-msgstr "Bokföring"
+msgstr "Redovisning"
#. module: account
#: selection:account.account.type,close_method:0
@@ -3664,7 +3664,7 @@ msgstr ""
#: field:account.tax.template,sequence:0
#: field:fiscalyear.seq,sequence_id:0
msgid "Sequence"
-msgstr "Nummerserie"
+msgstr "Sekvens"
#. module: account
#: model:ir.model,name:account.model_account_fiscal_position_template
@@ -4140,7 +4140,7 @@ msgstr "Valuta för boken"
#: view:account.journal.column:0
#: model:ir.model,name:account.model_account_journal_column
msgid "Journal Column"
-msgstr ""
+msgstr "Journalkolumn"
#. module: account
#: selection:account.fiscalyear,state:0
diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po
index 8b5131c0683..8d2ee5edb76 100644
--- a/addons/account/i18n/zh_CN.po
+++ b/addons/account/i18n/zh_CN.po
@@ -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-03-20 07:43+0000\n"
-"Last-Translator: Black Jack <onetimespeed@hotmail.com>\n"
+"PO-Revision-Date: 2010-03-29 00:34+0000\n"
+"Last-Translator: digitalsatori <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-03-21 04:42+0000\n"
+"X-Launchpad-Export-Date: 2010-03-29 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@@ -896,7 +896,7 @@ msgstr "货币金额"
#. module: account
#: field:account.chart.template,property_account_expense_categ:0
msgid "Expense Category Account"
-msgstr ""
+msgstr "费用类科目"
#. module: account
#: wizard_field:account.fiscalyear.close,init,fy2_id:0
@@ -1110,7 +1110,7 @@ msgstr "列表模板"
#. module: account
#: field:account.chart.template,property_account_income_categ:0
msgid "Income Category Account"
-msgstr ""
+msgstr "收入类科目"
#. module: account
#: model:ir.actions.act_window,name:account.analytic_account_form
diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml
index f551d77ccaa..cd9727d5903 100644
--- a/addons/account/security/account_security.xml
+++ b/addons/account/security/account_security.xml
@@ -46,7 +46,7 @@
<field model="ir.model.fields" name="field_id" search="[('model','=','account.move'),('name','=','company_id')]"/>
<field name="operator">child_of</field>
<field name="operand">user.company_id.id</field>
- <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
<field name="rule_group" ref="account_move_comp_rule_group"/>
</record>
@@ -60,7 +60,7 @@
<field model="ir.model.fields" name="field_id" search="[('model','=','account.move.line'),('name','=','company_id')]"/>
<field name="operator">child_of</field>
<field name="operand">user.company_id.id</field>
- <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
<field name="rule_group" ref="account_move_line_comp_rule_group"/>
</record>
<record id="journal_period_comp_rule_group" model="ir.rule.group">
@@ -72,7 +72,7 @@
<field model="ir.model.fields" name="field_id" search="[('model','=','account.journal.period'),('name','=','company_id')]"/>
<field name="operator">child_of</field>
<field name="operand">user.company_id.id</field>
- <field name="domain_force">['|','|',('company_id','=',False),('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
<field name="rule_group" ref="journal_period_comp_rule_group"/>
</record>
@@ -85,7 +85,7 @@
<field model="ir.model.fields" name="field_id" search="[('model','=','account.journal'),('name','=','company_id')]"/>
<field name="operator">child_of</field>
<field name="operand">user.company_id.id</field>
- <field name="domain_force">['|','|',('company_id','=',False),('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|','|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
<field name="rule_group" ref="journal_comp_rule_group"/>
</record>
<record id="analytic_journal_comp_rule_group" model="ir.rule.group">
diff --git a/addons/account_analytic_default/i18n/zh_CN.po b/addons/account_analytic_default/i18n/zh_CN.po
index a20701c0aae..a37b184a372 100644
--- a/addons/account_analytic_default/i18n/zh_CN.po
+++ b/addons/account_analytic_default/i18n/zh_CN.po
@@ -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-03-20 03:48+0000\n"
-"Last-Translator: Black Jack <onetimespeed@hotmail.com>\n"
+"PO-Revision-Date: 2010-03-29 00:37+0000\n"
+"Last-Translator: digitalsatori <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-03-21 04:42+0000\n"
+"X-Launchpad-Export-Date: 2010-03-29 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_analytic_default
@@ -42,7 +42,7 @@ msgstr "这对象名必须以x_开头并且不能包含特殊的字符!"
#. module: account_analytic_default
#: view:account.analytic.default:0
msgid "Seq"
-msgstr ""
+msgstr "序号"
#. module: account_analytic_default
#: field:account.analytic.default,date_stop:0
diff --git a/addons/account_analytic_plans/i18n/oc.po b/addons/account_analytic_plans/i18n/oc.po
new file mode 100644
index 00000000000..c697c75a25c
--- /dev/null
+++ b/addons/account_analytic_plans/i18n/oc.po
@@ -0,0 +1,376 @@
+# Occitan (post 1500) 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-03-25 12:58+0000\n"
+"Last-Translator: Cédric VALMARY (Per Tot en òc) <cvalmary@yahoo.fr>\n"
+"Language-Team: Occitan (post 1500) <oc@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-03-27 05:00+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,account4_ids:0
+msgid "Account4 Id"
+msgstr ""
+
+#. module: account_analytic_plans
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+"Lo nom de l'objècte deu començar amb x_ e conténer pas de caractèrs "
+"especials !"
+
+#. module: account_analytic_plans
+#: model:ir.actions.report.xml,name:account_analytic_plans.account_analytic_account_crossovered_analytic
+#: model:ir.actions.wizard,name:account_analytic_plans.account_analytic_account_inverted_balance_report
+msgid "Crossovered Analytic"
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,account5_ids:0
+msgid "Account5 Id"
+msgstr "Identificant del Compte5"
+
+#. module: account_analytic_plans
+#: wizard_field:wizard.crossovered.analytic,init,date2:0
+msgid "End Date"
+msgstr "Data de fin"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance.line,rate:0
+msgid "Rate (%)"
+msgstr "Taus (%)"
+
+#. module: account_analytic_plans
+#: view:account.analytic.plan:0
+#: field:account.analytic.plan,name:0
+#: field:account.analytic.plan.line,plan_id:0
+#: model:ir.actions.act_window,name:account_analytic_plans.account_analytic_plan_form_action
+#: model:ir.ui.menu,name:account_analytic_plans.menu_account_analytic_plan_action
+msgid "Analytic Plan"
+msgstr "Plan Analitic"
+
+#. module: account_analytic_plans
+#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_instance_line
+msgid "Analytic Instance Line"
+msgstr ""
+
+#. module: account_analytic_plans
+#: view:account.analytic.plan.instance.line:0
+msgid "Analytic Distribution Lines"
+msgstr ""
+
+#. module: account_analytic_plans
+#: wizard_button:wizard.crossovered.analytic,init,print:0
+msgid "Print"
+msgstr "Estampar"
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "To Date"
+msgstr "Data de Fin"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance.line,plan_id:0
+msgid "Plan Id"
+msgstr "Identificant del Plan"
+
+#. module: account_analytic_plans
+#: model:ir.actions.act_window,name:account_analytic_plans.account_analytic_plan_instance_action
+msgid "Analytic Distribution's Models"
+msgstr ""
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Account Name"
+msgstr "Nom del compte"
+
+#. module: account_analytic_plans
+#: view:account.analytic.plan.instance.line:0
+msgid "Analytic Distribution Line"
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,code:0
+msgid "Distribution Code"
+msgstr ""
+
+#. module: account_analytic_plans
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nom del Modèl invalid per la definicion de l'accion."
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.line,name:0
+msgid "Plan Name"
+msgstr "Nom del Plan"
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Printing date"
+msgstr "Data d'estampatge"
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Percentage"
+msgstr "Percentatge"
+
+#. module: account_analytic_plans
+#: wizard_field:wizard.crossovered.analytic,init,empty_line:0
+msgid "Dont show empty lines"
+msgstr ""
+
+#. module: account_analytic_plans
+#: wizard_view:wizard.crossovered.analytic,init:0
+msgid "Select Information"
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,account3_ids:0
+msgid "Account3 Id"
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,journal_id:0
+#: wizard_field:wizard.crossovered.analytic,init,journal_ids:0
+msgid "Analytic Journal"
+msgstr "Jornal analitic"
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "100.00%"
+msgstr "100.00%"
+
+#. module: account_analytic_plans
+#: wizard_field:wizard.crossovered.analytic,init,ref:0
+msgid "Analytic Account Ref."
+msgstr ""
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Analytic Account :"
+msgstr "Compte Analitic :"
+
+#. module: account_analytic_plans
+#: view:account.analytic.plan.line:0
+msgid "Analytic Plan Line"
+msgstr ""
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Analytic Account Reference:"
+msgstr ""
+
+#. module: account_analytic_plans
+#: model:ir.actions.wizard,name:account_analytic_plans.create_model
+msgid "Create Model"
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan,default_instance_id:0
+msgid "Default Entries"
+msgstr ""
+
+#. module: account_analytic_plans
+#: view:account.analytic.plan:0
+#: field:account.analytic.plan,plan_ids:0
+#: field:account.journal,plan_id:0
+#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan
+msgid "Analytic Plans"
+msgstr "Plans Analitics"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.line,min_required:0
+msgid "Minimum Allowed (%)"
+msgstr "Minimum Permés (%)"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,account1_ids:0
+msgid "Account1 Id"
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.line,max_required:0
+msgid "Maximum Allowed (%)"
+msgstr "Maximum Permés (%)"
+
+#. module: account_analytic_plans
+#: wizard_view:create.model,info:0
+msgid "Distribution Model Saved"
+msgstr ""
+
+#. module: account_analytic_plans
+#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_instance
+msgid "Analytic Plan Instance"
+msgstr ""
+
+#. module: account_analytic_plans
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML invalid per l'arquitectura de la vista"
+
+#. module: account_analytic_plans
+#: model:ir.actions.act_window,name:account_analytic_plans.account_analytic_instance_model_open
+msgid "Distribution Models"
+msgstr ""
+
+#. module: account_analytic_plans
+#: model:ir.module.module,description:account_analytic_plans.module_meta_information
+msgid ""
+"This module allows to use several analytic plans, according to the general "
+"journal,\n"
+"so that multiple analytic lines are created when the invoice or the entries\n"
+"are confirmed.\n"
+"\n"
+"For example, you can define the following analytic structure:\n"
+" Projects\n"
+" Project 1\n"
+" SubProj 1.1\n"
+" SubProj 1.2\n"
+" Project 2\n"
+" Salesman\n"
+" Eric\n"
+" Fabien\n"
+"\n"
+"Here, we have two plans: Projects and Salesman. An invoice line must\n"
+"be able to write analytic entries in the 2 plans: SubProj 1.1 and\n"
+"Fabien. The amount can also be split. The following example is for\n"
+"an invoice that touches the two subproject and assigned to one salesman:\n"
+"\n"
+"Plan1:\n"
+" SubProject 1.1 : 50%\n"
+" SubProject 1.2 : 50%\n"
+"Plan2:\n"
+" Eric: 100%\n"
+"\n"
+"So when this line of invoice will be confirmed, it will generate 3 analytic "
+"lines,\n"
+"for one account entry.\n"
+" "
+msgstr ""
+
+#. module: account_analytic_plans
+#: model:ir.module.module,shortdesc:account_analytic_plans.module_meta_information
+msgid "Multiple-plans management in Analytic Accounting"
+msgstr ""
+
+#. module: account_analytic_plans
+#: view:account.analytic.plan.line:0
+#: model:ir.model,name:account_analytic_plans.model_account_analytic_plan_line
+msgid "Analytic Plan Lines"
+msgstr ""
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Crossovered Analytic -"
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,plan_id:0
+msgid "Model's Plan"
+msgstr "Plan del Modèl"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,account2_ids:0
+msgid "Account2 Id"
+msgstr ""
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Amount"
+msgstr "Montant"
+
+#. module: account_analytic_plans
+#: help:account.analytic.plan.line,root_analytic_id:0
+msgid "Root account of this plan."
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,account6_ids:0
+msgid "Account6 Id"
+msgstr ""
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Quantity"
+msgstr "Quantitat"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance,account_ids:0
+msgid "Account Id"
+msgstr ""
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "Code"
+msgstr "Còde"
+
+#. module: account_analytic_plans
+#: wizard_button:create.model,info,end:0
+msgid "OK"
+msgstr "D'acòrdi"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.line,root_analytic_id:0
+msgid "Root Account"
+msgstr ""
+
+#. module: account_analytic_plans
+#: wizard_view:create.model,info:0
+msgid ""
+"This distribution model has been saved. You will be able to reuse it later."
+msgstr ""
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.line,sequence:0
+msgid "Sequence"
+msgstr "Sequéncia"
+
+#. module: account_analytic_plans
+#: field:account.analytic.plan.instance.line,analytic_account_id:0
+msgid "Analytic Account"
+msgstr "Compte Analitic"
+
+#. module: account_analytic_plans
+#: field:account.analytic.default,analytics_id:0
+#: view:account.analytic.plan.instance:0
+#: field:account.analytic.plan.instance,name:0
+#: field:account.invoice.line,analytics_id:0
+#: field:account.move.line,analytics_id:0
+msgid "Analytic Distribution"
+msgstr ""
+
+#. module: account_analytic_plans
+#: model:ir.ui.menu,name:account_analytic_plans.menu_account_analytic_plan_instance_action
+msgid "Analytic Distribution's models"
+msgstr ""
+
+#. module: account_analytic_plans
+#: wizard_button:wizard.crossovered.analytic,init,end:0
+msgid "Cancel"
+msgstr "Anullar"
+
+#. module: account_analytic_plans
+#: wizard_field:wizard.crossovered.analytic,init,date1:0
+msgid "Start Date"
+msgstr "Data de començament"
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "at"
+msgstr "a"
+
+#. module: account_analytic_plans
+#: rml:account.analytic.account.crossovered.analytic:0
+msgid "From Date"
+msgstr ""
diff --git a/addons/account_anglo_saxon/i18n/es.po b/addons/account_anglo_saxon/i18n/es.po
new file mode 100644
index 00000000000..68e7618ac56
--- /dev/null
+++ b/addons/account_anglo_saxon/i18n/es.po
@@ -0,0 +1,66 @@
+# Spanish 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-24 12:50+0000\n"
+"PO-Revision-Date: 2010-03-24 17:25+0000\n"
+"Last-Translator: relojero <relojero28@gmail.com>\n"
+"Language-Team: Spanish <es@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-03-27 05:00+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: account_anglo_saxon
+#: view:product.category:0
+msgid " Accounting Property"
+msgstr " Contabilidad de la propiedad"
+
+#. module: account_anglo_saxon
+#: model:ir.module.module,description:account_anglo_saxon.module_meta_information
+msgid ""
+"This module will support the Anglo-Saxons accounting methodology by \n"
+" changing the accounting logic with stock transactions. The difference "
+"between the Anglo-Saxon accounting countries \n"
+" and the Rhine or also called Continental accounting countries is the "
+"moment of taking the Cost of Goods Sold versus Cost of Sales. \n"
+" Anglo-Saxons accounting does take the cost when sales invoice is "
+"created, Continental accounting will take the cost at he moment the goods "
+"are shipped.\n"
+" This module will add this functionality by using a interim account, to "
+"store the value of shipped goods and will contra book this interim account \n"
+" when the invoice is created to transfer this amount to the debtor or "
+"creditor account."
+msgstr ""
+
+#. module: account_anglo_saxon
+#: model:ir.module.module,shortdesc:account_anglo_saxon.module_meta_information
+msgid "Stock Account"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: account_anglo_saxon
+#: field:product.category,property_account_creditor_price_difference_categ:0
+#: field:product.template,property_account_creditor_price_difference:0
+msgid "Price Difference Account"
+msgstr "Precio de la cuenta diferencia"
+
+#. module: account_anglo_saxon
+#: help:product.category,property_account_creditor_price_difference_categ:0
+#: help:product.template,property_account_creditor_price_difference:0
+msgid ""
+"This account will be used to value price difference between purchase price "
+"and cost price."
+msgstr ""
+"Esta cuenta se utilizará para valorar la diferencia de precios entre el "
+"precio de compra y precio de coste"
diff --git a/addons/account_chart/i18n/pt_BR.po b/addons/account_chart/i18n/pt_BR.po
index 5ca91351ef7..48873002c79 100644
--- a/addons/account_chart/i18n/pt_BR.po
+++ b/addons/account_chart/i18n/pt_BR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_chart
diff --git a/addons/account_date_check/i18n/pt_BR.po b/addons/account_date_check/i18n/pt_BR.po
index 01484e7d6de..46b422bf9ed 100644
--- a/addons/account_date_check/i18n/pt_BR.po
+++ b/addons/account_date_check/i18n/pt_BR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_date_check
diff --git a/addons/account_payment/i18n/pt_BR.po b/addons/account_payment/i18n/pt_BR.po
index 3292a090a89..0ea750cd530 100644
--- a/addons/account_payment/i18n/pt_BR.po
+++ b/addons/account_payment/i18n/pt_BR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account_payment
diff --git a/addons/analytic_user_function/i18n/hr.po b/addons/analytic_user_function/i18n/hr.po
index d458ac939a6..05b08aca798 100644
--- a/addons/analytic_user_function/i18n/hr.po
+++ b/addons/analytic_user_function/i18n/hr.po
@@ -1,64 +1,66 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * analytic_user_function
-#
+# * analytic_user_function
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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: 2009-09-08 15:12+0000\n"
-"Last-Translator: Ivica Perić <ivica.peric@ipsoft-tg.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 00:56+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 05:03+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: analytic_user_function
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nepravilan XML format za View Architecture!"
#. module: analytic_user_function
#: model:ir.model,name:analytic_user_function.model_analytic_user_funct_grid
msgid "Relation table between users and products on a analytic account"
-msgstr ""
+msgstr "Vza između korisnika i proizvoda kod Analitičkog konta."
#. module: analytic_user_function
#: field:analytic_user_funct_grid,product_id:0
msgid "Product"
-msgstr ""
+msgstr "Proizvod"
#. module: analytic_user_function
#: field:analytic_user_funct_grid,account_id:0
msgid "Analytic Account"
-msgstr ""
+msgstr "Analitički Konto"
#. module: analytic_user_function
#: view:account.analytic.account:0
#: field:account.analytic.account,user_product_ids:0
msgid "Users/Products Rel."
-msgstr ""
+msgstr "veza Korisnici/Proizvodi"
#. module: analytic_user_function
#: field:analytic_user_funct_grid,user_id:0
msgid "User"
-msgstr ""
+msgstr "Korisnik"
#. module: analytic_user_function
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: analytic_user_function
#: model:ir.module.module,shortdesc:analytic_user_function.module_meta_information
msgid "Analytic User Function"
-msgstr ""
+msgstr "Funkcija Analitičkog Korisnika"
#. module: analytic_user_function
#: view:analytic_user_funct_grid:0
msgid "User's Product for this Analytic Account"
-msgstr ""
+msgstr "Korisnikov Proizvod za ovaj Analitički konto."
diff --git a/addons/auction/__terp__.py b/addons/auction/__terp__.py
index ecc91f4e2d2..61e91802f44 100644
--- a/addons/auction/__terp__.py
+++ b/addons/auction/__terp__.py
@@ -38,6 +38,19 @@
'init_xml': ['auction_sequence.xml'],
'update_xml': [
'security/ir.model.access.csv',
+ 'wizard/auction_lots_able_view.xml',
+ 'wizard/auction_lots_enable_view.xml',
+ 'wizard/auction_lots_make_invoice_buyer_view.xml',
+ 'wizard/auction_lots_make_invoice_view.xml',
+ 'wizard/auction_taken_view.xml',
+ 'wizard/auction_lots_auction_move_view.xml',
+ 'wizard/auction_pay_buy_view.xml',
+ 'wizard/auction_payer_sel_view.xml',
+ 'wizard/auction_lots_sms_send_view.xml',
+ 'wizard/auction_catalog_flagey_view.xml',
+# 'wizard/auction_aie_send_result_view.xml',
+ 'wizard/auction_lots_buyer_map_view.xml',
+
'auction_view.xml',
'auction_report.xml',
'auction_wizard.xml'
diff --git a/addons/auction/auction.py b/addons/auction/auction.py
index 0ece4690d9f..1687980c029 100644
--- a/addons/auction/auction.py
+++ b/addons/auction/auction.py
@@ -478,13 +478,13 @@ class auction_lots(osv.osv):
result = [ (r['id'], str(r['obj_num'])+' - '+r['name']) for r in self.read(cr, user, ids, ['name','obj_num'])]
return result
- def name_search(self, cr, user, name, args=[], operator='ilike', context={}):
- try:
- ids = self.search(cr, user, [('obj_num','=',int(name))]+ args)
- except:
- ids = []
+ def name_search(self, cr, user, name, args=None, operator='ilike', context={}):
+ if not args:
+ args = []
+
+ ids = self.search(cr, user, [('obj_num','=',int(name))] + args)
if not ids:
- ids = self.search(cr, user, [('name',operator,name)]+ args)
+ ids = self.search(cr, user, [('name',operator,name)] + args)
return self.name_get(cr, user, ids)
def _sum_taxes_by_type_and_id(self, taxes):
diff --git a/addons/auction/security/ir.model.access.csv b/addons/auction/security/ir.model.access.csv
index 642209edd05..1c1df0828ca 100644
--- a/addons/auction/security/ir.model.access.csv
+++ b/addons/auction/security/ir.model.access.csv
@@ -22,3 +22,13 @@
"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_auction_lots_able","auction.lots.able","model_auction_lots_able","base.group_user",1,0,0,0
+"access_auction_lots_auction_move","auction.lots.auction.move","model_auction_lots_auction_move","base.group_user",1,0,0,0
+"access_auction_lots_enable","auction.lots.enable","model_auction_lots_enable","base.group_user",1,0,0,0
+"access_auction_lots_make_invoice_buyer","auction.lots.make.invoice.buyer","model_auction_lots_make_invoice_buyer","base.group_user",1,0,0,0
+"access_auction_lots_make_invoice","auction.lots.make.invoice","model_auction_lots_make_invoice","base.group_user",1,0,0,0
+"access_auction_lots_sms_send","auction.lots.sms.send","model_auction_lots_sms_send","base.group_user",1,0,0,0
+"access_auction_pay_buy","auction.pay.buy","model_auction_pay_buy","base.group_user",1,0,0,0
+"acess_auction_payer","auction.payer","model_auction_payer","base.group_user",1,0,0,0
+"access_auction_pay_sel","auction.pay.sel","model_auction_payer_sel","base.group_user",1,0,0,0
+"acess_auction_taken","auction.taken","model_auction_taken","base.group_user",1,0,0,0
diff --git a/addons/auction/wizard/__init__.py b/addons/auction/wizard/__init__.py
index ec07ef6e04f..bcd2de8b301 100644
--- a/addons/auction/wizard/__init__.py
+++ b/addons/auction/wizard/__init__.py
@@ -19,24 +19,19 @@
#
##############################################################################
-import wizard_aie_send
-import wizard_aie_send_result
-import wizard_lots_buyer_map
-import wizard_lots_cancel
-import wizard_lots_invoice
-import wizard_lots_numerotate
-import wizard_lots_pay
-import wizard_pay
-import wizard_lots_sms
-import wizard_lot_date_move
-import wizard_auction_journal
-import wizard_auction_invoice_buyer
-import wizard_transfer_unsold_object
-import auction_wizard_enable_taken
-import auction_wizard_able_taken
-import auction_catalog_flagey
-#import wizard_lots_barcode
-import wizard_emporte
-import wizard_payer
+import auction_lots_able
+import auction_lots_enable
+import auction_lots_make_invoice_buyer
+import auction_lots_make_invoice
+import auction_taken
+import auction_lots_auction_move
+import auction_pay_buy
+import auction_payer_sel
+import auction_lots_sms_send
+import auction_catalog_flagey_report
+
+#import auction_aie_send_result
+import auction_lots_buyer_map
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auction/wizard/auction_catalog_flagey_report.py b/addons/auction/wizard/auction_catalog_flagey_report.py
new file mode 100644
index 00000000000..119c3273ee0
--- /dev/null
+++ b/addons/auction/wizard/auction_catalog_flagey_report.py
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+import netsvc
+
+class auction_catalog_flagey(osv.osv_memory):
+ _name = 'auction.catalog.flagey'
+ _description = 'Auction Catalog Flagey'
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ res = super(auction_catalog_flagey, self).default_get(cr, uid, fields, context=context)
+ return res
+
+ def view_init(self, cr, uid, fields, context):
+ current_auction = self.pool.get('auction.dates').browse(cr,uid,context.get('active_ids', []))
+ v_lots = self.pool.get('auction.lots').search(cr,uid,[('auction_id','=',current_auction.id)])
+ v_ids = self.pool.get('auction.lots').browse(cr,uid,v_lots)
+ for ab in v_ids:
+ if not ab.auction_id :
+ raise osv.except_osv('Error!','No Lots belong to this Auction Date')
+ pass
+
+ def print_report(self, cr, uid, ids, context):
+ """
+ Prints auction catalog flagey report.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ @return: Report
+ """
+ datas = {'ids': context.get('active_ids',[])}
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'auction.cat_flagy',
+ 'datas': datas,
+ }
+
+auction_catalog_flagey()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/auction/wizard/auction_catalog_flagey_view.xml b/addons/auction/wizard/auction_catalog_flagey_view.xml
new file mode 100644
index 00000000000..ca87771cc37
--- /dev/null
+++ b/addons/auction/wizard/auction_catalog_flagey_view.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Auction Catalog Flagey Report -->
+
+ <record id="view_auction_catalog_flagey_wizard" model="ir.ui.view">
+ <field name="name">Auction Catalog Flagey</field>
+ <field name="model">auction.catalog.flagey</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Catalog Flagey Report">
+ <label string="Print Auction Catalog Flagey Report..."/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="print_report" string="Ok"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Auction Catalog Flagey"
+ res_model="auction.catalog.flagey"
+ src_model="auction.dates"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_auction_catalog_flagey_wizard"/>
+ </data>
+</openerp>
diff --git a/addons/auction/wizard/auction_lots_buyer_map.py b/addons/auction/wizard/auction_lots_buyer_map.py
new file mode 100644
index 00000000000..db80a2ab3f3
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_buyer_map.py
@@ -0,0 +1,127 @@
+# -*- 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 netsvc
+import sql_db
+from osv import osv,fields
+
+class wiz_auc_lots_buyer_map(osv.osv_memory):
+ _name = 'auction.lots.buyer_map'
+ _description = 'Map Buyer'
+
+ _columns = {
+ 'ach_login': fields.char('Buyer Username', size=64, required=True),
+ 'ach_uid': fields.many2one('res.partner','Buyer', required=True),
+ }
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ ids = context and context.get('active_ids',False) or False
+ assert ids, _('Active IDs not Found')
+ res = super(wiz_auc_lots_buyer_map,self).default_get(cr, uid, fields, context)
+ cr.execute('select id from auction_lots where (ach_uid is null and ach_login is not null) ')
+ v_ids = [x[0] for x in cr.fetchall()]
+ for rec in self.pool.get('auction.lots').browse(cr, uid, v_ids, context):
+ if (not rec.ach_uid or not rec.ach_login):
+ res.update(self._start(cr, uid, ids, context))
+ return res
+ res.update(self._start(cr, uid, ids, context))
+ return res
+
+ def _start(self, cr, uid, ids, context):
+ """
+ Returns login if already there in the selected record.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of ids
+ @param context: A standard dictionary
+ @return: login field from current record.
+ """
+ lots_obj = self.pool.get('auction.lots')
+ for rec in lots_obj.browse(cr, uid, ids, context):
+ if (len(ids)==1) and (not rec.ach_uid and not rec.ach_login):
+ raise osv.except_osv('Error', 'No buyer is set for this lot.')
+ if not rec.ach_uid and rec.ach_login:
+ return {'ach_login': rec.ach_login}
+ return {}
+
+ def buyer_map_set(self, cr, uid, ids, context):
+ """
+ To map the buyer and login name.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of ids
+ @param context: A standard dictionary
+ @return:
+ """
+ rec_ids = context and context.get('active_ids',False) or False
+ assert rec_ids, _('Active IDs not Found')
+ datas = self.read(cr, uid, ids[0],['ach_login','ach_uid'])
+ lots_obj = self.pool.get('auction.lots')
+ recs = lots_obj.browse(cr, uid, rec_ids, context)
+ for rec in recs:
+ if rec.ach_login==datas['ach_login']:
+ lots_obj.write(cr, uid, [rec.id], {'ach_uid': datas['ach_uid']}, context=context)
+ cr.commit()
+ return {}
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form',
+ context=None, toolbar=False, submenu=False):
+ """
+ Changes the view dynamically
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: New arch of view.
+ """
+ record_ids = context and context.get('active_ids', False) or False
+ res = super(wiz_auc_lots_buyer_map, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ lots_obj = self.pool.get('auction.lots')
+ if record_ids:
+ for lots in lots_obj.browse(cr, uid, record_ids):
+ if lots.ach_uid:
+ res['arch'] = """
+ <form title="Mapping Result">
+ <group col="2" colspan="2">
+ <label string="All objects are assigned to buyers !"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel"
+ string="Done" />
+ </group>
+ </form>
+ """
+ return res
+
+wiz_auc_lots_buyer_map()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/auction/wizard/auction_lots_buyer_map_view.xml b/addons/auction/wizard/auction_lots_buyer_map_view.xml
new file mode 100644
index 00000000000..c76c74983d2
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_buyer_map_view.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Auction lots send result -->
+
+ <record id="view_auction_buyer_map" model="ir.ui.view">
+ <field name="name">Map buyer username to Partners</field>
+ <field name="model">auction.lots.buyer_map</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Buyer Map" >
+ <field name="ach_login" colspan="4"/>
+ <newline/>
+ <field name="ach_uid" colspan="4"/>
+ <separator colspan="4"/>
+ <group col="4" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Exit" />
+ <button name="buyer_map_set" string="Update"
+ colspan="2" type="object" icon="gtk-go-forward" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Map buyer username to Partners"
+ res_model="auction.lots.buyer_map"
+ src_model="auction.lots"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_auction_buyer_map"/>
+
+ </data>
+</openerp>
diff --git a/addons/auction/wizard/auction_lots_invoice.py b/addons/auction/wizard/auction_lots_invoice.py
new file mode 100644
index 00000000000..9581941266f
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_invoice.py
@@ -0,0 +1,124 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+import netsvc
+from tools.translate import _
+
+class auction_lots_invoice(osv.osv_memory):
+ _name = 'auction.lots.invoice'
+ _description = "Auction Lots Invoice"
+
+ _columns = {
+ 'amount': fields.float('Invoiced Amount', required=True, readonly=True),
+ 'amount_topay': fields.float('Amount to pay', required=True, readonly=True),
+ 'amount_paid': fields.float('Amount paid', readonly=True),
+ 'objects': fields.integer('# of objects', required=True, readonly=True),
+ 'ach_uid': fields.many2one('res.partner','Buyer Name', required=True ),
+ 'number': fields.integer('Invoice Number'),
+# 'tax_applied':{'string':'Tax Applied', 'type':'float', 'readonly':True},
+ }
+
+ def default_get(self, cr, uid, fields, context={}):
+ """
+ To get default values for the object.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ res = super(auction_lots_invoice, self).default_get(cr, uid, fields, context=context)
+ service = netsvc.LocalService("object_proxy")
+ lots = service.execute(cr.dbname, uid, 'auction.lots', 'read', context.get('active_ids', []))
+ auction = service.execute(cr.dbname,uid, 'auction.dates', 'read', [lots[0]['auction_id'][0]])[0]
+
+ price = 0.0
+ price_topay = 0.0
+ price_paid = 0.0
+ #tax=data['form']['tax_applied']
+# uid = False
+ for lot in lots:
+ price_lot = lot['obj_price'] or 0.0
+
+ costs = service.execute(cr.dbname, uid, 'auction.lots', 'compute_buyer_costs', [lot['id']])
+ price_lot += costs['amount']
+# for cost in costs:
+# price_lot += cost['amount']
+
+ price += price_lot
+
+ if lot['ach_uid']:
+ if uid and (lot['ach_uid'][0]<>uid):
+ raise osv.except_osv(_('UserError'), _('Two different buyers for the same invoice !\nPlease correct this problem before invoicing'))
+ uid = lot['ach_uid'][0]
+ elif lot['ach_login']:
+ refs = service.execute(uid, 'res.partner', 'search', [('ref','=',lot['ach_login'])])
+ if len(refs):
+ uid = refs[-1]
+ if 'ach_pay_id' in lot and lot['ach_pay_id']:
+ price_paid += price_lot
+ #*tax
+ else:
+ price_topay += price_lot
+ #*tax
+
+ #TODO: recuperer id next invoice (de la sequence)???
+ invoice_number = False
+ for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
+ if 'objects' in fields:
+ res.update({'objects':len(context.get('active_ids', []))})
+ if 'amount' in fields:
+ res.update({'amount': price})
+ if 'ach_uid' in fields:
+ res.update({'ach_uid': uid})
+ if 'amount_topay' in fields:
+ res.update({'amount_topay':price_topay})
+ if 'amount_paid' in fields:
+ res.update({'amount_paid':price_paid})
+ if 'number' in fields:
+ res.update({'number':invoice_number})
+ return res
+
+ def print_report(self, cr, uid, ids, context={}):
+ """
+ Create an invoice report.
+ @param cr: the current row, from the database cursor.
+ @param uid: the current user’s ID for security checks.
+ @param ids: List of Auction lots make invoice buyer’s IDs
+ @return: dictionary of account invoice form.
+ """
+ service = netsvc.LocalService("object_proxy")
+ datas = {'ids' : context.get('active_ids',[])}
+ res = self.read(cr, uid, ids, ['number','ach_uid'])
+ res = res and res[0] or {}
+ datas['form'] = res
+# service.execute(cr.dbname, uid, 'auction.lots', 'lots_invoice_and_cancel_old_invoice', datas['ids'], datas['form']['number'], datas['form']['ach_uid'], 'invoice_open')
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'auction.invoice',
+ 'datas' : datas,
+ }
+
+auction_lots_invoice()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auction/wizard/auction_lots_invoice_view.xml b/addons/auction/wizard/auction_lots_invoice_view.xml
new file mode 100644
index 00000000000..4adc7098789
--- /dev/null
+++ b/addons/auction/wizard/auction_lots_invoice_view.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Auction Lots Invoice Report -->
+
+ <record id="view_auction_lots_invoice_wizard" model="ir.ui.view">
+ <field name="name">auction.lots.invoice.wizard</field>
+ <field name="model">auction.lots.invoice</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Paid ?">
+ <field name="amount"/>
+ <field name="objects"/>
+ <field name="amount_topay"/>
+ <field name="amount_paid"/>
+ <newline/>
+ <field name="ach_uid"/>
+ <field name="number"/>
+ <label string="Let this invoice's number"/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="print_report" string="Ok"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Auction Lots Invoice"
+ res_model="auction.lots.invoice"
+ src_model="auction.dates"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_auction_lots_invoice_wizard"/>
+ </data>
+</openerp>
diff --git a/addons/auction/wizard/wizard_auction_invoice_buyer.py b/addons/auction/wizard/wizard_auction_invoice_buyer.py
index 6cf12b5da22..53c3519d225 100644
--- a/addons/auction/wizard/wizard_auction_invoice_buyer.py
+++ b/addons/auction/wizard/wizard_auction_invoice_buyer.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,97 +15,86 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-
-import wizard
+from osv import fields, osv
+from tools.translate import _
import netsvc
import pooler
+import time
+import tools
+import wizard
-invoice_form = '''<?xml version="1.0"?>
-<form title="Paid ?">
- <field name="amount"/>
- <field name="objects"/>
- <field name="number"/>
- <label string="(Keep empty for automatic number)" colspan="2"/>
- <field name="buyer_id"/>
-</form>'''
-
-invoice_fields = {
- 'amount': {'string':'Invoiced Amount', 'type':'float', 'required':True, 'readonly':True},
- 'objects': {'string':'# of objects', 'type':'integer', 'required':True, 'readonly':True},
- 'number': {'string':'Invoice Number', 'type':'char'},
- 'buyer_id':{'string': 'Buyer', 'type': 'many2one', 'relation':'res.partner'}
-
-}
-
-
-def _values(self,cr,uid, datas,context={}):
- pool = pooler.get_pool(cr.dbname)
- lots= pool.get('auction.lots').browse(cr,uid,datas['ids'])
-# price = 0.0
- amount_total=0.0
-# pt_tax=pooler.get_pool(cr.dbname).get('account.tax')
- for lot in lots:
- buyer=lot and lot.ach_uid.id or False
- amount_total+=lot.buyer_price
-# taxes = lot.product_id.taxes_id
-# if lot.author_right:
-# taxes.append(lot.author_right)
-# if lot.auction_id:
-# taxes += lot.auction_id.buyer_costs
-# tax=pt_tax.compute(cr,uid,taxes,lot.obj_price,1)
-# for t in tax:
-# amount_total+=t['amount']
-# amount_total+=lot.obj_price
- # up_auction=pooler.get_pool(cr.dbname).get('auction.lots').write(cr,uid,[lot.id],{'ach_uid':datas['form']['buyer_id']})
- invoice_number = False
- return {'objects':len(datas['ids']), 'amount':amount_total, 'number':invoice_number,'buyer_id':buyer}
-
+class auction_lots_make_invoice_buyer(osv.osv_memory):
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ res = super(auction_lots_make_invoice_buyer, self).default_get(cr, uid, fields, context=context)
+ for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
+ if 'amount' in fields:
+ res.update({'amount': lot.buyer_price})
+ if 'buyer_id' in fields:
+ res.update({'buyer_id': lot.ach_uid and lot.ach_uid.id or False})
+ if 'objects' in fields:
+ res.update({'objects': len(context['active_ids'])})
+ return res
-def _makeInvoices(self, cr, uid, data, context):
- newinv = []
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('auction.lots')
- mod_obj = pool.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
- id = mod_obj.read(cr, uid, result, ['res_id'])
- lots= order_obj.browse(cr,uid,data['ids'])
- invoice_number=data['form']['number']
- for lot in lots:
- up_auction=pooler.get_pool(cr.dbname).get('auction.lots').write(cr,uid,[lot.id],{'ach_uid':data['form']['buyer_id']})
- ids = order_obj.lots_invoice(cr, uid, data['ids'],context,data['form']['number'])
-# ids = order_obj.lots_invoice(cr, uid, data['ids'],context,invoice_number)
- cr.commit()
- return {
- 'domain': "[('id','in', ["+','.join(map(str, ids))+"])]",
- 'name': 'Buyer invoices',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.invoice',
- 'view_id': False,
- 'context': "{'type':'in_refund'}",
- 'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id']
- }
- return {}
+ def makeInvoices(self, cr, uid, ids, context):
+ """
+ Create an invoice for selected lots (IDS) to BUYER_ID .
+ @param cr: the current row, from the database cursor.
+ @param uid: the current user’s ID for security checks.
+ @param ids: List of Auction lots make invoice buyer’s IDs
+ @return: dictionary of account invoice form.
+ """
+ newinv = []
-class make_invoice(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [_values],
- 'result' : {'type' : 'form',
- 'arch' : invoice_form,
- 'fields' : invoice_fields,
- 'state' : [('end', 'Cancel'),('invoice', 'Create invoices')]}
- },
- 'invoice' : {
- 'actions' : [],
- 'result' : {'type' : 'action',
- 'action' : _makeInvoices}
- },
- }
-make_invoice("auction.lots.make_invoice_buyer")
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+ order_obj = self.pool.get('auction.lots')
+ mod_obj = self.pool.get('ir.model.data')
+
+ for data in self.read(cr, uid, ids):
+ result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'])
+ lots = order_obj.browse(cr, uid, context['active_ids'])
+ invoice_number = data['number']
+ for lot in lots:
+ up_auction = order_obj.write(cr, uid, [lot.id], {'ach_uid':data['buyer_id']})
+ ids = order_obj.lots_invoice(cr, uid, context['active_ids'], context, data['number'])
+ cr.commit()
+ return {
+ 'domain': "[('id','in', ["+','.join(map(str, ids))+"])]",
+ 'name': 'Buyer invoices',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.invoice',
+ 'view_id': False,
+ 'context': "{'type':'in_refund'}",
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id']
+ }
+
+ _name = "auction.lots.make.invoice.buyer"
+ _description = "Make invoice buyer "
+ _columns= {
+ 'amount': fields.float('Invoiced Amount', required =True, readonly=True),
+ 'objects':fields.integer('# of objects', required =True, readonly=True),
+ 'number':fields.char('Invoice Number', size=64),
+ 'buyer_id':fields.many2one('res.partner', 'Buyer', required=True),
+ }
+ _defaults={
+ 'number':lambda *a: False,
+ }
+auction_lots_make_invoice_buyer()
diff --git a/addons/auction/wizard/wizard_auction_journal.py b/addons/auction/wizard/wizard_auction_journal.py
index 79329592165..6be49f7336a 100644
--- a/addons/auction/wizard/wizard_auction_journal.py
+++ b/addons/auction/wizard/wizard_auction_journal.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,91 +15,82 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-
-import wizard
+from osv import fields, osv
+from tools.translate import _
import netsvc
import pooler
+import time
+import tools
+import wizard
+class auction_lots_make_invoice(osv.osv_memory):
+
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ res = super(auction_lots_make_invoice, self).default_get(cr, uid, fields, context=context)
+ for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
+ if 'amount' in fields:
+ res.update({'amount': lot.buyer_price})
+ if 'objects' in fields:
+ res.update({'objects': len(context['active_ids'])})
+ return res
+
+ def makeInvoices(self, cr, uid, ids, context):
+ """
+ seller invoice :Create an invoice.
+ @param cr: the current row, from the database cursor.
+ @param uid: the current user’s ID for security checks.
+ @param ids: List of Auction lots make invoice’s IDs
+ @return: dictionary of account invoice form.
+ """
+ order_obj = self.pool.get('auction.lots')
+ mod_obj = self.pool.get('ir.model.data')
+
+ for data in self.read(cr, uid, ids):
+ result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'])
+ newinv = []
+ ids = order_obj.seller_trans_create(cr, uid, context['active_ids'], context)
+ cr.commit()
+ return {
+ 'domain': "[('id','in', ["+','.join(map(str, ids))+"])]",
+ 'name': 'Seller invoices',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.invoice',
+ 'view_id': False,
+ 'context': "{'type':'out_refund'}",
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id']
+ }
+
+ _name = "auction.lots.make.invoice"
+ _description = "Make invoice"
+ _columns= {
+ 'amount': fields.float('Invoiced Amount', required =True, readonly=True),
+ 'objects':fields.integer('# of objects', required =True, readonly=True),
+ 'number':fields.char('Invoice Number', size=64),
+
+ }
+ _defaults={
+ 'number':lambda *a: False,
+
+ }
-invoice_form = '''<?xml version="1.0"?>
-<form title="Paid ?">
- <field name="amount"/>
- <field name="objects"/>
- <field name="number" colspan="3"/>
-</form>'''
-
-invoice_fields = {
- 'amount': {'string':'Invoiced Amount', 'type':'float', 'required':True, 'readonly':True},
- 'objects': {'string':'# of objects', 'type':'integer', 'required':True, 'readonly':True},
- 'number': {'string':'Invoice Number', 'type':'integer'},
-}
-
-def _values(self,cr,uid, datas,context={}):
- lots= pooler.get_pool(cr.dbname).get('auction.lots').browse(cr,uid,datas['ids'])
-# service = netsvc.LocalService("object_proxy")
-# lots = service.execute(cr,uid, 'auction.lots', 'read', datas['ids'])
-# auction = service.execute(cr,uid, 'auction.dates', 'read', [lots[0]['auction_id'][0]])[0]
- price = 0.0
- amount_total=0.0
- pt_tax=pooler.get_pool(cr.dbname).get('account.tax')
- for lot in lots:
- # taxes = lot.product_id.taxes_id
- # if lot.bord_vnd_id.tax_id:
- # taxes.append(lot.bord_vnd_id.tax_id)
- # if lot.auction_id:
- # taxes += lot.auction_id.seller_costs
- # tax=pt_tax.compute(cr,uid,taxes,lot.obj_price,1)
- # for t in tax:
- # amount_total+=t['amount']
- # amount_total+=lot.obj_price
- amount_total+=lot.seller_price
-#TODO: recuperer id next invoice (de la sequence)???
- invoice_number = False
- return {'objects':len(datas['ids']), 'amount':amount_total, 'number':invoice_number}
-
-def _makeInvoices(self, cr, uid, data, context):
-
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('auction.lots')
- mod_obj = pool.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
- id = mod_obj.read(cr, uid, result, ['res_id'])
- newinv = []
- ids = order_obj.seller_trans_create(cr, uid, data['ids'],context)
- cr.commit()
- return {
- 'domain': "[('id','in', ["+','.join(map(str, ids))+"])]",
- 'name': 'Seller invoices',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.invoice',
- 'view_id': False,
- 'context': "{'type':'out_refund'}",
- 'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id']
- }
- return {}
-
-class make_invoice(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [_values],
- 'result' : {'type' : 'form',
- 'arch' : invoice_form,
- 'fields' : invoice_fields,
- 'state' : [('end', 'Cancel'),('invoice', 'Create invoices')]}
- },
- 'invoice' : {
- 'actions' : [_makeInvoices],
- 'result' : {'type' : 'action',
- 'action' : _makeInvoices,
- 'state' : 'end'}
- },
- }
-make_invoice("auction.lots.make_invoice")
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+auction_lots_make_invoice()
diff --git a/addons/auction/wizard/wizard_emporte.py b/addons/auction/wizard/wizard_emporte.py
index 1172404e218..63c3db7583c 100644
--- a/addons/auction/wizard/wizard_emporte.py
+++ b/addons/auction/wizard/wizard_emporte.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,59 +15,43 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-
-import wizard
+from osv import fields, osv
+from tools.translate import _
import netsvc
-
import pooler
-from tools.misc import UpdateableStr
-
-
-# Dossier
-
-_lot_arch = """<?xml version="1.0"?>
-<form string="Mark Lots" height="500" width="1000">
- <label string="Select lots which are Sold" colspan="4"/>
- <field name="lot_ids" nolabel="1" colspan="4" domain="[('state','=','sold')]"/>
-</form>
-"""
-_lot_fields = {
- 'lot_ids': {'string':'Lots Emportes','relation':'auction.lots','type':'many2many'}
-}
-
-def _to_xml(s):
- return s.replace('&','&amp;').replace('<','&lt;').replace('>','&gt;')
-
-def _process(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- lot_obj = pool.get('auction.lots')
- if data['form']['lot_ids']:
- lot_obj.write(cr, uid, data['form']['lot_ids'][0][2], {'state':'taken_away'})
- return {'lot_ids': []}
-
-class wizard_reprint(wizard.interface):
- states = {
- 'valid': {
- 'actions': [_process],
- 'result': {'type':'state', 'state':'init'}
- },
- 'init': {
- 'actions': [],
- 'result': {
- 'type':'form',
- 'arch': _lot_arch,
- 'fields': _lot_fields,
- 'state': [
- ('valid',' OK ')
- ],
- }
- }
- }
-wizard_reprint('auction.taken')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+import time
+import tools
+import wizard
+class auction_taken(osv.osv_memory):
+ """
+ Auction lots taken.
+ """
+ _name = "auction.taken"
+ _description = "Auction taken"
+ _columns = {
+ 'lot_ids':fields.many2many('auction.lots', 'auction_taken_rel', 'taken_id', 'lot_id', 'Lots Emportes'),
+
+ }
+
+ def _to_xml(s):
+ return s.replace('&','&amp;').replace('<','&lt;').replace('>','&gt;')
+
+ def process(self, cr, uid, ids, context):
+ """
+ Update Auction lots state to taken_away.
+ @param cr: the current row, from the database cursor.
+ @param uid: the current user’s ID for security checks.
+ @param ids: List of Auction taken’s IDs
+ @return: dictionary of lot_ids fields with empty list
+ """
+ lot_obj = self.pool.get('auction.lots')
+ for data in self.read(cr, uid, ids):
+ if data['lot_ids']:
+ lot_obj.write(cr, uid, data['lot_ids'], {'state':'taken_away'})
+ return {'lot_ids': []}
+
+auction_taken()
diff --git a/addons/auction/wizard/wizard_lot_date_move.py b/addons/auction/wizard/wizard_lot_date_move.py
index e6e13ea0ab2..24b2604d1d7 100644
--- a/addons/auction/wizard/wizard_lot_date_move.py
+++ b/addons/auction/wizard/wizard_lot_date_move.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,82 +15,74 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import wizard
+from osv import fields, osv
+from tools.translate import _
import netsvc
import pooler
-import sql_db
-
-auction_move = '''<?xml version="1.0"?>
-<form string="Change Auction Date">
- <group col="1" colspan="2">
- <label string="Warning, this will erase the object adjudication price and its buyer !" colspan="2"/>
- </group>
- <newline/>
- <field name="auction_id"/>
-</form>'''
-
-auction_move_fields = {
- 'auction_id': {'string':'Auction Date', 'type':'many2one', 'required':True, 'relation':'auction.dates'},
-}
+import time
+import tools
+import wizard
-#def _auction_move_set(self, uid, datas):
-# if datas['form']['auction_id']:
-# cr = sql_db.db.cursor()
-# cr.execute('update auction_lots set auction_id=%s, obj_price=NULL, ach_login=NULL, ach_uid=NULL, ach_pay_id=NULL, ach_inv_id=NULL, state=%s where id in ('+','.join(map(str, datas['ids']))+')', (str(datas['form']['auction_id']), 'draft'))
-# cr.execute('delete from auction_bid_line where lot_id in ('+','.join(map(str, datas['ids']))+')')
-# cr.commit()
-# cr.close()
-# return {}
-def _top(self,cr,uid,datas,context={}):
- refs = pooler.get_pool(cr.dbname).get('auction.lots')
- rec_ids = refs.browse(cr,uid,datas['ids'])
- for rec in rec_ids:
- if not rec.auction_id:
- raise wizard.except_wizard('Error !','You can not move a lot that has no auction date')
- return {}
-def _auction_move_set(self,cr,uid,datas,context={}):
- if not (datas['form']['auction_id'] and len(datas['ids'])) :
+class auction_lots_auction_move(osv.osv_memory):
+
+ _name = "auction.lots.auction.move"
+ _description = "Auction move "
+ _columns= {
+ 'auction_id':fields.many2one('auction.dates', 'Auction Date', required=True),
+ }
+
+ def _top(self, cr, uid, ids, context={}):
+ refs = self.pool.get('auction.lots')
+ rec_ids = refs.browse(cr, uid, context['active_ids'])
+ for rec in rec_ids:
+ if not rec.auction_id:
+ raise osv.except_osv('Error !', 'You can not move a lot that has no auction date')
return {}
- refs = pooler.get_pool(cr.dbname).get('auction.lots')
- rec_ids = refs.browse(cr,uid,datas['ids'])
- line_ids= pooler.get_pool(cr.dbname).get('auction.bid_line').search(cr,uid,[('lot_id','in',datas['ids'])])
-# pooler.get_pool(cr.dbname).get('auction.bid_line').unlink(cr, uid, line_ids)
- for rec in rec_ids:
- new_id=pooler.get_pool(cr.dbname).get('auction.lot.history').create(cr,uid,{
- 'auction_id':rec.auction_id.id,
- 'lot_id':rec.id,
- 'price': rec.obj_ret
- })
- up_auction=pooler.get_pool(cr.dbname).get('auction.lots').write(cr,uid,[rec.id],{
- 'auction_id':datas['form']['auction_id'],
- 'obj_ret':None,
- 'obj_price':None,
- 'ach_login':None,
- 'ach_uid':None,
- 'ach_inv_id':None,
- 'sel_inv_id':None,
- 'obj_num':None,
- 'state':'draft'})
- return {}
+ def auction_move_set(self, cr, uid, ids, context={}):
+ """
+ This Function update auction date on auction lots to given auction date.
+ erase the auction lots's object adjudication price and its buyer and change state to draft.
+ create new entry in auction lot history.
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of auction lots auction move’s IDs.
+ """
+ refs = self.pool.get('auction.lots')
+ auction_bid_line_obj = self.pool.get('auction.bid_line')
+ auction_lot_history_obj = self.pool.get('auction.lot.history')
+ auction_lots_obj = self.pool.get('auction.lots')
+ for datas in self.read(cr, uid, ids):
+ if not (datas['auction_id'] and len(context['active_ids'])) :
+ return {}
+
+ rec_ids = refs.browse(cr, uid, context['active_ids'])
+ line_ids = auction_bid_line_obj.search(cr, uid, [('lot_id', 'in', context['active_ids'])])
+ # pooler.get_pool(cr.dbname).get('auction.bid_line').unlink(cr, uid, line_ids)
+ for rec in rec_ids:
+ new_id = auction_lot_history_obj.create(cr, uid, {
+ 'auction_id': rec.auction_id.id,
+ 'lot_id': rec.id,
+ 'price': rec.obj_ret
+ })
+ up_auction = auction_lots_obj.write(cr, uid, [rec.id], {
+ 'auction_id':datas['auction_id'],
+ 'obj_ret': None,
+ 'obj_price': None,
+ 'ach_login': None,
+ 'ach_uid': None,
+ 'ach_inv_id': None,
+ 'sel_inv_id': None,
+ 'obj_num': None,
+ 'state': 'draft'})
+ return {}
-class wiz_auc_lots_auction_move(wizard.interface):
- states = {
- 'init': {
- 'actions': [_top],
- 'result': {'type': 'form', 'arch':auction_move, 'fields': auction_move_fields, 'state':[('set_date', 'Move to Auction date'),('end','Cancel')]}
- },
- 'set_date': {
- 'actions': [_auction_move_set],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
+auction_lots_auction_move()
-wiz_auc_lots_auction_move('auction.lots.auction_move')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auction/wizard/wizard_lots_buyer_map.py b/addons/auction/wizard/wizard_lots_buyer_map.py
deleted file mode 100644
index 42c5f80a530..00000000000
--- a/addons/auction/wizard/wizard_lots_buyer_map.py
+++ /dev/null
@@ -1,107 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import wizard
-import netsvc
-import pooler
-import sql_db
-
-buyer_map = '''<?xml version="1.0"?>
-<form title="Buyer Map">
- <field name="ach_login"/>
- <newline/>
- <field name="ach_uid"/>
-</form>'''
-
-buyer_map_fields = {
- 'ach_login': {'string':'Buyer Username', 'type':'char', 'size':64, 'required':True},
- 'ach_uid': {'string':'Buyer', 'type':'many2one', 'required':True, 'relation':'res.partner'},
-}
-
-
-#
-# Try to find an object not mapped
-#
-def _state_check(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- cr.execute('select id from auction_lots where (ach_uid is null and ach_login is not null) ')
- v_ids=[x[0] for x in cr.fetchall()]
- #ids_not_mapped=pool.get('auction.lots').search(cr,uid,[('rec.ach_uid','=',False)])
- for rec in pool.get('auction.lots').browse(cr,uid,v_ids,context):
- # if not rec.ach_uid and not rec.ach_login:
- # raise wizard.except_wizard ('Error','No username is associated to this lot!')
- if (not rec.ach_uid or not rec.ach_login):
- return 'check'
- return 'done'
-
-def _start(self,cr,uid,datas,context):
- pool = pooler.get_pool(cr.dbname)
- for rec in pool.get('auction.lots').browse(cr,uid,datas['ids'],context):
- if (len(datas['ids'])==1) and (not rec.ach_uid and not rec.ach_login):
- raise wizard.except_wizard('Error', 'No buyer setted for this lot')
- if not rec.ach_uid and rec.ach_login:
- return {'ach_login': rec.ach_login}
-
- for rec in pool.get('auction.lots').browse(cr,uid,datas['ids'],context):
- if (not rec.ach_uid and rec.ach_login):
- return {'ach_login': rec.ach_login}
- return {}
-
-def _buyer_map_set(self,cr, uid, datas,context):
- pool = pooler.get_pool(cr.dbname)
- recs=pool.get('auction.lots').browse(cr,uid,datas['ids'],context)
- for rec in recs:
- if rec.ach_login==datas['form']['ach_login']:
- pool.get('auction.lots').write(cr, uid, [rec.id], {'ach_uid': datas['form']['ach_uid']}, context=context)
- cr.commit()
- return {'ach_login':False, 'ach_uid':False}
-
-class wiz_auc_lots_buyer_map(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'choice', 'next_state':_state_check}
- },
- 'check': {
- 'actions': [_start],
- 'result': {'type': 'form', 'arch':buyer_map, 'fields': buyer_map_fields, 'state':[('end','Exit'),('set_buyer', 'Update')]}
- },
- 'set_buyer': {
- 'actions': [_buyer_map_set],
- 'result': {'type': 'state', 'state':'init'}
- },
- 'done': {
- 'actions': [_start],
- 'result': {
- 'type': 'form',
- 'arch':'''<?xml version="1.0"?>
- <form title="Mapping result">
- <label string="All objects are assigned to buyers !"/>
- </form>''',
- 'fields': {},
- 'state':[('end','Close')]}
- }
- }
-
-wiz_auc_lots_buyer_map('auction.lots.buyer_map')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/auction/wizard/wizard_lots_invoice.py b/addons/auction/wizard/wizard_lots_invoice.py
deleted file mode 100644
index 636b12cc2ff..00000000000
--- a/addons/auction/wizard/wizard_lots_invoice.py
+++ /dev/null
@@ -1,106 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import wizard
-import netsvc
-
-invoice_form = '''<?xml version="1.0"?>
-<form title="Paid ?">
- <field name="amount"/>
- <field name="objects"/>
- <field name="amount_topay"/>
- <field name="amount_paid"/>
- <!--field name= "tax_applied"/>-->
- <newline/>
- <field name="ach_uid" colspan="3"/>
- <field name="number" colspan="3"/>
- <field label="Let this invoice's number "/>
-</form>'''
-
-invoice_fields = {
- 'amount': {'string':'Invoiced Amount', 'type':'float', 'required':True, 'readonly':True},
- 'amount_topay': {'string':'Amount to pay', 'type':'float', 'required':True, 'readonly':True},
- 'amount_paid': {'string':'Amount paid', 'type':'float', 'readonly':True},
- 'objects': {'string':'# of objects', 'type':'integer', 'required':True, 'readonly':True},
- 'ach_uid': {'string':'Buyer Name', 'type':'many2one', 'required':True, 'relation':'res.partner'},
- 'number': {'string':'Invoice Number', 'type':'integer'},
- #'tax_applied':{'string':'Tax Applied', 'type':'float', 'readonly':True},
-}
-
-def _get_value(self,cr,uid, datas,context={}):
- service = netsvc.LocalService("object_proxy")
- lots = service.execute(cr,uid, 'auction.lots', 'read', datas['ids'])
- auction = service.execute(cr,uid, 'auction.dates', 'read', [lots[0]['auction_id'][0]])[0]
-
- price = 0.0
- price_topay = 0.0
- price_paid = 0.0
- #tax=data['form']['tax_applied']
- uid = False
- for lot in lots:
- price_lot = lot['obj_price'] or 0.0
-
- costs = service.execute(uid, 'auction.lots', 'compute_buyer_costs', [lot['id']])
- for cost in costs:
- price_lot += cost['amount']
-
- price += price_lot
-
- if lot['ach_uid']:
- if uid and (lot['ach_uid'][0]<>uid):
- raise wizard.except_wizard('UserError', ('Two different buyers for the same invoice !\nPlease correct this problem before invoicing', 'init'))
- uid = lot['ach_uid'][0]
- elif lot['ach_login']:
- refs = service.execute(uid, 'res.partner', 'search', [('ref','=',lot['ach_login'])])
- if len(refs):
- uid = refs[-1]
- if lot['ach_pay_id']:
- price_paid += price_lot
- #*tax
- else:
- price_topay += price_lot
- #*tax
-
-#TODO: recuperer id next invoice (de la sequence)???
- invoice_number = False
- return {'objects':len(datas['ids']), 'amount':price, 'ach_uid':uid, 'amount_topay':price_topay, 'amount_paid':price_paid, 'number':invoice_number}
-
-def _invoice(self, uid, datas):
- service = netsvc.LocalService("object_proxy")
- service.execute(uid, 'auction.lots', 'lots_invoice_and_cancel_old_invoice', datas['ids'], datas['form']['number'], datas['form']['ach_uid'], 'invoice_open')
- return {}
-
-class wiz_auc_lots_invoice(wizard.interface):
- states = {
- 'init': {
- 'actions': [_get_value],
- 'result': {'type': 'form', 'arch':invoice_form, 'fields': invoice_fields, 'state':[('invoice','Create Invoice'), ('end','Cancel')]}
- },
- 'invoice': {
- 'actions': [_invoice],
- 'result': {'type': 'print', 'report':'auction.invoice', 'state':'end'}
- }
- }
-wiz_auc_lots_invoice('auction.lots.invoice');
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/auction/wizard/wizard_lots_pay.py b/addons/auction/wizard/wizard_lots_pay.py
index a6b8f635ba4..df7b4a794f3 100644
--- a/addons/auction/wizard/wizard_lots_pay.py
+++ b/addons/auction/wizard/wizard_lots_pay.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,89 +15,48 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-
-import wizard
-import netsvc
+from osv import fields, osv
+from tools.translate import _
import netsvc
-import osv
-import time
import pooler
+import time
+import tools
+import wizard
-invoice_form = '''<?xml version="1.0"?>
-<form string="Pay invoice">
- <field name="amount"/>
- <field name="dest_account_id"/>
- <field name="journal_id"/>
- <field name="period_id"/>
-</form>'''
-
-invoice_fields = {
- 'amount': {'string': 'Amount paid', 'type':'float', 'required':True},
- 'dest_account_id': {'string':'Payment to Account', 'type':'many2one', 'required':True, 'relation':'account.account', 'domain':[('type','=','cash')]},
- 'journal_id': {'string': 'Journal', 'type': 'many2one', 'relation':'account.journal', 'required':True},
- 'period_id': {'string': 'Period', 'type': 'many2one', 'relation':'account.period', 'required':True},
-}
-#def pay_n_check(self, cr, uid, data, context):
-#
-# auction = pool.get('auction.lots').browse(cr,uid,data['id'],context)
-# try:
-#
-# for lot in auction:
-#
-# if not lot.auction_id :
-# raise osv.except_osv("Error","No payment defined for this auction.")
-# i=1
-# tot= 0
-# for payment in auction:
-# if not payment.journal_id :
-# raise osv.except_osv("Error","No journal defined for the payment line %d" % (i,))
-# if not payment.ach_inv_id.amount :
-# raise osv.except_osv("Error","No amount defined for the payment line %d." % (i,))
-# i+=1
-# tot+= payment.ach_inv_id.amount
-# if abs(float(tot)) - abs(float(lot.obj_ret)) > 10**-6:
-# raise osv.except_osv("Error","The amount paid does not match the total amount")
-# else:
-# for lot in auction:
-# if not lot.journal_id :
-# raise osv.except_osv("Error","Please choose a journal for the auction ("+lot.name+").")
-# pool.get('auction.lots').create(cr,uid,{
-# 'auction_id': lot.auction.id,
-# 'journal_id': lot.journal_id,
-#
-# })
-# except osv.except_osv, e:
-# raise wizard.except_wizard(e.name, e.name)
-# return True
-def _pay_and_reconcile(self, cr, uid, data, context):
-
- pool = pooler.get_pool(cr.dbname)
- lot = pool.get('auction.lots').browse(cr,uid,data['id'],context)
- form = data['form']
- account_id = form.get('writeoff_acc_id', False)
- period_id = form.get('period_id', False)
- journal_id = form.get('journal_id', False)
- if lot.sel_inv_id:
- p=pool.get('account.invoice').pay_and_reconcile(['lot.sel_inv_id.id'], form['amount'], form['dest_account_id'], journal_id, account_id, period_id, journal_id, context)
-# lots.sel_inv_id.pay_and_reconcile(cr,uid,data[id], form['amount'], form['dest_account_id'], journal_id, account_id, period_id, journal_id, context)
- return {}
-
-
-class wiz_auc_lots_pay(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':invoice_form, 'fields': invoice_fields, 'state':[ ('pay','Pay'), ('end','Cancel')]}
- },
- 'pay': {
- 'actions': [_pay_and_reconcile],
- 'result': {'type': 'state', 'state':'end'}
- }}
-wiz_auc_lots_pay('auction.pay.sel');
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+class auction_pay_sel(osv.osv_memory):
+
+ _name = "auction.pay.sel"
+ _description = "Pay Invoice"
+ _columns= {
+ 'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy'])), required=True),
+ 'dest_account_id':fields.many2one('account.account', 'Payment to Account', required=True, domain= [('type', '=', 'cash')]),
+ 'journal_id':fields.many2one('account.journal', 'Journal', required=True),
+ 'period_id':fields.many2one('account.period', 'Period', required=True),
+ }
+
+ def pay_and_reconcile(self, cr, uid, ids, context):
+
+ """
+ Pay and Reconcile
+
+ @param cr: the current row, from the database cursor.
+ @param uid: the current user’s ID for security checks.
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+ @return:
+ """
+ lot = self.pool.get('auction.lots').browse(cr, uid, context['active_id'], context)
+ invoice_obj = self.pool.get('account.invoice')
+ for datas in self.read(cr, uid, ids):
+ account_id = datas.get('writeoff_acc_id', False)
+ period_id = datas.get('period_id', False)
+ journal_id = datas.get('journal_id', False)
+ if lot.sel_inv_id:
+ p = invoice_obj.pay_and_reconcile(['lot.sel_inv_id.id'], datas['amount'], datas['dest_account_id'], journal_id, account_id, period_id, journal_id, context)
+ # lots.sel_inv_id.pay_and_reconcile(cr,uid,data[id], form['amount'], form['dest_account_id'], journal_id, account_id, period_id, journal_id, context)
+ return {}
+
+auction_pay_sel()
diff --git a/addons/auction/wizard/wizard_lots_sms.py b/addons/auction/wizard/wizard_lots_sms.py
index dc60a9bd24d..a5736ce4990 100644
--- a/addons/auction/wizard/wizard_lots_sms.py
+++ b/addons/auction/wizard/wizard_lots_sms.py
@@ -19,132 +19,60 @@
#
##############################################################################
-import wizard
-import netsvc
-
-import urllib
-
-sms_send_form = '''<?xml version="1.0"?>
-<form title="%s">
- <separator string="%s" colspan="4"/>
- <field name="app_id"/>
- <newline/>
- <field name="user"/>
- <field name="password"/>
- <newline/>
- <field name="text" colspan="3"/>
-</form>''' % ('SMS - Gateway: clickatell', 'Bulk SMS send')
-
-sms_send_fields = {
- 'app_id': {'string':'API ID', 'type':'char', 'required':True},
- 'user': {'string':'Login', 'type':'char', 'required':True},
- 'password': {'string':'Password', 'type':'char', 'required':True},
- 'text': {'string':'SMS Message', 'type':'text', 'required':True, 'value':'Les lots [lots] vous ont etes adjuges. -- Rops'}
-}
-##############################################################################
-#
-# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
-# Fabien Pinckaers <fp@tiny.Be>
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# 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 2
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-##############################################################################
-
-import wizard
+from osv import fields, osv
+from tools.translate import _
import netsvc
import pooler
+import time
+import tools
+import wizard
-sms_send_form = '''<?xml version="1.0"?>
-<form string="%s">
- <separator string="%s" colspan="4"/>
- <field name="app_id"/>
- <newline/>
- <field name="user"/>
- <field name="password"/>
- <newline/>
- <field name="text" colspan="3"/>
-</form>''' % ('SMS - Gateway: clickatell','Bulk SMS send')
-
-sms_send_fields = {
- 'app_id': {'string':'API ID', 'type':'char', 'required':True},
- 'user': {'string':'Login', 'type':'char', 'required':True},
- 'password': {'string':'Password', 'type':'char', 'required':True},
- 'text': {'string':'SMS Message', 'type':'text', 'required':True}
-}
-
-def _sms_send(self, cr, uid, data, context):
- service = netsvc.LocalService("object_proxy")
- lots = service.execute(cr.dbname,uid, 'auction.lots', 'read', data['ids'], ['obj_num','obj_price','ach_uid'])
- res = service.execute(cr.dbname,uid, 'res.partner', 'read', [l['ach_uid'] for l in lots if l['ach_uid']], ['gsm'])
- #res = service.execute(cr.dbname, uid, 'res.partner', 'read', data['ids'], ['gsm'])
-# service = netsvc.LocalService("object_proxy")
-# pool=pooler.get_pool(cr.dbname)
-# lots=pool.get('auction.lots').browse(cr,uid,data['id'],context)
-# r=lots.ach_uid.id
- nbr = 0
- for r in res:
- to = r['mobile']
- if to:
- tools.smssend(data['form']['user'], data['form']['password'], data['form']['app_id'], unicode(data['form']['text'], 'utf-8').encode('latin1'), to)
- nbr += 1
- return {'sms_sent': nbr}
+class auction_lots_sms_send(osv.osv_memory):
- if to:
- tools.smssend(data['form']['user'], data['form']['password'], data['form']['app_id'], unicode(data['form']['text'], 'utf-8').encode('latin1'), to)
- nbr += 1
- return {'sms_sent': nbr}
-#
-#def _sms_send(self, uid, datas):
-# service = netsvc.LocalService("object_proxy")
-# pool=pooler.ger_pool(cr.dbname)
-# lots=pool.get('auction.lots').browse(cr,uid,datas['ids'],context)
-# #lots = service.execute(uid, 'auction.lots', 'read', datas['ids'], ['obj_num','obj_price','ach_uid'])
-# #part = service.execute(uid, 'res.partner', 'read', [l['ach_uid'] for l in lots if l['ach_uid']], ['gsm'])
-#
-# part =ach_uid.id
-# part = map(lambda x: (x.id,x.mobile), part)
-# for l in lots:
-# part.append(str(l.obj_num)+'-%dEUR' % int(l.obj_price))
-#
-# for p in part.values():
-# to = p.mobile
-# if to:
-# params = urllib.urlencode({'user': datas['form']['user'], 'password': datas['form']['password'], 'api_id': datas['form']['app_id'], 'text':unicode(datas['form']['text'].replace('[lots]',', '.join(p['lots'])), 'utf-8').encode('latin1'), 'to':to})
-# f = urllib.urlopen("http://196.7.150.220/http/sendmsg", params)
-# nbr+=1
-# return {'sms_sent':nbr}
+ _name = "auction.lots.sms.send"
+ _description = "Sms send "
+ _columns= {
+ 'app_id':fields.char('API ID', size=64, required=True),
+ 'user':fields.char('Login', size=64, required=True),
+ 'password':fields.char('Password', size=64, required=True),
+ 'text':fields.text('SMS Message', required=True)
+ }
+
+ def sms_send(self, cr, uid, ids, context):
+ """
+ to send sms
+
+ @param cr: the current row, from the database cursor.
+ @param uid: the current user’s ID for security checks.
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+ @return: number indicating the acknowledgement
+ """
+
+ lot_obj = self.pool.get('auction.lots')
+ partner_obj = self.pool.get('res.partner')
+ partner_address_obj = self.pool.get('res.partner.address')
+ for datas in self.read(cr, uid, ids):
+ lots = lot_obj.read(cr, uid, context['active_ids'], ['obj_num','obj_price','ach_uid'])
+ res = partner_obj.read(cr, uid, [l['ach_uid'][0] for l in lots if l['ach_uid']], ['gsm'], context)
+
+ nbr = 0
+ for r in res:
+ add = partner_obj.address_get(cr, uid, [r['id']])['default']
+ addr = partner_address_obj.browse(cr, uid, add)
+ to = addr.mobile
+ if to:
+ tools.smssend(data['user'], data['password'], data['app_id'], unicode(data['text'], 'utf-8').encode('latin1'), to)
+ nbr += 1
+ return {'sms_sent': nbr}
+
+ if to:
+ tools.smssend(data['user'], data['password'], data['app_id'], unicode(data['text'], 'utf-8').encode('latin1'), to)
+ nbr += 1
+ return {'sms_sent': nbr}
+#
+auction_lots_sms_send()
-class lots_sms(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':sms_send_form, 'fields': sms_send_fields, 'state':[('send','Send SMS'), ('end','Cancel')]}
- },
- 'send': {
- 'actions': [_sms_send],
- 'result': {'type': 'state', 'state':'end'}
- }
- }
-lots_sms('auction.lots.sms_send');
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auction/wizard/wizard_pay.py b/addons/auction/wizard/wizard_pay.py
index ff68c2b5b8d..8f16ea9e7de 100644
--- a/addons/auction/wizard/wizard_pay.py
+++ b/addons/auction/wizard/wizard_pay.py
@@ -19,90 +19,96 @@
#
##############################################################################
-import wizard
-import netsvc
+from osv import fields, osv
+from tools.translate import _
import netsvc
-import osv
-import time
import pooler
-pay_form = '''<?xml version="1.0"?>
-<form string="Pay objects">
- <field name="amount"/>
- <field name="statement_id1" domain="[('state','=','draft')]"/>
- <field name="amount2"/>
- <field name="statement_id2" domain="[('state','=','draft')]"/>
- <field name="amount3"/>
- <field name="statement_id3" domain="[('state','=','draft')]"/>
- <newline/>
- <field name="buyer_id"/>
- <field name="total"/>
-</form>'''
-
-def _start(self,cr,uid,data,context):
- pool = pooler.get_pool(cr.dbname)
- rec=pool.get('auction.lots').browse(cr,uid,data['ids'],context)
- amount1=0.0
- for r in rec:
- amount1+=r.buyer_price
- buyer= r and r.ach_uid.id or False
- if r.is_ok:
- raise wizard.except_wizard('Error !', 'Some lots of the selection are already paid.')
- return {'amount':amount1, 'total':amount1,'buyer_id':buyer}
-
-pay_fields = {
- 'amount': {'string': 'Amount paid', 'type':'float'},
- 'buyer_id': {'string': 'Buyer', 'type': 'many2one', 'relation':'res.partner'},
- 'statement_id1': {'string':'Statement', 'type':'many2one', 'required':True, 'relation':'account.bank.statement'},
- 'amount2': {'string': 'Amount paid', 'type':'float'},
- 'statement_id2': {'string':'Statement', 'type':'many2one', 'relation':'account.bank.statement'},
- 'amount3': {'string': 'Amount paid', 'type':'float'},
- 'statement_id3': {'string':'Statement', 'type':'many2one', 'relation':'account.bank.statement'},
- 'total': {'string': 'Amount to paid', 'type':'float','readonly':True}
-}
+import time
+import tools
+import wizard
-def _pay_and_reconcile(self, cr, uid, data, context):
- if not abs(data['form']['total'] - (data['form']['amount']+data['form']['amount2']+data['form']['amount3']))<0.01:
- rest=data['form']['total']-(data['form']['amount']+data['form']['amount2']+data['form']['amount3'])
- raise wizard.except_wizard('Payment aborted !', 'You should pay all the total: "%.2f" are missing to accomplish the payment.' %(round(rest,2)))
+class auction_pay_buy(osv.osv_memory):
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ res = super(auction_pay_buy, self).default_get(cr, uid, fields, context=context)
+ for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
+ if 'amount' in fields:
+ res.update({'amount': lot.buyer_price})
+ if 'buyer_id' in fields:
+ res.update({'buyer_id': lot.ach_uid and lot.ach_uid.id or False})
+ if 'total' in fields:
+ res.update({'total': lot.buyer_price})
+ return res
- pool = pooler.get_pool(cr.dbname)
- lots = pool.get('auction.lots').browse(cr,uid,data['ids'],context)
- ref_bk_s=pooler.get_pool(cr.dbname).get('account.bank.statement.line')
+ def pay_and_reconcile(self, cr, uid, ids, context):
+ """
+ Pay and Reconcile
+
+ @param cr: the current row, from the database cursor.
+ @param uid: the current user’s ID for security checks.
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+ @return:
+ """
+ lot_obj = self.pool.get('auction.lots')
+ bank_statement_line_obj = self.pool.get('account.bank.statement.line')
+
+ for datas in self.read(cr, uid, ids):
+ if not abs(datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3'])) <0.01:
+ rest = datas['total']-(datas['amount'] + datas['amount2'] + datas['amount3'])
+ raise osv.except_osv('Payment aborted !', 'You should pay all the total: "%.2f" are missing to accomplish the payment.' %(round(rest, 2)))
- for lot in lots:
- if data['form']['buyer_id']:
- pool.get('auction.lots').write(cr,uid,[lot.id],{'ach_uid':data['form']['buyer_id']})
- if not lot.auction_id:
- raise wizard.except_wizard('Error !', 'No auction date for "%s": Please set one.'%(lot.name))
- pool.get('auction.lots').write(cr,uid,[lot.id],{'is_ok':True})
+ lots = lot_obj.browse(cr, uid, context['active_ids'], context)
+ ref_bk_s = bank_statement_line_obj
- for st,stamount in [('statement_id1','amount'),('statement_id2','amount2'),('statement_id3','amount3')]:
- if data['form'][st]:
- new_id=ref_bk_s.create(cr,uid,{
- 'name':'Buyer:'+str(lot.ach_login or '')+', auction:'+ lots[0].auction_id.name,
- 'date': time.strftime('%Y-%m-%d'),
- 'partner_id':data['form']['buyer_id'] or False,
- 'type':'customer',
- 'statement_id':data['form'][st],
- 'account_id':lot.auction_id.acc_income.id,
- 'amount':data['form'][stamount]
- })
for lot in lots:
- pool.get('auction.lots').write(cr,uid,[lot.id],{'statement_id':[(4,new_id)]})
- return {}
-
+ if datas['buyer_id']:
+ lot_obj.write(cr, uid, [lot.id], {'ach_uid':datas['buyer_id']})
+ if not lot.auction_id:
+ raise osv.except_osv('Error !', 'No auction date for "%s": Please set one.'%(lot.name))
+ lot_obj.write(cr, uid, [lot.id], {'is_ok':True})
+
+ for st, stamount in [('statement_id1', 'amount'), ('statement_id2', 'amount2'), ('statement_id3', 'amount3')]:
+ if datas[st]:
+ new_id = ref_bk_s.create(cr, uid, {
+ 'name':'Buyer:'+ str(lot.ach_login or '')+', auction:'+ lots[0].auction_id.name,
+ 'date': time.strftime('%Y-%m-%d'),
+ 'partner_id': datas['buyer_id'] or False,
+ 'type':'customer',
+ 'statement_id': datas[st],
+ 'account_id': lot.auction_id.acc_income.id,
+ 'amount': datas[stamount]
+ })
+ for lot in lots:
+ lot_obj.write(cr, uid, [lot.id], {'statement_id':[(4, new_id)]})
+ return {}
+
+ _name = "auction.pay.buy"
+ _description = "Pay buy"
+ _columns= {
+ 'amount': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
+ 'buyer_id':fields.many2one('res.partner', 'Buyer'),
+ 'statement_id1':fields.many2one('account.bank.statement', 'Statement', required=True),
+ 'amount2': fields.float('Amount paid', digits= (16, int(tools.config['price_accuracy']))),
+ 'statement_id2':fields.many2one('account.bank.statement', 'Statement'),
+ 'amount3': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy']))),
+ 'statement_id3':fields.many2one('account.bank.statement', 'Statement'),
+ 'total': fields.float('Amount paid', digits = (16, int(tools.config['price_accuracy'])), readonly =True),
+ }
+auction_pay_buy()
-class wiz_auc_lots_pay(wizard.interface):
- states = {
- 'init': {
- 'actions': [_start],
- 'result': {'type': 'form', 'arch':pay_form, 'fields': pay_fields, 'state':[('end','Cancel'),('pay','Pay')]}
- },
- 'pay': {
- 'actions': [_pay_and_reconcile],
- 'result': {'type': 'state', 'state':'end'}
- }}
-wiz_auc_lots_pay('auction.pay.buy')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_contact/i18n/hr.po b/addons/base_contact/i18n/hr.po
index 3d11dd37b3e..0d890821c0d 100644
--- a/addons/base_contact/i18n/hr.po
+++ b/addons/base_contact/i18n/hr.po
@@ -1,41 +1,43 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * base_contact
-#
+# * base_contact
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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 16:40+0000\n"
-"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:49+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:47+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: base_contact
#: field:res.partner.job,sequence_contact:0
msgid "Contact Seq."
-msgstr ""
+msgstr "Seq. Osobe"
#. module: base_contact
#: model:ir.model,name:base_contact.model_res_partner_contact
msgid "res.partner.contact"
-msgstr ""
+msgstr "res.partner.contact"
#. module: base_contact
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: base_contact
#: field:res.partner.job,function_id:0
msgid "Partner Function"
-msgstr ""
+msgstr "Funkcija Partnera"
#. module: base_contact
#: model:ir.actions.act_window,name:base_contact.action_partner_contact_form
@@ -45,62 +47,62 @@ msgstr ""
#: view:res.partner.address:0
#: field:res.partner.address,job_ids:0
msgid "Contacts"
-msgstr ""
+msgstr "Kontakti"
#. module: base_contact
#: field:res.partner.job,sequence_partner:0
msgid "Partner Seq."
-msgstr ""
+msgstr "Partner Seq."
#. module: base_contact
#: selection:res.partner.job,state:0
msgid "Current"
-msgstr ""
+msgstr "Tekući"
#. module: base_contact
#: field:res.partner.contact,first_name:0
msgid "First Name"
-msgstr ""
+msgstr "Ime osobe"
#. module: base_contact
#: model:ir.model,name:base_contact.model_res_partner_job
msgid "Contact Partner Function"
-msgstr ""
+msgstr "Funkcija Osobe Partnera - Contact Partner Function"
#. module: base_contact
#: field:res.partner.job,other:0
msgid "Other"
-msgstr ""
+msgstr "Drugi"
#. module: base_contact
#: model:process.transition,name:base_contact.process_transition_contacttofunction0
msgid "Contact to function"
-msgstr ""
+msgstr "Osoba na Funkciju - Contact to Function"
#. module: base_contact
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nepravilno ime modela u definiciji radnje."
#. module: base_contact
#: model:process.transition,name:base_contact.process_transition_partnertoaddress0
msgid "Partner to address"
-msgstr ""
+msgstr "Partner na Adresu"
#. module: base_contact
#: view:res.partner.address:0
msgid "# of Contacts"
-msgstr ""
+msgstr "# Osoba"
#. module: base_contact
#: help:res.partner.job,other:0
msgid "Additional phone field"
-msgstr ""
+msgstr "Dodatno polje za tel. broj"
#. module: base_contact
#: model:process.node,name:base_contact.process_node_function0
msgid "Function"
-msgstr ""
+msgstr "Funkcija"
#. module: base_contact
#: field:res.partner.job,fax:0
@@ -110,7 +112,7 @@ msgstr "Fax"
#. module: base_contact
#: field:res.partner.contact,lang_id:0
msgid "Language"
-msgstr ""
+msgstr "Jezik"
#. module: base_contact
#: field:res.partner.job,phone:0
@@ -120,22 +122,22 @@ msgstr ""
#. module: base_contact
#: model:process.transition,note:base_contact.process_transition_contacttofunction0
msgid "Defines contacts and functions."
-msgstr ""
+msgstr "Određuje Osobe i Funkcije"
#. module: base_contact
#: field:res.partner.contact,title:0
msgid "Title"
-msgstr ""
+msgstr "Naslov"
#. module: base_contact
#: view:res.partner.job:0
msgid "Contact Functions"
-msgstr ""
+msgstr "Funkcije Osoba"
#. module: base_contact
#: model:ir.module.module,shortdesc:base_contact.module_meta_information
msgid "Base Contact"
-msgstr ""
+msgstr "Osnovna Osoba"
#. module: base_contact
#: help:res.partner.job,sequence_partner:0
@@ -143,212 +145,214 @@ msgid ""
"Order of importance of this job title in the list of job title of the linked "
"partner"
msgstr ""
+"redoslijed važnosti ovog naziva Posla-Radnog mjesta u listi naziva Poslova-"
+"Radnih mjesta povezanog Partnera"
#. module: base_contact
#: field:res.partner.contact,email:0
#: field:res.partner.job,email:0
msgid "E-Mail"
-msgstr ""
+msgstr "E-Mail"
#. module: base_contact
#: field:res.partner.job,date_stop:0
msgid "Date Stop"
-msgstr ""
+msgstr "Datum Završetka"
#. module: base_contact
#: view:res.partner:0
#: field:res.partner.job,address_id:0
msgid "Address"
-msgstr ""
+msgstr "Adresa"
#. module: base_contact
#: model:ir.actions.act_window,name:base_contact.action_res_partner_job
#: model:ir.ui.menu,name:base_contact.menu_action_res_partner_job
msgid "Contact's Jobs"
-msgstr ""
+msgstr "Poslovi Osobe"
#. module: base_contact
#: field:res.partner.contact,country_id:0
msgid "Nationality"
-msgstr ""
+msgstr "Državljanstvo"
#. module: base_contact
#: help:res.partner.job,sequence_contact:0
msgid ""
"Order of importance of this address in the list of addresses of the linked "
"contact"
-msgstr ""
+msgstr "redoslijed važnosti ove Adrese u listi Adresa povezanog Partnera"
#. module: base_contact
#: field:res.partner.address,job_id:0
#: field:res.partner.contact,job_id:0
msgid "Main Job"
-msgstr ""
+msgstr "Glavni Posao"
#. module: base_contact
#: view:res.partner:0
msgid "Categories"
-msgstr ""
+msgstr "Kategorije"
#. module: base_contact
#: field:res.partner.contact,function_id:0
msgid "Main Function"
-msgstr ""
+msgstr "Glavna funkcija"
#. module: base_contact
#: model:process.transition,note:base_contact.process_transition_partnertoaddress0
msgid "Define partners and their addresses."
-msgstr ""
+msgstr "Definiraj Partnere i njihove Adrese"
#. module: base_contact
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nepravilan XML format za Arhitekturu Prikaza!"
#. module: base_contact
#: model:process.process,name:base_contact.process_process_basecontactprocess0
msgid "Base Contact Process"
-msgstr ""
+msgstr "Proces Osnovne Osobe za kontakt"
#. module: base_contact
#: view:res.partner.contact:0
msgid "Seq."
-msgstr ""
+msgstr "Seq."
#. module: base_contact
#: field:res.partner.job,extension:0
msgid "Extension"
-msgstr ""
+msgstr "Ekstenzija"
#. module: base_contact
#: field:res.partner.contact,mobile:0
msgid "Mobile"
-msgstr ""
+msgstr "Mobitel"
#. module: base_contact
#: help:res.partner.job,extension:0
msgid "Internal/External extension phone number"
-msgstr ""
+msgstr "Unutarnja/Vanjska Ekstenzija Tel. broja"
#. module: base_contact
#: model:process.node,note:base_contact.process_node_contacts0
msgid "People you work with."
-msgstr ""
+msgstr "Ljudi s kojima radite."
#. module: base_contact
#: view:res.partner.contact:0
msgid "Extra Information"
-msgstr ""
+msgstr "Dodatni Podaci"
#. module: base_contact
#: view:res.partner.contact:0
#: field:res.partner.contact,job_ids:0
msgid "Functions and Addresses"
-msgstr ""
+msgstr "Funkcije i Adrese"
#. module: base_contact
#: field:res.partner.contact,active:0
msgid "Active"
-msgstr ""
+msgstr "Aktivan"
#. module: base_contact
#: field:res.partner.job,contact_id:0
msgid "Contact"
-msgstr ""
+msgstr "Osoba"
#. module: base_contact
#: model:process.node,note:base_contact.process_node_partners0
msgid "Companies you work with."
-msgstr ""
+msgstr "Tvrtke s kojima radite."
#. module: base_contact
#: field:res.partner.contact,partner_id:0
msgid "Main Employer"
-msgstr ""
+msgstr "Glavni Poslodavac."
#. module: base_contact
#: model:process.transition,name:base_contact.process_transition_functiontoaddress0
msgid "Function to address"
-msgstr ""
+msgstr "Funkcija na Adresu - Function to address"
#. module: base_contact
#: model:ir.actions.act_window,name:base_contact.act_res_partner_jobs
msgid "Partner Contacts"
-msgstr ""
+msgstr "Osobe kod Partnera"
#. module: base_contact
#: view:res.partner.contact:0
msgid "Partner Contact"
-msgstr ""
+msgstr "Osoba kod Partnera"
#. module: base_contact
#: model:process.node,name:base_contact.process_node_partners0
msgid "Partners"
-msgstr ""
+msgstr "Partneri"
#. module: base_contact
#: model:process.node,name:base_contact.process_node_addresses0
#: view:res.partner:0
msgid "Addresses"
-msgstr ""
+msgstr "Adrese"
#. module: base_contact
#: model:process.node,note:base_contact.process_node_addresses0
msgid "Working and private addresses."
-msgstr ""
+msgstr "Poslovne i Privatne Adrese"
#. module: base_contact
#: field:res.partner.contact,name:0
msgid "Last Name"
-msgstr ""
+msgstr "Prezime osobe"
#. module: base_contact
#: field:res.partner.job,state:0
msgid "State"
-msgstr ""
+msgstr "Stanje"
#. module: base_contact
#: view:res.partner.contact:0
#: view:res.partner.job:0
msgid "General"
-msgstr ""
+msgstr "Općenit"
#. module: base_contact
#: selection:res.partner.job,state:0
msgid "Past"
-msgstr ""
+msgstr "Prošli"
#. module: base_contact
#: view:res.partner.contact:0
msgid "General Information"
-msgstr ""
+msgstr "Opća Informacija"
#. module: base_contact
#: model:process.node,note:base_contact.process_node_function0
msgid "Jobs at a same partner address."
-msgstr ""
+msgstr "Poslovi na istoj Adresi Partnera"
#. module: base_contact
#: field:res.partner.job,name:0
msgid "Partner"
-msgstr ""
+msgstr "Partner"
#. module: base_contact
#: field:res.partner.job,date_start:0
msgid "Date Start"
-msgstr ""
+msgstr "Datum Početka"
#. module: base_contact
#: model:process.transition,note:base_contact.process_transition_functiontoaddress0
msgid "Define functions and address."
-msgstr ""
+msgstr "Definiraj Funkcije i Adrese"
#. module: base_contact
#: field:res.partner.contact,website:0
msgid "Website"
-msgstr ""
+msgstr "Web stranica"
#. module: base_contact
#: field:res.partner.contact,birthdate:0
msgid "Birth Date"
-msgstr ""
+msgstr "Datum rođenja"
diff --git a/addons/base_contact/i18n/it.po b/addons/base_contact/i18n/it.po
index 487a73f2c3f..8fd01ee5ac3 100644
--- a/addons/base_contact/i18n/it.po
+++ b/addons/base_contact/i18n/it.po
@@ -7,19 +7,19 @@ 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-17 06:48+0000\n"
-"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
+"PO-Revision-Date: 2010-03-26 16:08+0000\n"
+"Last-Translator: Carlo Vettore <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-03-11 04:47+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_contact
#: field:res.partner.job,sequence_contact:0
msgid "Contact Seq."
-msgstr ""
+msgstr "Seq. Contatto"
#. module: base_contact
#: model:ir.model,name:base_contact.model_res_partner_contact
@@ -52,7 +52,7 @@ msgstr "Contatti"
#. module: base_contact
#: field:res.partner.job,sequence_partner:0
msgid "Partner Seq."
-msgstr ""
+msgstr "Seq. Partner"
#. module: base_contact
#: selection:res.partner.job,state:0
@@ -82,7 +82,7 @@ msgstr "Contatto di funzione"
#. module: base_contact
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nome del modulo non valido nella definizione dell'azione."
#. module: base_contact
#: model:process.transition,name:base_contact.process_transition_partnertoaddress0
@@ -92,12 +92,12 @@ msgstr "Partner da contattare"
#. module: base_contact
#: view:res.partner.address:0
msgid "# of Contacts"
-msgstr ""
+msgstr "Numero Contatti"
#. module: base_contact
#: help:res.partner.job,other:0
msgid "Additional phone field"
-msgstr ""
+msgstr "Numero di telefono aggiuntivo"
#. module: base_contact
#: model:process.node,name:base_contact.process_node_function0
@@ -189,7 +189,7 @@ msgstr ""
#: field:res.partner.address,job_id:0
#: field:res.partner.contact,job_id:0
msgid "Main Job"
-msgstr ""
+msgstr "Lavoro principale"
#. module: base_contact
#: view:res.partner:0
@@ -224,7 +224,7 @@ msgstr "Seq."
#. module: base_contact
#: field:res.partner.job,extension:0
msgid "Extension"
-msgstr ""
+msgstr "Interno"
#. module: base_contact
#: field:res.partner.contact,mobile:0
diff --git a/addons/base_contact/i18n/zh_CN.po b/addons/base_contact/i18n/zh_CN.po
index af2071d08b9..2b1ea9bf09d 100644
--- a/addons/base_contact/i18n/zh_CN.po
+++ b/addons/base_contact/i18n/zh_CN.po
@@ -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: 2009-12-01 14:36+0000\n"
-"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n"
+"PO-Revision-Date: 2010-03-29 00:51+0000\n"
+"Last-Translator: digitalsatori <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-03-11 04:47+0000\n"
+"X-Launchpad-Export-Date: 2010-03-29 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: base_contact
diff --git a/addons/base_iban/i18n/hr.po b/addons/base_iban/i18n/hr.po
index 0e2702c5b7a..b58483799a1 100644
--- a/addons/base_iban/i18n/hr.po
+++ b/addons/base_iban/i18n/hr.po
@@ -1,63 +1,64 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * base_iban
-#
+# * base_iban
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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-09-08 13:34+0000\n"
-"Last-Translator: Ivica Perić <ivica.peric@ipsoft-tg.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:49+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:41+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: base_iban
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nepravilan XML format za Arhitekturu Prikaza!"
#. module: base_iban
#: model:res.partner.bank.type.field,name:base_iban.bank_zip_field
msgid "zip"
-msgstr ""
+msgstr "Pošt. Broj"
#. module: base_iban
#: help:res.partner.bank,iban:0
msgid "International Bank Account Number"
-msgstr ""
+msgstr "Međunarodni broj Bankovnog računa"
#. module: base_iban
#: model:res.partner.bank.type.field,name:base_iban.bank_country_field
msgid "country_id"
-msgstr ""
+msgstr "country_id"
#. module: base_iban
#: model:res.partner.bank.type.field,name:base_iban.bank_swift_field
msgid "bic"
-msgstr ""
+msgstr "bic"
#. module: base_iban
#: model:res.partner.bank.type.field,name:base_iban.bank_iban_field
msgid "iban"
-msgstr ""
+msgstr "iban"
#. module: base_iban
#: model:ir.module.module,shortdesc:base_iban.module_meta_information
#: field:res.partner.bank,iban:0
msgid "IBAN"
-msgstr ""
+msgstr "IBAN"
#. module: base_iban
#: model:res.partner.bank.type,name:base_iban.bank_iban
msgid "IBAN Account"
-msgstr ""
+msgstr "IBAN konto"
#. module: base_iban
#: model:res.partner.bank.type.field,name:base_iban.bank_acc_number_field
msgid "acc_number"
-msgstr ""
+msgstr "Broj konta"
diff --git a/addons/base_module_merge/i18n/hr.po b/addons/base_module_merge/i18n/hr.po
index 86da56d3753..21f6ec6abd1 100644
--- a/addons/base_module_merge/i18n/hr.po
+++ b/addons/base_module_merge/i18n/hr.po
@@ -1,123 +1,124 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * base_module_merge
-#
+# * base_module_merge
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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: 2009-09-08 13:34+0000\n"
-"Last-Translator: Ivica Perić <ivica.peric@ipsoft-tg.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:51+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 05:04+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,info,category:0
msgid "Category"
-msgstr ""
+msgstr "Kategorija"
#. module: base_module_merge
#: wizard_view:base_module_merge.module_merge,save:0
msgid "Information"
-msgstr ""
+msgstr "Informacija"
#. module: base_module_merge
#: wizard_view:base_module_merge.module_merge,init:0
msgid "Module Merging"
-msgstr ""
+msgstr "Spajanje Modula"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,info,author:0
msgid "Author"
-msgstr ""
+msgstr "Autor"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,info,directory_name:0
msgid "Directory Name"
-msgstr ""
+msgstr "Ime Direktorija"
#. module: base_module_merge
#: selection:base_module_merge.module_merge,info,data_kind:0
msgid "Demo Data"
-msgstr ""
+msgstr "Demo Podaciž"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,save,module_filename:0
msgid "Filename"
-msgstr ""
+msgstr "Ime datoteke"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,info,version:0
msgid "Version"
-msgstr ""
+msgstr "Verzija"
#. module: base_module_merge
#: wizard_view:base_module_merge.module_merge,info:0
#: wizard_view:base_module_merge.module_merge,save:0
msgid "Module Recording"
-msgstr ""
+msgstr "Snimanje Modula"
#. module: base_module_merge
#: wizard_view:base_module_merge.module_merge,save:0
msgid "Thanks in advance for your contribution."
-msgstr ""
+msgstr "naprijed Hvala na doprinosu!"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,info,description:0
msgid "Full Description"
-msgstr ""
+msgstr "Puni opis"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,info,name:0
msgid "Module Name"
-msgstr ""
+msgstr "Ime Modula"
#. module: base_module_merge
#: model:ir.actions.wizard,name:base_module_merge.wizard_base_module_merger
#: model:ir.ui.menu,name:base_module_merge.menu_wizard_base_module_merger
msgid "Merge module"
-msgstr ""
+msgstr "Spoji Modul"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,save,module_file:0
msgid "Module .zip File"
-msgstr ""
+msgstr ".zip datoteka Modula"
#. module: base_module_merge
#: model:ir.module.module,shortdesc:base_module_merge.module_meta_information
msgid "Module Merger"
-msgstr ""
+msgstr "Spoj Modula"
#. module: base_module_merge
#: wizard_view:base_module_merge.module_merge,save:0
msgid "Module successfully created !"
-msgstr ""
+msgstr "Modul uspješno kreiran !"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,info,website:0
msgid "Documentation URL"
-msgstr ""
+msgstr "URL Dokumentacije"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,init,modules_list:0
msgid "Modules"
-msgstr ""
+msgstr "Moduli"
#. module: base_module_merge
#: wizard_button:base_module_merge.module_merge,info,save:0
#: wizard_button:base_module_merge.module_merge,init,info:0
msgid "Continue"
-msgstr ""
+msgstr "Nastavi"
#. module: base_module_merge
#: selection:base_module_merge.module_merge,info,data_kind:0
msgid "Normal Data"
-msgstr ""
+msgstr "Obični podaci"
#. module: base_module_merge
#: wizard_view:base_module_merge.module_merge,save:0
@@ -126,29 +127,32 @@ msgid ""
"publish it on OpenERP.com, in the 'Modules' section. You can do it through "
"the website or using features of the 'base_module_publish' module."
msgstr ""
+"Ako mislite da bi Vaš Modul mogao nekog zanimati, voljeli bismo da ga "
+"publicirate na OpenERP.com u sekciji \"Modules\". To možete putem weba ili "
+"korištenjem mogućnosti Modula: 'base_module_publish'"
#. module: base_module_merge
#: help:base_module_merge.module_merge,init,modules_list:0
msgid "Select Modules which you want to merge in single module"
-msgstr ""
+msgstr "Odaberite Module koje želite spojiti u jedan Modul"
#. module: base_module_merge
#: wizard_field:base_module_merge.module_merge,info,data_kind:0
msgid "Type of Data"
-msgstr ""
+msgstr "Tip Podataka"
#. module: base_module_merge
#: wizard_view:base_module_merge.module_merge,info:0
msgid "Module Information"
-msgstr ""
+msgstr "Informacije o Modulu"
#. module: base_module_merge
#: wizard_button:base_module_merge.module_merge,info,end:0
#: wizard_button:base_module_merge.module_merge,init,end:0
msgid "Cancel"
-msgstr ""
+msgstr "Odustani"
#. module: base_module_merge
#: wizard_button:base_module_merge.module_merge,save,end:0
msgid "Close"
-msgstr ""
+msgstr "Zatvori"
diff --git a/addons/base_module_quality/i18n/hr.po b/addons/base_module_quality/i18n/hr.po
index 6daae728fe3..d9adbe54358 100644
--- a/addons/base_module_quality/i18n/hr.po
+++ b/addons/base_module_quality/i18n/hr.po
@@ -2,66 +2,68 @@
# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
-#
+# Drazen Bosak <drazen.bosak@gmail.com>, 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: 2009-09-18 12:31+0000\n"
-"Last-Translator: Ivica Perić <ivica.peric@ipsoft-tg.com>\n"
-"Language-Team: Croatian <hr@li.org>\n"
+"PO-Revision-Date: 2010-03-25 21:09+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 05:04+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: base_module_quality
#: field:module.quality.check,final_score:0
msgid "Final Score (%)"
-msgstr ""
+msgstr "Konačni Rezultat (%)"
#. module: base_module_quality
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: base_module_quality
#: model:ir.module.module,shortdesc:base_module_quality.module_meta_information
msgid "Base module quality"
-msgstr ""
+msgstr "Kvalitet osnovnog Modula"
#. module: base_module_quality
#: field:module.quality.check,name:0
msgid "Rated Module"
-msgstr ""
+msgstr "Ocijenjen Modul"
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Detail"
-msgstr ""
+msgstr "Detalj"
#. module: base_module_quality
#: field:module.quality.detail,note:0
msgid "Note"
-msgstr ""
+msgstr "Bilješka"
#. module: base_module_quality
#: field:module.quality.detail,state:0
msgid "State"
-msgstr ""
+msgstr "Stanje"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
msgid "Details"
-msgstr ""
+msgstr "Detalji"
#. module: base_module_quality
#: field:module.quality.detail,ponderation:0
msgid "Ponderation"
-msgstr ""
+msgstr "Ponderacija"
#. module: base_module_quality
#: help:module.quality.detail,ponderation:0
@@ -69,17 +71,19 @@ msgid ""
"Some tests are more critical than others, so they have a bigger weight in "
"the computation of final rating"
msgstr ""
+"Neki su testovi od većeg kritičnog značaja od drugih, tako da imaju veću "
+"\"težinu\" u izračunu konačne procjene."
#. module: base_module_quality
#: view:module.quality.check:0
#: field:module.quality.check,check_detail_ids:0
msgid "Tests"
-msgstr ""
+msgstr "Testovi"
#. module: base_module_quality
#: selection:module.quality.detail,state:0
msgid "Skipped"
-msgstr ""
+msgstr "Preskočen"
#. module: base_module_quality
#: help:module.quality.detail,state:0
@@ -87,95 +91,97 @@ msgid ""
"The test will be completed only if the module is installed or if the test "
"may be processed on uninstalled module."
msgstr ""
+"test će biti dovršen jedino ako je modul instaliran ili ako test može biti "
+"procesiran an neinstaliranom modulu."
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nepravilan XML format za View Architecture!"
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_module_quality_check
msgid "module.quality.check"
-msgstr ""
+msgstr "module.quality.check"
#. module: base_module_quality
#: field:module.quality.detail,name:0
msgid "Name"
-msgstr ""
+msgstr "Ime"
#. module: base_module_quality
#: wizard_field:quality_detail_save,init,module_file:0
msgid "Save report"
-msgstr ""
+msgstr "Spremi Izvještaj"
#. module: base_module_quality
#: wizard_field:quality_detail_save,init,name:0
msgid "File name"
-msgstr ""
+msgstr "Ime datoteke"
#. module: base_module_quality
#: field:module.quality.detail,score:0
msgid "Score (%)"
-msgstr ""
+msgstr "Rezultat (%)"
#. module: base_module_quality
#: help:quality_detail_save,init,name:0
msgid "Save report as .html format"
-msgstr ""
+msgstr "Spremi izvještaj u .html formatu"
#. module: base_module_quality
#: view:module.quality.detail:0
#: field:module.quality.detail,summary:0
msgid "Summary"
-msgstr ""
+msgstr "Sižetak"
#. module: base_module_quality
#: model:ir.actions.wizard,name:base_module_quality.quality_detail_save
msgid "Report Save"
-msgstr ""
+msgstr "Spremi Izvještaj"
#. module: base_module_quality
#: wizard_view:quality_detail_save,init:0
msgid "Standard entries"
-msgstr ""
+msgstr "Standardni unosi"
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Save Report"
-msgstr ""
+msgstr "Spremi Izvještaj"
#. module: base_module_quality
#: model:ir.actions.wizard,name:base_module_quality.create_quality_check_id
msgid "Quality Check"
-msgstr ""
+msgstr "Provjera Kvalitete"
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_module_quality_detail
msgid "module.quality.detail"
-msgstr ""
+msgstr "module.quality.detail"
#. module: base_module_quality
#: selection:module.quality.detail,state:0
msgid "Done"
-msgstr ""
+msgstr "Gotovo"
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
-msgstr ""
+msgstr "Rezultat"
#. module: base_module_quality
#: wizard_button:quality_detail_save,init,end:0
msgid "Cancel"
-msgstr ""
+msgstr "Odustani"
#. module: base_module_quality
#: field:module.quality.detail,message:0
msgid "Message"
-msgstr ""
+msgstr "Poruka"
#. module: base_module_quality
#: field:module.quality.detail,quality_check_id:0
msgid "Quality"
-msgstr ""
+msgstr "Kvaliteta"
diff --git a/addons/base_module_record/i18n/hr.po b/addons/base_module_record/i18n/hr.po
index 1aacc87b906..ab8a8a4a73e 100644
--- a/addons/base_module_record/i18n/hr.po
+++ b/addons/base_module_record/i18n/hr.po
@@ -1,105 +1,107 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * base_module_record
-#
+# * base_module_record
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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-09-08 15:16+0000\n"
-"Last-Translator: Ivica Perić <ivica.peric@ipsoft-tg.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 21:09+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:48+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,intro,category:0
#: wizard_field:base_module_record.module_save,info,category:0
msgid "Category"
-msgstr ""
+msgstr "Kategorija"
#. module: base_module_record
#: wizard_view:base_module_record.module_record_objects,save:0
#: wizard_field:base_module_record.module_save,init,info_text:0
#: wizard_view:base_module_record.module_save,save:0
msgid "Information"
-msgstr ""
+msgstr "Informacija"
#. module: base_module_record
#: model:ir.model,name:base_module_record.model_ir_module_record
msgid "ir.module.record"
-msgstr ""
+msgstr "ir.module.record"
#. module: base_module_record
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Ime Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: base_module_record
#: wizard_view:base_module_record.module_record_objects,init:0
msgid "Choose objects to record"
-msgstr ""
+msgstr "Izaberite Objekte za Snimanje"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,intro,author:0
#: wizard_field:base_module_record.module_save,info,author:0
msgid "Author"
-msgstr ""
+msgstr "Autor"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,intro,directory_name:0
#: wizard_field:base_module_record.module_save,info,directory_name:0
msgid "Directory Name"
-msgstr ""
+msgstr "Ime Direktorija"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,init,filter_cond:0
msgid "Records only"
-msgstr ""
+msgstr "Samo Zapisi"
#. module: base_module_record
#: selection:base_module_record.module_record_objects,intro,data_kind:0
#: selection:base_module_record.module_save,info,data_kind:0
msgid "Demo Data"
-msgstr ""
+msgstr "Demo Podaci"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,save,module_filename:0
#: wizard_field:base_module_record.module_save,save,module_filename:0
msgid "Filename"
-msgstr ""
+msgstr "Ime datoteke"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,intro,version:0
#: wizard_field:base_module_record.module_save,info,version:0
msgid "Version"
-msgstr ""
+msgstr "Verzija"
#. module: base_module_record
#: wizard_view:base_module_record.module_record_objects,init:0
msgid "Objects Recording"
-msgstr ""
+msgstr "Objekti se Snimaju"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,init,check_date:0
msgid "Record from Date"
-msgstr ""
+msgstr "Zapis od Datuma"
#. module: base_module_record
#: wizard_view:base_module_record.module_record,stop:0
#: wizard_view:base_module_record.module_save,init:0
msgid "Recording Information"
-msgstr ""
+msgstr "Informacija o Snimanju"
#. module: base_module_record
#: wizard_field:base_module_record.module_save,init,info_status:0
msgid "Status"
-msgstr ""
+msgstr "Status"
#. module: base_module_record
#: wizard_view:base_module_record.module_record,stop:0
@@ -111,111 +113,111 @@ msgstr ""
#: wizard_view:base_module_record.module_save,init:0
#: wizard_view:base_module_record.module_save,save:0
msgid "Module Recording"
-msgstr ""
+msgstr "Modul se Zapisuje"
#. module: base_module_record
#: model:ir.actions.wizard,name:base_module_record.wizard_base_module_record_objects
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_module_record_objects
msgid "Export Customizations As a Module"
-msgstr ""
+msgstr "Izvezi Prilagodbe kao Modul"
#. module: base_module_record
#: wizard_view:base_module_record.module_record_objects,save:0
#: wizard_view:base_module_record.module_save,save:0
msgid "Thanks in advance for your contribution."
-msgstr ""
+msgstr "Hvala unaprijed na Vašem Doprinosu"
#. module: base_module_record
#: help:base_module_record.module_record_objects,init,objects:0
msgid "List of objects to be recorded"
-msgstr ""
+msgstr "Lista Objekata za zapis"
#. module: base_module_record
#: wizard_button:base_module_record.module_record,start,start_confirm:0
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_module_record
msgid "Start Recording"
-msgstr ""
+msgstr "Počni Snimanje"
#. module: base_module_record
#: selection:base_module_record.module_save,init,info_status:0
msgid "Not Recording"
-msgstr ""
+msgstr "Ne Zapisuje se"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,intro,description:0
#: wizard_field:base_module_record.module_save,info,description:0
msgid "Full Description"
-msgstr ""
+msgstr "Puni Opis"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,intro,name:0
#: wizard_field:base_module_record.module_save,info,name:0
msgid "Module Name"
-msgstr ""
+msgstr "Ime Modula"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,init,objects:0
msgid "Objects"
-msgstr ""
+msgstr "Objekti"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,save,module_file:0
#: wizard_field:base_module_record.module_save,save,module_file:0
msgid "Module .zip File"
-msgstr ""
+msgstr ".zip datoteka Modula"
#. module: base_module_record
#: wizard_view:base_module_record.module_record,start:0
msgid "Recording information"
-msgstr ""
+msgstr "Informacija o Snimanju"
#. module: base_module_record
#: wizard_view:base_module_record.module_record_objects,save:0
#: wizard_view:base_module_record.module_save,save:0
msgid "Module successfully created !"
-msgstr ""
+msgstr "Modul uspješno kreiran !"
#. module: base_module_record
#: wizard_view:base_module_record.module_record,start:0
msgid "Recording Stopped"
-msgstr ""
+msgstr "Snimanje zaustavljeno"
#. module: base_module_record
#: selection:base_module_record.module_record_objects,init,filter_cond:0
msgid "Created"
-msgstr ""
+msgstr "Kreiran"
#. module: base_module_record
#: wizard_view:base_module_record.module_record_objects,end:0
#: wizard_view:base_module_record.module_save,end:0
msgid "Thanks For using Module Recorder"
-msgstr ""
+msgstr "Hvala što ste koristili Snimač Modula"
#. module: base_module_record
#: wizard_field:base_module_record.module_record,start,continue:0
msgid "Continue Previous Session"
-msgstr ""
+msgstr "Nastavi Prethodnu Sesiju"
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,intro,website:0
#: wizard_field:base_module_record.module_save,info,website:0
msgid "Documentation URL"
-msgstr ""
+msgstr "URL Dokumentacije"
#. module: base_module_record
#: selection:base_module_record.module_record_objects,init,filter_cond:0
msgid "Modified"
-msgstr ""
+msgstr "Izmijenjen"
#. module: base_module_record
#: selection:base_module_record.module_save,init,info_status:0
msgid "Recording"
-msgstr ""
+msgstr "Snimanje"
#. module: base_module_record
#: wizard_button:base_module_record.module_record_objects,init,record:0
msgid "Record"
-msgstr ""
+msgstr "Zapis"
#. module: base_module_record
#: wizard_button:base_module_record.module_record,stop,end:0
@@ -223,25 +225,25 @@ msgstr ""
#: wizard_button:base_module_record.module_save,info,save:0
#: wizard_button:base_module_record.module_save,init,check:0
msgid "Continue"
-msgstr ""
+msgstr "Nastavi"
#. module: base_module_record
#: model:ir.module.module,shortdesc:base_module_record.module_meta_information
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_mod_rec_rec
msgid "Module Recorder"
-msgstr ""
+msgstr "Snimač Modula"
#. module: base_module_record
#: selection:base_module_record.module_record_objects,intro,data_kind:0
#: selection:base_module_record.module_save,info,data_kind:0
msgid "Normal Data"
-msgstr ""
+msgstr "uobičajeni Podaci"
#. module: base_module_record
#: wizard_button:base_module_record.module_record_objects,end,end:0
#: wizard_button:base_module_record.module_save,end,end:0
msgid "OK"
-msgstr ""
+msgstr "OK"
#. module: base_module_record
#: wizard_view:base_module_record.module_record_objects,save:0
@@ -251,6 +253,9 @@ msgid ""
"publish it on OpenERP.com, in the 'Modules' section. You can do it through "
"the website or using features of the 'base_module_publish' module."
msgstr ""
+"Ako mislite da bi Vaš Modul mogao nekog zanimati, voljeli bismo da ga "
+"publicirate na OpenERP.com u sekciji \"Modules\". To možete putem weba ili "
+"korištenjem mogućnosti Modula: 'base_module_publish'."
#. module: base_module_record
#: wizard_view:base_module_record.module_record,start:0
@@ -259,16 +264,19 @@ msgid ""
"ERP client and save them as a module. You will be able to install this "
"module on any database to reuse and/or publish it."
msgstr ""
+"Snimač Modula omogućuje Vam da snimite svaku operaciju izvršenu u Open ERP "
+"klijentu i izmjene spremite kao Modul. Moći ćete instalirati taj Modul na "
+"bilo kojoj Bazi Podataka za ponovnu uporabu ili publiciranje."
#. module: base_module_record
#: model:ir.actions.wizard,name:base_module_record.wizard_base_module_record
msgid "Record module"
-msgstr ""
+msgstr "Snimi Modul"
#. module: base_module_record
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_mod_rec
msgid "Module Creation"
-msgstr ""
+msgstr "Kreacija Modula"
#. module: base_module_record
#: wizard_view:base_module_record.module_record,stop:0
@@ -276,30 +284,33 @@ msgid ""
"You can continue the recording session by relauching the 'start recording' "
"wizard."
msgstr ""
+"Možete nastaviti snimanje tako da ponovo pokrenete Čarobnjak \"Počni "
+"Snimanje\""
#. module: base_module_record
#: wizard_field:base_module_record.module_record_objects,intro,data_kind:0
#: wizard_field:base_module_record.module_save,info,data_kind:0
msgid "Type of Data"
-msgstr ""
+msgstr "Tip podataka"
#. module: base_module_record
#: wizard_view:base_module_record.module_record_objects,intro:0
#: wizard_view:base_module_record.module_save,info:0
msgid "Module Information"
-msgstr ""
+msgstr "Informacija o Modulu"
#. module: base_module_record
#: model:ir.actions.wizard,name:base_module_record.wizard_base_module_save
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_module_save
msgid "Save Recorded Module"
-msgstr ""
+msgstr "Spremi Snimljen Modul"
#. module: base_module_record
#: wizard_view:base_module_record.module_record,stop:0
msgid ""
"Open ERP recording is stopped. Don't forget to save the recorded module."
msgstr ""
+"OpenERP Snimač je zaustavljen. Ne zaboravite spremiti snimljen Modul."
#. module: base_module_record
#: wizard_button:base_module_record.module_record,start,end:0
@@ -308,20 +319,20 @@ msgstr ""
#: wizard_button:base_module_record.module_save,info,end:0
#: wizard_button:base_module_record.module_save,init,end:0
msgid "Cancel"
-msgstr ""
+msgstr "Odustani"
#. module: base_module_record
#: wizard_button:base_module_record.module_record_objects,save,end:0
#: wizard_button:base_module_record.module_save,save,end:0
msgid "Close"
-msgstr ""
+msgstr "Zatvori"
#. module: base_module_record
#: selection:base_module_record.module_record_objects,init,filter_cond:0
msgid "Created & Modified"
-msgstr ""
+msgstr "Kreiran i Izmijenjen"
#. module: base_module_record
#: model:ir.ui.menu,name:base_module_record.menu_wizard_base_module_record_stop
msgid "Stop Recording"
-msgstr ""
+msgstr "Zaustavi Snimanje"
diff --git a/addons/base_report_designer/i18n/hr.po b/addons/base_report_designer/i18n/hr.po
index 4bf555fb9e5..446c310fe71 100644
--- a/addons/base_report_designer/i18n/hr.po
+++ b/addons/base_report_designer/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * base_report_designer
-#
+# * base_report_designer
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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-09-30 08:28+0000\n"
-"Last-Translator: Miro Glavić <glavicmiro@gmail.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-24 09:27+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:57+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: base_report_designer
#: wizard_field:base_report_designer.modify,init,text:0
@@ -29,67 +30,67 @@ msgstr ""
#. module: base_report_designer
#: wizard_button:base_report_designer.modify,get_form_result,send_form:0
msgid "Upload the modified report"
-msgstr ""
+msgstr "Pošalji promijenjen Izvještaj na Server"
#. module: base_report_designer
#: wizard_view:base_report_designer.modify,get_form_result:0
msgid "The .SXW report"
-msgstr ""
+msgstr ".SXW Izvještaj"
#. module: base_report_designer
#: wizard_view:base_report_designer.modify,send_form_result:0
msgid "Report modified"
-msgstr ""
+msgstr "Izvještaj je promijenjen"
#. module: base_report_designer
#: wizard_button:base_report_designer.modify,init,get_form:0
msgid "Modify a report"
-msgstr ""
+msgstr "Izmijeni Izvještaj"
#. module: base_report_designer
#: wizard_view:base_report_designer.modify,send_form_result:0
msgid "Your report has been modified."
-msgstr ""
+msgstr "Vaš je Izvještaj izmijenjen"
#. module: base_report_designer
#: model:ir.module.module,shortdesc:base_report_designer.module_meta_information
msgid "Report designer interface module"
-msgstr ""
+msgstr "Modul sučelja Dizajnera Izvještaja"
#. module: base_report_designer
#: wizard_field:base_report_designer.modify,get_form,report_id:0
#: wizard_field:base_report_designer.modify,get_form_result,report_id:0
#: wizard_field:base_report_designer.modify,send_form,report_id:0
msgid "Report"
-msgstr ""
+msgstr "Izvještaj"
#. module: base_report_designer
#: model:ir.ui.menu,name:base_report_designer.menu_wizard_report_designer_modify
msgid "Report Designer"
-msgstr ""
+msgstr "Dizajner Izvještaja"
#. module: base_report_designer
#: wizard_view:base_report_designer.modify,get_form:0
#: wizard_view:base_report_designer.modify,get_form_result:0
#: wizard_view:base_report_designer.modify,send_form:0
msgid "Get a report"
-msgstr ""
+msgstr "Napravi Izvještaj"
#. module: base_report_designer
#: wizard_button:base_report_designer.modify,get_form,get_form_result:0
msgid "Continue"
-msgstr ""
+msgstr "Nastavi"
#. module: base_report_designer
#: wizard_field:base_report_designer.modify,get_form_result,file_sxw:0
#: wizard_field:base_report_designer.modify,send_form,file_sxw:0
msgid "Your .SXW file"
-msgstr ""
+msgstr "Vaša .SXW datoteka"
#. module: base_report_designer
#: wizard_view:base_report_designer.modify,init:0
msgid "Report designer"
-msgstr ""
+msgstr "Dizajner Izvještaja"
#. module: base_report_designer
#: wizard_view:base_report_designer.modify,get_form_result:0
@@ -99,47 +100,51 @@ msgid ""
"to modify it. Once it is modified, re-upload it in Open ERP using this "
"wizard."
msgstr ""
+"Ovo je Predložak vašeg traženog Izvještaja. Spremite ga kao .SXW datoteku i "
+"otvorite s programon OpenOffice. Ne zaboravite instalirati Tiny OpenOffice "
+"paket kako biste mogli vršiti izmjene. kad izvršite izmjene, vratite "
+"datoteku u Open ERP koristeći ovaj Čarobnjak."
#. module: base_report_designer
#: wizard_button:base_report_designer.modify,send_form,send_form_result:0
msgid "Update the report"
-msgstr ""
+msgstr "Ažurirajte Izvještaj"
#. module: base_report_designer
#: selection:base_report_designer.modify,init,operation:0
msgid "Create a new report"
-msgstr ""
+msgstr "Napravi novi Izvještaj"
#. module: base_report_designer
#: selection:base_report_designer.modify,init,operation:0
#: model:ir.actions.wizard,name:base_report_designer.wizard_report_designer_modify
msgid "Modify an existing report"
-msgstr ""
+msgstr "Izmijeni postojeći izvještaj"
#. module: base_report_designer
#: wizard_button:base_report_designer.modify,get_form,end:0
#: wizard_button:base_report_designer.modify,init,end:0
msgid "Cancel"
-msgstr ""
+msgstr "Odustani"
#. module: base_report_designer
#: wizard_button:base_report_designer.modify,get_form_result,end:0
#: wizard_button:base_report_designer.modify,send_form,end:0
#: wizard_button:base_report_designer.modify,send_form_result,end:0
msgid "Close"
-msgstr ""
+msgstr "Zatvori"
#. module: base_report_designer
#: wizard_field:base_report_designer.modify,init,operation:0
msgid "Operation"
-msgstr ""
+msgstr "Operacija"
#. module: base_report_designer
#: wizard_view:base_report_designer.modify,init:0
msgid "Report designer introduction"
-msgstr ""
+msgstr "Uvod u Dizajner Izvještaja"
#. module: base_report_designer
#: wizard_view:base_report_designer.modify,get_form:0
msgid "Select your report"
-msgstr ""
+msgstr "Odaberite izvještaj"
diff --git a/addons/base_setup/i18n/hr.po b/addons/base_setup/i18n/hr.po
index 038c0c73538..3423f72d4a5 100644
--- a/addons/base_setup/i18n/hr.po
+++ b/addons/base_setup/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * base_setup
-#
+# * base_setup
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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-09-08 16:32+0000\n"
-"Last-Translator: Ivica Perić <ivica.peric@ipsoft-tg.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-26 01:09+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:49+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,city:0
@@ -29,34 +30,37 @@ msgid ""
"You can start configuring the system or connect directly to the database "
"using the default setup."
msgstr ""
+"Možete početi s konfiguracijom sustava ili se izravno spojiti na bazu "
+"podataka koristeći predefinirane postavke."
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,zip:0
#: wizard_field:base_setup.base_setup,init,zip:0
#: wizard_field:base_setup.base_setup,update,zip:0
msgid "Zip code"
-msgstr ""
+msgstr "Pošt. broj"
#. module: base_setup
#: wizard_view:base_setup.base_setup,init:0
msgid "Select a Profile"
-msgstr ""
+msgstr "Odaberite Profil"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "Report header"
-msgstr ""
+msgstr "Zaglavlje Izvještaja"
#. module: base_setup
#: wizard_button:base_setup.base_setup,finish,config:0
msgid "Start Configuration"
-msgstr ""
+msgstr "Započnite Konfiguriranje"
#. module: base_setup
#: wizard_view:base_setup.base_setup,init:0
msgid ""
"You'll be able to install more modules later through the Administration menu."
msgstr ""
+"Moći ćete instalirati više Modula kasnije kroz izbornik Admininstracija"
#. module: base_setup
#: wizard_view:base_setup.base_setup,init:0
@@ -65,88 +69,91 @@ msgid ""
"have been setup to help you discover the different aspects of OpenERP. This "
"is just an overview, we have 300+ available modules."
msgstr ""
+"Profil određuje pred-izbor modula za specifične potrebe. Ti su profili "
+"podešeni kako biste lakše otkrivali različite aspekte Open ERP-a. Ovo je tek "
+"osvrt, postoji 300+ raspoloživih modula."
#. module: base_setup
#: wizard_button:base_setup.base_setup,company,update:0
#: wizard_button:base_setup.base_setup,init,company:0
msgid "Next"
-msgstr ""
+msgstr "Dalje"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,email:0
#: wizard_field:base_setup.base_setup,init,email:0
#: wizard_field:base_setup.base_setup,update,email:0
msgid "E-mail"
-msgstr ""
+msgstr "E-Mail"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,state_id:0
#: wizard_field:base_setup.base_setup,init,state_id:0
#: wizard_field:base_setup.base_setup,update,state_id:0
msgid "State"
-msgstr ""
+msgstr "Stanje"
#. module: base_setup
#: wizard_view:base_setup.base_setup,finish:0
msgid "Your new database is now fully installed."
-msgstr ""
+msgstr "Vaša nova baza podataka sada je instalirana u potpunosti."
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,profile:0
#: wizard_field:base_setup.base_setup,init,profile:0
#: wizard_field:base_setup.base_setup,update,profile:0
msgid "Profile"
-msgstr ""
+msgstr "Profil"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,rml_footer1:0
#: wizard_field:base_setup.base_setup,init,rml_footer1:0
#: wizard_field:base_setup.base_setup,update,rml_footer1:0
msgid "Report Footer 1"
-msgstr ""
+msgstr "Podnožje Izvještaja 1"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,rml_footer2:0
#: wizard_field:base_setup.base_setup,init,rml_footer2:0
#: wizard_field:base_setup.base_setup,update,rml_footer2:0
msgid "Report Footer 2"
-msgstr ""
+msgstr "Podnožje Izvještaja 2"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "General Information"
-msgstr ""
+msgstr "Opće Informacije"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,street2:0
#: wizard_field:base_setup.base_setup,init,street2:0
#: wizard_field:base_setup.base_setup,update,street2:0
msgid "Street2"
-msgstr ""
+msgstr "Ulica2"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "Report Information"
-msgstr ""
+msgstr "Informacija o Izvještaju"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,phone:0
#: wizard_field:base_setup.base_setup,init,phone:0
#: wizard_field:base_setup.base_setup,update,phone:0
msgid "Phone"
-msgstr ""
+msgstr "Telefon"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "Define Main Company"
-msgstr ""
+msgstr "Odredite glavnu Tvrtku"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,name:0
#: wizard_field:base_setup.base_setup,init,name:0
#: wizard_field:base_setup.base_setup,update,name:0
msgid "Company Name"
-msgstr ""
+msgstr "Ime Tvrtke"
#. module: base_setup
#: help:base_setup.base_setup,company,rml_footer2:0
@@ -157,13 +164,16 @@ msgid ""
"We suggest you to put bank information here:\n"
"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701"
msgstr ""
+"Ova će se rečenica pojavljivati u podnožju vaših izvještaja.\n"
+"Savjetujemo vam da ovdje upišete bankovne podatke:\n"
+"IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - PDV: BE0477.472.701"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,country_id:0
#: wizard_field:base_setup.base_setup,init,country_id:0
#: wizard_field:base_setup.base_setup,update,country_id:0
msgid "Country"
-msgstr ""
+msgstr "Država"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
@@ -173,7 +183,7 @@ msgstr ""
#: model:ir.actions.wizard,name:base_setup.action_wizard_setup
#: model:ir.actions.wizard,name:base_setup.wizard_base_setup
msgid "Setup"
-msgstr ""
+msgstr "Postava"
#. module: base_setup
#: help:base_setup.base_setup,company,rml_footer1:0
@@ -184,21 +194,24 @@ msgid ""
"We suggest you to write legal sentences here:\n"
"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
msgstr ""
+"Ova će se rečenica pojavljivati u podnožju vaših izvještaja.\n"
+"Savjetujemo vam da ovdje upišete osnovne podatke:\n"
+"Web: http://openerp.com - Fax: +32.81.73.35.01 - Fortis Bank: 126-2013269-07"
#. module: base_setup
#: wizard_view:base_setup.base_setup,update:0
msgid "Summary"
-msgstr ""
+msgstr "Sižetak"
#. module: base_setup
#: wizard_button:base_setup.base_setup,update,finish:0
msgid "Install"
-msgstr ""
+msgstr "Instaliraj"
#. module: base_setup
#: wizard_view:base_setup.base_setup,finish:0
msgid "Installation Done"
-msgstr ""
+msgstr "Instalacija Završena"
#. module: base_setup
#: help:base_setup.base_setup,company,rml_header1:0
@@ -209,57 +222,60 @@ msgid ""
"We suggest you to put a slogan here:\n"
"\"Open Source Business Solutions\"."
msgstr ""
+"Ova će se rečenica pojavljivati u gornjem desno kutu vaših izvještaja.\n"
+"Savjetujemo vam da ovdje upišete slogan tvrtke:\n"
+"\"Open Source Business Solutions\""
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,rml_header1:0
#: wizard_field:base_setup.base_setup,init,rml_header1:0
#: wizard_field:base_setup.base_setup,update,rml_header1:0
msgid "Report Header"
-msgstr ""
+msgstr "Zaglavlje Izvještaja"
#. module: base_setup
#: wizard_view:base_setup.base_setup,company:0
msgid "Your Logo - Use a size of about 450x150 pixels."
-msgstr ""
+msgstr "Vaš Logo: Koristite veličinu slike od cca. 450x150 pixela."
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,currency:0
#: wizard_field:base_setup.base_setup,init,currency:0
#: wizard_field:base_setup.base_setup,update,currency:0
msgid "Currency"
-msgstr ""
+msgstr "Valuta"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,street:0
#: wizard_field:base_setup.base_setup,init,street:0
#: wizard_field:base_setup.base_setup,update,street:0
msgid "Street"
-msgstr ""
+msgstr "Ulica"
#. module: base_setup
#: wizard_button:base_setup.base_setup,finish,menu:0
msgid "Use Directly"
-msgstr ""
+msgstr "Koristi Izravno"
#. module: base_setup
#: wizard_button:base_setup.base_setup,init,menu:0
msgid "Cancel"
-msgstr ""
+msgstr "Odustani"
#. module: base_setup
#: wizard_field:base_setup.base_setup,company,logo:0
#: wizard_field:base_setup.base_setup,init,logo:0
#: wizard_field:base_setup.base_setup,update,logo:0
msgid "Logo"
-msgstr ""
+msgstr "Logo"
#. module: base_setup
#: model:ir.module.module,shortdesc:base_setup.module_meta_information
msgid "Base Setup"
-msgstr ""
+msgstr "Osnovni Postav"
#. module: base_setup
#: wizard_button:base_setup.base_setup,company,init:0
#: wizard_button:base_setup.base_setup,update,company:0
msgid "Previous"
-msgstr ""
+msgstr "Prethodno"
diff --git a/addons/board_crm/__init__.py b/addons/board_crm_configuration/__init__.py
index 9a6ca02408e..9a6ca02408e 100644
--- a/addons/board_crm/__init__.py
+++ b/addons/board_crm_configuration/__init__.py
diff --git a/addons/board_crm/__terp__.py b/addons/board_crm_configuration/__terp__.py
index 1742a491009..3c303ee2d1c 100644
--- a/addons/board_crm/__terp__.py
+++ b/addons/board_crm_configuration/__terp__.py
@@ -21,7 +21,7 @@
{
- 'name': 'Dashboard for CRM',
+ 'name': 'Dashboard for CRM Configuration',
'version': '1.0',
'category': 'Board/CRM',
'description': """
@@ -31,10 +31,10 @@ This module implements a dashboard for CRM that includes:
* My Meetings (list)
* Sales Pipeline by Stage (graph)
* My Cases (list)
- * Leads of the month by user (list)
+ * Jobs Tracking (graph)
""",
'author': 'Tiny',
- 'depends': ['board', 'crm'],
+ 'depends': ['board', 'crm', 'report_crm'],
'update_xml': ['board_crm_statistical_view.xml', 'board_crm_view.xml'],
'demo_xml': ['board_crm_demo.xml'],
'installable': True,
diff --git a/addons/board_crm/board_crm_demo.xml b/addons/board_crm_configuration/board_crm_demo.xml
index 76caab9208c..76caab9208c 100644
--- a/addons/board_crm/board_crm_demo.xml
+++ b/addons/board_crm_configuration/board_crm_demo.xml
diff --git a/addons/board_crm/board_crm_statistical_view.xml b/addons/board_crm_configuration/board_crm_statistical_view.xml
index 9d738721821..8dbe05735f0 100644
--- a/addons/board_crm/board_crm_statistical_view.xml
+++ b/addons/board_crm_configuration/board_crm_statistical_view.xml
@@ -6,38 +6,40 @@
-->
<record model="ir.ui.view" id="view_crm_lead_stage_graph1">
<field name="name">Leads By Stage - Graph</field>
- <field name="model">crm.lead.report</field>
+ <field name="model">report.crm.lead.section.stage</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Leads By Stage" type="pie">
<field name="stage_id"/>
<field name="nbr" operator="+"/>
+ <field name="state" group="True"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_crm_opportunity_categ_graph">
- <field name="name">crm.opportunity.report.graph</field>
- <field name="model">crm.opportunity.report</field>
+ <field name="name">report.crm.opportunity.categ.graph</field>
+ <field name="model">report.crm.opportunity.categ</field>
<field name="type">graph</field>
<field name="arch" type="xml">
- <graph string="Opportunities" type="bar" orientation="horizontal">
+ <graph string="Opportunity by Sections and Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="nbr" operator="+"/>
+ <field name="state" group="True"/>
</graph>
</field>
</record>
<act_window name="Opportunities By Categories"
domain="[('state','!=','done'),('state','!=','cancel')]"
- res_model="crm.opportunity.report"
+ res_model="report.crm.opportunity.categ"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_opportunity_categ_graph"
id="act_oppor_categ"/>
<record model="ir.actions.act_window" id="act_leads_state">
- <field name="res_model">crm.lead.report</field>
+ <field name="res_model">report.crm.lead.section.stage</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_lead_stage_graph1"/>
@@ -45,8 +47,8 @@
</record>
<act_window name="Leads Of The Month By User"
- domain="[('month','=',time.strftime('%%m')),('state','!=','cancel'),('user_id','=',uid)]"
- res_model="crm.lead.report"
+ domain="[('month','=',time.strftime('%%m')),('state','!=','cancel')]"
+ res_model="report.crm.lead.user"
view_type="form"
view_mode="graph,tree,form"
view_id="view_crm_lead_stage_graph1"
@@ -61,14 +63,14 @@
<hpaned>
<child1>
<action
- string="Opportunities"
+ string="Opportunities By Categories"
name="%(act_oppor_categ)d"
colspan="4"
height="200"
width="250"/>
<action
- string="Leads"
+ string="Leads By Stage"
name="%(act_leads_state)d"
height="200"
colspan="4"/>
@@ -98,7 +100,7 @@
<menuitem icon="terp-graph" id="base.dashboard" name="Dashboards" sequence="2" parent="base.reporting_menu"/>
<menuitem
- name="CRM" parent="base.dashboard"
+ name="CRM Configuration" parent="base.dashboard"
id="menu_board_crm_config"
groups="crm.group_crm_manager"/>
<menuitem
diff --git a/addons/board_crm/board_crm_view.xml b/addons/board_crm_configuration/board_crm_view.xml
index 8905f9d8530..586a3c64baa 100644
--- a/addons/board_crm/board_crm_view.xml
+++ b/addons/board_crm_configuration/board_crm_view.xml
@@ -2,12 +2,12 @@
<openerp>
<data>
<record model="board.note.type" id="note_crm_type">
- <field name="name">CRM</field>
+ <field name="name">CRM Configuration</field>
</record>
<record model="ir.ui.view" id="view_crm_opportunity_user_graph1">
- <field name="name">crm.opportunity.report.graph1</field>
- <field name="model">crm.opportunity.report</field>
+ <field name="name">crm.opportunity.user.graph1</field>
+ <field name="model">report.crm.opportunity.user</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunities by User and Section" type="pie">
@@ -41,7 +41,7 @@
id="act_my_cases"/>
<record model="ir.actions.act_window" id="act_my_leads_stage">
- <field name="res_model">crm.lead.report</field>
+ <field name="res_model">report.crm.lead.section.stage</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_lead_stage_graph1"/>
@@ -49,7 +49,7 @@
</record>
<record model="ir.actions.act_window" id="act_sales_pipeline">
- <field name="res_model">crm.opportunity.report</field>
+ <field name="res_model">report.crm.opportunity.user</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_user_graph1"/>
diff --git a/addons/board_crm/i18n/ar.po b/addons/board_crm_configuration/i18n/ar.po
index 0d45f64ade7..0d45f64ade7 100644
--- a/addons/board_crm/i18n/ar.po
+++ b/addons/board_crm_configuration/i18n/ar.po
diff --git a/addons/board_crm/i18n/bg.po b/addons/board_crm_configuration/i18n/bg.po
index 0c6b86788a2..0c6b86788a2 100644
--- a/addons/board_crm/i18n/bg.po
+++ b/addons/board_crm_configuration/i18n/bg.po
diff --git a/addons/board_crm/i18n/board_crm_configuration.pot b/addons/board_crm_configuration/i18n/board_crm_configuration.pot
index 51d9d26b179..51d9d26b179 100644
--- a/addons/board_crm/i18n/board_crm_configuration.pot
+++ b/addons/board_crm_configuration/i18n/board_crm_configuration.pot
diff --git a/addons/board_crm/i18n/bs.po b/addons/board_crm_configuration/i18n/bs.po
index 169d54c67c0..169d54c67c0 100644
--- a/addons/board_crm/i18n/bs.po
+++ b/addons/board_crm_configuration/i18n/bs.po
diff --git a/addons/board_crm/i18n/ca.po b/addons/board_crm_configuration/i18n/ca.po
index 85f3d59696d..85f3d59696d 100644
--- a/addons/board_crm/i18n/ca.po
+++ b/addons/board_crm_configuration/i18n/ca.po
diff --git a/addons/board_crm/i18n/cs.po b/addons/board_crm_configuration/i18n/cs.po
index a94aeadbbd1..a94aeadbbd1 100644
--- a/addons/board_crm/i18n/cs.po
+++ b/addons/board_crm_configuration/i18n/cs.po
diff --git a/addons/board_crm/i18n/de.po b/addons/board_crm_configuration/i18n/de.po
index 314ec8a2f7f..314ec8a2f7f 100644
--- a/addons/board_crm/i18n/de.po
+++ b/addons/board_crm_configuration/i18n/de.po
diff --git a/addons/board_crm/i18n/el.po b/addons/board_crm_configuration/i18n/el.po
index 85e11aa84e4..85e11aa84e4 100644
--- a/addons/board_crm/i18n/el.po
+++ b/addons/board_crm_configuration/i18n/el.po
diff --git a/addons/board_crm/i18n/es.po b/addons/board_crm_configuration/i18n/es.po
index e7c73f55d0d..e7c73f55d0d 100644
--- a/addons/board_crm/i18n/es.po
+++ b/addons/board_crm_configuration/i18n/es.po
diff --git a/addons/board_crm/i18n/es_AR.po b/addons/board_crm_configuration/i18n/es_AR.po
index 20f27d482ae..20f27d482ae 100644
--- a/addons/board_crm/i18n/es_AR.po
+++ b/addons/board_crm_configuration/i18n/es_AR.po
diff --git a/addons/board_crm/i18n/et.po b/addons/board_crm_configuration/i18n/et.po
index 7e16a374ebe..7e16a374ebe 100644
--- a/addons/board_crm/i18n/et.po
+++ b/addons/board_crm_configuration/i18n/et.po
diff --git a/addons/board_crm/i18n/fr.po b/addons/board_crm_configuration/i18n/fr.po
index 0151b62fb82..0151b62fb82 100644
--- a/addons/board_crm/i18n/fr.po
+++ b/addons/board_crm_configuration/i18n/fr.po
diff --git a/addons/board_crm/i18n/hr.po b/addons/board_crm_configuration/i18n/hr.po
index 608da6333da..608da6333da 100644
--- a/addons/board_crm/i18n/hr.po
+++ b/addons/board_crm_configuration/i18n/hr.po
diff --git a/addons/board_crm/i18n/hu.po b/addons/board_crm_configuration/i18n/hu.po
index 0d45f64ade7..0d45f64ade7 100644
--- a/addons/board_crm/i18n/hu.po
+++ b/addons/board_crm_configuration/i18n/hu.po
diff --git a/addons/board_crm/i18n/id.po b/addons/board_crm_configuration/i18n/id.po
index 6237ee205ba..6237ee205ba 100644
--- a/addons/board_crm/i18n/id.po
+++ b/addons/board_crm_configuration/i18n/id.po
diff --git a/addons/board_crm/i18n/it.po b/addons/board_crm_configuration/i18n/it.po
index f63f0417ef5..f63f0417ef5 100644
--- a/addons/board_crm/i18n/it.po
+++ b/addons/board_crm_configuration/i18n/it.po
diff --git a/addons/board_crm/i18n/ko.po b/addons/board_crm_configuration/i18n/ko.po
index 83bcf0bfd4b..83bcf0bfd4b 100644
--- a/addons/board_crm/i18n/ko.po
+++ b/addons/board_crm_configuration/i18n/ko.po
diff --git a/addons/board_crm/i18n/lt.po b/addons/board_crm_configuration/i18n/lt.po
index 0d45f64ade7..0d45f64ade7 100644
--- a/addons/board_crm/i18n/lt.po
+++ b/addons/board_crm_configuration/i18n/lt.po
diff --git a/addons/board_crm/i18n/nl.po b/addons/board_crm_configuration/i18n/nl.po
index 6e6ed7f9d70..6e6ed7f9d70 100644
--- a/addons/board_crm/i18n/nl.po
+++ b/addons/board_crm_configuration/i18n/nl.po
diff --git a/addons/board_crm/i18n/nl_BE.po b/addons/board_crm_configuration/i18n/nl_BE.po
index a407979359b..a407979359b 100644
--- a/addons/board_crm/i18n/nl_BE.po
+++ b/addons/board_crm_configuration/i18n/nl_BE.po
diff --git a/addons/board_crm/i18n/pl.po b/addons/board_crm_configuration/i18n/pl.po
index 9a5864ff93d..9a5864ff93d 100644
--- a/addons/board_crm/i18n/pl.po
+++ b/addons/board_crm_configuration/i18n/pl.po
diff --git a/addons/board_crm/i18n/pt.po b/addons/board_crm_configuration/i18n/pt.po
index 0e24b303455..0e24b303455 100644
--- a/addons/board_crm/i18n/pt.po
+++ b/addons/board_crm_configuration/i18n/pt.po
diff --git a/addons/board_crm/i18n/pt_BR.po b/addons/board_crm_configuration/i18n/pt_BR.po
index 965ee773daa..965ee773daa 100644
--- a/addons/board_crm/i18n/pt_BR.po
+++ b/addons/board_crm_configuration/i18n/pt_BR.po
diff --git a/addons/board_crm/i18n/ro.po b/addons/board_crm_configuration/i18n/ro.po
index 1df910d1e42..1df910d1e42 100644
--- a/addons/board_crm/i18n/ro.po
+++ b/addons/board_crm_configuration/i18n/ro.po
diff --git a/addons/board_crm/i18n/ru.po b/addons/board_crm_configuration/i18n/ru.po
index ab06806271e..ab06806271e 100644
--- a/addons/board_crm/i18n/ru.po
+++ b/addons/board_crm_configuration/i18n/ru.po
diff --git a/addons/board_crm/i18n/sk.po b/addons/board_crm_configuration/i18n/sk.po
index 8461cbb0130..8461cbb0130 100644
--- a/addons/board_crm/i18n/sk.po
+++ b/addons/board_crm_configuration/i18n/sk.po
diff --git a/addons/board_crm/i18n/sl.po b/addons/board_crm_configuration/i18n/sl.po
index e032b2f7647..e032b2f7647 100644
--- a/addons/board_crm/i18n/sl.po
+++ b/addons/board_crm_configuration/i18n/sl.po
diff --git a/addons/board_crm/i18n/sq.po b/addons/board_crm_configuration/i18n/sq.po
index 21bfdfbc657..21bfdfbc657 100644
--- a/addons/board_crm/i18n/sq.po
+++ b/addons/board_crm_configuration/i18n/sq.po
diff --git a/addons/board_crm/i18n/sv.po b/addons/board_crm_configuration/i18n/sv.po
index 0d45f64ade7..0d45f64ade7 100644
--- a/addons/board_crm/i18n/sv.po
+++ b/addons/board_crm_configuration/i18n/sv.po
diff --git a/addons/board_crm/i18n/tlh.po b/addons/board_crm_configuration/i18n/tlh.po
index 93bfa46a627..93bfa46a627 100644
--- a/addons/board_crm/i18n/tlh.po
+++ b/addons/board_crm_configuration/i18n/tlh.po
diff --git a/addons/board_crm/i18n/tr.po b/addons/board_crm_configuration/i18n/tr.po
index add143cbc72..add143cbc72 100644
--- a/addons/board_crm/i18n/tr.po
+++ b/addons/board_crm_configuration/i18n/tr.po
diff --git a/addons/board_crm/i18n/uk.po b/addons/board_crm_configuration/i18n/uk.po
index db1c4e12574..db1c4e12574 100644
--- a/addons/board_crm/i18n/uk.po
+++ b/addons/board_crm_configuration/i18n/uk.po
diff --git a/addons/board_crm/i18n/vi.po b/addons/board_crm_configuration/i18n/vi.po
index d6e48f47923..d6e48f47923 100644
--- a/addons/board_crm/i18n/vi.po
+++ b/addons/board_crm_configuration/i18n/vi.po
diff --git a/addons/board_crm/i18n/zh_CN.po b/addons/board_crm_configuration/i18n/zh_CN.po
index d8a60def1cf..d8a60def1cf 100644
--- a/addons/board_crm/i18n/zh_CN.po
+++ b/addons/board_crm_configuration/i18n/zh_CN.po
diff --git a/addons/board_crm/i18n/zh_TW.po b/addons/board_crm_configuration/i18n/zh_TW.po
index 7880bf4fcd5..7880bf4fcd5 100644
--- a/addons/board_crm/i18n/zh_TW.po
+++ b/addons/board_crm_configuration/i18n/zh_TW.po
diff --git a/addons/board_project/board_project_view.xml b/addons/board_project/board_project_view.xml
index 19cdb3a6a1b..fc79b0f9304 100644
--- a/addons/board_project/board_project_view.xml
+++ b/addons/board_project/board_project_view.xml
@@ -93,10 +93,10 @@
<child1>
<action colspan="4" height="220" name="%(action_view_task_tree)d" string="My Open Tasks" width="510"/>
<action colspan="4" name="%(project_issue.project_issue_categ_act0)d" string="Issues"/>
-
+
</child1>
<child2>
- <action colspan="4" height="150" name="%(action_view_project_member_tree)d" string="Members list of project"/>
+ <action colspan="4" height="150" name="%(action_view_project_member_tree)d" string="Project(s) Members"/>
<action colspan="4" name="%(action_view_project_editable_messages_tree)d" string="Messages"/>
</child2>
</hpaned>
diff --git a/addons/board_project/i18n/sv.po b/addons/board_project/i18n/sv.po
index 16fdd4bd9ff..9d4dfb842a3 100644
--- a/addons/board_project/i18n/sv.po
+++ b/addons/board_project/i18n/sv.po
@@ -7,100 +7,100 @@ 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: 2009-02-03 11:05+0000\n"
-"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
+"PO-Revision-Date: 2010-03-24 08:22+0000\n"
+"Last-Translator: Anders Eriksson (Mobila System) <ae@mobilasystem.se>\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-03-11 04:48+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_project
#: view:board.board:0
msgid "My project's planning"
-msgstr ""
+msgstr "Mina projekts planering"
#. module: board_project
#: view:hr_timesheet_sheet.sheet:0
#: model:ir.actions.act_window,name:board_project.act_hr_timesheet_sheet
msgid "Timesheets"
-msgstr ""
+msgstr "Tidrapporter"
#. module: board_project
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Felaktigt namn för modell i händelsedefinitionen."
#. module: board_project
#: view:board.board:0
#: model:ir.actions.act_window,name:board_project.act_my_project
msgid "My projects"
-msgstr ""
+msgstr "Mina projekt"
#. module: board_project
#: model:ir.actions.act_window,name:board_project.action_view_task_tree_deadline
msgid "My Task's Deadlines"
-msgstr ""
+msgstr "Mina aktiviteters deadlines"
#. module: board_project
#: view:project.task:0
msgid "My Tasks"
-msgstr ""
+msgstr "Mina aktiviteter"
#. module: board_project
#: view:board.board:0
#: model:ir.actions.act_window,name:board_project.action_view_board_note_tree
msgid "Public Notes"
-msgstr ""
+msgstr "Publika Inlägg"
#. module: board_project
#: model:ir.actions.act_window,name:board_project.open_board_project
#: model:ir.ui.menu,name:board_project.menu_board_project
msgid "Project Dashboard"
-msgstr ""
+msgstr "Projekt dashboard"
#. module: board_project
#: model:ir.module.module,shortdesc:board_project.module_meta_information
msgid "Board for project users"
-msgstr ""
+msgstr "Dashboard för projektanvändare"
#. module: board_project
#: model:ir.actions.act_window,name:board_project.action_project_pipeline_user
msgid "Pipeline of tasks"
-msgstr ""
+msgstr "Aktiviteter i pipeline"
#. module: board_project
#: view:board.board:0
msgid "My Planning"
-msgstr ""
+msgstr "Min planering"
#. module: board_project
#: view:board.board:0
#: model:ir.actions.act_window,name:board_project.act_my_account
msgid "My accounts to invoice"
-msgstr ""
+msgstr "Mina konton som skall fakturerar"
#. module: board_project
#: model:ir.actions.act_window,name:board_project.open_board_project_manager
#: model:ir.ui.menu,name:board_project.menu_board_project_manager
msgid "Project Manager Dashboard"
-msgstr ""
+msgstr "Projektledare dashboard"
#. module: board_project
#: view:board.board:0
msgid "My Deadlines"
-msgstr ""
+msgstr "Mina deadlines"
#. module: board_project
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Felaktig XML för Vyarkitektur!"
#. module: board_project
#: view:board.board:0
msgid "User's timesheets"
-msgstr ""
+msgstr "Användares tidrapporter"
#. module: board_project
#: model:ir.ui.menu,name:board_project.next_id_86
@@ -110,30 +110,30 @@ msgstr "Projekt"
#. module: board_project
#: view:board.board:0
msgid "Project manager board"
-msgstr ""
+msgstr "Projektledarens dashboard"
#. module: board_project
#: view:board.board:0
#: model:ir.actions.act_window,name:board_project.action_view_task_tree
msgid "My Open Tasks"
-msgstr ""
+msgstr "Mina öppna aktiviteter"
#. module: board_project
#: view:board.board:0
msgid "My Board"
-msgstr ""
+msgstr "Min dashboard"
#. module: board_project
#: view:board.board:0
msgid "My tasks board"
-msgstr ""
+msgstr "Dashboard för mina aktiviteter"
#. module: board_project
#: view:board.board:0
msgid "My user's pipeline"
-msgstr ""
+msgstr "Mina användares pipeline"
#. module: board_project
#: view:board.board:0
msgid "My Timesheet"
-msgstr ""
+msgstr "Min tidrapport"
diff --git a/addons/board_project/i18n/zh_CN.po b/addons/board_project/i18n/zh_CN.po
index f29a6851dcd..c21a62def53 100644
--- a/addons/board_project/i18n/zh_CN.po
+++ b/addons/board_project/i18n/zh_CN.po
@@ -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-03-20 07:39+0000\n"
-"Last-Translator: Black Jack <onetimespeed@hotmail.com>\n"
+"PO-Revision-Date: 2010-03-29 00:44+0000\n"
+"Last-Translator: digitalsatori <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-03-21 04:42+0000\n"
+"X-Launchpad-Export-Date: 2010-03-29 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_project
@@ -116,7 +116,7 @@ msgstr "项目管理控制台"
#: view:board.board:0
#: model:ir.actions.act_window,name:board_project.action_view_task_tree
msgid "My Open Tasks"
-msgstr "我打开的任务"
+msgstr "我的未结任务"
#. module: board_project
#: view:board.board:0
diff --git a/addons/board_sale/i18n/sv.po b/addons/board_sale/i18n/sv.po
index 146ea3c73d8..bd03fc11c76 100644
--- a/addons/board_sale/i18n/sv.po
+++ b/addons/board_sale/i18n/sv.po
@@ -7,67 +7,67 @@ 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: 2009-02-03 06:25+0000\n"
-"Last-Translator: <>\n"
+"PO-Revision-Date: 2010-03-24 13:56+0000\n"
+"Last-Translator: Anders Eriksson (Mobila System) <ae@mobilasystem.se>\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-03-11 04:43+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_sale
#: model:ir.module.module,shortdesc:board_sale.module_meta_information
msgid "Dashboard for sales"
-msgstr ""
+msgstr "Dashboard för kundorder"
#. module: board_sale
#: model:ir.actions.act_window,name:board_sale.open_board_sales_manager
#: model:ir.ui.menu,name:board_sale.menu_board_sales_manager
msgid "Sale Dashboard"
-msgstr ""
+msgstr "Kundorder dashboard"
#. module: board_sale
#: view:board.board:0
msgid "Sales of the month"
-msgstr ""
+msgstr "Försäljning denna månad"
#. module: board_sale
#: view:board.board:0
msgid "Sales manager board"
-msgstr ""
+msgstr "Dashboard för försäljningschef"
#. module: board_sale
#: view:board.board:0
msgid "Cases of the month"
-msgstr ""
+msgstr "Ärenden denna månad"
#. module: board_sale
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr "Felaktig XML för Vyarkitektur!"
+msgstr "Ogiltig XML för Vy-arkitektur!"
#. module: board_sale
#: view:board.board:0
msgid "My open quotations"
-msgstr ""
+msgstr "Mina öppna offerter"
#. module: board_sale
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr "Felaktigt namn för modell i händelsedefinitionen."
+msgstr "Ogiltigt modellnamn i åtgärdsdefinitionen."
#. module: board_sale
#: model:ir.ui.menu,name:board_sale.next_id_88
msgid "Sales"
-msgstr ""
+msgstr "Kundorder"
#. module: board_sale
#: view:board.board:0
msgid "Cases statistics"
-msgstr ""
+msgstr "Ärendestatistik"
#. module: board_sale
#: view:board.board:0
msgid "Top ten sales of the month"
-msgstr ""
+msgstr "Top tio kundorder denna månad"
diff --git a/addons/crm_profiling/i18n/pt_BR.po b/addons/crm_profiling/i18n/pt_BR.po
index 16c70e45e7f..ccc9abddce2 100644
--- a/addons/crm_profiling/i18n/pt_BR.po
+++ b/addons/crm_profiling/i18n/pt_BR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm_profiling
diff --git a/addons/delivery/__terp__.py b/addons/delivery/__terp__.py
index 1ce00a0cd26..9b0949e07e1 100644
--- a/addons/delivery/__terp__.py
+++ b/addons/delivery/__terp__.py
@@ -34,8 +34,8 @@
'init_xml': ['delivery_data.xml'],
'update_xml': [
'security/ir.model.access.csv',
- 'delivery_view.xml',
- 'delivery_wizard.xml',
+ 'wizard/delivery_sale_order_view.xml',
+ 'delivery_view.xml',
'partner_view.xml'
],
'demo_xml': ['delivery_demo.xml'],
diff --git a/addons/delivery/delivery_wizard.xml b/addons/delivery/delivery_wizard.xml
deleted file mode 100644
index b497e6144d9..00000000000
--- a/addons/delivery/delivery_wizard.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <wizard id="wizard_deliver_line_add" keyword="client_action_multi" model="sale.order" name="delivery.sale.order" string="Delivery Costs"/>
-
- </data>
-</openerp>
diff --git a/addons/delivery/i18n/hr.po b/addons/delivery/i18n/hr.po
index 0a9b6342c63..586c69fe1af 100644
--- a/addons/delivery/i18n/hr.po
+++ b/addons/delivery/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * delivery
-#
+# * delivery
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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-26 07:23+0000\n"
-"Last-Translator: Miro Glavić <glavicmiro@gmail.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 21:11+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:42+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: delivery
#: constraint:ir.model:0
@@ -47,7 +48,7 @@ msgstr "Dostava Poštom"
#. module: delivery
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr "Nevažeći XML za Arhitekturu Prikaza!"
+msgstr "Nevažeći XML format za Arhitekturu Prikaza!"
#. module: delivery
#: constraint:res.partner:0
@@ -57,17 +58,18 @@ msgstr "Greška ! Ne možete kreirati rekurzivno pridružene članove."
#. module: delivery
#: field:delivery.grid,state_ids:0
msgid "States"
-msgstr "Države"
+msgstr "Stanja"
#. module: delivery
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr "Nevažeće ime modela u definiciji akcije."
+msgstr "Nevažeće ime modela u definiciji Radnje."
#. module: delivery
#: help:res.partner,property_delivery_carrier:0
msgid "This delivery method will be used when invoicing from packing."
msgstr ""
+"Ovaj će način isporuke biti korišten kada se Račun radi kod Pakiranja."
#. module: delivery
#: model:ir.model,name:delivery.model_delivery_grid
@@ -77,7 +79,7 @@ msgstr "Dostavna Mreža"
#. module: delivery
#: field:delivery.grid,zip_from:0
msgid "Start Zip"
-msgstr ""
+msgstr "?Start Zip"
#. module: delivery
#: selection:delivery.grid.line,price_type:0
@@ -87,24 +89,24 @@ msgstr "Fiksno"
#. module: delivery
#: field:delivery.grid,line_ids:0
msgid "Grid Line"
-msgstr ""
+msgstr "?Grid line"
#. module: delivery
#: model:ir.actions.act_window,name:delivery.action_delivery_grid_form
#: model:ir.ui.menu,name:delivery.menu_action_delivery_grid_form
msgid "Delivery Pricelist"
-msgstr "Cijenik Dostave"
+msgstr "Cjenik Dostave"
#. module: delivery
#: model:ir.actions.act_window,name:delivery.action_picking_tree5
#: model:ir.ui.menu,name:delivery.menu_action_picking_tree5
msgid "Generate Draft Invoices On Receptions"
-msgstr ""
+msgstr "Generiraj Nacrte Računa kod Zaprimanja"
#. module: delivery
#: model:ir.model,name:delivery.model_delivery_grid_line
msgid "Delivery line of grid"
-msgstr ""
+msgstr "? Delivery line of grid"
#. module: delivery
#: model:ir.ui.menu,name:delivery.menu_delivery
@@ -114,7 +116,7 @@ msgstr "Dostava"
#. module: delivery
#: view:delivery.grid.line:0
msgid "Grid Lines"
-msgstr ""
+msgstr "?Grid line"
#. module: delivery
#: field:delivery.grid.line,grid_id:0
@@ -141,7 +143,7 @@ msgstr "Definicija mreže"
#: selection:delivery.grid.line,type:0
#: selection:delivery.grid.line,variable_factor:0
msgid "Weight * Volume"
-msgstr ""
+msgstr "Težina * Volumen"
#. module: delivery
#: selection:delivery.grid.line,operator:0
@@ -151,7 +153,7 @@ msgstr "="
#. module: delivery
#: field:delivery.carrier,product_id:0
msgid "Delivery Product"
-msgstr ""
+msgstr "Proizvod za Isporuku"
#. module: delivery
#: view:delivery.grid.line:0
@@ -161,7 +163,7 @@ msgstr "Uvjet"
#. module: delivery
#: model:ir.model,name:delivery.model_delivery_carrier
msgid "Carrier and delivery grids"
-msgstr ""
+msgstr "Mreža Prijevoza i Isporuka"
#. module: delivery
#: field:delivery.grid.line,standard_price:0
@@ -176,7 +178,7 @@ msgstr "Naziv"
#. module: delivery
#: constraint:product.template:0
msgid "Error: UOS must be in a different category than the UOM"
-msgstr ""
+msgstr "Greška: UOS mora biti u kategoriji drogačijoj od one u kojoj je UOM"
#. module: delivery
#: field:delivery.grid,country_ids:0
@@ -188,6 +190,7 @@ msgstr "Zemlje"
msgid ""
"Error: The default UOM and the purchase UOM must be in the same category."
msgstr ""
+"Greška: Predefinirani UOM i UOM kupnje moraju biti u istoj kategoriji."
#. module: delivery
#: view:sale.order:0
@@ -216,14 +219,14 @@ msgstr "Naziv Mreže"
#: field:delivery.grid,carrier_id:0
#: field:stock.picking,carrier_id:0
msgid "Carrier"
-msgstr "Nosač"
+msgstr "Prijevoznik"
#. module: delivery
#: selection:delivery.grid.line,type:0
#: selection:delivery.grid.line,variable_factor:0
#: field:stock.picking,volume:0
msgid "Volume"
-msgstr "Zapremina"
+msgstr "Volumen"
#. module: delivery
#: field:delivery.grid.line,max_value:0
@@ -256,7 +259,7 @@ msgstr "Operator"
#. module: delivery
#: model:ir.module.module,shortdesc:delivery.module_meta_information
msgid "Carriers and deliveries"
-msgstr ""
+msgstr "Prijevoznici i Isporuke"
#. module: delivery
#: field:delivery.carrier,grids_id:0
@@ -278,7 +281,7 @@ msgstr "Sekvenca"
#. module: delivery
#: field:delivery.carrier,partner_id:0
msgid "Carrier Partner"
-msgstr ""
+msgstr "Partner Prijevoznik"
#. module: delivery
#: model:ir.module.module,description:delivery.module_meta_information
@@ -287,23 +290,28 @@ msgid ""
"define your own carrier and delivery grids for prices. When creating "
"invoices from picking, Open ERP is able to add and compute the shipping line."
msgstr ""
+"Omogućuje Vam da dodate načine isporuke Prodajnim narudžbama i pakiranjima. "
+"Možete odrediti vlastitog prijevoznika i cjenike mreže isporuke. Kada se "
+"Računi kreiraju kod preuzimanja, Open ERP može dodati i izračunati način i "
+"troškove otpreme."
#. module: delivery
#: field:delivery.grid,zip_to:0
msgid "To Zip"
-msgstr ""
+msgstr "Na Pošt. Broj"
#. module: delivery
#: model:ir.actions.act_window,name:delivery.action_picking_tree4
#: model:ir.ui.menu,name:delivery.menu_action_picking_tree3
msgid "Packing to be invoiced"
-msgstr ""
+msgstr "Pakiranje za koje treba izdati račun"
#. module: delivery
#: help:sale.order,carrier_id:0
msgid ""
"Complete this field if you plan to invoice the shipping based on packing."
msgstr ""
+"Popunite ovo polje ako planirate Otpremu fakturirati na bazi Pakiranja."
#. module: delivery
#: model:ir.actions.wizard,name:delivery.wizard_deliver_line_add
@@ -318,7 +326,7 @@ msgstr "Prodajna Cijena"
#. module: delivery
#: constraint:product.product:0
msgid "Error: Invalid ean code"
-msgstr ""
+msgstr "Greška: Nepravilan ean kod"
#. module: delivery
#: view:delivery.grid:0
@@ -328,7 +336,7 @@ msgstr "Dostavne mreže"
#. module: delivery
#: wizard_button:delivery.sale.order,init,end:0
msgid "Cancel"
-msgstr "Poništi"
+msgstr "Otkaži"
#. module: delivery
#: field:sale.order,carrier_id:0
@@ -345,7 +353,7 @@ msgstr "Cijena"
#. module: delivery
#: constraint:res.partner:0
msgid "The VAT doesn't seem to be correct."
-msgstr ""
+msgstr "PDV nije točno naveden."
#. module: delivery
#: field:delivery.grid.line,price_type:0
diff --git a/addons/delivery/i18n/pt_BR.po b/addons/delivery/i18n/pt_BR.po
index 7f638659b38..9534a2fb9e9 100644
--- a/addons/delivery/i18n/pt_BR.po
+++ b/addons/delivery/i18n/pt_BR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: delivery
diff --git a/addons/delivery/wizard/delivery_sale_order.py b/addons/delivery/wizard/delivery_sale_order.py
index c7870e43d85..efc82ae4141 100644
--- a/addons/delivery/wizard/delivery_sale_order.py
+++ b/addons/delivery/wizard/delivery_sale_order.py
@@ -20,77 +20,94 @@
##############################################################################
import time
-import wizard
import ir
-import pooler
from tools.translate import _
-from tools.misc import UpdateableStr
+from osv import osv, fields
-delivery_form = UpdateableStr()
+class make_delivery(osv.osv_memory):
+ _name = "delivery.sale.order"
+ _description = 'Make Delievery'
-delivery_fields = {
- 'carrier_id' : {'string':'Delivery Method', 'type':'many2one', 'relation': 'delivery.carrier','required':True}
-}
-
-def _delivery_default(self, cr, uid, data, context):
- order_obj = pooler.get_pool(cr.dbname).get('sale.order')
- order = order_obj.browse(cr, uid, data['ids'])[0]
- delivery_form.string="""<?xml version="1.0"?>
- <form string="Create deliveries">
- <separator colspan="4" string="Delivery Method" />
- <field name="carrier_id" context="{'order_id': %d}"/>
- </form>
- """ % (data['id'],)
-
-
- if not order.state in ('draft'):
- raise wizard.except_wizard(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.'))
-
-
- carrier_id = order.partner_id.property_delivery_carrier.id
- return {'carrier_id': carrier_id}
-
-def _delivery_set(self, cr, uid, data, context):
- order_obj = pooler.get_pool(cr.dbname).get('sale.order')
- line_obj = pooler.get_pool(cr.dbname).get('sale.order.line')
- order_objs = order_obj.browse(cr, uid, data['ids'], context)
-
- for order in order_objs:
- grid_id = pooler.get_pool(cr.dbname).get('delivery.carrier').grid_get(cr, uid, [data['form']['carrier_id']],order.partner_shipping_id.id)
- if not grid_id:
- raise wizard.except_wizard(_('No grid avaible !'), _('No grid matching for this carrier !'))
- grid_obj=pooler.get_pool(cr.dbname).get('delivery.grid')
- grid = grid_obj.browse(cr, uid, [grid_id])[0]
-
- taxes = grid.carrier_id.product_id.taxes_id
- fpos = order.fiscal_position or False
- taxes_ids = pooler.get_pool(cr.dbname).get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
- line_obj.create(cr, uid, {
- 'order_id': order.id,
- 'name': grid.carrier_id.name,
- 'product_uom_qty': 1,
- 'product_uom': grid.carrier_id.product_id.uom_id.id,
- 'product_id': grid.carrier_id.product_id.id,
- 'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
- 'tax_id': [(6,0,taxes_ids)],
- 'type': 'make_to_stock'
- })
+ _columns = {
+ 'carrier_id': fields.many2one('delivery.carrier','Delivery Method', required=True),
+ }
- return {}
-class make_delivery(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [_delivery_default],
- 'result' : {'type' : 'form', 'arch' : delivery_form, 'fields' : delivery_fields, 'state' : [('end', 'Cancel', 'gtk-cancel'),('delivery', 'Add Delivery Costs', 'gtk-ok') ]}
- },
- 'delivery' : {
- 'actions' : [_delivery_set],
- 'result' : {'type' : 'state', 'state' : 'end'}
- },
- }
-make_delivery("delivery.sale.order")
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ res = super(make_delivery, self).default_get(cr, uid, fields, context=context)
+ order_obj = self.pool.get('sale.order')
+ for order in order_obj.browse(cr, uid, context.get('active_ids', [])):
+ res.update({'carrier_id': order.partner_id.property_delivery_carrier.id})
+ return res
+
+ def view_init(self, cr , uid , fields, context=None):
+ order_obj = self.pool.get('sale.order')
+ for order in order_obj.browse(cr, uid, context.get('active_ids', [])):
+ if not order.state in ('draft'):
+ raise osv.except_osv(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.'))
+ pass
+
+ def delivery_set(self, cr, uid, ids, context):
+ """
+ Adds delivery costs to Sale Order Line.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ rec_ids = context and context.get('active_ids',[])
+ order_obj = self.pool.get('sale.order')
+ line_obj = self.pool.get('sale.order.line')
+ grid_obj = self.pool.get('delivery.grid')
+ carrier_obj = self.pool.get('delivery.carrier')
+ acc_fp_obj = self.pool.get('account.fiscal.position')
+ order_objs = order_obj.browse(cr, uid, rec_ids, context)
+ for datas in self.browse(cr, uid, ids):
+ for order in order_objs:
+ grid_id = carrier_obj.grid_get(cr, uid, [datas.carrier_id.id],order.partner_shipping_id.id)
+ if not grid_id:
+ raise osv.except_osv(_('No grid available !'), _('No grid matching for this carrier !'))
+
+ if not order.state in ('draft'):
+ raise osv.except_osv(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.'))
+
+ grid = grid_obj.browse(cr, uid, grid_id)
+
+ taxes = grid.carrier_id.product_id.taxes_id
+ fpos = order.fiscal_position or False
+ taxes_ids = acc_fp_obj.map_tax(cr, uid, fpos, taxes)
+ line_obj.create(cr, uid, {
+ 'order_id': order.id,
+ 'name': grid.carrier_id.name,
+ 'product_uom_qty': 1,
+ 'product_uom': grid.carrier_id.product_id.uom_id.id,
+ 'product_id': grid.carrier_id.product_id.id,
+ 'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
+ 'tax_id': [(6,0,taxes_ids)],
+ 'type': 'make_to_stock'
+ })
+
+ return {}
+
+make_delivery()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/delivery/wizard/delivery_sale_order_view.xml b/addons/delivery/wizard/delivery_sale_order_view.xml
new file mode 100644
index 00000000000..c2609bc3923
--- /dev/null
+++ b/addons/delivery/wizard/delivery_sale_order_view.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Delivery Sale Order -->
+
+ <record id="view_make_delivery_wizard" model="ir.ui.view">
+ <field name="name">Delivery Costs</field>
+ <field name="model">delivery.sale.order</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Create Deliveries">
+ <separator colspan="4" string="Delivery Method" />
+ <field name="carrier_id"/>
+ <newline/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="delivery_set" string="Add Delivery Costs"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Delivery Costs"
+ res_model="delivery.sale.order"
+ src_model="sale.order"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="act_delivery_cost"/>
+
+
+ </data>
+</openerp>
diff --git a/addons/document/document.py b/addons/document/document.py
index 86f02e85269..f6cbddebae7 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -165,7 +165,7 @@ class document_file(osv.osv):
vals['res_model'] = context.get('default_res_model', False)
if vals.get('res_id', False) and vals.get('res_model', False):
obj_model = self.pool.get(vals['res_model'])
- result = obj_model.read(cr, uid, [vals['res_id']], context=context)
+ result = obj_model.read(cr, uid, [vals['res_id']], ['name', 'partner_id', 'address_id'], context=context)
if len(result):
obj = result[0]
if obj.get('name', False):
diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py
index a04bfce7231..270f2d9353f 100644
--- a/addons/document/document_directory.py
+++ b/addons/document/document_directory.py
@@ -64,7 +64,7 @@ class document_directory(osv.osv):
def _get_root_directory(self, cr,uid, context=None):
objid=self.pool.get('ir.model.data')
try:
- mid = objid._get_id(cr, uid, 'document', 'dir_root')
+ mid = objid._get_id(cr, uid, 'document', 'dir_root')
if not mid:
return False
root_id = objid.read(cr, uid, mid, ['res_id'])['res_id']
diff --git a/addons/document/i18n/hr.po b/addons/document/i18n/hr.po
index 7f599d3c91a..c397d2e6aab 100644
--- a/addons/document/i18n/hr.po
+++ b/addons/document/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * document
-#
+# * document
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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: 2009-12-21 01:41+0000\n"
-"Last-Translator: Jožek Prikratki <Unknown>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-24 10:09+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 05:03+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: document
#: field:document.directory,create_date:0
@@ -29,7 +30,7 @@ msgstr "ID resursa"
#. module: document
#: field:document.directory.content,include_name:0
msgid "Include Record Name"
-msgstr "Uključi naziv stavke"
+msgstr "Uključi naziv zapisa"
#. module: document
#: constraint:ir.model:0
@@ -56,7 +57,7 @@ msgstr "Postavke dokumenta"
#. module: document
#: view:ir.attachment:0
msgid "Preview"
-msgstr "Pretpregled"
+msgstr "Pregled"
#. module: document
#: field:ir.attachment,store_method:0
@@ -66,7 +67,7 @@ msgstr "Metoda pohrane"
#. module: document
#: model:ir.actions.act_window,name:document.action_config_auto_directory
msgid "Auto Configure Directory"
-msgstr "Automatski konfiguriraj mapu"
+msgstr "Automatski podesi mapu"
#. module: document
#: field:ir.attachment,file_size:0
@@ -79,7 +80,7 @@ msgid ""
"Check this field if you want that the name of the file start by the record "
"name."
msgstr ""
-"Uključite ovu opciju ako želite da naziv datoteke počinje s nazivom stavke"
+"Uključite ovu opciju ako želite da naziv datoteke počinje s nazivom zapisa"
#. module: document
#: selection:document.directory,type:0
@@ -89,7 +90,7 @@ msgstr "Drugi resursi"
#. module: document
#: field:document.directory,ressource_parent_type_id:0
msgid "Parent Model"
-msgstr "Model roditelj"
+msgstr "Ishodni Model"
#. module: document
#: view:document.configuration.wizard:0
@@ -147,7 +148,7 @@ msgstr "Struktura mape"
#. module: document
#: field:document.directory,parent_id:0
msgid "Parent Item"
-msgstr "Roditelj"
+msgstr "Ishodna stavka"
#. module: document
#: view:ir.attachment:0
@@ -174,7 +175,7 @@ msgstr "Korisnik posljednje promjene"
#. module: document
#: view:document.configuration.wizard:0
msgid "Configure"
-msgstr "Postavi"
+msgstr "Podesi"
#. module: document
#: field:document.directory,ressource_tree:0
@@ -267,7 +268,7 @@ msgstr "Bilješke"
#: view:ir.attachment:0
#: field:ir.attachment,index_content:0
msgid "Indexed Content"
-msgstr "Indeksirani dokument"
+msgstr "Indeksirani sadržaj"
#. module: document
#: view:document.directory:0
@@ -482,7 +483,7 @@ msgstr "Vrsta dokumenta"
#. module: document
#: field:document.directory,child_ids:0
msgid "Children"
-msgstr "Djeca"
+msgstr "Slijedne stavke"
#. module: document
#: view:document.directory:0
diff --git a/addons/document_webdav/i18n/pt_BR.po b/addons/document_webdav/i18n/pt_BR.po
index 6b243cb883f..aca9eaf8488 100644
--- a/addons/document_webdav/i18n/pt_BR.po
+++ b/addons/document_webdav/i18n/pt_BR.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: document_webdav_old
diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml
index 55dea914ac5..f257c8df6e4 100644
--- a/addons/event/event_view.xml
+++ b/addons/event/event_view.xml
@@ -162,7 +162,7 @@
<field name="arch" type="xml">
<tree string="Registration">
<field name="id"/>
- <field name="create_date"/>
+ <field name="date"/>
<field name="event_id"/>
<field name="partner_id"/>
<field name="nb_register"/>
@@ -331,7 +331,7 @@
</record>
<record model="ir.actions.act_window" id="action_event_registration">
- <field name="name">Registration by Event</field>
+ <field name="name">Events On Registrations</field>
<field name="res_model">report.event.registration</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
diff --git a/addons/hr/i18n/it.po b/addons/hr/i18n/it.po
index 625f910a1e0..ccae93abc2f 100644
--- a/addons/hr/i18n/it.po
+++ b/addons/hr/i18n/it.po
@@ -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: 2009-02-03 16:29+0000\n"
-"Last-Translator: Mario Riva <mario.riva@domsense.com>\n"
+"PO-Revision-Date: 2010-03-28 10:20+0000\n"
+"Last-Translator: aiedail92 <aiedail92@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 05:01+0000\n"
+"X-Launchpad-Export-Date: 2010-03-29 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr
@@ -52,12 +52,12 @@ msgstr "Domenica"
#. module: hr
#: view:res.users:0
msgid "Parents"
-msgstr ""
+msgstr "Genitori"
#. module: hr
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Modello di nome non valido nella definzione dell'azione."
#. module: hr
#: view:hr.department:0
@@ -417,7 +417,7 @@ msgstr "Categorie Dipendenti"
#. module: hr
#: field:hr.employee,address_home_id:0
msgid "Home Address"
-msgstr ""
+msgstr "Indirizzo abitazione"
#. module: hr
#: view:hr.department:0
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 24008e64843..3702bcb0f1d 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -308,6 +308,17 @@
</field>
</field>
</record>
+ <record id="view_attendance_tree_who" model="ir.ui.view">
+ <field name="name">hr.attendance.tree</field>
+ <field name="model">hr.attendance</field>
+ <field name="type">tree</field>
+ <field name="inherit_id" ref="hr_attendance.view_attendance_who"/>
+ <field name="arch" type="xml">
+ <field name="action_desc" position="after">
+ <field name="sheet_id"/>
+ </field>
+ </field>
+ </record>
<act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_by_day" name="Timesheet by Account" res_model="hr_timesheet_sheet.sheet.account" src_model="hr_timesheet_sheet.sheet"/>
<!-- <act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_by_account" name="Timesheet by Day" res_model="hr_timesheet_sheet.sheet.day" src_model="hr_timesheet_sheet.sheet"/> -->
diff --git a/addons/idea/i18n/hr.po b/addons/idea/i18n/hr.po
index 020d7d042ba..0d143c7948c 100644
--- a/addons/idea/i18n/hr.po
+++ b/addons/idea/i18n/hr.po
@@ -1,172 +1,174 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * idea
-#
+# * idea
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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: 2009-02-03 06:25+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-24 10:38+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:54+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: idea
#: field:idea.category,name:0
#: field:idea.idea,category_id:0
msgid "Category"
-msgstr ""
+msgstr "Kategorija"
#. module: idea
#: selection:idea.idea,my_vote:0
#: selection:idea.vote,score:0
#: selection:idea.vote.stat,score:0
msgid "Very Good"
-msgstr ""
+msgstr "Vrlo dobro"
#. module: idea
#: view:idea.idea:0
#: field:idea.idea,stat_vote_ids:0
msgid "Statistics"
-msgstr ""
+msgstr "Statistika"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_idea_my_idea
#: model:ir.ui.menu,name:idea.menu_idea_idea_my_idea
msgid "My Ideas"
-msgstr ""
+msgstr "Moje ideje"
#. module: idea
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nepravilno ime modela u definiciji radnje."
#. module: idea
#: selection:idea.idea,my_vote:0
#: selection:idea.vote,score:0
#: selection:idea.vote.stat,score:0
msgid "Not Voted"
-msgstr ""
+msgstr "Nije izglasan"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_idea_open_my
#: model:ir.ui.menu,name:idea.menu_idea_idea_open_my
msgid "My Open Ideas"
-msgstr ""
+msgstr "Moje otvorene Ideje"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_idea
#: model:ir.ui.menu,name:idea.menu_ideas
#: model:ir.ui.menu,name:idea.menu_ideas1
msgid "Ideas"
-msgstr ""
+msgstr "Ideje"
#. module: idea
#: field:idea.category,child_ids:0
msgid "Child Categories"
-msgstr ""
+msgstr "Slijedne Kategorije"
#. module: idea
#: view:idea.idea:0
msgid "New Idea"
-msgstr ""
+msgstr "Nova Ideja"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_category_tree
#: model:ir.ui.menu,name:idea.menu_idea_category_tree
msgid "Ideas by Categories"
-msgstr ""
+msgstr "Ideje po Kategorijama"
#. module: idea
#: field:idea.vote,score:0
#: field:idea.vote.stat,score:0
msgid "Score"
-msgstr ""
+msgstr "Bodovanje"
#. module: idea
#: selection:idea.idea,state:0
msgid "Draft"
-msgstr ""
+msgstr "Nacrt"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_vote
msgid "Idea's vote"
-msgstr ""
+msgstr "Glasanje za Ideju"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_vote_stat
msgid "Statistics on Votes"
-msgstr ""
+msgstr "Statistika Glasanja"
#. module: idea
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: idea
#: model:ir.model,name:idea.model_idea_category
msgid "Category for an idea"
-msgstr ""
+msgstr "Kategorija za Ideju"
#. module: idea
#: model:ir.module.module,shortdesc:idea.module_meta_information
msgid "Idea Manager"
-msgstr ""
+msgstr "Upravitelj Idejama"
#. module: idea
#: model:ir.ui.menu,name:idea.menu_idea_vote_stat
msgid "Vote Statistics"
-msgstr ""
+msgstr "Statistika Glasovanja"
#. module: idea
#: selection:idea.idea,state:0
msgid "Opened"
-msgstr ""
+msgstr "Otvoren"
#. module: idea
#: field:idea.idea,state:0
msgid "Status"
-msgstr ""
+msgstr "Status"
#. module: idea
#: selection:idea.idea,my_vote:0
#: selection:idea.vote,score:0
#: selection:idea.vote.stat,score:0
msgid "Good"
-msgstr ""
+msgstr "Dobro"
#. module: idea
#: field:idea.idea,description:0
msgid "Description"
-msgstr ""
+msgstr "Opis"
#. module: idea
#: selection:idea.idea,my_vote:0
#: selection:idea.vote,score:0
#: selection:idea.vote.stat,score:0
msgid "Normal"
-msgstr ""
+msgstr "Običan"
#. module: idea
#: model:ir.ui.menu,name:idea.menu_reporting
msgid "Reporting"
-msgstr ""
+msgstr "Izvještavanje"
#. module: idea
#: model:ir.model,name:idea.model_idea_vote_stat
msgid "Idea Votes Statistics"
-msgstr ""
+msgstr "Statistika Glasovanja o Ideji"
#. module: idea
#: model:ir.model,name:idea.model_idea_vote
msgid "idea.vote"
-msgstr ""
+msgstr "idea.vote"
#. module: idea
#: field:idea.comment,user_id:0
@@ -177,38 +179,38 @@ msgstr ""
#. module: idea
#: view:idea.idea:0
msgid "Your comment"
-msgstr ""
+msgstr "Vaš komentar"
#. module: idea
#: model:ir.ui.menu,name:idea.menu_config
msgid "Configuration"
-msgstr ""
+msgstr "Konfiguracija"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_category
#: model:ir.ui.menu,name:idea.menu_idea_category
msgid "Categories"
-msgstr ""
+msgstr "Kategorije"
#. module: idea
#: view:idea.stat:0
msgid "stat"
-msgstr ""
+msgstr "Stat"
#. module: idea
#: field:idea.idea,my_vote:0
msgid "My Vote"
-msgstr ""
+msgstr "Moj glas"
#. module: idea
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Neispravan XML za Arhitekturu Prikaza!"
#. module: idea
#: view:idea.vote:0
msgid "Votes"
-msgstr ""
+msgstr "Glasovi"
#. module: idea
#: model:ir.module.module,description:idea.module_meta_information
@@ -220,51 +222,58 @@ msgid ""
"managers can obtain an easy view on best ideas from all the users. Once "
"installed, check the menu 'Ideas' in the 'Tools' main menu."
msgstr ""
+"Ovaj modul omogućuje Vašem korisniku da lako i jednostavno sudjeluje u "
+"unaprijeđenju poslovanja u okviru tvrtke. Omogućuje svakome da izrazi Ideje "
+"o različitim temama i područjima. Tada ostali korisnici mogu komentirati "
+"ideju i glasovati prema tome koje ideje smatraju važnima. Svaka ideja dobija "
+"zbroj bodova na osnovi glasovanja. Voditelji tako mogu imati jasan uvid u "
+"ideje djelatnika i o tome kako su one percipirane u tvrtki. Po instalaciji, "
+"odaberite izbornik \"Ideje\" u glavnom izborniku \"Pomagala\"."
#. module: idea
#: field:idea.comment,create_date:0
#: field:idea.idea,create_date:0
msgid "Creation date"
-msgstr ""
+msgstr "Datum stvaranja"
#. module: idea
#: field:idea.idea,count_votes:0
msgid "Count of votes"
-msgstr ""
+msgstr "Zbrajanje glasova"
#. module: idea
#: field:idea.vote.stat,nbr:0
msgid "Number of Votes"
-msgstr ""
+msgstr "Broj glasova"
#. module: idea
#: model:ir.model,name:idea.model_idea_idea
msgid "idea.idea"
-msgstr ""
+msgstr "idea.idea"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_idea_draft_my
#: model:ir.ui.menu,name:idea.menu_idea_idea_draft_my
msgid "My Draft Ideas"
-msgstr ""
+msgstr "Moje Ideje u Nacrtu."
#. module: idea
#: field:idea.idea,vote_ids:0
msgid "Vote"
-msgstr ""
+msgstr "Glasuj"
#. module: idea
#: selection:idea.idea,my_vote:0
#: selection:idea.vote,score:0
#: selection:idea.vote.stat,score:0
msgid "Bad"
-msgstr ""
+msgstr "Loše"
#. module: idea
#: view:idea.idea:0
#: model:ir.ui.menu,name:idea.menu_idea_idea
msgid "All Ideas"
-msgstr ""
+msgstr "Sve ideje"
#. module: idea
#: view:idea.comment:0
@@ -272,62 +281,62 @@ msgstr ""
#: field:idea.idea,comment_ids:0
#: model:ir.model,name:idea.model_idea_comment
msgid "Comments"
-msgstr ""
+msgstr "Komentari"
#. module: idea
#: field:idea.idea,count_comments:0
msgid "Count of comments"
-msgstr ""
+msgstr "Zbrajanje komentara"
#. module: idea
#: field:idea.idea,title:0
msgid "Idea Summary"
-msgstr ""
+msgstr "Sižetak Ideje"
#. module: idea
#: view:idea.category:0
msgid "Category of ideas"
-msgstr ""
+msgstr "Kategorija Ideja"
#. module: idea
#: field:idea.category,summary:0
msgid "Summary"
-msgstr ""
+msgstr "Sižetak"
#. module: idea
#: model:ir.actions.act_window,name:idea.action_idea_idea_categ_open
#: model:ir.actions.act_window,name:idea.action_idea_idea_open
#: model:ir.ui.menu,name:idea.menu_idea_idea_open
msgid "Open Ideas"
-msgstr ""
+msgstr "Otvorene Ideje"
#. module: idea
#: view:idea.idea:0
#: view:idea.vote.stat:0
msgid "vote_stat of ideas"
-msgstr ""
+msgstr "Statistika glasovanja o Idejama"
#. module: idea
#: view:idea.comment:0
#: field:idea.comment,content:0
#: view:idea.idea:0
msgid "Comment"
-msgstr ""
+msgstr "Komentar"
#. module: idea
#: field:idea.category,parent_id:0
msgid "Parent Categories"
-msgstr ""
+msgstr "Ishodne Kategorije"
#. module: idea
#: field:idea.idea,user_id:0
msgid "Creator"
-msgstr ""
+msgstr "Kreator"
#. module: idea
#: model:ir.ui.menu,name:idea.menu_tools
msgid "Tools"
-msgstr ""
+msgstr "Pomagala"
#. module: idea
#: field:idea.comment,idea_id:0
@@ -335,46 +344,46 @@ msgstr ""
#: field:idea.vote,idea_id:0
#: field:idea.vote.stat,idea_id:0
msgid "Idea"
-msgstr ""
+msgstr "Ideja"
#. module: idea
#: selection:idea.idea,my_vote:0
#: selection:idea.vote,score:0
#: selection:idea.vote.stat,score:0
msgid "Very Bad"
-msgstr ""
+msgstr "Vrlo loše"
#. module: idea
#: selection:idea.idea,state:0
msgid "Canceled"
-msgstr ""
+msgstr "Otkazan"
#. module: idea
#: model:ir.ui.menu,name:idea.menu_idea_vote
msgid "All Votes"
-msgstr ""
+msgstr "Svi glasovi"
#. module: idea
#: view:idea.idea:0
msgid "Cancel"
-msgstr ""
+msgstr "Odustani"
#. module: idea
#: view:idea.idea:0
msgid "Close"
-msgstr ""
+msgstr "Zaključi"
#. module: idea
#: field:idea.idea,vote_avg:0
msgid "Average Score"
-msgstr ""
+msgstr "Prosječan zbroj bodova"
#. module: idea
#: view:idea.idea:0
msgid "Open"
-msgstr ""
+msgstr "Otvori"
#. module: idea
#: help:idea.idea,description:0
msgid "Content of the idea"
-msgstr ""
+msgstr "Sadržaj Ideje"
diff --git a/addons/l10n_be/__terp__.py b/addons/l10n_be/__terp__.py
index 43d5a189247..618367dfef7 100644
--- a/addons/l10n_be/__terp__.py
+++ b/addons/l10n_be/__terp__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -39,20 +39,21 @@
""",
'author': 'Tiny',
- 'depends': [
- 'account',
- 'account_report',
- 'base_vat',
- 'base_iban',
- 'account_chart'
+ 'depends': [
+ 'account',
+ 'account_report',
+ 'base_vat',
+ 'base_iban',
+ 'account_chart'
],
'init_xml': [],
'update_xml': [
- 'account_pcmn_belgium.xml',
- 'l10n_be_wizard.xml',
- 'l10n_be_sequence.xml',
- 'fiscal_templates.xml',
- 'security/ir.model.access.csv'
+ 'account_pcmn_belgium.xml',
+ 'l10n_be_wizard.xml',
+ 'wizard/l10n_be_account_vat_declaration_view.xml',
+ 'l10n_be_sequence.xml',
+ 'fiscal_templates.xml',
+ 'security/ir.model.access.csv'
],
'demo_xml': [
'account.report.report.csv'
diff --git a/addons/l10n_be/company.py b/addons/l10n_be/company.py
index 8d6633b0d88..4395f13380e 100644
--- a/addons/l10n_be/company.py
+++ b/addons/l10n_be/company.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,17 +15,15 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-
from osv import osv
class res_company(osv.osv):
_inherit = "res.company"
_description = 'res.company'
-
def _get_default_ad(self, addresses):
city = post_code = address = ""
for ads in addresses:
@@ -39,4 +37,4 @@ class res_company(osv.osv):
return city, post_code, address
res_company()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/addons/l10n_be/l10n_be_wizard.xml b/addons/l10n_be/l10n_be_wizard.xml
index c20f1c62420..86c4d828b70 100644
--- a/addons/l10n_be/l10n_be_wizard.xml
+++ b/addons/l10n_be/l10n_be_wizard.xml
@@ -21,7 +21,7 @@
type="wizard"
id="partner_wizard_vat_menu"/>
- <wizard
+<!-- <wizard
string="Periodical VAT Declaration"
name="wizard.account.xml.vat.declaration"
menu="False"
@@ -32,7 +32,7 @@
parent="menu_finance_belgian_statement"
action="wizard_xml_vat_declaration"
type="wizard"
- id="account_wizard_vat_declaration"/>
+ id="account_wizard_vat_declaration"/> -->
<wizard
string="Partner VAT intra"
diff --git a/addons/l10n_be/wizard/__init__.py b/addons/l10n_be/wizard/__init__.py
index 1050e8e2ee9..b811c54a6e4 100644
--- a/addons/l10n_be/wizard/__init__.py
+++ b/addons/l10n_be/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,13 +15,14 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import account_vat_declaration
import partner_vat_listing
import wizard_vat_intra
+import l10n_be_account_vat_declaration
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/l10n_be/wizard/account_vat_declaration.py b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
index 6533493ce23..490709b15ec 100644
--- a/addons/l10n_be/wizard/account_vat_declaration.py
+++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,69 +15,62 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import wizard
import time
import datetime
-import pooler
import base64
-
+from osv import osv, fields
from tools.translate import _
-form_fyear = """<?xml version="1.0"?>
-<form string="Select Period">
- <field name="period" />
-</form>"""
-
-fields_fyear = {
- 'period': {'string': 'Period', 'type': 'many2one', 'relation': 'account.period', 'required': True,},
-}
+class l10n_be_vat_declaration(osv.osv_memory):
+ """ Vat Declaration """
+ _name = "l1on_be.vat.declaration"
+ _description = "Vat Declaration"
-form = """<?xml version="1.0"?>
-<form string="Notification">
- <separator string="XML Flie has been Created." colspan="4"/>
- <field name="msg" colspan="4" nolabel="1"/>
- <field name="file_save" />
-</form>"""
-
-fields = {
- 'msg': {'string':'File created', 'type':'text', 'size':'100','readonly':True},
- 'file_save':{'string': 'Save File',
- 'type': 'binary',
- 'readonly': True,},
-}
+ _columns = {
+ 'period_id': fields.many2one('account.period','Period', required=True),
+ 'msg': fields.text('File created', size=64, readonly=True),
+ 'file_save' : fields.binary('Save File'),
+ }
+ _defaults = {
+ 'msg': lambda *a:'''Save the File with '".xml"' extension.''',
+ }
-class wizard_vat_declaration(wizard.interface):
+ def create_xml(self, cr, uid, ids, context={}):
+ obj_fyear = self.pool.get('account.fiscalyear')
+ obj_tax_code = self.pool.get('account.tax.code')
+ obj_acc_period = self.pool.get('account.period')
+ obj_user = self.pool.get('res.users')
+ obj_comp = self.pool.get('res.company')
+ obj_data = self.pool.get('ir.model.data')
- def _create_xml(self, cr, uid, data, context):
list_of_tags=['00','01','02','03','45','46','47','48','49','54','55','56','57','59','61','62','63','64','71','81','82','83','84','85','86','87','91']
- pool_obj = pooler.get_pool(cr.dbname)
- #obj_company = pool_obj.get('res.company').browse(cr,uid,1)
- obj_company = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id
+ obj_company = obj_user.browse(cr, uid, uid, context=context).company_id
user_cmpny = obj_company.name
vat_no=obj_company.partner_id.vat
if not vat_no:
raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!'))
- tax_ids = pool_obj.get('account.tax.code').search(cr,uid,[])
+ tax_code_ids = obj_tax_code.search(cr, uid, [], context=context)
ctx = context.copy()
- ctx['period_id'] = data['form']['period'] #added context here
- tax_info = pool_obj.get('account.tax.code').read(cr,uid,tax_ids,['code','sum_period'],context=ctx)
+ data = self.read(cr, uid, ids)[0]
+ ctx['period_id'] = data['period_id'] #added context here
+ tax_info = obj_tax_code.read(cr, uid, tax_code_ids, ['code','sum_period'], context=ctx)
- address=post_code=city=''
+ address = post_code = city = ''
if not obj_company.partner_id.address:
- address=post_code=city=''
+ address = post_code = city = ''
+
+ city, post_code, address = obj_comp._get_default_ad(obj_company.partner_id.address)
- city, post_code, address = pooler.get_pool(cr.dbname).get('res.company')._get_default_ad(obj_company.partner_id.address)
- obj_fyear = pool_obj.get('account.fiscalyear')
year_id = obj_fyear.find(cr, uid)
-
- account_period=pool_obj.get('account.period').browse(cr, uid, data['form']['period'])
+
+ account_period = obj_acc_period.browse(cr, uid, data['period_id'], context=context)
current_year = account_period.fiscalyear_id.name
period_code = account_period.code
@@ -93,7 +86,7 @@ class wizard_vat_declaration(wizard.interface):
starting_month = account_period.date_start[5:7]
ending_month = account_period.date_stop[5:7]
if starting_month != ending_month:
- #starting month and ending month of selected period are not the same
+ #starting month and ending month of selected period are not the same
#it means that the accounting isn't based on periods of 1 month but on quarters
quarter = str(((int(starting_month) - 1) / 3) + 1)
data_of_file += '<QUARTER>'+quarter+'</QUARTER>\n\t\t\t'
@@ -110,21 +103,10 @@ class wizard_vat_declaration(wizard.interface):
data_of_file +='\n\t\t\t\t<D'+str(int(item['code'])) +'>' + str(int(item['sum_period']*100)) + '</D'+str(int(item['code'])) +'>'
data_of_file +='\n\t\t\t</DATA_ELEM>\n\t\t</DATA>\n\t</VATRECORD>\n</VATSENDING>'
- data['form']['msg']='Save the File with '".xml"' extension.'
- data['form']['file_save']=base64.encodestring(data_of_file)
- return data['form']
-
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':form_fyear, 'fields':fields_fyear, 'state':[('end','Cancel'),('go','Create XML')]},
- },
- 'go': {
- 'actions': [_create_xml],
- 'result': {'type':'form', 'arch':form, 'fields':fields, 'state':[('end','Ok')]},
- }
- }
+ data['file_save'] = base64.encodestring(data_of_file)
+ self.write(cr, uid, ids, {'file_save':data['file_save']}, context=context)
+
+
+l10n_be_vat_declaration()
-wizard_vat_declaration('wizard.account.xml.vat.declaration')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml b/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml
new file mode 100644
index 00000000000..f0c19198bf3
--- /dev/null
+++ b/addons/l10n_be/wizard/l10n_be_account_vat_declaration_view.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <menuitem
+ id="menu_finance_belgian_statement"
+ name="Belgium Statements"
+ parent="account.menu_finance_legal_statement"/>
+
+ <record id="view_vat_declaration" model="ir.ui.view">
+ <field name="name">Select Period</field>
+ <field name="model">l1on_be.vat.declaration</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Select Period">
+ <group colspan="4" >
+ <field name="period_id" select="1"/>
+ <button colspan="1" name="create_xml" string="Create XML" type="object" default_focus="1"/>
+ </group>
+ <separator string="XML Flie has been Created." colspan="4"/>
+ <group colspan="4" >
+ <field name="msg" nolabel="1" colspan="4"/>
+ <field name="file_save" readonly="True"/>
+ </group>
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_vat_declaration" model="ir.actions.act_window">
+ <field name="name">Vat Declaraion</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">l1on_be.vat.declaration</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="view_vat_declaration"/>
+ <field name="target">new</field>
+ </record>
+
+ <menuitem
+ name="Periodical VAT Declaration"
+ parent="menu_finance_belgian_statement"
+ action="action_vat_declaration"
+ id="l10_be_vat_declaration"/>
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/mrp/__init__.py b/addons/mrp/__init__.py
index b1b92e8514e..39d97d0ba11 100644
--- a/addons/mrp/__init__.py
+++ b/addons/mrp/__init__.py
@@ -21,8 +21,8 @@
import mrp
import stock
+import product
import installer
-import mrp_wizard
import wizard
import report
import company
diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py
index feabb8cc123..acf25b160e0 100644
--- a/addons/mrp/__terp__.py
+++ b/addons/mrp/__terp__.py
@@ -60,8 +60,14 @@
'security/ir.model.access.csv',
'mrp_workflow.xml',
'mrp_data.xml',
- 'mrp_wizard_view.xml',
+ 'wizard/mrp_product_produce_view.xml',
+ 'wizard/make_procurement_view.xml',
+ 'wizard/change_production_qty_view.xml',
+ 'wizard/orderpoint_procurement_view.xml',
+ 'wizard/mrp_price_view.xml',
+ 'wizard/mrp_workcenter_load_view.xml',
'mrp_view.xml',
+ 'wizard/schedulers_all_view.xml',
'mrp_wizard.xml',
'mrp_report.xml',
'company_view.xml',
diff --git a/addons/mrp/i18n/zh_CN.po b/addons/mrp/i18n/zh_CN.po
index 3da923faf93..8f9e0cabe47 100644
--- a/addons/mrp/i18n/zh_CN.po
+++ b/addons/mrp/i18n/zh_CN.po
@@ -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-03-20 08:33+0000\n"
-"Last-Translator: Black Jack <onetimespeed@hotmail.com>\n"
+"PO-Revision-Date: 2010-03-29 00:43+0000\n"
+"Last-Translator: digitalsatori <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-03-21 04:42+0000\n"
+"X-Launchpad-Export-Date: 2010-03-29 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: mrp
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 716b19164e9..6864b542396 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -134,6 +134,18 @@ class mrp_bom(osv.osv):
_name = 'mrp.bom'
_description = 'Bills of Material'
def _child_compute(self, cr, uid, ids, name, arg, context={}):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID of mrp.production object
+ @param name:
+ @param arg:
+
+ @return: True
+
+ """
+
result = {}
for bom in self.browse(cr, uid, ids, context=context):
result[bom.id] = map(lambda x: x.id, bom.bom_lines)
@@ -145,6 +157,9 @@ class mrp_bom(osv.osv):
if sids:
bom2 = self.pool.get('mrp.bom').browse(cr, uid, sids[0], context=context)
result[bom.id] += map(lambda x: x.id, bom2.bom_lines)
+ print "name",name
+ print "arg",arg
+ print "result",result
return result
def _compute_type(self, cr, uid, ids, field_name, arg, context):
res = dict(map(lambda x: (x,''), ids))
@@ -189,6 +204,8 @@ class mrp_bom(osv.osv):
'child_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hierarchy", type='many2many'),
'child_complete_ids': fields.function(_child_compute,relation='mrp.bom', method=True, string="BoM Hierarchy", type='many2many'),
'company_id': fields.many2one('res.company','Company',required=True),
+ 'multi_level_bom': fields.boolean('Multi-level BoM'),
+
}
_defaults = {
'active': lambda *a: 1,
@@ -196,7 +213,8 @@ class mrp_bom(osv.osv):
'product_qty': lambda *a: 1.0,
'product_rounding': lambda *a: 1.0,
'type': lambda *a: 'normal',
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.bom', context=c)
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.bom', context=c),
+ 'multi_level_bom': lambda *a: 0,
}
_order = "sequence"
_sql_constraints = [
@@ -298,11 +316,12 @@ class mrp_bom(osv.osv):
rev_ids = res[0]['revision_ids']
idx = 1
new_idx = []
+ bom_rev_obj = self.pool.get('mrp.bom.revision')
for rev_id in rev_ids:
if res[0]['revision_type'] == 'numeric':
- self.pool.get('mrp.bom.revision').write(cr, uid, [rev_id], {'indice' : idx})
+ bom_rev_obj.write(cr, uid, [rev_id], {'indice' : idx})
else:
- self.pool.get('mrp.bom.revision').write(cr, uid, [rev_id], {'indice' : "%c"%(idx+96,)})
+ bom_rev_obj.write(cr, uid, [rev_id], {'indice' : "%c"%(idx+96,)})
idx+=1
return True
@@ -375,30 +394,7 @@ class one2many_domain(fields.one2many):
class mrp_production(osv.osv):
_name = 'mrp.production'
_description = 'Production'
- _date_name = 'date_planned'
-
- def _get_sale_order(self,cr,uid,ids,field_name=False):
- move_obj=self.pool.get('stock.move')
- def get_parent_move(move_id):
- move = move_obj.browse(cr,uid,move_id)
- if move.move_dest_id:
- return get_parent_move(move.move_dest_id.id)
- return move_id
- productions=self.read(cr,uid,ids,['id','move_prod_id'])
- res={}
- for production in productions:
- res[production['id']]=False
- if production.get('move_prod_id',False):
- parent_move_line=get_parent_move(production['move_prod_id'][0])
- if parent_move_line:
- move = move_obj.browse(cr,uid,parent_move_line)
- #TODO: fix me sale module can not be used here,
- #as may be mrp can be installed without sale module
- if field_name=='name':
- res[production['id']]=move.sale_line_id and move.sale_line_id.order_id.name or False
- if field_name=='client_order_ref':
- res[production['id']]=move.sale_line_id and move.sale_line_id.order_id.client_order_ref or False
- return res
+ _date_name = 'date_planned'
def _production_calc(self, cr, uid, ids, prop, unknow_none, context={}):
result = {}
@@ -424,11 +420,12 @@ class mrp_production(osv.osv):
result[prod.id] = prod.date_planned[:10]
return result
- def _sale_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict):
- return self._get_sale_order(cr,uid,ids,field_name='name')
-
- def _sale_ref_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict):
- return self._get_sale_order(cr,uid,ids,field_name='client_order_ref')
+ def _ref_calc(self, cr, uid, ids, field_names=None, arg=False, context={}):
+ res = {}
+ for f in field_names:
+ for order_id in ids:
+ res[order_id] = {f:False}
+ return res
_columns = {
'name': fields.char('Reference', size=64, required=True),
@@ -470,8 +467,8 @@ class mrp_production(osv.osv):
'hour_total': fields.function(_production_calc, method=True, type='float', string='Total Hours', multi='workorder'),
'cycle_total': fields.function(_production_calc, method=True, type='float', string='Total Cycles', multi='workorder'),
- 'sale_name': fields.function(_sale_name_calc, method=True, type='char', string='Sale Name', help='Indicate the name of sale order.'),
- 'sale_ref': fields.function(_sale_ref_calc, method=True, type='char', string='Sale Reference', help='Indicate the Customer Reference from sale order.'),
+ 'sale_name': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sale Name', help='Indicate the name of sale order.'),
+ 'sale_ref': fields.function(_ref_calc, method=True, multi='sale_ref', type='char', string='Sale Reference', help='Indicate the Customer Reference from sale order.'),
'company_id': fields.many2one('res.company','Company',required=True),
}
_defaults = {
@@ -533,15 +530,18 @@ class mrp_production(osv.osv):
def action_compute(self, cr, uid, ids, properties=[]):
results = []
+ bom_obj = self.pool.get('mrp.bom')
+ prod_line_obj = self.pool.get('mrp.production.product.line')
+ workcenter_line_obj = self.pool.get('mrp.production.workcenter.line')
for production in self.browse(cr, uid, ids):
cr.execute('delete from mrp_production_product_line where production_id=%s', (production.id,))
cr.execute('delete from mrp_production_workcenter_line where production_id=%s', (production.id,))
bom_point = production.bom_id
bom_id = production.bom_id.id
if not bom_point:
- bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, production.product_id.id, production.product_uom.id, properties)
+ bom_id = bom_obj._bom_find(cr, uid, production.product_id.id, production.product_uom.id, properties)
if bom_id:
- bom_point = self.pool.get('mrp.bom').browse(cr, uid, bom_id)
+ bom_point = bom_obj.browse(cr, uid, bom_id)
routing_id = bom_point.routing_id.id or False
self.write(cr, uid, [production.id], {'bom_id': bom_id, 'routing_id': routing_id})
@@ -552,32 +552,34 @@ class mrp_production(osv.osv):
# 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 = self.pool.get('mrp.bom')._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties)
+ res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties)
results = res[0]
results2 = res[1]
for line in results:
line['production_id'] = production.id
- self.pool.get('mrp.production.product.line').create(cr, uid, line)
+ prod_line_obj.create(cr, uid, line)
for line in results2:
line['production_id'] = production.id
- self.pool.get('mrp.production.workcenter.line').create(cr, uid, line)
+ workcenter_line_obj.create(cr, uid, line)
return len(results)
def action_cancel(self, cr, uid, ids):
+ move_obj = self.pool.get('stock.move')
for production in self.browse(cr, uid, ids):
if production.move_created_ids:
- self.pool.get('stock.move').action_cancel(cr, uid, [x.id for x in production.move_created_ids])
- self.pool.get('stock.move').action_cancel(cr, uid, [x.id for x in production.move_lines])
+ 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,[])]})
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):
+ move_obj = self.pool.get('stock.move')
self.write(cr, uid, ids, {'state':'ready'})
for production in self.browse(cr, uid, ids):
if production.move_prod_id:
- self.pool.get('stock.move').write(cr, uid, [production.move_prod_id.id],
+ move_obj.write(cr, uid, [production.move_prod_id.id],
{'location_id':production.location_dest_id.id})
return True
@@ -596,7 +598,23 @@ class mrp_production(osv.osv):
res = False
return res
- def do_produce(self, cr, uid, production_id, production_qty, production_mode, context=None):
+ def action_produce(self, cr, uid, production_id, production_qty, production_mode, context=None):
+ """
+ To produce final product base on production mode (consume/consume&produce).
+ If Production mode is consume, all stock move lines of raw materials will be done/consumed.
+ If Production mode is consume & produce, all stock move lines of raw materials will be done/consumed
+ and stock move lines of final product will be also done/produced.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param production_id: the ID of mrp.production object
+ @param production_qty: specify qty to produce
+ @param production_mode: specify production mode (consume/consume&produce).
+
+ @return: True
+
+ """
stock_mov_obj = self.pool.get('stock.move')
production = self.browse(cr, uid, production_id)
@@ -604,6 +622,7 @@ class mrp_production(osv.osv):
final_product_todo = []
if production_mode in ['consume','consume_produce']:
+ # To consume remaining qty of raw materials
consumed_products = {}
produced_qty = 0
for consumed_product in production.move_lines2:
@@ -628,6 +647,7 @@ class mrp_production(osv.osv):
stock_mov_obj.action_consume(cr, uid, [raw_product.id], rest_qty, production.location_src_id.id, context=context)
if production_mode == 'consume_produce':
+ # To produce remaining qty of final product
vals = {'state':'confirmed'}
final_product_todo = [x.id for x in production.move_created_ids]
stock_mov_obj.write(cr, uid, final_product_todo, vals)
@@ -663,6 +683,7 @@ class mrp_production(osv.osv):
def _costs_generate(self, cr, uid, production):
amount = 0.0
+ analytic_line_obj = self.pool.get('account.analytic.line')
for wc_line in production.workcenter_lines:
wc = wc_line.workcenter_id
if wc.costs_journal_id and wc.costs_general_account_id:
@@ -670,7 +691,7 @@ class mrp_production(osv.osv):
account = wc.costs_hour_account_id.id
if value and account:
amount += value
- self.pool.get('account.analytic.line').create(cr, uid, {
+ analytic_line_obj.create(cr, uid, {
'name': wc_line.name+' (H)',
'amount': value,
'account_id': account,
@@ -683,7 +704,7 @@ class mrp_production(osv.osv):
account = wc.costs_cycle_account_id.id
if value and account:
amount += value
- self.pool.get('account.analytic.line').create(cr, uid, {
+ analytic_line_obj.create(cr, uid, {
'name': wc_line.name+' (C)',
'amount': value,
'account_id': account,
@@ -712,6 +733,10 @@ class mrp_production(osv.osv):
def action_confirm(self, cr, uid, ids):
picking_id=False
proc_ids = []
+ seq_obj = self.pool.get('ir.sequence')
+ pick_obj = self.pool.get('stock.picking')
+ move_obj = self.pool.get('stock.move')
+ proc_obj = self.pool.get('mrp.procurement')
for production in self.browse(cr, uid, ids):
if not production.product_lines:
self.action_compute(cr, uid, [production.id])
@@ -725,7 +750,9 @@ class mrp_production(osv.osv):
pick_type = 'out'
address_id = routing_loc.address_id and routing_loc.address_id.id or False
routing_loc = routing_loc.id
- picking_id = self.pool.get('stock.picking').create(cr, uid, {
+ pick_name = seq_obj.get(cr, uid, 'stock.picking.'+pick_type)
+ picking_id = pick_obj.create(cr, uid, {
+ 'name': pick_name,
'origin': (production.origin or '').split(':')[0] +':'+production.name,
'type': pick_type,
'move_type': 'one',
@@ -750,7 +777,7 @@ class mrp_production(osv.osv):
'state': 'waiting',
'company_id': production.company_id.id,
}
- res_final_id = self.pool.get('stock.move').create(cr, uid, data)
+ res_final_id = move_obj.create(cr, uid, data)
self.write(cr, uid, [production.id], {'move_created_ids': [(6, 0, [res_final_id])]})
moves = []
@@ -758,7 +785,7 @@ class mrp_production(osv.osv):
move_id=False
newdate = production.date_planned
if line.product_id.type in ('product', 'consu'):
- res_dest_id = self.pool.get('stock.move').create(cr, uid, {
+ res_dest_id = move_obj.create(cr, uid, {
'name':'PROD:'+production.name,
'date_planned': production.date_planned,
'product_id': line.product_id.id,
@@ -773,7 +800,7 @@ class mrp_production(osv.osv):
'company_id': production.company_id.id,
})
moves.append(res_dest_id)
- move_id = self.pool.get('stock.move').create(cr, uid, {
+ move_id = move_obj.create(cr, uid, {
'name':'PROD:'+production.name,
'picking_id':picking_id,
'product_id': line.product_id.id,
@@ -788,7 +815,7 @@ class mrp_production(osv.osv):
'state': 'waiting',
'company_id': production.company_id.id,
})
- proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
+ proc_id = proc_obj.create(cr, uid, {
'name': (production.origin or '').split(':')[0] + ':' + production.name,
'origin': (production.origin or '').split(':')[0] + ':' + production.name,
'date_planned': newdate,
@@ -1038,6 +1065,7 @@ class mrp_procurement(osv.osv):
def check_buy(self, cr, uid, ids):
user = self.pool.get('res.users').browse(cr, uid, uid)
+ partner_obj = self.pool.get('res.partner')
for procurement in self.browse(cr, uid, ids):
if procurement.product_id.product_tmpl_id.supply_method<>'buy':
return False
@@ -1048,7 +1076,7 @@ class mrp_procurement(osv.osv):
if user.company_id and user.company_id.partner_id:
if partner.id == user.company_id.partner_id.id:
return False
- address_id = self.pool.get('res.partner').address_get(cr, uid, [partner.id], ['delivery'])['delivery']
+ address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
if not address_id:
cr.execute('update mrp_procurement set message=%s where id=%s', (_('No address defined for the supplier'), procurement.id))
return False
@@ -1061,6 +1089,7 @@ class mrp_procurement(osv.osv):
return False
def action_confirm(self, cr, uid, ids, context={}):
+ move_obj = self.pool.get('stock.move')
for procurement in self.browse(cr, uid, ids):
if procurement.product_qty <= 0.00:
raise osv.except_osv(_('Data Insufficient !'), _('Please check the Quantity of Requisition Order(s), it should not be less than 1!'))
@@ -1069,7 +1098,7 @@ class mrp_procurement(osv.osv):
source = procurement.location_id.id
if procurement.procure_method=='make_to_order':
source = procurement.product_id.product_tmpl_id.property_stock_procurement.id
- id = self.pool.get('stock.move').create(cr, uid, {
+ id = move_obj.create(cr, uid, {
'name': 'PROC:'+procurement.name,
'location_id': source,
'location_dest_id': procurement.location_id.id,
@@ -1084,7 +1113,7 @@ class mrp_procurement(osv.osv):
else:
# TODO: check this
if procurement.procure_method=='make_to_stock' and procurement.move_id.state in ('waiting',):
- id = self.pool.get('stock.move').write(cr, uid, [procurement.move_id.id], {'state':'confirmed'})
+ id = move_obj.write(cr, uid, [procurement.move_id.id], {'state':'confirmed'})
self.write(cr, uid, ids, {'state':'confirmed','message':''})
return True
@@ -1112,14 +1141,31 @@ class mrp_procurement(osv.osv):
return True
def action_produce_assign_product(self, cr, uid, ids, context={}):
- produce_id = False
+ """
+ This is action which call from workflow to assign production order to procuments
+ @return : True
+ """
+ res = self.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
+
+ def make_mo(self, cr, uid, ids, context={}):
+ """
+ Make Manufecturing(production) order from procurement
+
+ @return : New created Production Orders procurement wise
+ """
+ res = {}
company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
+ production_obj = self.pool.get('mrp.production')
+ move_obj = self.pool.get('stock.move')
+ wf_service = netsvc.LocalService("workflow")
for procurement in self.browse(cr, uid, ids):
res_id = procurement.move_id.id
loc_id = procurement.location_id.id
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0)
newdate = newdate - DateTime.RelativeDateTime(days=company.manufacturing_lead)
- produce_id = self.pool.get('mrp.production').create(cr, uid, {
+ produce_id = production_obj.create(cr, uid, {
'origin': procurement.origin,
'product_id': procurement.product_id.id,
'product_qty': procurement.product_qty,
@@ -1133,32 +1179,52 @@ class mrp_procurement(osv.osv):
'move_prod_id': res_id,
'company_id': procurement.company_id.id,
})
+ res[procurement.id] = produce_id
self.write(cr, uid, [procurement.id], {'state':'running'})
- bom_result = self.pool.get('mrp.production').action_compute(cr, uid,
+ bom_result = production_obj.action_compute(cr, uid,
[produce_id], properties=[x.id for x in procurement.property_ids])
- wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'mrp.production', produce_id, 'button_confirm', cr)
- self.pool.get('stock.move').write(cr, uid, [res_id],
+ move_obj.write(cr, uid, [res_id],
{'location_id':procurement.location_id.id})
- return produce_id
-
+ return res
+
def action_po_assign(self, cr, uid, ids, context={}):
- purchase_id = False
+ """
+ This is action which call from workflow to assign purchase order to procuments
+ @return : True
+ """
+ res = self.make_po(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
+
+ def make_po(self, cr, uid, ids, context={}):
+ """
+ Make purchase order from procurement
+
+ @return : New created Purchase Orders procurement wise
+ """
+ res = {}
company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
+ partner_obj = self.pool.get('res.partner')
+ uom_obj = self.pool.get('product.uom')
+ pricelist_obj = self.pool.get('product.pricelist')
+ prod_obj = self.pool.get('product.product')
+ acc_pos_obj = self.pool.get('account.fiscal.position')
+ po_obj = self.pool.get('purchase.order')
for procurement in self.browse(cr, uid, ids):
res_id = procurement.move_id.id
partner = procurement.product_id.seller_ids[0].name
partner_id = partner.id
- address_id = self.pool.get('res.partner').address_get(cr, uid, [partner_id], ['delivery'])['delivery']
+ address_id = partner_obj.address_get(cr, uid, [partner_id], ['delivery'])['delivery']
pricelist_id = partner.property_product_pricelist_purchase.id
uom_id = procurement.product_id.uom_po_id.id
- qty = self.pool.get('product.uom')._compute_qty(cr, uid, procurement.product_uom.id, procurement.product_qty, uom_id)
+ qty = uom_obj._compute_qty(cr, uid, procurement.product_uom.id, procurement.product_qty, uom_id)
if procurement.product_id.seller_ids[0].qty:
qty=max(qty,procurement.product_id.seller_ids[0].qty)
- price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id]
+ price = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id]
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
@@ -1167,7 +1233,7 @@ class mrp_procurement(osv.osv):
#Passing partner_id to context for purchase order line integrity of Line name
context.update({'lang':partner.lang, 'partner_id':partner_id})
- product=self.pool.get('product.product').browse(cr,uid,procurement.product_id.id,context=context)
+ product = prod_obj.browse(cr,uid,procurement.product_id.id,context=context)
line = {
'name': product.partner_ref,
@@ -1181,11 +1247,11 @@ class mrp_procurement(osv.osv):
}
taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
- taxes = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, taxes_ids)
+ taxes = acc_pos_obj.map_tax(cr, uid, partner.property_account_position, taxes_ids)
line.update({
'taxes_id':[(6,0,taxes)]
})
- purchase_id = self.pool.get('purchase.order').create(cr, uid, {
+ purchase_id = po_obj.create(cr, uid, {
'origin': procurement.origin,
'partner_id': partner_id,
'partner_address_id': address_id,
@@ -1195,12 +1261,14 @@ class mrp_procurement(osv.osv):
'company_id': procurement.company_id.id,
'fiscal_position': partner.property_account_position and partner.property_account_position.id or False
})
+ res[procurement.id] = purchase_id
self.write(cr, uid, [procurement.id], {'state':'running', 'purchase_id':purchase_id})
- return purchase_id
+ return res
def action_cancel(self, cr, uid, ids):
todo = []
todo2 = []
+ move_obj = self.pool.get('stock.move')
for proc in self.browse(cr, uid, ids):
if proc.close_move:
if proc.move_id.state not in ('done','cancel'):
@@ -1209,9 +1277,9 @@ class mrp_procurement(osv.osv):
if proc.move_id and proc.move_id.state=='waiting':
todo.append(proc.move_id.id)
if len(todo2):
- self.pool.get('stock.move').action_cancel(cr, uid, todo2)
+ move_obj.action_cancel(cr, uid, todo2)
if len(todo):
- self.pool.get('stock.move').write(cr, uid, todo, {'state':'assigned'})
+ move_obj.write(cr, uid, todo, {'state':'assigned'})
self.write(cr, uid, ids, {'state':'cancel'})
wf_service = netsvc.LocalService("workflow")
for id in ids:
@@ -1234,10 +1302,11 @@ class mrp_procurement(osv.osv):
return res
def action_done(self, cr, uid, ids):
+ move_obj = self.pool.get('stock.move')
for procurement in self.browse(cr, uid, ids):
if procurement.move_id:
if procurement.close_move and (procurement.move_id.state <> 'done'):
- self.pool.get('stock.move').action_done(cr, uid, [procurement.move_id.id])
+ move_obj.action_done(cr, uid, [procurement.move_id.id])
res = self.write(cr, uid, ids, {'state':'done', 'date_close':time.strftime('%Y-%m-%d')})
wf_service = netsvc.LocalService("workflow")
for id in ids:
diff --git a/addons/mrp/mrp_demo.xml b/addons/mrp/mrp_demo.xml
index f0c1cfa5483..8962eb6e1c8 100644
--- a/addons/mrp/mrp_demo.xml
+++ b/addons/mrp/mrp_demo.xml
@@ -165,6 +165,7 @@
<record id="mrp_bom_0" model="mrp.bom">
<field name="name">Regular processor config</field>
+ <field name="sequence">1</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="routing_id" ref="mrp_routing_2"/>
@@ -174,6 +175,7 @@
<record id="mrp_bom_1" model="mrp.bom">
<field name="name">Assembly Basic+ PC</field>
+ <field name="sequence">5</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="routing_id" ref="mrp_routing_0"/>
@@ -181,18 +183,21 @@
</record>
<record id="mrp_bom_2" model="mrp.bom">
<field name="name">Assembly Medium PC</field>
+ <field name="sequence">8</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field model="product.product" name="product_id" search="[('default_code','=','PC3')]"/>
</record>
<record id="mrp_bom_3" model="mrp.bom">
<field name="name">Assembly Customizable PC</field>
+ <field name="sequence">11</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field model="product.product" name="product_id" search="[('default_code','=','PC4')]"/>
</record>
<record id="mrp_bom_4" model="mrp.bom">
<field name="name">HDD on demand</field>
+ <field name="sequence">14</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
@@ -200,6 +205,7 @@
</record>
<record id="mrp_bom_5" model="mrp.bom">
<field name="name">RAM on demand</field>
+ <field name="sequence">18</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
@@ -207,6 +213,7 @@
</record>
<record id="mrp_bom_6" model="mrp.bom">
<field name="name">HDD on demand</field>
+ <field name="sequence">21</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
@@ -214,6 +221,7 @@
</record>
<record id="mrp_bom_7" model="mrp.bom">
<field name="name">HDD on demand</field>
+ <field name="sequence">25</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
@@ -221,6 +229,7 @@
</record>
<record id="mrp_bom_8" model="mrp.bom">
<field name="name">HDD Seagate</field>
+ <field name="sequence">26</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -228,6 +237,7 @@
</record>
<record id="mrp_bom_9" model="mrp.bom">
<field name="name">Assembly Basic PC</field>
+ <field name="sequence">29</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="routing_id" ref="mrp_routing_0"/>
@@ -236,12 +246,14 @@
</record>
<record id="mrp_bom_10" model="mrp.bom">
<field name="name">Complete PC with peripherals</field>
+ <field name="sequence">33</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field model="product.product" name="product_id" search="[('default_code','=','PC0')]"/>
</record>
<record id="mrp_bom_11" model="mrp.bom">
<field name="name">RAM on demand</field>
+ <field name="sequence">36</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
@@ -250,6 +262,7 @@
<record id="mrp_bom_13" model="mrp.bom">
<field name="name">High Speed Processor + main board on demand</field>
+ <field name="sequence">38</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field model="product.product" name="product_id" search="[('default_code','=','CPU2')]"/>
@@ -258,6 +271,7 @@
<record id="mrp_bom_kit" model="mrp.bom">
<field name="code">KIT</field>
<field name="name">Kit Mouse</field>
+ <field name="sequence">40</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -266,6 +280,7 @@
</record>
<record id="mrp_bom_clavier" model="mrp.bom">
<field name="name">Keyboard</field>
+ <field name="sequence">42</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_kit"/>
@@ -273,6 +288,7 @@
</record>
<record id="mrp_bom_mouse" model="mrp.bom">
<field name="name">Mouse</field>
+ <field name="sequence">44</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_kit"/>
@@ -280,6 +296,7 @@
</record>
<record id="mrp_bom_16" model="mrp.bom">
<field name="name">Moon PC</field>
+ <field name="sequence">45</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_10"/>
@@ -287,6 +304,7 @@
</record>
<record id="mrp_bom_18" model="mrp.bom">
<field name="name">Mainboard ASUStek A7N8X</field>
+ <field name="sequence">49</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_13"/>
@@ -294,6 +312,7 @@
</record>
<record id="mrp_bom_19" model="mrp.bom">
<field name="name">Processor AMD Athlon 2200+</field>
+ <field name="sequence">51</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_13"/>
@@ -301,6 +320,7 @@
</record>
<record id="mrp_bom_1900" model="mrp.bom">
<field name="name">Regular Case Fan</field>
+ <field name="sequence">54</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_13"/>
@@ -308,6 +328,7 @@
</record>
<record id="mrp_bom_23" model="mrp.bom">
<field name="name">DDR 256MB PC333</field>
+ <field name="sequence">57</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_11"/>
@@ -315,6 +336,7 @@
</record>
<record id="mrp_bom_1901" model="mrp.bom">
<field name="name">DDR 512MB PC400</field>
+ <field name="sequence">59</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_13"/>
@@ -322,6 +344,7 @@
</record>
<record id="mrp_bom_22" model="mrp.bom">
<field name="name">DDR 1024MB PC400</field>
+ <field name="sequence">61</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_5"/>
@@ -329,6 +352,7 @@
</record>
<record id="mrp_bom_24" model="mrp.bom">
<field name="name">HDD Seagate 7200.8 80GB</field>
+ <field name="sequence">64</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_7"/>
@@ -336,6 +360,7 @@
</record>
<record id="mrp_bom_25" model="mrp.bom">
<field name="name">HDD Seagate 7200.8 120GB</field>
+ <field name="sequence">66</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -344,6 +369,7 @@
</record>
<record id="mrp_bom_26" model="mrp.bom">
<field name="name">RAM on demand</field>
+ <field name="sequence">69</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_3"/>
@@ -351,6 +377,7 @@
</record>
<record id="mrp_bom_27" model="mrp.bom">
<field name="name">HDD on demand</field>
+ <field name="sequence">73</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_3"/>
@@ -358,6 +385,7 @@
</record>
<record id="mrp_bom_28" model="mrp.bom">
<field name="name">ATX middle-size case</field>
+ <field name="sequence">76</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -366,6 +394,7 @@
</record>
<record id="mrp_bom_29" model="mrp.bom">
<field name="name">Processor on demand</field>
+ <field name="sequence">79</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -374,6 +403,7 @@
</record>
<record id="mrp_bom_30" model="mrp.bom">
<field name="name">ATX Middle-size case</field>
+ <field name="sequence">81</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -382,6 +412,7 @@
</record>
<record id="mrp_bom_31" model="mrp.bom">
<field name="name">HDD Seagate 7200.8 80GB</field>
+ <field name="sequence">83</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -390,6 +421,7 @@
</record>
<record id="mrp_bom_32" model="mrp.bom">
<field name="name">High speed processor config</field>
+ <field name="sequence">85</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -398,6 +430,7 @@
</record>
<record id="mrp_bom_33" model="mrp.bom">
<field name="name">HDD Seagate 7200.8 120GB</field>
+ <field name="sequence">87</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -406,6 +439,7 @@
</record>
<record id="mrp_bom_34" model="mrp.bom">
<field name="name">Regular processor config</field>
+ <field name="sequence">89</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -414,6 +448,7 @@
</record>
<record id="mrp_bom_35" model="mrp.bom">
<field name="name">ATX middle-size case</field>
+ <field name="sequence">92</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -422,6 +457,7 @@
</record>
<record id="mrp_bom_36" model="mrp.bom">
<field name="name">HDD Seagate 7200.8 120GB</field>
+ <field name="sequence">95</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -430,6 +466,7 @@
</record>
<record id="mrp_bom_processor" model="mrp.bom">
<field name="name">processor</field>
+ <field name="sequence">98</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -438,6 +475,7 @@
</record>
<record id="mrp_bom_38" model="mrp.bom">
<field name="name">mainboard</field>
+ <field name="sequence">101</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -446,6 +484,7 @@
</record>
<record id="mrp_bom_fan" model="mrp.bom">
<field name="name">fan</field>
+ <field name="sequence">105</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -454,6 +493,7 @@
</record>
<record id="mrp_bom_ram" model="mrp.bom">
<field name="name">RAM</field>
+ <field name="sequence">108</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -462,6 +502,7 @@
</record>
<record id="mrp_bom_41" model="mrp.bom">
<field name="name">Regular processor config</field>
+ <field name="sequence">111</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -470,6 +511,7 @@
</record>
<record id="mrp_bom_42" model="mrp.bom">
<field name="name">HDD Seagate 7200.8 80GB</field>
+ <field name="sequence">113</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -478,6 +520,7 @@
</record>
<record id="mrp_bom_43" model="mrp.bom">
<field name="name">ATX Middle-size case</field>
+ <field name="sequence">115</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
@@ -487,6 +530,7 @@
<record id="mrp_bom_kit2" model="mrp.bom">
<field name="code">KIT</field>
+ <field name="sequence">118</field>
<field name="name">Kit Keyboard + Mouse</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
@@ -496,6 +540,7 @@
</record>
<record id="mrp_bom_mouse2" model="mrp.bom">
<field name="name">Mouse</field>
+ <field name="sequence">121</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_kit2"/>
@@ -503,6 +548,7 @@
</record>
<record id="mrp_bom_clavier2" model="mrp.bom">
<field name="name">Keyboard</field>
+ <field name="sequence">123</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field name="bom_id" ref="mrp_bom_kit2"/>
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index e3071185725..15729a8c985 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -5,10 +5,10 @@
<menuitem icon="terp-mrp" id="base.menu_mrp_root" name="Manufacturing"
groups="group_mrp_user,group_mrp_manager" sequence="3"/>
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="4"/>
- <menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
+ <menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
<menuitem name="Control" id="menu_mrp_control" parent="base.menu_mrp_root" sequence="3" />
- <menuitem name="Master Data"
+ <menuitem name="Master Data"
id="menu_mrp_bom"
parent="base.menu_mrp_root"
sequence="5" />
@@ -242,19 +242,21 @@
<field name="arch" type="xml">
<form string="Bill of Material">
<group colspan="4" col="6">
- <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
- <field name="name" select="1"/>
- <field name="code" select="1"/>
- <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
+ <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
+ <field name="name" select="1"/>
+ <field name="code" select="1"/>
+ <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
</group>
<newline/>
- <field name="product_uom"/>
- <field name="product_qty"/>
- <newline/>
<field name="product_uos" groups="product.group_uos"/>
<field name="product_uos_qty" groups="product.group_uos"/>
<field name="routing_id" select="2" groups="base.group_extended"/>
<field name="type" groups="base.group_extended"/>
+ <group colspan="4" col="6">
+ <field name="product_uom"/>
+ <field name="product_qty"/>
+ <field name="multi_level_bom"/>
+ </group>
<notebook colspan="4">
<page string="General Information">
<field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list"/>
@@ -274,6 +276,9 @@
<field name="product_efficiency"/>
<field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
</page>
+ <page string="Multi-Level BoM" attrs="{'invisible':[('multi_level_bom','=',False)]}">
+ <field colspan="4" name="child_ids" nolabel="1" string="BoM Hierarchy"/>
+ </page>
</notebook>
</form>
</field>
@@ -286,6 +291,7 @@
<field name="field_parent">child_complete_ids</field>
<field name="arch" type="xml">
<tree string="BoM Structure" colors="blue:method">
+ <field name="sequence" invisible="1"/>
<field name="name"/>
<field name="code"/>
<field name="product_id"/>
@@ -438,15 +444,7 @@
<field name="cycle_total" operator="+"/>
</graph>
</field>
- </record>
-
- <wizard
- string="Change Product Qty."
- model="mrp.production"
- name="change_production_qty"
- id="mrp.wizard_change_production_qty"
- keyword="client_action_multi"
- multi="True"/>
+ </record>
<record id="mrp_production_form_view" model="ir.ui.view">
<field name="name">mrp.production.form</field>
@@ -463,7 +461,7 @@
<group colspan="2" col="3">
<field name="product_uom"/>
<button type="action"
- name="%(mrp.wizard_change_production_qty)d"
+ name="%(mrp.action_change_production_qty)d"
string="Change Qty" states="ready,confirmed" />
</group>
<label string="" colspan="2"/>
@@ -489,6 +487,7 @@
<field name="product_qty" string="Qty"/>
<field name="product_uom" string="UOM"/>
<field name="location_id" string="Source Loc."/>
+
<field name="state" invisible="1"/>
<button name="%(stock.move_consume)d"
string="Consume Products" type="action"
@@ -506,7 +505,7 @@
<tree string="Consumed Products" editable="bottom" colors="red:scraped==True">
<field name="product_id" readonly="1"/>
<field name="product_qty" readonly="1" string="Qty"/>
- <field name="product_uom" readonly="1" string="UOM"/>
+ <field name="product_uom" readonly="1" string="UOM"/>
<field name="location_dest_id" readonly="1" string="Destination Loc."/>
<field name="prodlot_id" />
<field name="state" invisible="1"/>
@@ -940,6 +939,7 @@
<tree string="Minimum Stock Rules">
<field name="name"/>
<field name="warehouse_id"/>
+ <field name="location_id"/>
<field name="product_id"/>
<field name="product_uom"/>
<field name="product_min_qty"/>
@@ -954,11 +954,18 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Minimum Stock Rules Search">
- <field name="name" select="1" />
- <field name="warehouse_id" select="1" widget="selection"/>
- <field name="location_id" select="1" />
- <field name="company_id" select="1" widget="selection"/>
- <field name="product_id" select="1"/>
+ <group col="10" colspan="4">
+ <field name="name" select="1" />
+ <field name="warehouse_id" select="1" widget="selection"/>
+ <field name="location_id" select="1" />
+ <field name="company_id" select="1" widget="selection"/>
+ <field name="product_id" select="1"/>
+ </group>
+ <newline/>
+ <group expand="1" string="Group By..." colspan="4" col="10">
+ <filter string="Warehouse" icon="terp-stock" domain="[]" context="{'group_by':'warehouse_id'}"/>
+ <filter string="Location" icon="terp-stock" domain="[]" context="{'group_by':'location_id'}"/>
+ </group>
</search>
</field>
</record>
diff --git a/addons/mrp/mrp_wizard.xml b/addons/mrp/mrp_wizard.xml
index 74001494c77..f7bfdcd7395 100644
--- a/addons/mrp/mrp_wizard.xml
+++ b/addons/mrp/mrp_wizard.xml
@@ -1,35 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
- <wizard id="wiz_mrp_proc0" model="mrp.procurement" string="Compute Schedulers" name="mrp.procurement.compute.all"/>
- <menuitem id="menu_mrp_scheduler" name="Schedulers" parent="base.menu_mrp_root" sequence="4"/>
- <menuitem action="wiz_mrp_proc0" id="mrp_Sched_all" parent="mrp.menu_mrp_scheduler" type="wizard" sequence="90"/>
- <!--
- <menuitem action="wiz_mrp_proc1" id="menu_wiz_mrp_proc1" parent="mrp.mrp_Sched_all" type="wizard"/>
- -->
- <wizard id="wiz_mrp_proc2" model="mrp.procurement" string="Compute Stock Minimum Rules Only" name="mrp.procurement.orderpoint.compute"/>
- <!--
- <menuitem action="wiz_mrp_proc2" id="menu_wiz_mrp_proc2" parent="mrp.mrp_Sched_all" type="wizard"/>
- -->
-
- <wizard id="wizard_workcenter_load" model="mrp.workcenter" name="mrp.workcenter.load" string="Work Center load"/>
-
- <wizard id="wizard_price" menu="False" model="product.product" name="product_price" string="Product Cost Structure"/>
- <record id="ir_project_cost_structure" model="ir.values">
- <field eval="'client_print_multi'" name="key2"/>
- <field eval="'product.product'" name="model"/>
- <field name="name">Product Cost Structure</field>
- <field eval="'ir.actions.wizard,%d'%wizard_price" name="value"/>
- <field eval="True" name="object"/>
- </record>
-
- <wizard
- string="Requisition Request"
- model="product.product"
- name="product.product.procurement"
- keyword="client_action_multi"
- id="product_procurement_wizard"/>
</data>
</openerp>
diff --git a/addons/mrp/product.py b/addons/mrp/product.py
new file mode 100644
index 00000000000..375bd0c9f46
--- /dev/null
+++ b/addons/mrp/product.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+
+
+class product_product(osv.osv):
+ _inherit = "product.product"
+
+ def do_change_standard_price(self, cr, uid, ids, datas, context={}):
+ #TODO : TO Check
+ res = super(product_product, self).do_change_standard_price(cr, uid, ids, datas, context=context)
+ bom_obj = self.pool.get('mrp.bom')
+ product_uom_obj = self.pool.get('product.uom')
+
+ def _compute_price(bom):
+ price = 0
+ if bom.bom_lines:
+ for sbom in bom.bom_lines:
+ price += _compute_price(sbom) * sbom.product_qty
+ else:
+
+ no_child_bom = bom_obj.search(cr, uid, [('product_id', '=', bom.product_id.id), ('bom_id', '=', False)])
+ if no_child_bom and bom.id not in no_child_bom:
+ other_bom = bom_obj.browse(cr, uid, no_child_bom)[0]
+ if not other_bom.product_id.calculate_price:
+ price += _compute_price(other_bom) * other_bom.product_qty
+ else:
+ price += other_bom.product_id.standard_price
+ else:
+ price += bom.product_id.standard_price
+
+ if bom.routing_id:
+ for wline in bom.routing_id.workcenter_lines:
+ wc = wline.workcenter_id
+ cycle = wline.cycle_nbr
+ hour = (wc.time_start + wc.time_stop + cycle * wc.time_cycle) * (wc.time_efficiency or 1.0)
+ price += wc.costs_cycle * cycle + wc.costs_hour * hour
+ price = product_uom_obj._compute_price(cr, uid, bom.product_uom.id, price, bom.product_id.uom_id.id)
+ if bom.bom_lines:
+ self.write(cr, uid, [bom.product_id.id], {'standard_price' : price/bom.product_qty})
+ if bom.product_uom.id != bom.product_id.uom_id.id:
+ price = product_uom_obj._compute_price(cr, uid, bom.product_uom.id, price, bom.product_id.uom_id.id)
+ return price
+
+
+ bom_ids = bom_obj.search(cr, uid, [('product_id', 'in', ids)])
+ for bom in bom_obj.browse(cr, uid, bom_ids):
+ _compute_price(bom)
+ return res
+product_product()
diff --git a/addons/mrp/report/workcenter_load.py b/addons/mrp/report/workcenter_load.py
index a65a51d03f7..248e9e5707e 100644
--- a/addons/mrp/report/workcenter_load.py
+++ b/addons/mrp/report/workcenter_load.py
@@ -134,9 +134,9 @@ class report_custom(report_int):
# select workcenters
cr.execute(
- "SELECT id, name FROM mrp_workcenter " \
- "WHERE id=ANY(%s)" \
- "ORDER BY mrp_workcenter.id" ,(ids,))
+ "SELECT mw.id, rs.name FROM mrp_workcenter mw, resource_resource rs " \
+ "WHERE mw.id=ANY(%s) and mw.resource_id=rs.id " \
+ "ORDER BY mw.id" ,(ids,))
workcenters = cr.dictfetchall()
data = []
@@ -144,13 +144,13 @@ class report_custom(report_int):
vals = []
for workcenter in workcenters:
cr.execute("SELECT SUM(mrp_production_workcenter_line.hour) AS hours, SUM(mrp_production_workcenter_line.cycle) AS cycles, \
- mrp_workcenter.name AS name, mrp_workcenter.id AS id \
- FROM mrp_production_workcenter_line, mrp_production, mrp_workcenter \
+ resource_resource.name AS name, mrp_workcenter.id AS id \
+ FROM mrp_production_workcenter_line, mrp_production, mrp_workcenter, resource_resource \
WHERE (mrp_production_workcenter_line.production_id=mrp_production.id) \
AND (mrp_production_workcenter_line.workcenter_id=mrp_workcenter.id) \
AND (mrp_workcenter.id=%s) \
AND (mrp_production.date_planned BETWEEN %s AND %s) \
- GROUP BY mrp_production_workcenter_line.workcenter_id, mrp_workcenter.name, mrp_workcenter.id \
+ GROUP BY mrp_production_workcenter_line.workcenter_id, resource_resource.name, mrp_workcenter.id \
ORDER BY mrp_workcenter.id", (workcenter['id'], dates[date]['start'] + ' 00:00:00', dates[date]['stop'] + ' 23:59:59'))
res = cr.dictfetchall()
if not res:
diff --git a/addons/mrp/schedulers.py b/addons/mrp/schedulers.py
index fb9b1edf6a8..097f81f7529 100644
--- a/addons/mrp/schedulers.py
+++ b/addons/mrp/schedulers.py
@@ -195,7 +195,7 @@ class mrp_procurement(osv.osv):
qty = max(op.product_min_qty, op.product_max_qty)-prods
reste = qty % op.qty_multiple
if reste > 0:
- qty += op.qty_multiple - reste
+ qty += op.qty_multiple - reste
newdate = DateTime.now() + DateTime.RelativeDateTime(
days=int(op.product_id.seller_delay))
if op.product_id.supply_method == 'buy':
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index 9913071038c..48f27679435 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -32,6 +32,12 @@
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
"access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0
"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0
+"access_mrp_make_procurement","make.procurement","model_make_procurement","mrp.group_mrp_user",1,0,0,0
+"access_mrp_change_production_qty","change.production.qty","model_change_production_qty","mrp.group_mrp_user",1,0,0,0
+"access_mrp_procurement_compute_all","mrp.procurement.compute.all","model_mrp_procurement_compute_all","mrp.group_mrp_user",1,0,0,0
+"access_mrp_procurement_orderpoint_compute","mrp.procurement.orderpoint.compute","model_mrp_procurement_orderpoint_compute","mrp.group_mrp_user",1,0,0,0
"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",1,0,0,0
"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,0,0,0
"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0
+"access_mrp_product_price","mrp.product_price","model_mrp_product_price","mrp.group_mrp_manager",1,0,0,0
+"access_mrp_workcenter_load","mrp.workcenter.load","model_mrp_workcenter_load","mrp.group_mrp_manager",1,0,0,0
diff --git a/addons/mrp/wizard/__init__.py b/addons/mrp/wizard/__init__.py
index 240f25daa9d..043cdc94465 100644
--- a/addons/mrp/wizard/__init__.py
+++ b/addons/mrp/wizard/__init__.py
@@ -19,14 +19,15 @@
#
##############################################################################
-import wizard_orderpoint_procurement
+import mrp_product_produce
+import orderpoint_procurement
import wizard_procurement
-import wizard_schedulers_all
-import wizard_price
-import wizard_workcenter_load
+import schedulers_all
+import mrp_price
+import mrp_workcenter_load
import wizard_track_prod
-import wizard_change_production_qty
-import make_procurement
+import change_production_qty
+import make_procurement_product
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
new file mode 100644
index 00000000000..fbbbc356c7c
--- /dev/null
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -0,0 +1,106 @@
+# -*- 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 time
+import ir
+from osv.osv import except_osv
+from osv import fields, osv
+import netsvc
+from tools.translate import _
+
+class change_production_qty(osv.osv_memory):
+ _name = 'change.production.qty'
+ _description = 'Change Quantity of Products'
+
+ _columns = {
+ 'product_qty': fields.float('Product Qty', required=True),
+ }
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ res = super(change_production_qty, self).default_get(cr, uid, fields, context=context)
+ prod_obj = self.pool.get('mrp.production')
+ prod = prod_obj.browse(cr, uid, context.get('active_id'))
+ if 'product_qty' in fields:
+ res.update({'product_qty': prod.product_qty})
+ return res
+
+ def change_prod_qty(self, cr, uid, ids, context):
+ """
+ Changes the Quantity of Product.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ record_id = context and context.get('active_id',False)
+ assert record_id, _('Active Id is not found')
+ prod_obj = self.pool.get('mrp.production')
+ product_lines_obj = self.pool.get('mrp.production.product.line')
+ bom_obj = self.pool.get('mrp.bom')
+ for wiz_qty in self.browse(cr, uid, ids):
+ prod = prod_obj.browse(cr, uid,record_id)
+ prod_obj.write(cr, uid,prod.id, {'product_qty': wiz_qty.product_qty})
+ prod_obj.action_compute(cr, uid, [prod.id])
+
+ move_lines_obj = self.pool.get('stock.move')
+ for move in prod.move_lines:
+ bom_point = prod.bom_id
+ bom_id = prod.bom_id.id
+ if not bom_point:
+ bom_id = bom_obj._bom_find(cr, uid, prod.product_id.id, prod.product_uom.id)
+ if not bom_id:
+ raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
+ prod_obj.write(cr, uid, [prod.id], {'bom_id': bom_id})
+ bom_point = sbom_obj.browse(cr, uid, [bom_id])[0]
+
+ if not bom_id:
+ raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
+
+ factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
+ res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
+ for r in res[0]:
+ if r['product_id']== move.product_id.id:
+ move_lines_obj.write(cr, uid,move.id, {'product_qty' : r['product_qty']})
+ for m in prod.move_created_ids:
+ move_lines_obj.write(cr, uid,m.id, {'product_qty': wiz_qty.product_qty})
+
+ return {}
+
+change_production_qty()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/change_production_qty_view.xml b/addons/mrp/wizard/change_production_qty_view.xml
new file mode 100644
index 00000000000..34520a71721
--- /dev/null
+++ b/addons/mrp/wizard/change_production_qty_view.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Change Product Quantity -->
+
+ <record id="view_change_production_qty_wizard" model="ir.ui.view">
+ <field name="name">Change Product Qty</field>
+ <field name="model">change.production.qty</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Change Product Qty">
+ <field name="product_qty"/>
+ <newline/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="change_prod_qty" string="Validate"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_change_production_qty" model="ir.actions.act_window">
+ <field name="name">Change Product Qty</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">change.production.qty</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
diff --git a/addons/mrp/wizard/make_procurement.py b/addons/mrp/wizard/make_procurement.py
index 0cf12107181..a549d9f24b2 100644
--- a/addons/mrp/wizard/make_procurement.py
+++ b/addons/mrp/wizard/make_procurement.py
@@ -19,84 +19,116 @@
#
##############################################################################
-import wizard
-import pooler
import netsvc
-
import time
-def _get_default(obj, cr, uid, data, context=None):
- pool = pooler.get_pool(cr.dbname)
- product = pool.get('product.product').browse(cr, uid, data['id'], context)
- return {'product_id': product.id, 'uom_id':product.uom_id.id, 'qty':1.0}
-
-def make_procurement(obj, cr, uid, data, context=None):
- '''Create procurement'''
- pool = pooler.get_pool(cr.dbname)
- wh = pool.get('stock.warehouse').browse(cr, uid, data['form']['warehouse_id'], context)
- user = pool.get('res.users').browse(cr, uid, uid, context)
- procure_id = pool.get('mrp.procurement').create(cr, uid, {
- 'name':'INT:'+str(user.login),
- 'date_planned':data['form']['date_planned'],
- 'product_id':data['form']['product_id'],
- 'product_qty':data['form']['qty'],
- 'product_uom':data['form']['uom_id'],
- 'location_id':wh.lot_stock_id.id,
- 'procure_method':'make_to_order',
- }, context=context)
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr)
- return {}
-
+from osv import fields, osv
-class MakeProcurement(wizard.interface):
- '''Wizard that create a procurement from a product form'''
-
- done_form = """<?xml version="1.0"?>
-<form string="Make Requisition">
- <label string="Your procurement request has been sent !"/>
-</form>"""
- procurement_form = """<?xml version="1.0"?>
-<form string="Internal Requisition Request">
- <label string="This wizard will plan the procurement for this product. This procurement may generate task, production orders or purchase orders." align="0.0" colspan="4"/>
- <field name="product_id"/>
- <field name="warehouse_id"/>
- <field name="qty"/>
- <field name="uom_id"/>
- <field name="date_planned"/>
-</form>"""
- procurement_fields = {
- 'qty': {'string': 'Quantity', 'type': 'float', 'digits':(16,2), 'required': True},
- 'product_id': {'string': 'product', 'type': 'many2one', 'relation': 'product.product', 'required': True, 'readonly':1},
- 'uom_id': {'string': 'Unit of Measure', 'type': 'many2one', 'relation': 'product.uom', 'required':True},
- 'warehouse_id': {'string': 'Warehouse', 'type': 'many2one', 'relation':'stock.warehouse', 'required':True},
- 'date_planned': {'string': 'Planned Date', 'type': 'date', 'required':True, 'default': lambda *args: time.strftime('%Y-%m-%d')}
+class make_procurement(osv.osv_memory):
+ _name = 'make.procurement'
+ _description = 'Make Procurements'
+
+ def onchange_product_id(self, cr, uid, ids, prod_id):
+ """
+ On Change of Product ID getting the value of related UoM.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param prod_id: Changed ID of Product
+
+ @return: A dictionary which gives the UoM of the changed Product
+
+ """
+ product = self.pool.get('product.product').browse(cr, uid, prod_id)
+ return {'value': {'uom_id': product.uom_id.id}}
+
+ _columns = {
+ 'qty': fields.float('Quantity', digits=(16,2), required=True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, readonly=1),
+ 'uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True),
+ 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
+ 'date_planned': fields.date('Planned Date', required=True),
}
-
- states = {
- 'init': {
- 'actions': [_get_default],
- 'result': {'type': 'form', 'arch': procurement_form, 'fields': procurement_fields,
- 'state': [
- ('end', 'Cancel'),
- ('create', 'Ask New Products')
- ]
- }
- },
- 'done': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': done_form, 'fields': {},
- 'state': [
- ('end', 'Close'),
- ]
- }
- },
- 'create': {
- 'actions': [],
- 'result': {'type': 'action', 'action': make_procurement, 'state': 'done'}
- }
+
+ _defaults = {
+ 'date_planned': lambda *args: time.strftime('%Y-%m-%d'),
+ 'qty': lambda *args: 1.0,
}
+
+ def make_procurement(self, cr, uid, ids, context=None):
+ """
+ Creates procurement order for selected product.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return: A dictionary which loads Procurement form view.
+
+ """
+ user = self.pool.get('res.users').browse(cr, uid, uid, context).login
+ wh_obj = self.pool.get('stock.warehouse')
+ procurement_obj = self.pool.get('mrp.procurement')
+ wf_service = netsvc.LocalService("workflow")
+ data_obj = self.pool.get('ir.model.data')
+
+ for proc in self.browse(cr, uid, ids):
+ wh = wh_obj.browse(cr, uid, proc.warehouse_id.id, context)
+ procure_id = procurement_obj.create(cr, uid, {
+ 'name':'INT: '+str(user),
+ 'date_planned': proc.date_planned,
+ 'product_id': proc.product_id.id,
+ 'product_qty': proc.qty,
+ 'product_uom': proc.uom_id.id,
+ 'location_id': wh.lot_stock_id.id,
+ 'procure_method':'make_to_order',
+ })
+
+ wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr)
+
+
+ id2 = data_obj._get_id(cr, uid, 'mrp', 'mrp_procurement_tree_view')
+ id3 = data_obj._get_id(cr, uid, 'mrp', 'mrp_procurement_form_view')
+
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'mrp.procurement',
+ 'res_id' : procure_id,
+ 'views': [(id3,'form'),(id2,'tree')],
+ 'type': 'ir.actions.act_window',
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ record_id = context and context.get('active_id', False) or False
+
+ res = super(make_procurement, self).default_get(cr, uid, fields, context=context)
+ product_id = self.pool.get('product.product').browse(cr, uid, record_id, context=context).id
+ if 'product_id' in fields:
+ res.update({'product_id':product_id})
+ return res
-MakeProcurement('product.product.procurement')
+make_procurement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/make_procurement_view.xml b/addons/mrp/wizard/make_procurement_view.xml
new file mode 100644
index 00000000000..08c4b2cabf5
--- /dev/null
+++ b/addons/mrp/wizard/make_procurement_view.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Make Procurement -->
+
+ <record id="view_make_procurment_wizard" model="ir.ui.view">
+ <field name="name">Requisition Request</field>
+ <field name="model">make.procurement</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Requisition Request">
+ <label string="This wizard will plan the procurement for this product. This procurement may generate task, production orders or purchase orders." colspan="4"/>
+ <field name="product_id" on_change="onchange_product_id(product_id)"/>
+ <field name="qty"/>
+ <field name="uom_id"/>
+ <field name="date_planned"/>
+ <field name="warehouse_id" colspan="4"/>
+ <newline/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="make_procurement" string="Ask New Products"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Requisition Request"
+ res_model="make.procurement"
+ src_model="product.product"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="act_make_procurement"/>
+
+ </data>
+</openerp>
diff --git a/addons/mrp/wizard/wizard_workcenter_load.py b/addons/mrp/wizard/mrp_price.py
index 6465622c421..5d3c16cbaa5 100644
--- a/addons/mrp/wizard/wizard_workcenter_load.py
+++ b/addons/mrp/wizard/mrp_price.py
@@ -19,34 +19,37 @@
#
##############################################################################
-import wizard
+from osv import fields, osv
-_time_unit_form = '''<?xml version="1.0"?>
-<form string="Select time unit">
- <field name="time_unit"/>
- <newline/>
- <field name="measure_unit"/>
-</form>'''
-
-_time_unit_fields = {
- 'time_unit': {'string':'Type of period', 'type':'selection', 'selection':[('day', 'Day by day'),('week', 'Per week'),('month', 'Per month')], 'required':True},
- 'measure_unit': {'string':'Amount measuring unit', 'type':'selection', 'selection':[('hours', 'Amount in hours'),('cycles', 'Amount in cycles')], 'required':True},
-}
-
-class wizard_mrp_workcenter(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':_time_unit_form, 'fields':_time_unit_fields, 'state':[('end','Cancel'),('report','Print') ]},
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'mrp.workcenter.load', 'state':'end'},
- },
+class mrp_price(osv.osv_memory):
+ _name = 'mrp.product_price'
+ _description = 'Product Price'
+ _columns = {
+ 'number': fields.integer('Number of products to produce', required=True),
}
-
-wizard_mrp_workcenter('mrp.workcenter.load')
-
+
+ def print_report(self, cr, uid, ids, context=None):
+ """
+ To print the report of Product cost structure
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+
+ @return : Report
+ """
+ datas = {'ids' : context.get('active_ids',[])}
+ res = self.read(cr, uid, ids, ['number'])
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'product.price',
+ 'datas' : datas,
+ }
+
+mrp_price()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/wizard/mrp_price_view.xml b/addons/mrp/wizard/mrp_price_view.xml
new file mode 100644
index 00000000000..e2e294c5739
--- /dev/null
+++ b/addons/mrp/wizard/mrp_price_view.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Product Cost Structure Report -->
+
+ <record id="view_mrp_product_price_wizard" model="ir.ui.view">
+ <field name="name">Product Cost Structure</field>
+ <field name="model">mrp.product_price</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Paid ?">
+ <field name="number"/>
+ <newline/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="print_report" string="Print"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Product Cost Structure"
+ res_model="mrp.product_price"
+ src_model="product.product"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_mrp_product_price_wizard"/>
+ </data>
+</openerp>
diff --git a/addons/mrp/mrp_wizard.py b/addons/mrp/wizard/mrp_product_produce.py
index 40d9f2ed1ab..7c77dfdee94 100644
--- a/addons/mrp/mrp_wizard.py
+++ b/addons/mrp/wizard/mrp_product_produce.py
@@ -34,6 +34,16 @@ class mrp_product_produce(osv.osv_memory):
}
def _get_product_qty(self, cr, uid, context):
+ """
+ To obtain product quantity
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: quantity
+
+ """
prod = self.pool.get('mrp.production').browse(cr, uid,
context['active_id'], context=context)
done = 0.0
@@ -47,11 +57,22 @@ class mrp_product_produce(osv.osv_memory):
}
def do_produce(self, cr, uid, ids, context={}):
+ """
+ To check the product type
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
+
+ """
prod_obj = self.pool.get('mrp.production')
move_ids = context['active_ids']
for data in self.read(cr, uid, ids):
for move_id in move_ids:
- prod_obj.do_produce(cr, uid, move_id,
+ prod_obj.action_produce(cr, uid, move_id,
data['product_qty'], data['mode'], context=context)
return {}
diff --git a/addons/mrp/mrp_wizard_view.xml b/addons/mrp/wizard/mrp_product_produce_view.xml
index f730c4a6b92..f730c4a6b92 100644
--- a/addons/mrp/mrp_wizard_view.xml
+++ b/addons/mrp/wizard/mrp_product_produce_view.xml
diff --git a/addons/mrp/wizard/mrp_workcenter_load.py b/addons/mrp/wizard/mrp_workcenter_load.py
new file mode 100644
index 00000000000..1b5478dcbeb
--- /dev/null
+++ b/addons/mrp/wizard/mrp_workcenter_load.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class mrp_workcenter_load(osv.osv_memory):
+ _name = 'mrp.workcenter.load'
+ _description = 'Workcenter Load'
+
+ _columns = {
+ 'time_unit': fields.selection([('day', 'Day by day'),('week', 'Per week'),('month', 'Per month')],'Type of period', required=True),
+ 'measure_unit': fields.selection([('hours', 'Amount in hours'),('cycles', 'Amount in cycles')],'Amount measuring unit', required=True),
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ """
+ To print the report of Work Center Load
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+
+ @return : Report
+ """
+ datas = {'ids' : context.get('active_ids',[])}
+ res = self.read(cr, uid, ids, ['time_unit','measure_unit'])
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'mrp.workcenter.load',
+ 'datas' : datas,
+ }
+
+mrp_workcenter_load()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/mrp_workcenter_load_view.xml b/addons/mrp/wizard/mrp_workcenter_load_view.xml
new file mode 100644
index 00000000000..a6b7a4f987d
--- /dev/null
+++ b/addons/mrp/wizard/mrp_workcenter_load_view.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Work Center Load Report -->
+
+ <record id="view_mrp_workcenter_load_wizard" model="ir.ui.view">
+ <field name="name">Work Center Load</field>
+ <field name="model">mrp.workcenter.load</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Select time unit">
+ <field name="time_unit"/>
+ <newline/>
+ <field name="measure_unit"/>
+ <newline/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="print_report" string="Print"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Work Center Load"
+ res_model="mrp.workcenter.load"
+ src_model="mrp.workcenter"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_mrp_workcenter_load_wizard"/>
+ </data>
+</openerp>
diff --git a/addons/mrp/wizard/orderpoint_procurement_view.xml b/addons/mrp/wizard/orderpoint_procurement_view.xml
new file mode 100644
index 00000000000..c17bedae84f
--- /dev/null
+++ b/addons/mrp/wizard/orderpoint_procurement_view.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Compute Stock Minimum Rules Only -->
+
+ <record id="view_procurement_compute_wizard" model="ir.ui.view">
+ <field name="name">Compute Stock Minimum Rules Only</field>
+ <field name="model">mrp.procurement.orderpoint.compute</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Parameters">
+ <field name="automatic"/>
+ <separator colspan="4"/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="procure_calculation" string="Compute Stock"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Compute Stock Minimum Rules Only"
+ res_model="mrp.procurement.orderpoint.compute"
+ src_model="mrp.procurement"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_procurement_compute"/>
+
+ </data>
+</openerp>
diff --git a/addons/mrp/wizard/schedulers_all_view.xml b/addons/mrp/wizard/schedulers_all_view.xml
new file mode 100644
index 00000000000..b8b465e03e9
--- /dev/null
+++ b/addons/mrp/wizard/schedulers_all_view.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Compute Schedulers -->
+
+ <record id="view_compute_schedulers_wizard" model="ir.ui.view">
+ <field name="name">Compute Schedulers</field>
+ <field name="model">mrp.procurement.compute.all</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Scheduler Parameters">
+ <field name="automatic"/>
+ <separator colspan="4"/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="procure_calculation" string="Compute Schedulers"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Compute Schedulers"
+ res_model="mrp.procurement.compute.all"
+ src_model="mrp.procurement"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_compute_schedulers"/>
+
+ <menuitem id="menu_mrp_scheduler" name="Schedulers" parent="base.menu_mrp_root" sequence="4"/>
+ <menuitem action="action_compute_schedulers" id="mrp_Sched_all" parent="mrp.menu_mrp_scheduler" sequence="90"/>
+
+ </data>
+</openerp>
diff --git a/addons/mrp/wizard/wizard_change_production_qty.py b/addons/mrp/wizard/wizard_change_production_qty.py
deleted file mode 100644
index a9a8387acdf..00000000000
--- a/addons/mrp/wizard/wizard_change_production_qty.py
+++ /dev/null
@@ -1,117 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-import wizard
-import ir
-import pooler
-from osv.osv import except_osv
-from osv import fields,osv
-import netsvc
-from tools.translate import _
-
-
-form1 = '''<?xml version="1.0"?>
-<form string="Change Product Qty">
- <field name="product_qty"/>
-</form>'''
-
-form1_fields={
- 'product_qty': {'string': 'Product Qty', 'type':'float', 'required':True},
- }
-
-def _get_qty(self,cr,uid, data, state):
- prod_obj = pooler.get_pool(cr.dbname).get('mrp.production')
- prod = prod_obj.browse(cr, uid,data['ids'])[0]
- form1_fields['product_qty']['default']=prod.product_qty
- return {}
-def _get_states(self, cr, uid, data, context):
- prod_obj = pooler.get_pool(cr.dbname).get('mrp.production')
- prod = prod_obj.browse(cr, uid,data['ids'])[0]
- if prod.state in ('cancel', 'done'):
- raise wizard.except_wizard(_('Warning !'), _('The production is in "%s" state. You can not change the production quantity anymore') % (prod.state).upper() )
- return 'end'
- if prod.state in ('draft'):
- #raise wizard.except_wizard('Warning !', 'The production is in "%s" state. You can change the production quantity directly...!!!' % (prod.state).upper() )
- return 'end'
- else:
- return 'confirm'
-
-def _change_prod_qty(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- prod_obj = pool.get('mrp.production')
- prod = prod_obj.browse(cr, uid,data['ids'])[0]
- prod_obj.write(cr, uid,prod.id, {'product_qty' : data['form']['product_qty']})
- prod_obj.action_compute(cr, uid, [prod.id])
-
- move_lines_obj = pool.get('stock.move')
- for move in prod.move_lines:
- bom_point = prod.bom_id
- bom_id = prod.bom_id.id
- if not bom_point:
- bom_id = pool.get('mrp.bom')._bom_find(cr, uid, prod.product_id.id, prod.product_uom.id)
- if not bom_id:
- raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
- self.write(cr, uid, [prod.id], {'bom_id': bom_id})
- bom_point = pool.get('mrp.bom').browse(cr, uid, [bom_id])[0]
-
- if not bom_id:
- raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
-
- factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
- res = pool.get('mrp.bom')._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
- for r in res[0]:
- if r['product_id']== move.product_id.id:
- move_lines_obj.write(cr, uid,move.id, {'product_qty' : r['product_qty']})
-
- product_lines_obj = pool.get('mrp.production.product.line')
-
- for m in prod.move_created_ids:
- move_lines_obj.write(cr, uid,m.id, {'product_qty' : data['form']['product_qty']})
-
- return {}
-
-class change_production_qty(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'choice', 'next_state' : _get_states}
- },
-
- 'confirm' : {
- 'actions' : [_get_qty],
- 'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state':[('end','Cancel'),('validate','Validate')]}
- },
-
- 'validate': {
- 'actions': [],
- 'result': {'type':'action', 'action':_change_prod_qty, 'state':'end'}
- },
-
- 'end' : {
- 'actions' : [],
- 'result': {'type': 'state', 'state': 'end'},
- },
- }
-
-change_production_qty('change_production_qty')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/wizard_orderpoint_procurement.py b/addons/mrp/wizard/wizard_orderpoint_procurement.py
index a4fa57bb9a8..731c3fca440 100644
--- a/addons/mrp/wizard/wizard_orderpoint_procurement.py
+++ b/addons/mrp/wizard/wizard_orderpoint_procurement.py
@@ -24,50 +24,48 @@
# - Order if the virtual stock of today is bellow the min of the defined order point
#
-import wizard
import threading
-import pooler
+from osv import fields,osv
-parameter_form = '''<?xml version="1.0"?>
-<form string="Parameters" colspan="4">
- <field name="automatic" />
-</form>'''
-
-parameter_fields = {
- 'automatic': {'string': 'Automatic orderpoint', 'type': 'boolean', 'help': 'If the stock of a product is under 0, it will act like an orderpoint', 'default': lambda *a: False},
-}
-
-def _procure_calculation_orderpoint(self, db_name, uid, data, context):
- db, pool = pooler.get_db_and_pool(db_name)
- cr = db.cursor()
- try:
- proc_obj = pool.get('mrp.procurement')
- automatic = data['form']['automatic']
- proc_obj._procure_orderpoint_confirm(cr, uid, automatic=automatic,\
- use_new_cursor=cr.dbname, context=context)
- finally:
- cr.close()
- return {}
-
-def _procure_calculation(self, cr, uid, data, context):
- threaded_calculation = threading.Thread(target=_procure_calculation_orderpoint, args=(self, cr.dbname, uid, data, context))
- threaded_calculation.start()
- return {}
-
-class procurement_compute(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':parameter_form, 'fields': parameter_fields, 'state':[('end','Cancel'),('compute','Compute Stock')]}
- },
- 'compute': {
- 'actions': [_procure_calculation],
- 'result': {'type': 'state', 'state':'end'}
- },
+class procurement_compute(osv.osv_memory):
+ _name = 'mrp.procurement.orderpoint.compute'
+ _description = 'Automatic Order Point'
+
+ _columns = {
+ 'automatic': fields.boolean('Automatic Orderpoint', help='If the stock of a product is under 0, it will act like an orderpoint'),
}
-procurement_compute('mrp.procurement.orderpoint.compute')
+ _defaults = {
+ 'automatic' : lambda *a: False,
+ }
+
+ def _procure_calculation_orderpoint(self, cr, uid, ids, context):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ """
+ proc_obj = self.pool.get('mrp.procurement')
+ for proc in self.browse(cr, uid, ids):
+ proc_obj._procure_orderpoint_confirm(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname, context=context)
+
+ return {}
+
+ def procure_calculation(self, cr, uid, ids, context):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ """
+ threaded_calculation = threading.Thread(target=self._procure_calculation_orderpoint, args=(cr, uid, ids, context))
+ threaded_calculation.start()
+ return {}
+procurement_compute()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/wizard/wizard_schedulers_all.py b/addons/mrp/wizard/wizard_schedulers_all.py
index e93e31c0599..62497564905 100644
--- a/addons/mrp/wizard/wizard_schedulers_all.py
+++ b/addons/mrp/wizard/wizard_schedulers_all.py
@@ -19,46 +19,50 @@
#
##############################################################################
-import wizard
import threading
-import pooler
-parameter_form = '''<?xml version="1.0"?>
-<form string="Scheduler Parameters" colspan="4">
- <field name="automatic" />
-</form>'''
+from osv import osv, fields
-parameter_fields = {
- 'automatic': {'string': 'Automatic orderpoint', 'type': 'boolean', 'help': 'Triggers an automatic procurement for all products that have a virtual stock under 0. You should probably not use this option, we suggest using a MTO configuration on products.', 'default': lambda *a: False},
-}
-
-def _procure_calculation_all(self, db_name, uid, data, context):
- db, pool = pooler.get_db_and_pool(db_name)
- cr = db.cursor()
- proc_obj = pool.get('mrp.procurement')
- automatic = data['form']['automatic']
- proc_obj.run_scheduler(cr, uid, automatic=automatic, use_new_cursor=cr.dbname,\
- context=context)
- cr.close()
- return {}
-
-def _procure_calculation(self, cr, uid, data, context):
- threaded_calculation = threading.Thread(target=_procure_calculation_all, args=(self, cr.dbname, uid, data, context))
- threaded_calculation.start()
- return {}
-
-class procurement_compute(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':parameter_form, 'fields': parameter_fields, 'state':[('end','Cancel'),('compute','Compute Stock') ]}
- },
- 'compute': {
- 'actions': [_procure_calculation],
- 'result': {'type': 'state', 'state':'end'}
- },
+class procurement_compute(osv.osv_memory):
+ _name = 'mrp.procurement.compute.all'
+ _description = 'Compute all schedulers'
+
+ _columns = {
+ 'automatic': fields.boolean('Automatic orderpoint',help='Triggers an automatic procurement for all products that have a virtual stock under 0. You should probably not use this option, we suggest using a MTO configuration on products.'),
}
-procurement_compute('mrp.procurement.compute.all')
+
+ _defaults ={
+ 'automatic': lambda *a: False,
+ }
+
+ def _procure_calculation_all(self, cr, uid, ids, context):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ """
+ proc_obj = self.pool.get('mrp.procurement')
+ for proc in self.browse(cr, uid, ids):
+ proc_obj.run_scheduler(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname,\
+ context=context)
+ return {}
+
+ def procure_calculation(self, cr, uid, ids, context):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ """
+ threaded_calculation = threading.Thread(target=self._procure_calculation_all, args=(cr, uid, ids, context))
+ threaded_calculation.start()
+ return {}
+
+procurement_compute()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_repair/__terp__.py b/addons/mrp_repair/__terp__.py
index 2f44e257a80..12a796b4f3b 100644
--- a/addons/mrp_repair/__terp__.py
+++ b/addons/mrp_repair/__terp__.py
@@ -37,11 +37,12 @@
'depends': ['base', 'sale', 'account'],
'update_xml': [
'security/ir.model.access.csv',
- 'mrp_repair_sequence.xml',
- 'mrp_repair_wizard.xml',
+ 'mrp_repair_sequence.xml',
+ 'wizard/mrp_repair_cancel_view.xml',
+ 'wizard/mrp_repair_make_invoice_view.xml',
'mrp_repair_view.xml',
'mrp_repair_workflow.xml',
- 'mrp_repair_report.xml'
+ 'mrp_repair_report.xml',
],
'demo_xml': [],
'installable': True,
diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py
index fc91fe1f9e6..e456c3770d2 100644
--- a/addons/mrp_repair/mrp_repair.py
+++ b/addons/mrp_repair/mrp_repair.py
@@ -95,7 +95,7 @@ class mrp_repair(osv.osv):
\n* The \'To be Invoiced\' state is used to generate the invoice before or after repairing done. \
\n* The \'Done\' state is set when repairing is completed.\
\n* The \'Cancelled\' state is used when user cancel repair order.'),
- 'location_id': fields.many2one('stock.location', 'Current Location', required=True, select=True, readonly=True, states={'draft':[('readonly',False)]}),
+ 'location_id': fields.many2one('stock.location', 'Current Location', select=True, readonly=True, states={'draft':[('readonly',False)]}),
'location_dest_id': fields.many2one('stock.location', 'Delivery Location', readonly=True, states={'draft':[('readonly',False)]}),
'move_id': fields.many2one('stock.move', 'Move',required=True, domain="[('product_id','=',product_id)]", readonly=True, states={'draft':[('readonly',False)]}),
'guarantee_limit': fields.date('Guarantee limit', help="The guarantee limit is computed as: last move date + warranty defined on selected product. If the current date is below the guarantee limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."),
@@ -261,12 +261,12 @@ class mrp_repair(osv.osv):
def action_invoice_create(self, cr, uid, ids, group=False, context=None):
res={}
invoices_group = {}
- for repair in self.browse(cr, uid, ids, context=context):
+ for repair in self.browse(cr, uid, ids, context=context):
res[repair.id]=False
if repair.state in ('draft','cancel') or repair.invoice_id:
continue
if not (repair.partner_id.id and repair.partner_invoice_id.id):
- raise osv.except_osv(_('No partner !'),_('You have to select a partner in the repair form !'))
+ raise osv.except_osv(_('No partner !'),_('You have to select a Partner Invoice Address in the repair form !'))
comment=repair.quotation_notes
if (repair.invoice_method != 'none'):
if group and repair.partner_invoice_id.id in invoices_group:
@@ -398,7 +398,9 @@ class mrp_repair(osv.osv):
self.pool.get('mrp.repair.line').write(cr, uid, [move.id], {'move_id': move_id})
if repair.deliver_bool:
+ pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out')
picking = self.pool.get('stock.picking').create(cr, uid, {
+ 'name': pick_name,
'origin': repair.name,
'state': 'draft',
'move_type': 'one',
diff --git a/addons/mrp_repair/mrp_repair_wizard.xml b/addons/mrp_repair/mrp_repair_wizard.xml
deleted file mode 100644
index 42383f517cc..00000000000
--- a/addons/mrp_repair/mrp_repair_wizard.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
- <wizard
- id="action_cancel_repair"
- model="mrp.repair"
- name="mrp.repair.cancel"
- string="Cancel Repair"
- menu = "False"
- multi = "True"
- />
- <wizard
- id="wizard_mrp_repair_make_invoice"
- keyword="client_action_multi"
- model="mrp.repair"
- name="mrp.repair.make_invoice"
- multi="True"
- string="Make invoices"/>
-
- </data>
-</openerp>
- \ No newline at end of file
diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml
index 6c56c80978b..bb3e61ab4e7 100644
--- a/addons/mrp_repair/report/order.rml
+++ b/addons/mrp_repair/report/order.rml
@@ -397,7 +397,7 @@
<blockTable colWidths="534.0" style="Table8">
<tr>
<td>
- <para style="P3">[[ format(o.quotation_notes) or '' ]]</para>
+ <para style="P3">[[ format(o.quotation_notes) or removeParentNode('blockTable') ]]</para>
</td>
</tr>
</blockTable>
diff --git a/addons/mrp_repair/security/ir.model.access.csv b/addons/mrp_repair/security/ir.model.access.csv
index 0f12f66a815..c524afce69b 100644
--- a/addons/mrp_repair/security/ir.model.access.csv
+++ b/addons/mrp_repair/security/ir.model.access.csv
@@ -5,3 +5,7 @@
"access_mrp_repair_line_manager","MRP Repair Line manager","model_mrp_repair_line","stock.group_stock_manager",1,1,1,1
"access_mrp_repair_fee_user","MRP Repair Fee user","model_mrp_repair_fee","stock.group_stock_user",1,0,0,0
"access_mrp_repair_fee_manager","MRP Repair Fee manager","model_mrp_repair_fee","stock.group_stock_manager",1,1,1,1
+"access_mrp_repair_cancel_user","mrp.repair.cancel user","model_mrp_repair_cancel","stock.group_stock_user",1,0,0,0
+"access_mrp_repair_cancel_manager","mrp.repair.cancel manager","model_mrp_repair_cancel","stock.group_stock_manager",1,1,1,1
+"access_mrp_repair_make_invoice_user","mrp.repair.make_invoice user","model_mrp_repair_make_invoice","stock.group_stock_user",1,0,0,0
+"access_mrp_repair_make_invoice_manager","mrp.repair.make_invoice manager","model_mrp_repair_make_invoice","stock.group_stock_manager",1,1,1,1
diff --git a/addons/mrp_repair/wizard/wizard_cancel_repair.py b/addons/mrp_repair/wizard/wizard_cancel_repair.py
index d895096ce6f..91df6fb01ef 100644
--- a/addons/mrp_repair/wizard/wizard_cancel_repair.py
+++ b/addons/mrp_repair/wizard/wizard_cancel_repair.py
@@ -19,63 +19,69 @@
#
##############################################################################
-import wizard
import netsvc
-import pooler
+from osv import osv,fields
+from tools.translate import _
-cancel_form = """<?xml version="1.0"?>
-<form string="Cancel Repair...??">
- <label colspan="4" string="This operation will cancel the Repair process, but will not cancel it's Invoice.\nDo you want to continue?" />
-</form>
-"""
+class repair_cancel(osv.osv_memory):
+ _name = 'mrp.repair.cancel'
+ _description = 'Cancel Repair'
-cancel_fields = {}
-
-def check_state(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- repair_obj = pool.get('mrp.repair').browse(cr, uid, data['ids'])[0]
- if repair_obj.invoice_id:
- return 'display'
- else:
- pool.get('mrp.repair').write(cr,uid,data['ids'],{'state':'cancel'})
- return 'end'
+ def cancel_repair(self, cr, uid, ids, context):
+ """
+ Cancels the repair
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return:
-def _cancel_repair(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- repair_obj = pool.get('mrp.repair').browse(cr, uid, data['ids'])
- pool.get('mrp.repair').write(cr,uid,data['ids'],{'state':'cancel'})
- mrp_line_obj = pool.get('mrp.repair.line')
- for line in repair_obj:
- mrp_line_obj.write(cr, uid, [l.id for l in line.operations], {'state': 'cancel'})
- return {}
-
-class repair_cancel(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'choice', 'next_state' : check_state}
- },
+ """
+ record_id = context and context.get('active_id', False) or False
+ assert record_id, _('Active ID is not Found')
+ repair_order_obj = self.pool.get('mrp.repair')
+ repair_line_obj = self.pool.get('mrp.repair.line')
+ repair_order = repair_order_obj.browse(cr, uid, record_id)
+
+ if repair_order.invoiced or repair_order.invoice_method == 'none':
+ repair_order_obj.action_cancel(cr, uid, [record_id], context=context)
+ else:
+ raise osv.except_osv(_('Warning!'),_('Repair is not cancelled. It is not invoiced.'))
+
+ return {}
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ """
+ Changes the view dynamically
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+
+ @return: New arch of view.
+
+ """
+ record_id = context and context.get('active_id', False) or False
+ res = super(repair_cancel, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ if record_id:
+ repair_order = self.pool.get('mrp.repair').browse(cr, uid, record_id)
+ if not repair_order.invoiced:
+ res['arch'] = """ <form string="Cancel Repair" colspan="4">
+ <group col="2" colspan="2">
+ <label string="Do you want to continue?" colspan="4"/>
+ <separator colspan="4"/>
+ <button icon="gtk-cancel" special="cancel" string="No" readonly="0"/>
+ <button name="cancel_repair" string="Yes" type="object" icon="gtk-ok"/>
+ </group>
+ </form>
+ """
+ return res
- 'display' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : cancel_form,
- 'fields' : cancel_fields,
- 'state' : [('end', 'No'),('yes', 'Yes') ]}
- },
- 'yes' : {
- 'actions' : [],
- 'result' : {'type' : 'action',
- 'action' : _cancel_repair,
- 'state' : 'end'}
- },
- 'end' : {
- 'actions' : [],
- 'result': {'type': 'state', 'state': 'end'},
- },
- }
-repair_cancel("mrp.repair.cancel")
+repair_cancel()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_repair/wizard/wizard_make_invoice.py b/addons/mrp_repair/wizard/wizard_make_invoice.py
index 71aefadfe4b..063040590e6 100644
--- a/addons/mrp_repair/wizard/wizard_make_invoice.py
+++ b/addons/mrp_repair/wizard/wizard_make_invoice.py
@@ -19,63 +19,46 @@
#
##############################################################################
-import wizard
import netsvc
-import pooler
+from osv import osv, fields
-invoice_form = """<?xml version="1.0"?>
-<form string="Create invoices">
- <separator colspan="4" string="Do you really want to create the invoices ?" />
- <field name="group"/>
-</form>
-"""
-invoice_fields = {
- 'group': {
- 'string': 'Group by partner invoice address',
- 'type':'boolean'
- },
-}
-
-ack_form = """<?xml version="1.0"?>
-<form string="Create invoices">
- <separator string="Invoices created" />
-</form>"""
-
-ack_fields = {}
+class make_invoice(osv.osv_memory):
+ _name = 'mrp.repair.make_invoice'
+ _description = 'Make Invoice'
+
+ _columns = {
+ 'group': fields.boolean('Group by partner invoice address'),
+ }
-def _makeInvoices(self, cr, uid, data, context):
- order_obj = pooler.get_pool(cr.dbname).get('mrp.repair')
- newinv = order_obj.action_invoice_create(cr, uid, data['ids'],group=data['form']['group'],context=context)
+ def make_invoices(self, cr, uid, ids, context):
+ """
+ Generates invoice(s) of selected records.
- return {
- 'domain': [('id','in', newinv.values())],
- 'name': 'Invoices',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.invoice',
- 'view_id': False,
- 'context': "{'type':'out_refund'}",
- 'type': 'ir.actions.act_window'
- }
-
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return: Loads the view of new invoice(s).
+
+ """
+ inv = self.browse(cr, uid, ids[0])
+ order_obj = self.pool.get('mrp.repair')
+ newinv = order_obj.action_invoice_create(cr, uid, context['active_ids'], group=inv.group,context=context)
+
+ return {
+ 'domain': [('id','in', newinv.values())],
+ 'name': 'Invoices',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.invoice',
+ 'view_id': False,
+ 'context': "{'type':'out_invoice'}",
+ 'type': 'ir.actions.act_window'
+ }
-class make_invoice(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : invoice_form,
- 'fields' : invoice_fields,
- 'state' : [('end', 'Cancel'),('invoice', 'Create invoices') ]}
- },
- 'invoice' : {
- 'actions' : [],
- 'result' : {'type' : 'action',
- 'action' : _makeInvoices,
- 'state' : 'end'}
- },
- }
-make_invoice("mrp.repair.make_invoice")
+make_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/olap_crm/i18n/pt_BR.po b/addons/olap_crm/i18n/pt_BR.po
index 478f2803ff8..1608cac66d5 100644
--- a/addons/olap_crm/i18n/pt_BR.po
+++ b/addons/olap_crm/i18n/pt_BR.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: olap_crm
diff --git a/addons/olap_extract/i18n/pt_BR.po b/addons/olap_extract/i18n/pt_BR.po
index 9049669952e..178edd2bfeb 100644
--- a/addons/olap_extract/i18n/pt_BR.po
+++ b/addons/olap_extract/i18n/pt_BR.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: olap_extract
diff --git a/addons/olap_sale/i18n/pt_BR.po b/addons/olap_sale/i18n/pt_BR.po
index 6031ea21a6d..f946a91bc88 100644
--- a/addons/olap_sale/i18n/pt_BR.po
+++ b/addons/olap_sale/i18n/pt_BR.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: olap_sale
diff --git a/addons/point_of_sale/__terp__.py b/addons/point_of_sale/__terp__.py
index e094d9dcb37..b1838a28fc1 100644
--- a/addons/point_of_sale/__terp__.py
+++ b/addons/point_of_sale/__terp__.py
@@ -38,9 +38,30 @@ Main features :
'author': 'Tiny',
'depends': ['sale', 'delivery'],
# 'depends': ['sale', 'purchase', 'account', 'account_tax_include','board','mrp','board_manufacturing','delivery','profile_manufacturing','account','multi_company'],
- 'init_xml': [
- 'security/point_of_sale_security.xml',
+ 'init_xml': [],
+
+ 'update_xml': [
+ 'security/point_of_sale_security.xml',
'security/ir.model.access.csv',
+ 'wizard/pos_details.xml',
+ 'wizard/pos_add_product.xml',
+ 'wizard/pos_confirm.xml',
+ 'wizard/pos_discount.xml',
+ 'wizard/pos_get_sale.xml',
+ 'wizard/pos_open_statement.xml',
+ 'wizard/pos_close_statement.xml',
+ 'wizard/pos_box_entries.xml',
+ 'wizard/pos_payment_report_user_view.xml',
+ 'wizard/pos_payment_report_date_view.xml',
+ 'wizard/pos_box_out.xml',
+ 'wizard/pos_sales_user.xml',
+ 'wizard/all_closed_cashbox_of_the_day.xml',
+ 'wizard/pos_sales_user_current_user.xml',
+ 'wizard/pos_sale_user_today.xml',
+ 'wizard/pos_receipt_view.xml',
+ 'wizard/pos_payment_report_user.xml',
+ 'wizard/pos_payment_report.xml',
+ 'wizard/pos_payment.xml',
'pos_report.xml',
'pos_wizard.xml',
'pos_view.xml',
@@ -51,18 +72,7 @@ Main features :
'statement_view.xml',
'statement_report.xml',
'statement_data.xml',
- 'statement_wizard.xml'
- ],
- 'update_xml': [
- 'security/point_of_sale_security.xml',
- 'security/ir.model.access.csv',
- 'pos_report.xml',
- 'pos_wizard.xml',
- 'pos_view.xml',
- 'pos_sequence.xml',
- 'posrule_data.xml',
- 'pos_data.xml',
- 'pos_workflow.xml'
+ 'statement_wizard.xml',
],
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml'],
'installable': True,
diff --git a/addons/point_of_sale/account_bank_statement.py b/addons/point_of_sale/account_bank_statement.py
index b599f0531f9..b71e78afcfd 100644
--- a/addons/point_of_sale/account_bank_statement.py
+++ b/addons/point_of_sale/account_bank_statement.py
@@ -125,14 +125,17 @@ class account_bank_statement(osv.osv):
}
def create(self, cr, uid, vals, context=None):
- open_jrnl = self.search(cr, uid, [('company_id', '=', vals['company_id']), ('journal_id', '=', vals['journal_id']), ('state', '=', 'open')])
- if open_jrnl:
- raise osv.except_osv('Error', u'Une caisse de type espèce est déjà ouverte')
- if 'starting_details_ids' in vals:
- vals['starting_details_ids'] = starting_details_ids = map(list, vals['starting_details_ids'])
- for i in starting_details_ids:
- if i and i[0] and i[1]:
- i[0], i[1] = 0, 0
+
+ company_id = vals and vals.get('company_id',False)
+ if company_id:
+ open_jrnl = self.search(cr, uid, [('company_id', '=', vals['company_id']), ('journal_id', '=', vals['journal_id']), ('state', '=', 'open')])
+ if open_jrnl:
+ raise osv.except_osv('Error', u'Une caisse de type espèce est déjà ouverte')
+ if 'starting_details_ids' in vals:
+ vals['starting_details_ids'] = starting_details_ids = map(list, vals['starting_details_ids'])
+ for i in starting_details_ids:
+ if i and i[0] and i[1]:
+ i[0], i[1] = 0, 0
res = super(account_bank_statement, self).create(cr, uid, vals, context=context)
return res
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index baaac139ce4..f5ce8368bbe 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -43,7 +43,7 @@
<group colspan="4" col="7">
<field name="amount_tax"/>
<field name="amount_total"/>
- <button name="%(pos_discount)d" string="D_iscount" type="action" states="draft"/>
+ <button name="%(action_pos_discount)d" string="D_iscount" type="action" states="draft"/>
<button name="dummy_button" string="Compute" type="object" />
</group>
@@ -68,8 +68,8 @@
<button name="%(pos_add_product)d" string="_Add product" type="action" states="draft"/>
-->
- <button name="%(pos_payment)d" string="Ma_ke Payment" icon="gtk-ok" type="action" states="draft,advance"/>
- <button name="%(o_rec)d" string="_Reprint" icon="gtk-print" type="action" states="paid,done,invoiced"/>
+ <button name="%(action_pos_payment)d" string="Ma_ke Payment" icon="gtk-ok" type="action" states="draft,advance" context="{'record_id':'active_id'}" />
+ <button name="%(action_report_pos_receipt)d" string="_Reprint" icon="gtk-print" type="action" states="paid,done,invoiced"/>
<!--
@@ -830,31 +830,31 @@ invoiced
action="action_product_output"
id="products_for_output_operations"/>
- <wizard
+<!-- <wizard
string="Refloat Box entries"
model="account.bank.statement"
name="pos.entry"
menu="False"
- id="pos_entries"/>
+ id="pos_entries"/>-->
+
<menuitem name="Register Management" parent="menu_point_root"
id="menu_point_config" sequence="3"/>
<menuitem
name="Input Operations" parent="menu_point_config"
string="Refloat"
- action="pos_entries"
- type="wizard"
- id="menu_wizard_enter_jrnl" sequence="2" />
- <wizard
+ action="action_box_entries"
+ id="menu_wizard_enter_jrnl" sequence="3" />
+
+ <!-- <wizard
string="Enter negative operations"
model="account.bank.statement"
name="pos.out"
menu="False"
- id="pos_entries2"/>
+ id="pos_entries2"/>-->
<menuitem
name="Output Operations" parent="menu_point_config"
string="Refloat"
- action="pos_entries2"
- type="wizard"
+ action="action_box_out"
id="menu_wizard_enter_jrnl2" sequence="3" />
<!-- <menuitem name="Sales Waiting Validation" parent="menu_point_config" id="menu_point_ofsale_date_payment"-->
@@ -981,22 +981,29 @@ invoiced
<!-- <menuitem icon="STOCK_PRINT" action="wizard_pos_payment_report"
id="menu_pos_payment_report" parent="menu_cashboxes_by_day" type="wizard" sequence="4"/-->
- <menuitem icon="STOCK_PRINT" action="wizard_pos_sales_user"
- id="menu_pos_sales_user" parent="menu_trans_pos_tree" type="wizard" sequence="3" groups="base.group_extended" />
+ <menuitem icon="STOCK_PRINT" action="action_report_pos_sale_user"
+ id="menu_pos_sales_user" parent="menu_trans_pos_tree" sequence="3" groups="base.group_extended" />
- <menuitem icon="STOCK_PRINT" action="wizard_pos_sales_user_today"
- id="menu_pos_sales_user_today" parent="menu_trans_pos_tree_today" type="wizard" sequence="2" groups="base.group_extended"/>
+ <menuitem icon="STOCK_PRINT" action="action_report_pos_payment_repport_date"
+ id="menu_pos_payment_report_date" parent="menu_trans_pos_tree" sequence="5" groups="base.group_extended"/>
+
+ <menuitem icon="STOCK_PRINT" action="action_report_pos_payment_report_user"
+ id="menu_pos_payment_report_user" parent="menu_trans_pos_tree_today" sequence="6" groups="base.group_extended"/>
+ <menuitem icon="STOCK_PRINT" action="action_pos_sales_user_today"
+ id="menu_pos_sales_user_today" parent="menu_trans_pos_tree_today" sequence="2" groups="base.group_extended"/>
- <menuitem icon="STOCK_PRINT" action="wizard_pos_payment_report_date"
- id="menu_pos_payment_report_date" parent="menu_trans_pos_tree" type="wizard" sequence="5" groups="base.group_extended"/>
+ <menuitem icon="STOCK_PRINT" action="action_report_pos_payment_repport_date"
+ id="menu_pos_payment_report_date" parent="menu_trans_pos_tree" sequence="5" groups="base.group_extended"/>
- <menuitem icon="STOCK_PRINT" action="wizard_pos_payment_report_user"
- id="menu_pos_payment_report_user" parent="menu_trans_pos_tree_today" type="wizard" sequence="6" groups="base.group_extended"/>
- <menuitem icon="STOCK_PRINT" action="wizard_pos_sales_user_today_current_user"
- id="menu_pos_sales_user_today_current_user" parent="menu_cashboxes_by_day" type="wizard" sequence="7"/>
- <menuitem icon="STOCK_PRINT" action="wizard_pos_details"
- id="menu_pos_details" parent="menu_cashboxes_by_day" type="wizard" />
+ <menuitem icon="STOCK_PRINT" action="action_report_pos_payment_report_user"
+ id="menu_pos_payment_report_user" parent="menu_trans_pos_tree_today" sequence="6" groups="base.group_extended"/>
+ <menuitem icon="STOCK_PRINT" action="action_report_pos_sales_user_today_current_user"
+ id="menu_pos_sales_user_today_current_user" parent="menu_cashboxes_by_day" sequence="7"/>
+
+
+ <menuitem icon="STOCK_PRINT" action="action_report_pos_details"
+ id="menu_pos_details" parent="menu_cashboxes_by_day" />
</data>
diff --git a/addons/point_of_sale/pos_wizard.xml b/addons/point_of_sale/pos_wizard.xml
index 325350d031b..2e09b5cc9df 100644
--- a/addons/point_of_sale/pos_wizard.xml
+++ b/addons/point_of_sale/pos_wizard.xml
@@ -9,17 +9,13 @@
string="Return Goods"/>
- <wizard string="Receipt" model="pos.order"
- name="ord.receipt" id="o_rec"
- keyword="client_print_multi"
- menu="False"
- />
+
<!-- <wizard string="Box Entries" model="account.bank.statement"
name="pos.entry" id="pos_entry" menu="False"/>-->
- <wizard string="Payment" model="pos.order"
- name="pos.payment" id="pos_payment" menu="False"/>
+<!-- <wizard string="Payment" model="pos.order"
+ name="pos.payment" id="pos_payment" menu="False"/>-->
<!--<wizard string="Create Invoices" model="pos.order"
name="pos.create_invoice" id="pos_invoice" multi="True"/>-->
@@ -30,64 +26,49 @@
<!--<wizard string="Cancel" model="pos.order"
name="pos.cancel" id="pos_cancel" multi="True"/>-->
- <wizard
- string="Confirm"
- model="pos.order"
- name="pos.confirm"
- id="pos_confirm"
- multi="True"
- menu="True"
- />
-
+<!--
<wizard string="Discount" model="pos.order"
- name="pos.discount" id="pos_discount" menu="False"/>
+ name="pos.discount" id="pos_discount" menu="False"/>-->
<!-- <wizard id="wizard_pos_payment_report" menu="False"
model="pos.order" name="pos.payment.report" string="All paid lines for the current User"/-->
-
+<!--
<wizard id="wizard_pos_sales_user" menu="False"
- model="pos.order" name="pos.sales.user" string="Sales Report"/>
-
- <wizard id="wizard_pos_sales_user_today" menu="False"
- model="pos.order" name="pos.sales.user.today" string="Sales by Users"/>
+ model="pos.order" name="pos.sales.user" string="Sales Report"/>-->
+<!--
<wizard id="wizard_pos_payment_report_date" menu="False"
model="pos.order" name="pos.payment.report.date" string="Sales lines Report"/>
<wizard id="wizard_pos_payment_report_user" menu="False"
model="pos.order" name="pos.payment.report.user" string="Sales lines by Users"/>
-
+-->
+
<wizard id="wizard_pos_sales_user_today_current_user" menu="False"
model="pos.order" name="pos.sales.user.today.current.user" string="Sales for Current User"/>
- <wizard id="wizard_pos_details" menu="False"
- model="pos.order" name="pos.details" string="Sales Details"/>
+<!-- <wizard id="wizard_pos_details" menu="False"
+ model="pos.order" name="pos.details" string="Sales Details"/>-->
<!-- <wizard string="Get From Order" model="pos.order"
name="pos.sale.get" id="pos_sale_get"/>
<wizard string="Scan Product" model="pos.order"
name="pos.scan_product" id="pos_scan_product"/-->
- <wizard
+<!-- <wizard
id="close_statement"
model="account.bank.statement"
- menu="False"
+ menu="True"
name="statement.close"
- string="Close Statements"/>
- <wizard
- id="open_statement"
- model="account.bank.statement"
- menu="False"
- name="statement.open"
- string="Open Statements"/>
+ string="Close Statements"/>-->
- <wizard
+ <!--wizard
id="wizard_all_closed_cashbox_of_the_day"
model="account.bank.statement"
menu="False"
name="all.closed.cashbox.of.the.day"
- string="All Cashboxes Of the day"/>
+ string="All Cashboxes Of the day"/-->
</data>
diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
index 854acfde3a9..f3c21da2dcb 100644
--- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
+++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
@@ -138,4 +138,6 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
res = self.cr.dictfetchall()
return res[0]['net_total'] or 0.0
-report_sxw.report_sxw('report.all.closed.cashbox.of.the.day', 'account.bank.statement', 'addons/statement/report/all_closed_cashbox_of_the_day.rml', parser=all_closed_cashbox_of_the_day)
+
+report_sxw.report_sxw('report.all.closed.cashbox.of.the.day', 'account.bank.statement', 'addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml', parser=all_closed_cashbox_of_the_day)
+
diff --git a/addons/point_of_sale/report/pos_payment_report_date.py b/addons/point_of_sale/report/pos_payment_report_date.py
index 1578f0e6958..82723a43125 100644
--- a/addons/point_of_sale/report/pos_payment_report_date.py
+++ b/addons/point_of_sale/report/pos_payment_report_date.py
@@ -43,7 +43,7 @@ class pos_payment_report_date(report_sxw.rml_parse):
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state in ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id in %s " \
- ,(dt1,dt2,tuple(form['user_id'][0][-1])))
+ ,(dt1,dt2,tuple(form['user_id'])))
data=self.cr.dictfetchall()
return data
@@ -55,7 +55,7 @@ class pos_payment_report_date(report_sxw.rml_parse):
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
"and po.state in ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id in %s " \
- ,(dt1,dt2,tuple(form['user_id'][0][-1])))
+ ,(dt1,dt2,tuple(form['user_id'])))
res=self.cr.fetchone()[0]
return res
diff --git a/addons/point_of_sale/report/pos_payment_report_user.py b/addons/point_of_sale/report/pos_payment_report_user.py
index cde5162425e..9af9377d64c 100644
--- a/addons/point_of_sale/report/pos_payment_report_user.py
+++ b/addons/point_of_sale/report/pos_payment_report_user.py
@@ -35,7 +35,7 @@ class pos_payment_report_user(report_sxw.rml_parse):
def __pos_payment_user__(self,form):
data={}
- ids = form['user_id'][0][-1]
+ ids = form['user_id']
idss = map(str, ids)
sql = "select pt.name,pol.qty,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
diff --git a/addons/point_of_sale/report/pos_receipt.rml b/addons/point_of_sale/report/pos_receipt.rml
index ecf1aa8c52a..1d5e70241c7 100644
--- a/addons/point_of_sale/report/pos_receipt.rml
+++ b/addons/point_of_sale/report/pos_receipt.rml
@@ -104,7 +104,9 @@
<para style="terp_default_Centre_9">E-mail : [[ address and address.email ]]</para>
<para style="terp_default_Centre_9">Shop : [[ o.shop_id.name ]]</para>
<para style="terp_default_Centre_9">Vendeur : [[ o.user_id1.name ]]</para>
- <para style="terp_default_Centre_9">Date : [[ o.date_order ]]</para>
+
+ <para style="terp_default_Centre_9">Date : [[ formatLang(o.date_order,date = True) ]]</para>
+
<para style="P4">
<font color="white"> </font>
</para>
diff --git a/addons/point_of_sale/report/pos_receipt_without_remboursment.rml b/addons/point_of_sale/report/pos_receipt_without_remboursment.rml
index d863efd40f3..0eb0dba773a 100644
--- a/addons/point_of_sale/report/pos_receipt_without_remboursment.rml
+++ b/addons/point_of_sale/report/pos_receipt_without_remboursment.rml
@@ -71,7 +71,7 @@
<para style="terp_default_Centre_9">Tel : [[ address and address.phone ]]</para>
<para style="terp_default_Centre_9">E-mail : [[ address and address.email ]]</para>
<para style="terp_default_Centre_9">Salesman : [[ o.user_id.name ]]</para>
- <para style="terp_default_Centre_9">Sale Date : [[ o.date_order ]]</para>
+ <para style="terp_default_Centre_9">Sale Date : [[ str(o.date_order) ]]</para>
<para style="P5">Purchase Voucher : [[o.name]]</para>
<para style="P4">
<font color="white"> </font>
diff --git a/addons/point_of_sale/report/pos_sales_user.py b/addons/point_of_sale/report/pos_sales_user.py
index 034587a8ae4..b1b7272a030 100644
--- a/addons/point_of_sale/report/pos_sales_user.py
+++ b/addons/point_of_sale/report/pos_sales_user.py
@@ -42,7 +42,7 @@ class pos_sales_user(report_sxw.rml_parse):
"from pos_order as po,res_users as ru,res_company as rc " \
"where po.date_order >= %s and po.date_order <= %s " \
"and po.company_id=rc.id and po.user_id=ru.id and po.user_id in %s " \
- ,(dt1,dt2,tuple(form['user_id'][0][-1])))
+ ,(dt1,dt2,tuple(form['user_id'])))
data = self.cr.dictfetchall()
return data
diff --git a/addons/point_of_sale/report/pos_sales_user_today.py b/addons/point_of_sale/report/pos_sales_user_today.py
index 4e06a936116..a5caf899069 100644
--- a/addons/point_of_sale/report/pos_sales_user_today.py
+++ b/addons/point_of_sale/report/pos_sales_user_today.py
@@ -36,7 +36,7 @@ class pos_sales_user_today(report_sxw.rml_parse):
def _get_data(self,form):
data={}
- ids = form['user_id'][0][-1]
+ ids = form['user_id']
idss = map(str, ids)
self.cr.execute("select po.name as pos,po.date_order,ru.name as user,po.state,rc.name " \
diff --git a/addons/point_of_sale/security/ir.model.access.csv b/addons/point_of_sale/security/ir.model.access.csv
index efbe26893f1..a761e78c362 100644
--- a/addons/point_of_sale/security/ir.model.access.csv
+++ b/addons/point_of_sale/security/ir.model.access.csv
@@ -19,3 +19,12 @@
"access_report_sales_by_margin_pos","report.sales.by.margin.pos","model_report_sales_by_margin_pos","point_of_sale.group_pos_user",1,0,0,0
"access_report_sales_by_margin_pos_month","report.sales.by.margin.pos.month","model_report_sales_by_margin_pos_month","point_of_sale.group_pos_user",1,0,0,0
"access_singer_statement","singer.statement","model_singer_statement","point_of_sale.group_pos_user",1,0,0,0
+"access_add_product","pos.add.product ","model_pos_add_product","point_of_sale.group_pos_user",1,0,0,0
+"access_pos_confirm","pos.confirm","model_pos_confirm","point_of_sale.group_pos_user",1,0,0,0
+"access_pos_discount","pos.discount","model_pos_discount","point_of_sale.group_pos_user",1,0,0,0
+"access_pos_get_sale","pos.get.sale","model_pos_get_sale","point_of_sale.group_pos_user",1,0,0,0
+"access_pos_close_statement","pos.open.statement","model_pos_open_statement","point_of_sale.group_pos_user",1,0,0,0
+"access_pos_open_statement","pos.close.statement","model_pos_close_statement","point_of_sale.group_pos_user",1,0,0,0
+"acess_pos_box_entries ","pos.box.entries ","model_pos_box_entries","point_of_sale.group_pos_user",1,0,0,0
+"access_pos_box_out","pos.box.out","model_pos_box_out","point_of_sale.group_pos_user",1,0,0,0
+"acess_pos_details ","pos.details ","model_pos_details","point_of_sale.group_pos_user",1,0,0,0
diff --git a/addons/point_of_sale/statement_report.xml b/addons/point_of_sale/statement_report.xml
index 256d0644583..719729a5d45 100644
--- a/addons/point_of_sale/statement_report.xml
+++ b/addons/point_of_sale/statement_report.xml
@@ -9,7 +9,7 @@
name="pos.user.product"
auto="False"
multi="True"
- rml="statement/report/pos_users_product.rml"
+ rml="point_of_sale/report/pos_users_product.rml"
/>
<report
@@ -19,27 +19,17 @@
name="account.statement"
auto="False"
multi="True"
- rml="statement/report/account_statement.rml"
+ rml="point_of_sale/report/account_statement.rml"
/>
<report
- id="all_closed_cashbox_of_the_day"
- string="All Cloded CashBOx"
- model="account.bank.statement"
- name="all.closed.cashbox.of.the.day"
- auto="False"
- multi="True"
- menu = 'False'
- rml="statement/report/all_closed_cashbox_of_the_day.rml"
- />
- <report
id="pos_users_product_re"
string="User's Product"
model="account.bank.statement"
name="pos.user.product"
auto="False"
multi="True"
- rml="statement/report/pos_users_product.rml"
+ rml="point_of_sale/report/pos_users_product.rml"
/>
<report
@@ -49,18 +39,18 @@
name="account.statement"
auto="False"
multi="True"
- rml="statement/report/account_statement.rml"
+ rml="point_of_sale/report/account_statement.rml"
/>
<report
id="all_closed_cashbox_of_the_day"
- string="All Cloded CashBOx"
+ string="All Closed CashBOx"
model="account.bank.statement"
name="all.closed.cashbox.of.the.day"
auto="False"
multi="True"
menu = 'False'
- rml="statement/report/all_closed_cashbox_of_the_day.rml"
+ rml="point_of_sale/report/all_closed_cashbox_of_the_day.rml"
/>
</data>
diff --git a/addons/point_of_sale/statement_view.xml b/addons/point_of_sale/statement_view.xml
index e7e7119583d..7f241e5bfa8 100644
--- a/addons/point_of_sale/statement_view.xml
+++ b/addons/point_of_sale/statement_view.xml
@@ -417,23 +417,27 @@
<menuitem name="Cashboxes to Close" parent="menu_pos_bank_statment_tree"
action="action_cashboxes_to_close" id="menu_cashboxes_to_close_tree" groups="base.group_extended"/>
+
<menuitem
- name="Open Statements" parent="point_of_sale.menu_point_config"
- string="Open Statements"
- action="open_statement"
- type="wizard"
- id="menu_open_statement" sequence="3" />
+ name="Open Registers" parent="point_of_sale.menu_point_config"
+ string="Open Register"
+ action="action_pos_open_statement"
+ id="menu_open_statement" sequence="1" />
+
<menuitem icon="STOCK_PRINT"
- action="wizard_all_closed_cashbox_of_the_day"
+ action="action_report_all_closed_cashbox_of_the_day"
id="menu_all_closed_cashbox_of_the_day"
+
parent="menu_statement_tree_all"
- type="wizard"/>
+ />
+
<menuitem
- name="Close Statements" parent="point_of_sale.menu_point_config"
- string="Close Statements"
- action="close_statement"
- type="wizard"
- id="menu_close_statement" sequence="3" />
+ name="Close Register" parent="point_of_sale.menu_point_config"
+ string="Close Register"
+ action="action_pos_close_statement"
+ id="menu_close_statement" sequence="2" />
+
+
</data>
</openerp>
diff --git a/addons/point_of_sale/statement_wizard.xml b/addons/point_of_sale/statement_wizard.xml
index f3bffb15ce1..c4f4ddf9072 100644
--- a/addons/point_of_sale/statement_wizard.xml
+++ b/addons/point_of_sale/statement_wizard.xml
@@ -1,9 +1,9 @@
<openerp>
<data>
- <wizard
+<!-- <wizard
id="close_statement"
model="account.bank.statement"
- menu="False"
+ menu="True"
name="statement.close"
string="Close Statements"/>
<menuitem
@@ -12,31 +12,25 @@
action="close_statement"
type="wizard"
id="menu_close_statement" sequence="4" />
- <wizard
- id="open_statement"
- model="account.bank.statement"
- menu="False"
- name="statement.open"
- string="Open Register"/>
- <menuitem
- name="Open Register" parent="point_of_sale.menu_point_config"
- string="Open Register"
- action="open_statement"
- type="wizard"
- id="menu_open_statement" sequence="1" />
+-->
- <wizard
- id="wizard_all_closed_cashbox_of_the_day"
+
+
+ <!-- <wizard
+ id="action_report_all_closed_cashbox_of_the_day2"
model="account.bank.statement"
menu="False"
name="all.closed.cashbox.of.the.day"
- string="All Cashboxes Of the day"/>
+ string="All Cashboxes Of the day"/>-->
+
<menuitem icon="STOCK_PRINT"
- action="wizard_all_closed_cashbox_of_the_day"
+ action="action_report_all_closed_cashbox_of_the_day"
id="menu_all_closed_cashbox_of_the_day"
+
parent="menu_point_report_register"
- type="wizard"/>
+ />
+
</data>
</openerp>
diff --git a/addons/point_of_sale/wizard/__init__.py b/addons/point_of_sale/wizard/__init__.py
index 1ff9c124861..1384fb8329a 100644
--- a/addons/point_of_sale/wizard/__init__.py
+++ b/addons/point_of_sale/wizard/__init__.py
@@ -20,24 +20,29 @@
#
##############################################################################
-import wizard_pos_payment
+#import wizard_pos_payment
import wizard_default_journal
-import wizard_refund_order
-import wizard_add_product
-import wizard_confirm
-import wizard_discount
-import wizard_get_sale
import wizard_scan_product
-import wizard_receipt
import wizard_return
-import wizard_pos_payment_report
-import wizard_pos_sales_user
-import wizard_pos_sales_user_today
-import wizard_pos_payment_report_date
-import wizard_pos_payment_report_user
-import wizard_pos_sales_user_current_user
-import wizard_pos_details
-import wizard_open_statement
-import wizard_all_closed_cashbox_of_the_day
+#import wizard_open_statement
+import pos_add_product
+import pos_confirm
+import pos_discount
+import pos_get_sale
+import pos_open_statement
+import pos_close_statement
+import pos_box_entries
+import pos_box_out
+import pos_details
+import pos_sales_user
+import pos_sales_user_today
+import pos_sales_user_current_user
+import all_closed_cashbox_of_the_day
+import pos_receipt
+import pos_payment_report_user
+import pos_payment_report_date
+import pos_payment_report
+import pos_payment
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml b/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml
new file mode 100644
index 00000000000..e78ef5c6d6a
--- /dev/null
+++ b/addons/point_of_sale/wizard/all_closed_cashbox_of_the_day.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- pos.details -->
+
+ <record id="view_all_closed_cashbox_of_the_day" model="ir.ui.view">
+ <field name="name">all closed cashbox of the day</field>
+ <field name="model">all.closed.cashbox.of.the.day</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="All Cashboxes Of the day :">
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-print" />
+ </form>
+ </field>
+ </record>
+
+
+
+ <record id="action_report_all_closed_cashbox_of_the_day" model="ir.actions.act_window">
+ <field name="name">All Cashboxes Of the day</field>
+ <field name="res_model">all.closed.cashbox.of.the.day</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
diff --git a/addons/point_of_sale/wizard/pos_add_product.py b/addons/point_of_sale/wizard/pos_add_product.py
new file mode 100644
index 00000000000..f02d8bd3b30
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_add_product.py
@@ -0,0 +1,67 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+
+class add_product(osv.osv_memory):
+ _name = 'pos.add.product'
+ _description = 'Add Product'
+
+ _columns = {
+ 'product_id': fields.many2one('product.product', 'Product',required=True),
+ 'quantity': fields.float('Quantity ', required=True),
+ }
+ _defaults = {
+ 'quantity': lambda *a: 1,
+ }
+
+ def select_product(self, cr, uid, ids, context):
+ """
+ To get the product and quantity and add in order .
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : Retrun the add product form again for adding more product
+ """
+ this = self.browse(cr, uid, ids[0], context=context)
+ record_id = context and context.get('active_id',False)
+ assert record_id, _('Active ID is not found')
+ if record_id:
+ order_obj = self.pool.get('pos.order')
+ order_obj.add_product(cr, uid, record_id, this.product_id.id,this.quantity,context=context)
+
+ return {
+ 'name': _('Add Product'),
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'pos.add.product',
+ 'view_id': False,
+ 'target':'new',
+ 'views': False,
+ 'type': 'ir.actions.act_window',
+ }
+add_product()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/point_of_sale/wizard/pos_add_product.xml b/addons/point_of_sale/wizard/pos_add_product.xml
new file mode 100644
index 00000000000..5d380624f0d
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_add_product.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Add Product -->
+
+ <record id="view_add_product" model="ir.ui.view">
+ <field name="name">Add Product</field>
+ <field name="model">pos.add.product</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Add product :">
+ <group col="2" colspan="4">
+ <field name="product_id"/>
+ <field name="quantity"/>
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="select_product" string="Contiue"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_add_product" model="ir.actions.act_window">
+ <field name="name">Add Product</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.add.product</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
diff --git a/addons/point_of_sale/wizard/pos_box_entries.py b/addons/point_of_sale/wizard/pos_box_entries.py
new file mode 100644
index 00000000000..83e3e576044
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_box_entries.py
@@ -0,0 +1,133 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+from tools.misc import UpdateableStr
+from mx import DateTime
+from tools.translate import _
+
+def get_journal(self,cr,uid,context):
+ """
+ Make the selection list of Cash Journal .
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return :Return the list of journal
+ """
+
+ obj = self.pool.get('account.journal')
+ user = self.pool.get('res.users').browse(cr, uid, uid)
+ ids = obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', user.company_id.id)])
+ res = obj.read(cr, uid, ids, ['id', 'name'], context)
+ res = [(r['id'], r['name']) for r in res]
+ res.insert(0, ('', ''))
+ return res
+
+class pos_box_entries(osv.osv_memory):
+ _name = 'pos.box.entries'
+ _description = 'Pos Box Entries'
+
+
+
+ def _get_income_product(self,cr,uid,context):
+
+ """
+ Make the selection list of purchasing products.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return :Return of operation of product
+ """
+ obj = self.pool.get('product.product')
+ ids = obj.search(cr, uid, [('income_pdt', '=', True)])
+ res = obj.read(cr, uid, ids, ['id', 'name'], context)
+ res = [(r['id'], r['name']) for r in res]
+ res.insert(0, ('', ''))
+
+ return res
+
+
+ _columns = {
+ 'name': fields.char('Name', size=32,required=True),
+ 'journal_id': fields.selection(get_journal, "Journal",required=True),
+ 'product_id': fields.selection(_get_income_product, "Operation",required=True),
+ 'amount' :fields.float('Amount', digits=(16,2)),
+ 'ref':fields.char('Ref', size=32),
+ }
+ _defaults = {
+ 'journal_id': lambda *a: 1,
+ 'product_id': lambda *a: 1,
+ }
+ def get_in(self, cr, uid, ids, context):
+
+
+ """
+ Create the entry of statement in journal .
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return :Return of operation of product
+ """
+ statement_obj = self.pool.get('account.bank.statement')
+ product_obj = self.pool.get('product.template')
+ res_obj = self.pool.get('res.users')
+ product_obj=self.pool.get('product.product')
+ bank_statement=self.pool.get('account.bank.statement.line')
+ for data in self.read(cr, uid, ids):
+ args = {}
+ curr_company = res_obj.browse(cr,uid,uid).company_id.id
+ statement_id = statement_obj.search(cr,uid, [('journal_id','=',data['journal_id']),('company_id','=',curr_company),('user_id','=',uid),('state','=','open')])
+ if not statement_id:
+ raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox'))
+
+ product = product_obj.browse(cr, uid, data['product_id'])
+ acc_id = product_obj.browse(cr,uid,data['product_id']).property_account_income
+ if not acc_id:
+ raise osv.except_osv(_('Error !'), _('please check that account is set to %s')%(product_obj.browse(cr,uid,data['product_id']).name))
+ if statement_id:
+ statement_id = statement_id[0]
+ if not statement_id:
+ statement_id = statement_obj.create(cr,uid,{'date':time.strftime('%Y-%m-%d 00:00:00'),
+ 'journal_id':data['journal_id'],
+ 'company_id':curr_company,
+ 'user_id':uid,
+ })
+
+ args['statement_id'] = statement_id
+ args['journal_id'] = data['journal_id']
+ if acc_id:
+ args['account_id'] = acc_id.id
+ args['amount'] = data['amount'] or 0.0
+ args['ref'] = "%s" %(data['ref'] or '')
+ args['name'] = "%s: %s "% (product_obj.browse(cr,uid,data['product_id']).name, data['name'].decode('utf8'))
+ address_u = res_obj.browse(cr,uid,uid).address_id
+ if address_u:
+ partner_id = address_u.partner_id and address_u.partner_id.id or None
+ args['partner_id'] = partner_id
+ statement_line_id =bank_statement.create(cr, uid, args)
+
+ return {}
+pos_box_entries() \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_box_entries.xml b/addons/point_of_sale/wizard/pos_box_entries.xml
new file mode 100644
index 00000000000..e0f0a21402f
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_box_entries.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Box Entries -->
+
+ <record id="view_box_entries" model="ir.ui.view">
+ <field name="name">Box Entries</field>
+ <field name="model">pos.box.entries</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Entrée de caisse">
+ <separator string="Please fill these fields for entries to the box:" colspan="4"/>
+ <field name="name"/>
+ <field name="journal_id"/>
+ <field name="product_id"/>
+ <field name="amount"/>
+ <field name="ref"/>
+ <group colspan="4" col="2">
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="get_in" string="Make Entries in the CashBox"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_box_entries" model="ir.actions.act_window">
+ <field name="name">Box Entries</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.box.entries</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
diff --git a/addons/point_of_sale/wizard/pos_box_out.py b/addons/point_of_sale/wizard/pos_box_out.py
new file mode 100644
index 00000000000..52d2be0a3d0
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_box_out.py
@@ -0,0 +1,132 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+from tools.misc import UpdateableStr
+from mx import DateTime
+from tools.translate import _
+import pos_box_entries
+print dir(pos_box_entries)
+
+class pos_box_out(osv.osv_memory):
+ _name = 'pos.box.out'
+ _description = 'Pos Box Out'
+
+ def _get_expense_product(self,cr,uid,context):
+
+ """
+ Make the selection list of expense product.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return :Return of operation of product
+ """
+ obj = self.pool.get('product.product')
+ company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
+ ids = obj.search(cr, uid, ['&', ('expense_pdt', '=', True), '|', ('company_id', '=', company_id), ('company_id', '=', None)])
+ res = obj.read(cr, uid, ids, ['id', 'name'], context)
+ res = [(r['id'], r['name']) for r in res]
+ res.insert(0, ('', ''))
+ return res
+
+ _columns = {
+ 'name': fields.char('Name', size=32,required=True),
+ 'journal_id': fields.selection(pos_box_entries.get_journal, "Journal",required=True),
+ 'product_id': fields.selection(_get_expense_product, "Operation",required=True),
+ 'amount' :fields.float('Amount', digits=(16,2)),
+ 'ref':fields.char('Ref', size=32),
+ }
+ _defaults = {
+ 'journal_id': lambda *a: 1,
+ 'product_id': lambda *a: 1,
+ }
+ def get_out(self, cr, uid, ids, context):
+
+ """
+ Create the entries in the CashBox .
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return :Return of operation of product
+ """
+ args = {}
+ statement_obj= self.pool.get('account.bank.statement')
+ statement_line_obj=self.pool.get('account.bank.statement.line')
+ product_obj= self.pool.get('product.template')
+ productp_obj= self.pool.get('product.product')
+ res_obj = self.pool.get('res.users')
+ for data in self.read(cr, uid, ids):
+
+ curr_company = res_obj.browse(cr,uid,uid).company_id.id
+ statement_id = statement_obj.search(cr,uid, [('journal_id','=',data['journal_id']),('company_id','=',curr_company),('user_id','=',uid),('state','=','open')])
+ monday = (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Monday,0))).strftime('%Y-%m-%d')
+ sunday = (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Sunday,0))).strftime('%Y-%m-%d')
+ done_statmt = statement_obj.search(cr,uid, [('date','>=',monday+' 00:00:00'),('date','<=',sunday+' 23:59:59'),('journal_id','=',data['journal_id']),('company_id','=',curr_company),('user_id','=',uid)])
+ stat_done = statement_obj.browse(cr,uid, done_statmt)
+ address_u = res_obj.browse(cr,uid,uid).address_id
+ am = 0.0
+
+ amount_check = productp_obj.browse(cr,uid,data['product_id']).am_out or False
+ for st in stat_done:
+ for s in st.line_ids:
+ if address_u and s.partner_id==address_u.partner_id and s.am_out:
+ am+=s.amount
+ if (-data['amount'] or 0.0)+ am <-(res_obj.browse(cr,uid,uid).company_id.max_diff or 0.0) and amount_check:
+ val = (res_obj.browse(cr,uid,uid).company_id.max_diff or 0.0)+ am
+ raise osv.except_osv(_('Error !'), _('The maximum value you can still withdraw is exceeded. \n Remaining value is equal to %d ')%(val))
+
+ acc_id = product_obj.browse(cr,uid,data['product_id']).property_account_income
+ if not acc_id:
+ raise osv.except_osv(_('Error !'), _('please check that account is set to %s')%(product_obj.browse(cr,uid,data['product_id']).name))
+ if not statement_id:
+ raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox'))
+ if statement_id:
+ statement_id = statement_id[0]
+ if not statement_id:
+ statement_id = statement_obj.create(cr,uid,{'date':time.strftime('%Y-%m-%d 00:00:00'),
+ 'journal_id':data['journal_id'],
+ 'company_id':curr_company,
+ 'user_id':uid,
+ })
+ args['statement_id']= statement_id
+ args['journal_id']= data['journal_id']
+ if acc_id:
+ args['account_id']= acc_id.id
+ amount= data['amount'] or 0.0
+ if data['amount'] > 0:
+ amount= -data['amount']
+ args['amount'] = amount
+ if productp_obj.browse(cr,uid,data['product_id']).am_out:
+ args['am_out'] = True
+ args['ref'] = data['ref'] or ''
+ args['name'] = "%s: %s "%(product_obj.browse(cr,uid,data['product_id']).name, data['name'].decode('utf8'))
+ address_u = res_obj.browse(cr,uid,uid).address_id
+ if address_u:
+ partner_id = address_u.partner_id and address_u.partner_id.id or None
+ args['partner_id'] = partner_id
+ statement_line_id = statement_line_obj.create(cr, uid, args)
+ return {}
+
+pos_box_out() \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_box_out.xml b/addons/point_of_sale/wizard/pos_box_out.xml
new file mode 100644
index 00000000000..c634b4cf997
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_box_out.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Box Entries -->
+
+ <record id="view_pos_box_out" model="ir.ui.view">
+ <field name="name">Box Out</field>
+ <field name="model">pos.box.out</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Sortie de caisse">
+ <separator string="Please fill these fields for entries to the box:" colspan="4"/>
+ <field name="name"/>
+ <field name="journal_id"/>
+ <field name="product_id"/>
+ <field name="amount"/>
+ <field name="ref"/>
+ <group colspan="4" col="2">
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="get_out" string="Make Entries in the CashBox"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_box_out" model="ir.actions.act_window">
+ <field name="name">Box Out</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.box.out</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
diff --git a/addons/point_of_sale/wizard/pos_close_statement.py b/addons/point_of_sale/wizard/pos_close_statement.py
new file mode 100644
index 00000000000..4a1d305973d
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_close_statement.py
@@ -0,0 +1,52 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+import time
+
+class pos_close_statement(osv.osv_memory):
+ _name = 'pos.close.statement'
+ _description = 'Close Statements'
+
+
+ def close_statement(self, cr, uid, ids, context):
+ """
+ Close the statements
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : Blank Dictionary
+ """
+ company_id=self.pool.get('res.users').browse(cr,uid,uid).company_id.id
+ statement_obj = self.pool.get('account.bank.statement')
+ singer_obj = self.pool.get('singer.statement')
+ journal_obj=self.pool.get('account.journal')
+ journal_lst=journal_obj.search(cr,uid,[('company_id','=',company_id),('auto_cash','=',True),('check_dtls','=',False)])
+ journal_ids=journal_obj.browse(cr,uid, journal_lst)
+ for journal in journal_ids:
+ ids = statement_obj.search(cr, uid, [('state','!=','confirm'),('user_id','=',uid),('journal_id','=',journal.id)])
+ statement_obj.button_confirm(cr,uid,ids)
+ return {}
+pos_close_statement()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_close_statement.xml b/addons/point_of_sale/wizard/pos_close_statement.xml
new file mode 100644
index 00000000000..fed3518b706
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_close_statement.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Point of Sale Confirm -->
+
+ <record id="view_pos_close_statement" model="ir.ui.view">
+ <field name="name">Close Statements</field>
+ <field name="model">pos.close.statement</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Close Statements">
+ <label string="Are you sure you want to close the statements ?" colspan="2"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel"
+ string="No" />
+ <button name="close_statement" string="Yes"
+ colspan="1" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Close Statements"
+ res_model="pos.close.statement"
+ src_model="account.bank.statement"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="act_pos_open_statement"/>
+
+
+ <record id="action_pos_close_statement" model="ir.actions.act_window">
+ <field name="name">Close Register</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.close.statement</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_confirm.py b/addons/point_of_sale/wizard/pos_confirm.py
new file mode 100644
index 00000000000..f2765a5b74a
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_confirm.py
@@ -0,0 +1,60 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+
+class pos_confirm(osv.osv_memory):
+ _name = 'pos.confirm'
+ _description = 'Point of Sale Confirm'
+ def action_confirm(self, cr, uid, ids, context):
+ """
+ Confirm the order and close the sales .
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return :Blank dictionary
+ """
+
+ this = self.browse(cr, uid, ids[0], context=context)
+ record_id = context and context.get('active_id',False)
+ if record_id:
+ if isinstance(record_id, (int, long)):
+ record_id=[record_id]
+ if record_id:
+ company_id=self.pool.get('res.users').browse(cr,uid,uid).company_id
+ order_obj = self.pool.get('pos.order')
+
+ for order_id in order_obj.browse(cr, uid, record_id, context=context):
+ if order_id.state =='paid':
+ order_obj.write(cr,uid,[order_id.id],{'journal_entry':True})
+ order_obj.create_account_move(cr, uid, [order_id.id], context=context)
+
+ wf_service = netsvc.LocalService("workflow")
+ for i in record_id:
+ wf_service.trg_validate(uid, 'pos.order', i, 'done', cr)
+ return {}
+
+pos_confirm()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/point_of_sale/wizard/pos_confirm.xml b/addons/point_of_sale/wizard/pos_confirm.xml
new file mode 100644
index 00000000000..384d75f768f
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_confirm.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Point of Sale Confirm -->
+
+ <record id="view_pos_confirm" model="ir.ui.view">
+ <field name="name">Sale Confirm</field>
+ <field name="model">pos.confirm</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Open Statements">
+ <label string="Are you sure you want to close your sales ?" colspan="2"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel"
+ string="No" />
+ <button name="action_confirm" string="Yes"
+ colspan="1" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_pos_confirm" model="ir.actions.act_window">
+ <field name="name">Sale Confirm</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.confirm</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+ <record model="ir.values" id="values_pos_confirm">
+ <field name="model_id" ref="point_of_sale.model_pos_order" />
+ <field name="object" eval="1" />
+ <field name="name">Sale Confirm</field>
+ <field name="key2">client_action_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' + str(ref('action_pos_confirm'))"/>
+ <field name="key">action</field>
+ <field name="model">pos.order</field>
+ </record>
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_details.py b/addons/point_of_sale/wizard/pos_details.py
new file mode 100644
index 00000000000..d51b30bdca9
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_details.py
@@ -0,0 +1,62 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+from mx import DateTime
+import time
+
+class pos_details(osv.osv_memory):
+ _name = 'pos.details'
+ _description = 'Sales Details'
+
+ _columns = {
+ 'date_start': fields.date('Date Start',required=True),
+ 'date_end': fields.date('Date End',required=True)
+ }
+ _defaults = {
+ 'date_start': lambda *a: time.strftime('%Y-%m-%d'),
+ 'date_end': lambda *a: time.strftime('%Y-%m-%d'),
+ }
+ def print_report(self, cr, uid, ids, context={}):
+ """
+ To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun report
+ """
+
+ datas = {'ids' : context.get('active_ids', [])}
+ res = self.read(cr, uid, ids, ['date_start','date_end'], context)
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type':'ir.actions.report.xml',
+ 'report_name':'pos.details',
+ 'datas':datas,
+ }
+pos_details()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/point_of_sale/wizard/pos_details.xml b/addons/point_of_sale/wizard/pos_details.xml
new file mode 100644
index 00000000000..7d6dd346c12
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_details.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- pos.details -->
+
+ <record id="view_pos_details" model="ir.ui.view">
+ <field name="name">POS Details</field>
+ <field name="model">pos.details</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="POS Details :">
+ <group col="2" colspan="4">
+ <field name="date_start"/>
+ <field name="date_end"/>
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-print" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+
+ <record id="action_report_pos_details" model="ir.actions.act_window">
+ <field name="name">Sale Details</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.details</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ <field name="context">{'record_id' : active_id}</field>
+ </record>
+<!-- <act_window name="POS Details"
+ res_model="pos.details"
+ src_model="pos.order"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_report_pos_details"/> -->
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_discount.py b/addons/point_of_sale/wizard/pos_discount.py
new file mode 100644
index 00000000000..8c9f9ac032d
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_discount.py
@@ -0,0 +1,111 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+
+class pos_discount(osv.osv_memory):
+ _name = 'pos.discount'
+ _description = 'Add Discount'
+
+ _columns = {
+ 'discount': fields.float('Discount ', required=True),
+ 'discount_notes': fields.char('Discount Notes',size= 128, required=True),
+ }
+ _defaults = {
+ 'discount': lambda *a: 5,
+ }
+
+ def apply_discount(self, cr, uid, ids, context):
+ """
+ To give the discount of product and check the.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : nothing
+ """
+ this = self.browse(cr, uid, ids[0], context=context)
+ record_id = context and context.get('active_id', False)
+ if isinstance(record_id, (int, long)):
+ record_id=[record_id]
+
+ order_ref = self.pool.get('pos.order')
+ order_line_ref =self.pool.get('pos.order.line')
+
+ for order in order_ref.browse(cr, uid, record_id, context=context):
+
+ for line in order.lines :
+ company_discount = order.company_id.company_discount
+ applied_discount = this.discount
+
+ if applied_discount == 0.00:
+ notice = 'No Discount'
+ elif company_discount >= applied_discount:
+ notice = 'Minimum Discount'
+ else:
+ notice = this.discount_notes
+
+ res_new = {
+ }
+
+ if this.discount <= company_discount:
+ res_new = {
+ 'discount': this.discount,
+ 'notice': notice,
+ 'price_ded': line.price_unit * line.qty * (this.discount or 0) * 0.01 or 0.0
+ }
+ else:
+ res_new = {
+ 'discount': this.discount,
+ 'notice': notice,
+ 'price_ded': line.price_unit * line.qty * (this.discount or 0) * 0.01 or 0.0
+ }
+
+ order_line_ref.write(cr, uid, [line.id], res_new, context=context)
+ return {}
+
+# def check_discount(self, cr, uid, record_id, discount, context):
+# """
+# Check the discount of define by company .
+# @param self: The object pointer.
+# @param cr: A database cursor
+# @param uid: ID of the user currently logged in
+# @param record_id:Current Order id
+# @param discount:Select Discount
+# @param context: A standard dictionary
+# @return : retrun to apply and used the company discount base on condition
+# """
+
+# order_ref = self.pool.get('pos.order')
+#
+# for order in order_ref.browse(cr, uid, record_id, context=context):
+# company_disc = order.company_id.company_discount
+# for line in order.lines :
+# prod_disc = discount
+# if prod_disc <= company_disc :
+# return 'apply_discount'
+# else :
+# return 'disc_discount'
+pos_discount()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_discount.xml b/addons/point_of_sale/wizard/pos_discount.xml
new file mode 100644
index 00000000000..a0a7c534a95
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_discount.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Add Product -->
+
+ <record id="view_pos_discount" model="ir.ui.view">
+ <field name="name">Apply Discount</field>
+ <field name="model">pos.discount</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Apply Discount">
+ <group col="2" colspan="4">
+ <field name="discount"/>
+ <field name="discount_notes"/>
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="apply_discount" string="Apply Discount"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_pos_discount" model="ir.actions.act_window">
+ <field name="name">Apply Discount</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.discount</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_get_sale.py b/addons/point_of_sale/wizard/pos_get_sale.py
new file mode 100644
index 00000000000..901cc3a521f
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_get_sale.py
@@ -0,0 +1,79 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+
+class pos_get_sale(osv.osv_memory):
+ _name = 'pos.get.sale'
+ _description = 'Get From Sale'
+
+ _columns = {
+ 'picking_id': fields.many2one('stock.picking', 'Sale Order', domain=[('state','in',('assigned','confirmed')), ('type', '=', 'out')],context="{'contact_display':'partner'}",required=True),
+ }
+
+ def sale_complete(self, cr, uid, ids, context):
+ """
+ Select the picking order and add the in Point of sale order
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : nothing
+ """
+ this = self.browse(cr, uid, ids[0], context=context)
+ record_id = context and context.get('active_id',False)
+
+ proxy_pos = self.pool.get('pos.order')
+ proxy_pick = self.pool.get('stock.picking')
+ proxy_order_line=self.pool.get('pos.order.line')
+
+ if record_id:
+ order=proxy_pos.browse(cr, uid, record_id, context)
+
+ if order.state in ('paid', 'invoiced'):
+ raise osv.except_osv(_('UserError '), _("You can't modify this order. It has already been paid"))
+
+ for pick in proxy_pick.browse(cr, uid, [this.picking_id.id], context):
+ proxy_pos.write(cr, uid, record_id, {
+ 'last_out_picking':this.picking_id.id,
+ 'partner_id': pick.address_id and pick.address_id.partner_id.id
+ })
+
+ order = proxy_pick.write(cr, uid, [this.picking_id.id], {
+ 'invoice_state': 'none',
+ 'pos_order': record_id
+ })
+
+ for line in pick.move_lines:
+ proxy_order_line.create(cr, uid, {
+ 'name': line.sale_line_id.name,
+ 'order_id': record_id,
+ 'qty': line.product_qty,
+ 'product_id': line.product_id.id,
+ 'price_unit': line.sale_line_id.price_unit,
+ 'discount': line.sale_line_id.discount,
+ })
+
+ return {}
+pos_get_sale()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_get_sale.xml b/addons/point_of_sale/wizard/pos_get_sale.xml
new file mode 100644
index 00000000000..9a28da548d2
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_get_sale.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Select an Open Sale Order -->
+
+ <record id="view_pos_get_sale" model="ir.ui.view">
+ <field name="name">Open Sale Order</field>
+ <field name="model">pos.get.sale</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Select an Open Sale Order">
+ <field name="picking_id"/>
+ <newline/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="sale_complete" string="Confirm"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+ <record id="action_pos_get_sale" model="ir.actions.act_window">
+ <field name="name">Select an Open Sale Order</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.get.sale</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+ </data>
+</openerp>
+ \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_open_statement.py b/addons/point_of_sale/wizard/pos_open_statement.py
new file mode 100644
index 00000000000..1c02221677c
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_open_statement.py
@@ -0,0 +1,90 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+import time
+class pos_open_statement(osv.osv_memory):
+ _name = 'pos.open.statement'
+ _description = 'Open Statements'
+
+
+ def open_statement(self, cr, uid, ids, context):
+ """
+ Open the statements
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : Blank Directory
+ """
+ company_id=self.pool.get('res.users').browse(cr,uid,uid).company_id.id
+ statement_obj =self.pool.get('account.bank.statement')
+ singer_obj = self.pool.get('singer.statement')
+ journal_obj=self.pool.get('account.journal')
+ journal_lst=journal_obj.search(cr,uid,[('company_id','=',company_id),('auto_cash','=',True)])
+ journal_ids=journal_obj.browse(cr,uid, journal_lst)
+ for journal in journal_ids:
+ ids = statement_obj.search(cr, uid, [('state','!=','confirm'),('user_id','=',uid),('journal_id','=',journal.id)])
+ if len(ids):
+ raise osv.except_osv(_('Message'),_('You can not open a Cashbox for "%s". \n Please close the cashbox related to. '%(journal.name) ))
+ sql = """ Select id from account_bank_statement
+ where journal_id=%d
+ and company_id =%d
+ order by id desc limit 1"""%(journal.id,company_id)
+ singer_ids=None
+ cr.execute(sql)
+ st_id = cr.fetchone()
+ number=''
+ sequence_obj=self.pool.get('ir.sequence')
+ if journal.statement_sequence_id:
+ number = sequence_obj.get_id(cr, uid, journal.id)
+ else:
+ number = sequence_obj.get(cr, uid,
+ 'account.bank.statement')
+
+ # statement_id=statement_obj.create(cr,uid,{'journal_id':journal.id,
+ # 'company_id':company_id,
+ # 'user_id':uid,
+ # 'state':'open',
+ # 'name':number
+ # })
+ period=statement_obj._get_period(cr,uid,context) or None
+ cr.execute("INSERT INTO account_bank_statement(journal_id,company_id,user_id,state,name, period_id,date) VALUES(%d,%d,%d,'open','%s',%d,'%s')"%(journal.id,company_id,uid,number, period, time.strftime('%Y-%m-%d %H:%M:%S')))
+ cr.commit()
+ cr.execute("select id from account_bank_statement where journal_id=%d and company_id=%d and user_id=%d and state='open' and name='%s'"%(journal.id,company_id,uid,number))
+ statement_id=cr.fetchone()[0]
+ if st_id:
+ statemt_id=statement_obj.browse(cr,uid,st_id[0])
+ if statemt_id and statemt_id.ending_details_ids:
+ statement_obj.write(cr, uid,[statement_id], {'balance_start':statemt_id.balance_end,
+ 'state':'open'})
+ if statemt_id.ending_details_ids:
+ for i in statemt_id.ending_details_ids:
+ c=singer_obj.create(cr,uid, { 'pieces':i.pieces,
+ 'number':i.number,
+ 'starting_id':statement_id,
+ })
+ cr.commit()
+ return {}
+pos_open_statement()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_open_statement.xml b/addons/point_of_sale/wizard/pos_open_statement.xml
new file mode 100644
index 00000000000..9b80a7ec60d
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_open_statement.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Point of Sale Confirm -->
+
+ <record id="view_pos_open_statement" model="ir.ui.view">
+ <field name="name">Open Statements</field>
+ <field name="model">pos.open.statement</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Open Statements">
+ <label string="Are you sure you want to open the statements ?" colspan="2"/>
+ <newline/>
+ <button icon='gtk-cancel' special="cancel"
+ string="No" />
+ <button name="open_statement" string="Yes"
+ colspan="1" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+ <act_window name="Open Statements"
+ res_model="pos.open.statement"
+ src_model="account.bank.statement"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="act_pos_open_statement"/>
+
+ <record id="action_pos_open_statement" model="ir.actions.act_window">
+ <field name="name">Open Register</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.open.statement</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py
new file mode 100644
index 00000000000..b29a6a43b7f
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment.py
@@ -0,0 +1,204 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+import pos_box_entries
+import time
+from decimal import Decimal
+from tools.translate import _
+import pos_receipt
+
+class pos_make_payment(osv.osv_memory):
+ _name = 'pos.make.payment'
+ _description = 'Point of Sale Payment'
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
+ """
+ res = super(pos_make_payment, self).default_get(cr, uid, fields, context=context)
+ record_id = context and context.get('active_id',False)
+ j_obj = self.pool.get('account.journal')
+ company_id = self.pool.get('res.users').browse(cr,uid,uid).company_id.id
+ journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
+ if journal:
+ journal = journal[0]
+ else:
+ journal = None
+ wf_service = netsvc.LocalService("workflow")
+
+
+ order = self.pool.get('pos.order').browse(cr, uid, record_id, context)
+ #get amount to pay
+ amount = order.amount_total - order.amount_paid
+
+ if amount<=0.0:
+ context.update({'flag':True})
+ self.pool.get('pos.order').action_paid(cr,uid,[record_id],context)
+ elif order.amount_paid > 0.0:
+ self.pool.get('pos.order').write(cr, uid, [record_id],{'state':'advance'})
+
+ invoice_wanted_checked = False
+
+ current_date = time.strftime('%Y-%m-%d')
+
+ if 'journal' in fields:
+ res.update({'journal':journal})
+ if 'amount' in fields:
+ res.update({'amount':amount})
+ if 'invoice_wanted' in fields:
+ res.update({'invoice_wanted':invoice_wanted_checked})
+ if 'payment_date' in fields:
+ res.update({'payment_date':current_date})
+ if 'payment_name' in fields:
+ res.update({'payment_name':'Payment'})
+ return res
+ def view_init(self, cr, uid, fields_list, context=None):
+ res = super(pos_make_payment, self).view_init(cr, uid, fields_list, context=context)
+ record_id = context and context.get('active_id', False) or False
+ order = self.pool.get('pos.order').browse(cr, uid, record_id)
+ if not order.lines:
+ raise osv.except_osv('Error!','No Order Lines ')
+ True
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ """
+ Changes the view dynamically
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+
+ @return: New arch of view.
+
+ """
+ record_id = context and context.get('record_id', False) or False
+ res = super(pos_make_payment, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+
+ if record_id:
+ order = self.pool.get('pos.order').browse(cr, uid, record_id)
+ amount = order.amount_total - order.amount_paid
+ if amount==0.0:
+ res['arch'] = """ <form string="Make Payment" colspan="4">
+ <group col="2" colspan="2">
+ <label string="Do you want to print the Receipt?" colspan="4"/>
+ <separator colspan="4"/>
+ <button icon="gtk-cancel" special="cancel" string="No" readonly="0"/>
+ <button name="print_report" string="Print Receipt" type="object" icon="gtk-ok"/>
+ </group>
+ </form>
+ """
+ return res
+
+ def check(self, cr, uid, ids, context=None):
+
+ """Check the order:
+ if the order is not paid: continue payment,
+ if the order is paid print invoice (if wanted) or ticket.
+ """
+ record_id = context and context.get('active_id',False)
+ order_obj = self.pool.get('pos.order')
+ jrnl_obj = self.pool.get('account.journal')
+ order = order_obj.browse(cr, uid, record_id, context)
+ amount = order.amount_total - order.amount_paid
+ data = self.read(cr, uid, ids)[0]
+
+ # Todo need to check ...
+ if amount !=0.0:
+ invoice_wanted = data['invoice_wanted']
+ jrnl_used=False
+ if data.get('journal',False):
+ jrnl_used=jrnl_obj.browse(cr,uid,data['journal'])
+ order_obj.write(cr, uid, [record_id], {'invoice_wanted': invoice_wanted})
+ order_obj.add_payment(cr, uid, record_id, data, context=context)
+
+ if amount<=0.0:
+ context.update({'flag':True})
+ order_obj.action_paid(cr,uid,[record_id],context)
+ if order_obj.test_paid(cr, uid, [record_id]):
+ if order.partner_id and order.invoice_wanted:
+ return self.create_invoice(cr,uid,ids,context)
+ else:
+ return self.print_report(cr, uid, ids, context)
+ return {}
+
+
+ def create_invoice(self, cr, uid, ids, context):
+ wf_service = netsvc.LocalService("workflow")
+ record_ids = context and context.get('active_ids',False)
+ for i in record_ids:
+ wf_service.trg_validate(uid, 'pos.order', i, 'invoice', cr)
+ datas = {'ids' : context.get('active_ids', [])}
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'pos.invoice',
+ 'datas' : datas,
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ if not context:
+ context={}
+ """
+ @summary: To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun report
+ """
+ datas = {'ids' : context.get('active_ids',[])}
+ res = {}
+ datas['form'] = res
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'pos.receipt',
+ 'datas' : datas,
+ }
+
+ def trigger_wkf(self, cr, uid, data, context):
+ record_id = context and context.get('active_id',False)
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'pos.order', record_id, 'payment', cr)
+ return {}
+
+ _columns = {
+ 'journal':fields.selection(pos_box_entries.get_journal, "Journal",required=True),
+ 'product_id': fields.many2one('product.product', "Acompte"),
+ 'amount':fields.float('Amount', digits=(16,2) ,required= True),
+ 'payment_name': fields.char('Payment name', size=32, required=True),
+ 'payment_date': fields.date('Payment date', required=True),
+ 'is_acc': fields.boolean('Accompte'),
+ 'invoice_wanted': fields.boolean('Invoice'),
+ 'num_sale':fields.char('Num.File', size=32),
+ }
+
+pos_make_payment()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/point_of_sale/wizard/pos_payment.xml b/addons/point_of_sale/wizard/pos_payment.xml
new file mode 100644
index 00000000000..771ec3c72e3
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+
+"""
+ <!-- Select an Open Sale Order -->
+
+ <record id="view_pos_payment" model="ir.ui.view">
+ <field name="name">Add payment :</field>
+ <field name="model">pos.make.payment</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Add payment :">
+ <group colspan="4" >
+ <field name="amount" />
+ <field name="journal"/>
+ <field name="payment_date" />
+ <field name="payment_name" />
+ <field name="invoice_wanted" />
+ <field name="num_sale" />
+ <field name="is_acc" />
+ <group attrs="{'readonly':[('is_acc','=',False)]}" colspan="4" col="2">
+ <field name="product_id" attrs="{'required':[('is_acc', '=', True)]}" domain="[('type','=','service')]"/>
+ </group>
+ <newline/>
+ <separator orientation="vertical"/>
+ <button icon='gtk-cancel' special="cancel" string="Cancel" />
+ <button name="trigger_wkf" string="Finish" colspan="1" type="object" icon="gtk-ok"/>
+ <button name="check" string="Make Payment" colspan="1" type="object" icon="gtk-ok"/>
+ </group>
+ </form>
+ </field>
+ </record>
+ <record id="action_pos_payment" model="ir.actions.act_window">
+ <field name="name">Add payment</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.make.payment</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+ </data>
+</openerp>
+ \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_payment_report.py b/addons/point_of_sale/wizard/pos_payment_report.py
new file mode 100644
index 00000000000..12cc044e448
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment_report.py
@@ -0,0 +1,74 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
+#
+# 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.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import pooler
+import netsvc
+import wizard
+import time# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+from mx import DateTime
+import time
+
+class pos_payment_report(osv.osv_memory):
+ _name = 'pos.payment.report'
+ _description = 'Payment Report'
+
+ def print_report(self, cr, uid, ids, context={}):
+ """
+ To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun report
+ """
+
+ datas = {'ids' : context.get('active_ids', [])}
+ return {
+ 'type':'ir.actions.report.xml',
+ 'report_name':'pos.payment.report',
+ 'datas':datas,
+ }
+pos_payment_report()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_payment_report.xml b/addons/point_of_sale/wizard/pos_payment_report.xml
new file mode 100644
index 00000000000..593068a9ebf
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment_report.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- pos.details -->
+
+ <record id="view_pos_payment_report" model="ir.ui.view">
+ <field name="name">Payment Report</field>
+ <field name="model">pos.payment.report</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="POS Details :">
+ <group col="2" colspan="4">
+ <field name="date_start"/>
+ <field name="date_end"/>
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-print" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_pos_payment_report" model="ir.actions.act_window">
+ <field name="name">Payment Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.details</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_payment_report_date.py b/addons/point_of_sale/wizard/pos_payment_report_date.py
new file mode 100644
index 00000000000..9e24fb76505
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment_report_date.py
@@ -0,0 +1,65 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
+#
+# 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.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv
+from osv import fields
+import time
+class pos_payment_report_date(osv.osv_memory):
+ '''
+ Open ERP Model
+ '''
+ _name = 'pos.payment.report.date'
+ _description = 'POS Payment Report according to date'
+ def print_report(self, cr, uid, ids, context=None):
+
+ """
+ To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun report
+ """
+ datas = {'ids' : context.get('active_ids',[])}
+ res = self.read(cr, uid, ids, ['date_start','date_end','user_id'])
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'pos.payment.report.date',
+ 'datas' : datas,
+ }
+
+ _columns = {
+ 'date_start': fields.date('Start Date', required=True),
+ 'date_end': fields.date('End Date', required=True),
+ 'user_id':fields.many2many('res.users','res_user_sale','user_id','sale_id','Salesman')
+ }
+ _defaults = {
+ 'date_start': lambda *a: time.strftime('%Y-%m-%d'),
+ 'date_end': lambda *a: time.strftime('%Y-%m-%d'),
+ }
+pos_payment_report_date()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/point_of_sale/wizard/pos_payment_report_date_view.xml b/addons/point_of_sale/wizard/pos_payment_report_date_view.xml
new file mode 100644
index 00000000000..4c05c8ac514
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment_report_date_view.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="pos_payment_report_date_form" model="ir.ui.view">
+ <field name="name">pos.payment.report.date.form</field>
+ <field name="model">pos.payment.report.date</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Sale by Date and User">
+ <group col="2" colspan="4">
+ <field name="date_start"/>
+ <field name="date_end"/>
+ <field name="user_id"/>
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-print" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_report_pos_payment_repport_date" model="ir.actions.act_window">
+ <field name="name">Sales lines Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.payment.report.date</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+ </data>
+</openerp>
diff --git a/addons/point_of_sale/wizard/pos_payment_report_user.py b/addons/point_of_sale/wizard/pos_payment_report_user.py
new file mode 100644
index 00000000000..59df8d28881
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment_report_user.py
@@ -0,0 +1,56 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
+#
+# 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.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv
+from osv import fields
+
+class pos_payment_report_user(osv.osv_memory):
+ '''
+ Open ERP Model
+ '''
+ _name = 'pos.payment.report.user'
+ _description = 'Sales lines by Users'
+ def print_report(self, cr, uid, ids, context=None):
+
+ """
+ To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun report
+ """
+ datas = {'ids' : context.get('active_ids',[])}
+ res = self.read(cr, uid, ids, ['user_id'])
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'pos.payment.report.user',
+ 'datas' : datas,
+ }
+
+ _columns = {
+ 'user_id':fields.many2many('res.users','res_user_sale','user_id','sale_id','Salesman')
+ }
+pos_payment_report_user() \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_payment_report_user.xml b/addons/point_of_sale/wizard/pos_payment_report_user.xml
new file mode 100644
index 00000000000..bccfe92a847
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment_report_user.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- pos.details -->
+
+ <record id="view_pos_payment_report" model="ir.ui.view">
+ <field name="name">Pyament Report</field>
+ <field name="model">pos.payment.report</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Pyament Report ">
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-print" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+
+ <record id="action_report_pos_payment" model="ir.actions.act_window">
+ <field name="name">Pyament Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.payment.report</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+<!-- <act_window name="POS Details"
+ res_model="pos.details"
+ src_model="pos.order"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_report_pos_details"/> -->
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_payment_report_user_view.xml b/addons/point_of_sale/wizard/pos_payment_report_user_view.xml
new file mode 100644
index 00000000000..9d6e925ebd7
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_payment_report_user_view.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="pos_payment_report_user_form" model="ir.ui.view">
+ <field name="name">pos.payment.report.user.form</field>
+ <field name="model">pos.payment.report.user</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Sale by User">
+ <group col="2" colspan="4">
+ <field name="user_id"/>
+ <button icon='gtk-cancel' special="cancel" string="Close" />
+ <button name="print_report" string="Print Report" colspan="1" type="object" icon="gtk-print" />
+ </group >
+ </form>
+ </field>
+ </record>
+ <record id="action_report_pos_payment_report_user" model="ir.actions.act_window">
+ <field name="name">Sales lines by Users</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.payment.report.user</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+ </data>
+</openerp>
diff --git a/addons/point_of_sale/wizard/pos_receipt.py b/addons/point_of_sale/wizard/pos_receipt.py
new file mode 100644
index 00000000000..a812ad342a4
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_receipt.py
@@ -0,0 +1,66 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
+#
+# 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.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import netsvc
+from osv import osv,fields
+from tools.translate import _
+
+from mx import DateTime
+import time
+
+class pos_receipt(osv.osv_memory):
+ _name = 'pos.receipt'
+ _description = 'Point of sale receipt'
+
+ _columns = {
+
+ }
+ def view_init(self, cr , uid , fields_list, context=None):
+ order_lst =self. pool.get('pos.order').browse(cr,uid,context['active_id'])
+ for order in order_lst:
+ if order.state_2 in ('to_verify'):
+ raise osv.except_osv(_('Error!', 'Can not print the receipt because of discount and/or payment '))
+ True
+ def print_report(self, cr, uid, ids, context=None):
+
+ """
+ To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun report
+ """
+ datas = {'ids' : context.get('active_ids',[])}
+ res = {}
+ datas['form'] = res
+
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'pos.receipt',
+ 'datas' : datas,
+ }
+
+pos_receipt()
+
+
+
+
diff --git a/addons/point_of_sale/wizard/pos_receipt_view.xml b/addons/point_of_sale/wizard/pos_receipt_view.xml
new file mode 100644
index 00000000000..5839e4fcb3e
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_receipt_view.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- pos.details -->
+
+ <record id="view_pos_receipt" model="ir.ui.view">
+ <field name="name">Receipt</field>
+ <field name="model">pos.receipt</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Receipt :">
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-ok" />
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Fill Inventory"
+ res_model="pos.receipt"
+ src_model="pos.order"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_report_pos_receipt"/>
+
+ <!--record id="action_report_pos_receipt" model="ir.actions.act_window">
+ <field name="name">Receipt</field>
+ <field name="res_model">pos.receipt</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record-->
+
+ </data>
+</openerp>
diff --git a/addons/point_of_sale/wizard/wizard_return.py b/addons/point_of_sale/wizard/pos_return.py
index 591fd00b18a..1b5860cef1c 100644
--- a/addons/point_of_sale/wizard/wizard_return.py
+++ b/addons/point_of_sale/wizard/pos_return.py
@@ -20,19 +20,69 @@
#
##############################################################################
-import wizard
-import pooler
-from tools.misc import UpdateableStr
+#import wizard
+#import pooler
+#from tools.misc import UpdateableStr
+#
+#import netsvc
+#import time
+#
+#from tools.translate import _
+#from decimal import Decimal
+
+#arch=UpdateableStr()
+#fields={}
import netsvc
+from osv import osv,fields
+from tools.translate import _
+from mx import DateTime
import time
-from tools.translate import _
-from decimal import Decimal
+class pos_return(osv.osv_memory):
+ _name = 'pos.return'
+ _description = 'Point of sale return'
+
+ _columns = {
+
+ }
+pos_return()
+
+class pos_add_payment(osv.osv_memory):
+ _name = 'pos.add.payment'
+ _description = 'Add Payment'
+
+ _columns = {
+ 'amount': fields.float('Amount', digits=(16,2),required=True),
+ 'journal': fields.function(_get_journal, 'Journal', method=True, required=True),
+ 'payment_date': fields.date('Payment date',required=True),
+ 'payment_name': fields.char('Payment name', size=32,required=True),
+ 'invoice_wanted': fields.boolean('Invoice'),
+ 'num_sale': fields.char('Num.Cof', size=32)
+ }
+ _defaults = {
+ 'payment_name': lambda *a: 'Payment'
+ }
+
+pos_add_payment()
+
+class pos_add_product(osv.osv_memory):
+ _name = 'pos.add.product'
+ _description = 'Add Product'
+
+ _columns = {
+ 'product': fields.many2one('product.product','Product', required=True),
+ 'quantity': fields.integer( 'Quantity',required=True),
+
+ }
+
+ _defaults = {
+ 'product': lambda *a: 'False',
+ 'quantity': lambda *a: 1
+ }
-arch=UpdateableStr()
-fields={}
+pos_add_product()
def _get_journal(self, cr, uid, context):
diff --git a/addons/point_of_sale/wizard/pos_sale_user_today.xml b/addons/point_of_sale/wizard/pos_sale_user_today.xml
new file mode 100644
index 00000000000..78f01a4650f
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_sale_user_today.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- pos.details -->
+
+ <record id="view_pos_sales_user_today" model="ir.ui.view">
+ <field name="name">Sales User Today</field>
+ <field name="model">pos.sales.user.today</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Sales User Today">
+ <group col="2" colspan="4">
+ <field name="user_id"/>
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-print" />
+ </group>
+ </form>
+ </field>
+ </record>
+ <record id="action_pos_sales_user_today" model="ir.actions.act_window">
+ <field name="name">Sale by Users</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.sales.user.today</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_sales_user.py b/addons/point_of_sale/wizard/pos_sales_user.py
new file mode 100644
index 00000000000..cbb2ddaead9
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_sales_user.py
@@ -0,0 +1,59 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+from mx import DateTime
+import time
+
+class pos_sale_user(osv.osv_memory):
+ _name = 'pos.sale.user'
+ _description = 'Sale by User'
+
+ _columns = {
+ 'date_start': fields.date('Date Start',required=True),
+ 'date_end': fields.date('Date End',required=True),
+ 'user_id': fields.many2many('res.users', 'sale_user_rel', 'user_id', 'uid', 'Salesman'),
+ }
+
+ def print_report(self, cr, uid, ids, context={}):
+ """
+ To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : return report
+ """
+
+ datas = {'ids' : context.get('active_ids', [])}
+ res = self.read(cr, uid, ids, ['date_start','date_end','user_id'], context)
+ res = res and res[0] or {}
+ datas['form'] = res
+ return {
+ 'type':'ir.actions.report.xml',
+ 'report_name':'pos.sales.user',
+ 'datas':datas,
+ }
+pos_sale_user()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/point_of_sale/wizard/pos_sales_user.xml b/addons/point_of_sale/wizard/pos_sales_user.xml
new file mode 100644
index 00000000000..0fc46f81aac
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_sales_user.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- pos.details -->
+
+ <record id="view_pos_sale_user" model="ir.ui.view">
+ <field name="name">Sale By User</field>
+ <field name="model">pos.sale.user</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="POS Details :">
+ <group col="2" colspan="4">
+ <field name="date_start"/>
+ <field name="date_end"/>
+ <field name="user_id"/>
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+
+ <record id="action_report_pos_sale_user" model="ir.actions.act_window">
+ <field name="name">Sale by User</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.sale.user</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+<!-- <act_window name="POS Details"
+ res_model="pos.details"
+ src_model="pos.order"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_report_pos_details"/> -->
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/auction/wizard/auction_catalog_flagey.py b/addons/point_of_sale/wizard/pos_sales_user_current_user.py
index fd73e7dadc4..22ac95a5451 100644
--- a/addons/auction/wizard/auction_catalog_flagey.py
+++ b/addons/point_of_sale/wizard/pos_sales_user_current_user.py
@@ -19,31 +19,39 @@
#
##############################################################################
-import wizard
import netsvc
-import pooler
+from osv import osv,fields
+from tools.translate import _
+from mx import DateTime
+import time
-def _wo_check(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- current_auction=pool.get('auction.dates').browse(cr,uid,data['id'])
- v_lots=pool.get('auction.lots').search(cr,uid,[('auction_id','=',current_auction.id)])
- v_ids=pool.get('auction.lots').browse(cr,uid,v_lots)
- for ab in v_ids:
- if not ab.auction_id :
- raise wizard.except_wizard('Error!','No Lots belong to this Auction Date')
- return 'report'
+class pos_sales_user_today_current_user(osv.osv_memory):
+ _name = 'pos.sales.user.today.current_user'
+ _description = 'Sales Details'
-class wizard_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result' : {'type': 'choice', 'next_state': _wo_check }
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'auction.cat_flagy', 'state':'end'}
- }
+ _columns = {
}
-wizard_report('auction.catalog.flagey')
+
+ def print_report(self, cr, uid, ids, context={}):
+ """
+ To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun report
+ """
+
+ datas = {'ids' : context.get('active_ids', [])}
+ res = self.read(cr, uid, ids, [], context)
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type':'ir.actions.report.xml',
+ 'report_name':'pos.sales.user.today.current.user',
+ 'datas':datas,
+ }
+pos_sales_user_today_current_user()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/pos_sales_user_current_user.xml b/addons/point_of_sale/wizard/pos_sales_user_current_user.xml
new file mode 100644
index 00000000000..5625b70770f
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_sales_user_current_user.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Sales for Current User -->
+
+ <record id="view_pos_sales_user_today_current_user" model="ir.ui.view">
+ <field name="name">Sales for Current User</field>
+ <field name="model">pos.sales.user.today.current_user</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Sales for Current User">
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Close" />
+ <button name="print_report" string="Print Report"
+ colspan="1" type="object" icon="gtk-print" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+
+ <record id="action_report_pos_sales_user_today_current_user" model="ir.actions.act_window">
+ <field name="name">Sales for Current User</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">pos.sales.user.today.current_user</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+<!-- <act_window name="POS Details"
+ res_model="pos.details"
+ src_model="pos.order"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_report_pos_details"/> -->
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/point_of_sale/wizard/pos_sales_user_today.py b/addons/point_of_sale/wizard/pos_sales_user_today.py
new file mode 100644
index 00000000000..50464b6936d
--- /dev/null
+++ b/addons/point_of_sale/wizard/pos_sales_user_today.py
@@ -0,0 +1,58 @@
+# -*- 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 netsvc
+from osv import osv,fields
+from tools.translate import _
+from mx import DateTime
+import time
+
+class pos_sales_user_today(osv.osv_memory):
+ _name = 'pos.sales.user.today'
+ _description = 'Sales User Today'
+
+ _columns = {
+ 'user_id': fields.many2many('res.users', 'sale_user_rel_today', 'user_id', 'uid', 'Salesman'),
+ }
+
+ def print_report(self, cr, uid, ids, context={}):
+ """
+ To get the date and print the report
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return : retrun report
+ """
+
+ datas = {'ids' : context.get('active_ids', [])}
+ res = self.read(cr, uid, ids, ['user_id'], context)
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type':'ir.actions.report.xml',
+ 'report_name':'pos.sales.user.today',
+ 'datas':datas,
+ }
+pos_sales_user_today()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/point_of_sale/wizard/wizard_add_product.py b/addons/point_of_sale/wizard/wizard_add_product.py
deleted file mode 100644
index 0daa0bdf0db..00000000000
--- a/addons/point_of_sale/wizard/wizard_add_product.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import wizard
-
-
-_form = """<?xml version="1.0"?>
-<form string="Add product :">
-<field name="product"/>
-<field name="quantity"/>
-</form>
-"""
-_fields = {
- 'product': {
- 'string': 'Product',
- 'type': 'many2one',
- 'relation': 'product.product',
- 'required': True,
- 'default': False
- },
-
- 'quantity': {
- 'string': 'Quantity',
- 'type': 'integer',
- 'required': True,
- 'default': 1},
- }
-
-
-def _add(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('pos.order')
- order_obj.add_product(cr, uid, data['id'], data['form']['product'],
- data['form']['quantity'], context=context)
-
- return {}
-
-
-def _pre_init(self, cr, uid, data, context):
- return {'product': False, 'quantity': 1}
-
-
-class add_product(wizard.interface):
-
- states = {
- 'init': {
- 'actions': [_pre_init],
- 'result': {
- 'type': 'form',
- 'arch': _form,
- 'fields': _fields,
- 'state': [('end', 'Cancel'), ('add', '_Add product', 'gtk-ok', True)
- ]
- }
- },
- 'add': {
- 'actions': [_add],
- 'result': {
- 'type': 'state',
- 'state': 'init',
- }
- },
- }
-
-add_product('pos.add_product')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_all_closed_cashbox_of_the_day.py b/addons/point_of_sale/wizard/wizard_all_closed_cashbox_of_the_day.py
deleted file mode 100644
index bdb7f72cb93..00000000000
--- a/addons/point_of_sale/wizard/wizard_all_closed_cashbox_of_the_day.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import netsvc
-import wizard
-import time
-
-
-class wizard_all_closed_cashbox_of_the_day(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'print', 'report':'all.closed.cashbox.of.the.day', 'state':'end'}
- },
- }
-
-wizard_all_closed_cashbox_of_the_day('all.closed.cashbox.of.the.day')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_confirm.py b/addons/point_of_sale/wizard/wizard_confirm.py
deleted file mode 100644
index b819c840ae5..00000000000
--- a/addons/point_of_sale/wizard/wizard_confirm.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-
-import wizard
-import netsvc
-import pooler
-import time
-
-_form = """<?xml version="1.0"?>
-<form string="Open Statements">
- <label string="Are you sure you want to close your sales ?" colspan="2"/>
-</form>
-"""
-_fields = {}
-
-def _confirm(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- company_id=pool.get('res.users').browse(cr,uid,uid).company_id
- order_obj = pool.get('pos.order')
- for order_id in order_obj.browse(cr, uid, data['ids'], context=context):
- if order_id.state =='paid':
- order_obj.write(cr,uid,[order_id.id],{'journal_entry':True})
- order_obj.create_account_move(cr, uid, [order_id.id], context=context)
-
- wf_service = netsvc.LocalService("workflow")
- for i in data['ids']:
- wf_service.trg_validate(uid, 'pos.order', i, 'done', cr)
- return {}
-
-def _get_state(self, cr, uid, data, context):
- action = 'invoice'
- return action
-class pos_confirm(wizard.interface):
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': _form,
- 'fields': _fields,
- 'state': (('end', 'No','gtk-cancel'),
- ('open', 'Yes', 'gtk-ok', True)
- )
- }
- },
- 'open': {
- 'actions': [_confirm],
- 'result': {
- 'type': 'state',
- 'state':'end'}
- },
- }
-
-pos_confirm('pos.confirm')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_discount.py b/addons/point_of_sale/wizard/wizard_discount.py
deleted file mode 100644
index 035c387793c..00000000000
--- a/addons/point_of_sale/wizard/wizard_discount.py
+++ /dev/null
@@ -1,145 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import wizard
-
-_form = """<?xml version="1.0"?>
-<form string="Discount :">
- <field name="discount"/>
-</form>
-"""
-disc_form = """<?xml version="1.0"?>
-
-<form string="Discount Notes :">
- <label colspan="2" string="Reason For Giving Discount" align="0.0"/>
- <newline/>
- <field name="note" nolabel="1"/>
-</form>
-"""
-
-
-_fields = {
- 'discount': {
- 'string': 'Discount percentage',
- 'type': 'float',
- 'required': True,
- 'default': lambda *args: 5
- },
-}
-
-disc_fields = {
- 'note': {
- 'string': 'Discount Notes',
- 'type': 'char',
- 'size': 128,
- 'required': True
- },
-}
-
-class discount_wizard(wizard.interface):
-
- def apply_discount(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- order_ref = pool.get('pos.order')
- order_line_ref = pool.get('pos.order.line')
- for order in order_ref.browse(cr, uid, data['ids'], context=context):
- for line in order.lines :
- company_discount = order.company_id.company_discount
- applied_discount =data['form']['discount']
- if applied_discount == 0.00:
- notice = 'No Discount'
- elif company_discount >= applied_discount:
- notice = 'Minimum Discount'
- else:
- notice = data['form']['note']
- if self.check_discount(cr, uid, data, context) == 'apply_discount':
- order_line_ref.write(cr, uid, [line.id],
- {'discount': data['form']['discount'],
- 'price_ded':line.price_unit*line.qty*(data['form']['discount'] or 0)*0.01 or 0.0,
- 'notice':notice
- },
- context=context,)
- else :
- order_line_ref.write(cr, uid, [line.id],
- {'discount': data['form']['discount'],
- 'notice': notice,
- 'price_ded':line.price_unit*line.qty*(data['form']['discount'] or 0)*0.01 or 0.0
- },
- context=context,)
- return {}
-
- def check_discount(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- order_ref = pool.get('pos.order')
- for order in order_ref.browse(cr, uid, data['ids'], context=context):
- company_disc = order.company_id.company_discount
- for line in order.lines :
- prod_disc = data['form']['discount']
- if prod_disc <= company_disc :
- return 'apply_discount'
- else :
- return 'disc_discount'
-
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': _form,
- 'fields': _fields,
- 'state': (('end', 'Cancel'),
- ('check_disc', 'Apply Discount', 'gtk-ok', True)
- )
- }
- },
-
- 'check_disc': {
- 'actions': [],
- 'result': {'type':'choice','next_state':check_discount}
- },
-
- 'disc_discount': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': disc_form,
- 'fields':disc_fields,
- 'state': (('end', 'Cancel'),
- ('apply_discount', 'Apply Discount', 'gtk-ok', True)
- )
- }
- },
- 'apply_discount': {
- 'actions': [],
- 'result': {
- 'type': 'action',
- 'action': apply_discount,
- 'state': "end",
- }
- },
- }
-
-discount_wizard('pos.discount')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_get_sale.py b/addons/point_of_sale/wizard/wizard_get_sale.py
deleted file mode 100644
index de686c11d49..00000000000
--- a/addons/point_of_sale/wizard/wizard_get_sale.py
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import wizard
-from tools.translate import _
-
-picking_form = """<?xml version="1.0"?>
-<form string="Select an Open Sale Order">
- <field name="picking_id" domain="[('state','in',('assigned','confirmed')), ('type', '=', 'out')]" context="{'contact_display':'partner'}"/>
-</form>
-"""
-
-picking_fields = {
- 'picking_id': {'string': 'Sale Order', 'type': 'many2one', 'relation': 'stock.picking', 'required': True}
-}
-
-
-def _sale_complete(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- order = pool.get('pos.order').browse(cr, uid, data['id'], context)
-
- if order.state in ('paid', 'invoiced'):
- raise wizard.except_wizard(_('UserError'), _("You can't modify this order. It has already been paid"))
-
- pick = pool.get('stock.picking').browse(cr, uid, data['form']['picking_id'], context)
-
- pool.get('pos.order').write(cr, uid, data['id'], {
- 'last_out_picking': data['form']['picking_id'],
- 'partner_id': pick.address_id and pick.address_id.partner_id.id
- })
-
- order = pool.get('stock.picking').write(cr, uid, [data['form']['picking_id']], {
- 'invoice_state': 'none',
- 'pos_order': data['id']
- })
-
- for line in pick.move_lines:
- pool.get('pos.order.line').create(cr, uid, {
- 'name': line.sale_line_id.name,
- 'order_id': data['id'],
- 'qty': line.product_qty,
- 'product_id': line.product_id.id,
- 'price_unit': line.sale_line_id.price_unit,
- 'discount': line.sale_line_id.discount,
- })
-
- return {}
-
-
-class pos_sale_get(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': picking_form,
- 'fields': picking_fields,
- 'state': (('end', 'Cancel'),
- ('set', 'Confirm', 'gtk-ok', True)
- )
- }
- },
- 'set': {
- 'actions': [_sale_complete],
- 'result': {
- 'type': 'state',
- 'state': "end",
- }
- },
- }
-
-pos_sale_get('pos.sale.get')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_open_statement.py b/addons/point_of_sale/wizard/wizard_open_statement.py
deleted file mode 100644
index 09205a97b08..00000000000
--- a/addons/point_of_sale/wizard/wizard_open_statement.py
+++ /dev/null
@@ -1,147 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import wizard
-from tools.translate import _
-import time
-
-statement_form = """<?xml version="1.0"?>
-<form string="Open Statements">
- <label string="Are you sure you want to open the statements ?" colspan="2"/>
-</form>
-"""
-statement_form_close = """<?xml version="1.0"?>
-<form string="Close Statements">
- <label string="Are you sure you want to close the statements ?" colspan="2"/>
-</form>
-"""
-
-statement_fields = {}
-
-def _close_statement(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- company_id=pool.get('res.users').browse(cr,uid,uid).company_id.id
- statement_obj = pool.get('account.bank.statement')
- singer_obj = pool.get('singer.statement')
- journal_obj=pool.get('account.journal')
- journal_lst=journal_obj.search(cr,uid,[('company_id','=',company_id),('auto_cash','=',True),('check_dtls','=',False)])
- journal_ids=journal_obj.browse(cr,uid, journal_lst)
- for journal in journal_ids:
- ids = statement_obj.search(cr, uid, [('state','!=','confirm'),('user_id','=',uid),('journal_id','=',journal.id)])
- statement_obj.button_confirm(cr,uid,ids)
- return {}
-def _open_statement(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- company_id=pool.get('res.users').browse(cr,uid,uid).company_id.id
- statement_obj = pool.get('account.bank.statement')
- singer_obj = pool.get('singer.statement')
- journal_obj=pool.get('account.journal')
- journal_lst=journal_obj.search(cr,uid,[('company_id','=',company_id),('auto_cash','=',True)])
- journal_ids=journal_obj.browse(cr,uid, journal_lst)
- for journal in journal_ids:
- ids = statement_obj.search(cr, uid, [('state','!=','confirm'),('user_id','=',uid),('journal_id','=',journal.id)])
- if len(ids):
- raise wizard.except_wizard(_('Message'),_('You can not open a Cashbox for "%s". \n Please close the cashbox related to. '%(journal.name) ))
- sql = """ Select id from account_bank_statement
- where journal_id=%d
- and company_id =%d
- order by id desc limit 1"""%(journal.id,company_id)
- singer_ids=None
- cr.execute(sql)
- st_id = cr.fetchone()
- number=''
- if journal.statement_sequence_id:
- number = pool.get('ir.sequence').get_id(cr, uid, journal.id)
- else:
- number = pool.get('ir.sequence').get(cr, uid,
- 'account.bank.statement')
-
-# statement_id=statement_obj.create(cr,uid,{'journal_id':journal.id,
-# 'company_id':company_id,
-# 'user_id':uid,
-# 'state':'open',
-# 'name':number
-# })
- period=statement_obj._get_period(cr,uid,context) or None
- cr.execute("INSERT INTO account_bank_statement(journal_id,company_id,user_id,state,name, period_id,date) VALUES(%d,%d,%d,'open','%s',%d,'%s')"%(journal.id,company_id,uid,number, period, time.strftime('%Y-%m-%d %H:%M:%S')))
- cr.commit()
- cr.execute("select id from account_bank_statement where journal_id=%d and company_id=%d and user_id=%d and state='open' and name='%s'"%(journal.id,company_id,uid,number))
- statement_id=cr.fetchone()[0]
- if st_id:
- statemt_id=statement_obj.browse(cr,uid,st_id[0])
- if statemt_id and statemt_id.ending_details_ids:
- statement_obj.write(cr, uid,[statement_id], {'balance_start':statemt_id.balance_end,
- 'state':'open'})
- if statemt_id.ending_details_ids:
- for i in statemt_id.ending_details_ids:
- c=singer_obj.create(cr,uid, { 'pieces':i.pieces,
- 'number':i.number,
- 'starting_id':statement_id,
- })
- cr.commit()
- return {}
-
-class statement_open(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': statement_form,
- 'fields': statement_fields,
- 'state': (('end', 'No','gtk-cancel'),
- ('open', 'Yes', 'gtk-ok', True)
- )
- }
- },
- 'open': {
- 'actions': [_open_statement],
- 'result': {
- 'type': 'state',
-# 'action' :_open_statement,
- 'state':'end'}
- },
- }
-statement_open('statement.open')
-class statement_close(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': statement_form_close,
- 'fields': statement_fields,
- 'state': (('end', 'No','gtk-cancel'),
- ('open', 'Yes', 'gtk-ok', True)
- )
- }
- },
- 'open': {
- 'actions': [_close_statement],
- 'result': {
- 'type': 'state',
- 'state':'end'}
- },
- }
-statement_close('statement.close')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/point_of_sale/wizard/wizard_pos_details.py b/addons/point_of_sale/wizard/wizard_pos_details.py
deleted file mode 100644
index 80a0593c08e..00000000000
--- a/addons/point_of_sale/wizard/wizard_pos_details.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from osv import fields
-from osv import osv
-import time
-import ir
-from mx import DateTime
-import datetime
-import pooler
-from tools import config
-import wizard
-import netsvc
-
-
-pos_details_res_form= """<?xml version="1.0"?>
-<form string="Sale by User">
- <field name="date_start" />
- <field name="date_end" />
-</form>
-"""
-
-pos_details_res_field= {
- 'date_start': {'string':'Start Date','type':'date','required': True,'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'date_end': {'string':'End Date','type':'date','required': True,'default': lambda *a: time.strftime('%Y-%m-%d')},
-
-
-}
-
-
-class wizard_pos_details(wizard.interface):
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : pos_details_res_form,
- 'fields' : pos_details_res_field,
- 'state' : [('end', 'Cancel','gtk-cancel'),('print_report', 'Print Report','gtk-print') ]}
- },
- 'print_report' : {
- 'actions' : [],
- 'result' : {'type' : 'print',
- 'report':'pos.details',
- 'state' : 'end'}
- },
- }
-wizard_pos_details('pos.details')
diff --git a/addons/point_of_sale/wizard/wizard_pos_payment.py b/addons/point_of_sale/wizard/wizard_pos_payment.py
deleted file mode 100644
index 580b0b308dd..00000000000
--- a/addons/point_of_sale/wizard/wizard_pos_payment.py
+++ /dev/null
@@ -1,233 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import netsvc
-import wizard
-import time
-from decimal import Decimal
-from tools.translate import _
-
-
-def _get_journal(self, cr, uid, context):
- pool = pooler.get_pool(cr.dbname)
- obj = pool.get('account.journal')
- c=pool.get('res.users').browse(cr,uid,uid).company_id.id
- ids = obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', c)])
- res = obj.read(cr, uid, ids, ['id', 'name'], context)
- res = [(r['id'], r['name']) for r in res]
- return res
-
-
-payment_form = """<?xml version="1.0"?>
-<form string="Add payment :">
-<group colspan="4" label="Payment">
- <field name="amount" />
- <field name="journal"/>
- <field name="payment_date" />
- <field name="payment_name" />
- <field name="invoice_wanted" />
- <field name="num_sale" />
- <field name="is_acc" />
- <group attrs="{'readonly':[('is_acc','=',False)]}" colspan="4" cols="2">
- <field name="product_id" attrs="{'required':[('is_acc', '=', True)]}" domain="[('type','=','service')]"/>
- </group>
- </group>
-</form>
-"""
-
-payment_fields = {
- 'amount': {'string': 'Amount', 'type': 'float', 'required': True},
- 'is_acc': {'string': 'Accompte', 'type': 'boolean'},
- 'invoice_wanted': {'string': 'Invoice', 'type': 'boolean'},
- 'journal': {'string': 'Journal',
- 'type': 'selection',
- 'selection': _get_journal,
- 'required': True,
- },
- 'payment_date': {'string': 'Payment date', 'type': 'date', 'required': True},
- 'payment_name': {'string': 'Payment name', 'type': 'char', 'size': '32', 'required':True, 'default':'Payment'},
- 'num_sale': {'string': 'Num.File', 'type': 'char', 'size': '32'},
- 'product_id': {'string':'Acompte','type': 'many2one', 'relation': 'product.product'},
- }
-
-
-def _pre_init(self, cr, uid, data, context):
- def _get_journal(pool, order):
- j_obj = pool.get('account.journal')
- c = pool.get('res.users').browse(cr,uid,uid).company_id.id
- journal = j_obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', c)])
- if journal:
- journal = journal[0]
- else:
- journal = None
- return journal
-
- wf_service = netsvc.LocalService("workflow")
- # wf_service.trg_validate(uid, 'pos.order', data['id'], 'start_payment', cr)
-
- pool = pooler.get_pool(cr.dbname)
- order = pool.get('pos.order').browse(cr, uid, data['id'], context)
- #get amount to pay
- #amount = Decimal(str(order.amount_total)) - Decimal(str(order.amount_paid))
- amount = order.amount_total - order.amount_paid
-
- if amount<=0:
- context.update({'flag':True})
- pool.get('pos.order').action_paid(cr,uid,data['ids'],context)
- elif order.amount_paid > 0:
- pool.get('pos.order').write(cr, uid, data['id'],{'state':'advance'})
-
-
- # get journal:
- journal = _get_journal(pool, order)
-
- # check if an invoice is wanted:
- #invoice_wanted_checked = not not order.partner_id # not not -> boolean
- invoice_wanted_checked = False
-
- # select the current date
- current_date = time.strftime('%Y-%m-%d')
-
- return {'journal': journal, 'amount': amount, 'invoice_wanted': invoice_wanted_checked, 'payment_date': current_date}
-
-
-def _add_pay(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('pos.order')
- jrnl_obj = pool.get('account.journal')
- result = data['form']
- invoice_wanted = data['form']['invoice_wanted']
- jrnl_used=False
- if data['form'] and data['form'].get('journal',False):
- jrnl_used=jrnl_obj.browse(cr,uid,data['form']['journal'])
-
- # add 'invoice_wanted' in 'pos.order'
- order_obj.write(cr, uid, [data['id']], {'invoice_wanted': invoice_wanted})
-
- order_obj.add_payment(cr, uid, data['id'], result, context=context)
- return {}
-
-
-def _check(self, cr, uid, data, context):
- """Check the order:
- if the order is not paid: continue payment,
- if the order is paid print invoice (if wanted) or ticket.
- """
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('pos.order')
- order = order_obj.browse(cr, uid, data['id'], context)
- amount = order.amount_total - order.amount_paid
- if amount<=0:
- context.update({'flag':True})
- pool.get('pos.order').action_paid(cr,uid,data['ids'],context)
-
- action = 'ask_pay'
- if order_obj.test_paid(cr, uid, [data['id']]):
- if order.partner_id:
- if order.invoice_wanted:
- action = 'invoice'
- else:
- action = 'paid'
- elif order.date_payment:
- action = 'receipt'
- else:
- action = 'paid'
- return action
-
-
-def create_invoice(self, cr, uid, data, context):
- wf_service = netsvc.LocalService("workflow")
- for i in data['ids']:
- wf_service.trg_validate(uid, 'pos.order', i, 'invoice', cr)
- return {}
-
-def _trigger_wkf(self, cr, uid, data, context):
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'pos.order', data['id'], 'payment', cr)
- return {}
-
-
-
-class pos_payment(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'choice',
- 'next_state': _check,
- }
- },
- 'ask_pay': {
- 'actions': [_pre_init],
- 'result': {
- 'type': 'form',
- 'arch': payment_form,
- 'fields': payment_fields,
- 'state': (('end', 'Cancel'), ('finish', 'Finish'), ('add_pay', 'Ma_ke payment', 'gtk-ok', True))
- }
- },
- 'add_pay': {
- 'actions': [_add_pay],
- 'result': {
- 'type': 'state',
- 'state': "init",
- }
- },
- 'invoice': {
- 'actions': [create_invoice],
- 'result': {
- 'type': 'print',
- 'report': 'pos.invoice',
- 'state': 'finish'
- }
- },
- 'receipt': {
- 'actions': [],
- 'result': {
- 'type': 'print',
- 'report': 'pos.receipt',
- 'state': 'finish'
- }
- },
- 'paid': {
- 'actions': [],
- 'result': {
- 'type': 'print',
- 'report': 'pos.receipt',
- 'state': 'finish'
- }
- },
- 'finish': {
- 'actions': [_trigger_wkf],
- 'result': {
- 'type': 'state',
- 'state': 'end'
- }
- },
-
- }
-
-pos_payment('pos.payment')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_pos_payment_report.py b/addons/point_of_sale/wizard/wizard_pos_payment_report.py
deleted file mode 100644
index 1f6ed1afda5..00000000000
--- a/addons/point_of_sale/wizard/wizard_pos_payment_report.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import netsvc
-import wizard
-import time
-
-
-class wizard_pos_payment_report(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'print', 'report':'pos.payment.report', 'state':'end'}
- },
- }
-
-wizard_pos_payment_report('pos.payment.report')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_pos_payment_report_date.py b/addons/point_of_sale/wizard/wizard_pos_payment_report_date.py
deleted file mode 100644
index 570b6de9ad7..00000000000
--- a/addons/point_of_sale/wizard/wizard_pos_payment_report_date.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import netsvc
-import wizard
-import time
-
-pos_payment_report_date_form= """<?xml version="1.0"?>
-<form string="Sale by User">
- <field name="date_start" />
- <field name="date_end"/>
- <field name="user_id"/>
-</form>
-"""
-
-pos_payment_report_date_field= {
-
- 'date_start': {'string':'Start Date','type':'date','required': True,'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'date_end': {'string':'End Date','type':'date','required': True,'default': lambda *a: time.strftime('%Y-%m-%d')},
- 'user_id': {'string': 'Salesman', 'type': 'many2many', 'relation': 'res.users', 'required': True},
-}
-
-
-class wizard_pos_payment_report_date(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : pos_payment_report_date_form,
- 'fields' : pos_payment_report_date_field,
- 'state' : [('end', 'Cancel','gtk-cancel'),('print_report', 'Print Report','gtk-print') ]}
- },
- 'print_report' : {
- 'actions' : [],
- 'result' : {'type' : 'print',
- 'report':'pos.payment.report.date',
- 'state' : 'end'}
- },
- }
-
-wizard_pos_payment_report_date('pos.payment.report.date')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_pos_payment_report_user.py b/addons/point_of_sale/wizard/wizard_pos_payment_report_user.py
deleted file mode 100644
index aaad1d328c5..00000000000
--- a/addons/point_of_sale/wizard/wizard_pos_payment_report_user.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from osv import fields
-from osv import osv
-import time
-import ir
-from mx import DateTime
-import datetime
-import pooler
-from tools import config
-import wizard
-import netsvc
-
-
-pos_payment_report_user_form= """<?xml version="1.0"?>
-<form string="Sale by User">
- <field name="user_id" />
-
-</form>
-"""
-
-pos_payment_report_user_field= {
-
- 'user_id': {'string': 'Salesman', 'type': 'many2many', 'relation': 'res.users', 'required': True},
-
-}
-
-
-class wizard_pos_payment_report_user(wizard.interface):
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : pos_payment_report_user_form,
- 'fields' : pos_payment_report_user_field,
- 'state' : [('end', 'Cancel','gtk-cancel'),('print_report', 'Print Report','gtk-print') ]}
- },
- 'print_report' : {
- 'actions' : [],
- 'result' : {'type' : 'print',
- 'report':'pos.payment.report.user',
- 'state' : 'end'}
- },
- }
-wizard_pos_payment_report_user('pos.payment.report.user')
diff --git a/addons/point_of_sale/wizard/wizard_pos_sales_user_current_user.py b/addons/point_of_sale/wizard/wizard_pos_sales_user_current_user.py
deleted file mode 100644
index a76c0c97b59..00000000000
--- a/addons/point_of_sale/wizard/wizard_pos_sales_user_current_user.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import pooler
-import netsvc
-import wizard
-import time
-
-
-class wizard_pos_sales_user_today_current_user(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'print', 'report':'pos.sales.user.today.current.user', 'state':'end'}
- },
- }
-
-wizard_pos_sales_user_today_current_user('pos.sales.user.today.current.user')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_pos_sales_user_today.py b/addons/point_of_sale/wizard/wizard_pos_sales_user_today.py
deleted file mode 100644
index 58d990ef4bc..00000000000
--- a/addons/point_of_sale/wizard/wizard_pos_sales_user_today.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-from osv import fields
-from osv import osv
-import time
-import ir
-from mx import DateTime
-import datetime
-import pooler
-from tools import config
-import wizard
-import netsvc
-
-
-sale_pos_res_form= """<?xml version="1.0"?>
-<form string="Sale by User">
- <field name="user_id" />
-
-</form>
-"""
-
-sale_pos_res_field= {
-
- 'user_id': {'string': 'Salesman', 'type': 'many2many', 'relation': 'res.users', 'required': True},
-
-}
-
-
-class wizard_pos_sales_user_today(wizard.interface):
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : sale_pos_res_form,
- 'fields' : sale_pos_res_field,
- 'state' : [('end', 'Cancel','gtk-cancel'),('print_report', 'Print Report','gtk-print') ]}
- },
- 'print_report' : {
- 'actions' : [],
- 'result' : {'type' : 'print',
- 'report':'pos.sales.user.today',
- 'state' : 'end'}
- },
- }
-wizard_pos_sales_user_today('pos.sales.user.today')
diff --git a/addons/point_of_sale/wizard/wizard_receipt.py b/addons/point_of_sale/wizard/wizard_receipt.py
deleted file mode 100644
index 64e8a2e5685..00000000000
--- a/addons/point_of_sale/wizard/wizard_receipt.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-
-#import time
-#import netsvc
-#from tools.misc import UpdateableStr
-#import pooler
-import wizard
-import pooler
-from tools.translate import _
-
-def _check(self,cr,uid,data,*a):
- pool = pooler.get_pool(cr.dbname)
- order_lst = pool.get('pos.order').browse(cr,uid,data['ids'])
- for order in order_lst:
- if order.state_2 in ('to_verify'):
- raise wizard.except_wizard('Error!', 'Can not print the receipt because of discount and/or payment ')
- return data
-
-class print_order_receipt(wizard.interface):
- states = {
- 'init': {
- 'actions': [_check],
- 'result': {'type':'print', 'report':'pos.receipt', 'state':'end'}
- }
- }
-
-print_order_receipt('ord.receipt')
-
diff --git a/addons/point_of_sale/wizard/wizard_refund_order.py b/addons/point_of_sale/wizard/wizard_refund_order.py
deleted file mode 100644
index 188e7b47690..00000000000
--- a/addons/point_of_sale/wizard/wizard_refund_order.py
+++ /dev/null
@@ -1,232 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
-# $Id$
-#
-# 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-
-import time
-import netsvc
-from tools.misc import UpdateableStr
-import wizard
-import pooler
-from mx import DateTime
-from tools.translate import _
-
-
-entry_form = '''<?xml version="1.0"?>
-<form string="%s">
-<separator string="Please fill these fields for entries to the box:" colspan="4"/>
-<newline/>
-<field name="name"/>
-<field name="ref"/>
-<field name="journal_id"/>
-<field name="amount"/>
-<field name="product_id"/>
-</form>
-'''
-
-def _get_journal(self,cr,uid,context):
- pool = pooler.get_pool(cr.dbname)
- obj = pool.get('account.journal')
- user = pool.get('res.users').browse(cr, uid, uid)
- ids = obj.search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', user.company_id.id)])
- res = obj.read(cr, uid, ids, ['id', 'name'], context)
- res = [(r['id'], r['name']) for r in res]
- res.insert(0, ('', ''))
- return res
-
-def _get_pdt(self,cr,uid,context):
- pool = pooler.get_pool(cr.dbname)
- obj = pool.get('product.product')
- ids = obj.search(cr, uid, [('income_pdt', '=', True)])
- res = obj.read(cr, uid, ids, ['id', 'name'], context)
- res = [(r['id'], r['name']) for r in res]
- res.insert(0, ('', ''))
- return res
-
-def _get_pdt_exp(self,cr,uid,context):
- pool = pooler.get_pool(cr.dbname)
- obj = pool.get('product.product')
- company_id = pool.get('res.users').browse(cr, uid, uid).company_id.id
- ids = obj.search(cr, uid, ['&', ('expense_pdt', '=', True), '|', ('company_id', '=', company_id), ('company_id', '=', None)])
- res = obj.read(cr, uid, ids, ['id', 'name'], context)
- res = [(r['id'], r['name']) for r in res]
- res.insert(0, ('', ''))
- return res
-
-entry_fields = {
- 'journal_id': {'string': 'Journal', 'type': 'selection', 'selection': _get_journal, 'required':True},
- 'product_id': {'string': 'Operation', 'type': 'selection', 'selection':_get_pdt , 'required':True},
- 'amount': {'string': 'Amount', 'type': 'float'},
- 'name': {'string': 'Name', 'type': 'char', 'size': '32', 'required':True},
- 'ref': {'string': 'Ref.', 'type': 'char', 'size': '32'},
-
-}
-
-out_fields = {
- 'journal_id': {'string': 'Journal', 'type': 'selection', 'selection': _get_journal, 'required':True},
- 'product_id': {'string': 'Operation', 'type': 'selection', 'selection':_get_pdt_exp , 'required':True},
- 'amount': {'string': 'Amount', 'type': 'float'},
- 'name': {'string': 'Name', 'type': 'char', 'size': '32', 'required':True},
- 'ref': {'string': 'Ref.', 'type': 'char', 'size': '32'},
-}
-
-def _get_out(self, cr, uid, data, context):
- args = {}
- pool = pooler.get_pool(cr.dbname)
- statement_obj= pool.get('account.bank.statement')
- product_obj= pool.get('product.template')
- productp_obj= pool.get('product.product')
- res_obj = pool.get('res.users')
- curr_company = res_obj.browse(cr,uid,uid).company_id.id
- statement_id = statement_obj.search(cr,uid, [('journal_id','=',data['form']['journal_id']),('company_id','=',curr_company),('user_id','=',uid),('state','=','open')])
- monday = (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Monday,0))).strftime('%Y-%m-%d')
- sunday = (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Sunday,0))).strftime('%Y-%m-%d')
- done_statmt = statement_obj.search(cr,uid, [('date','>=',monday+' 00:00:00'),('date','<=',sunday+' 23:59:59'),('journal_id','=',data['form']['journal_id']),('company_id','=',curr_company),('user_id','=',uid)])
- stat_done = statement_obj.browse(cr,uid, done_statmt)
- address_u = pool.get('res.users').browse(cr,uid,uid).address_id
- am = 0.0
- amount_check = productp_obj.browse(cr,uid,data['form']['product_id']).am_out or False
- for st in stat_done:
- for s in st.line_ids:
- if address_u and s.partner_id==address_u.partner_id and s.am_out:
- am+=s.amount
- if (-data['form']['amount'] or 0.0)+ am <-(res_obj.browse(cr,uid,uid).company_id.max_diff or 0.0) and amount_check:
- val = (res_obj.browse(cr,uid,uid).company_id.max_diff or 0.0)+ am
- raise wizard.except_wizard(_('Error !'), _('The maximum value you can still withdraw is exceeded. \n Remaining value is equal to %d ')%(val))
-
- acc_id = product_obj.browse(cr,uid,data['form']['product_id']).property_account_income
- if not acc_id:
- raise wizard.except_wizard(_('Error !'), _('please check that account is set to %s')%(product_obj.browse(cr,uid,data['form']['product_id']).name))
- if not statement_id:
- raise wizard.except_wizard(_('Error !'), _('You have to open at least one cashbox'))
- if statement_id:
- statement_id = statement_id[0]
- if not statement_id:
- statement_id = statement_obj.create(cr,uid,{'date':time.strftime('%Y-%m-%d 00:00:00'),
- 'journal_id':data['form']['journal_id'],
- 'company_id':curr_company,
- 'user_id':uid,
- })
- args['statement_id']= statement_id
- args['journal_id']= data['form']['journal_id']
- if acc_id:
- args['account_id']= acc_id.id
- amount= data['form']['amount'] or 0.0
- if data['form']['amount'] > 0:
- amount= -data['form']['amount']
- args['amount'] = amount
- if productp_obj.browse(cr,uid,data['form']['product_id']).am_out:
- args['am_out'] = True
- args['ref'] = data['form']['ref'] or ''
- args['name'] = "%s: %s "%(product_obj.browse(cr,uid,data['form']['product_id']).name, data['form']['name'].decode('utf8'))
- address_u = pool.get('res.users').browse(cr,uid,uid).address_id
- if address_u:
- partner_id = address_u.partner_id and address_u.partner_id.id or None
- args['partner_id'] = partner_id
- statement_line_id = pool.get('account.bank.statement.line').create(cr, uid, args)
- return {}
-
-def _get_in(self, cr, uid, data, context):
- args = {}
- pool = pooler.get_pool(cr.dbname)
- statement_obj = pool.get('account.bank.statement')
- product_obj = pool.get('product.template')
- res_obj = pool.get('res.users')
- curr_company = res_obj.browse(cr,uid,uid).company_id.id
- statement_id = statement_obj.search(cr,uid, [('journal_id','=',data['form']['journal_id']),('company_id','=',curr_company),('user_id','=',uid),('state','=','open')])
- if not statement_id:
- raise wizard.except_wizard(_('Error !'), _('You have to open at least one cashbox'))
-
- product = pool.get('product.product').browse(cr, uid, data['form']['product_id'])
- acc_id = product_obj.browse(cr,uid,data['form']['product_id']).property_account_income
- if not acc_id:
- raise wizard.except_wizard(_('Error !'), _('please check that account is set to %s')%(product_obj.browse(cr,uid,data['form']['product_id']).name))
- if statement_id:
- statement_id = statement_id[0]
- if not statement_id:
- statement_id = statement_obj.create(cr,uid,{'date':time.strftime('%Y-%m-%d 00:00:00'),
- 'journal_id':data['form']['journal_id'],
- 'company_id':curr_company,
- 'user_id':uid,
- })
-
- args['statement_id'] = statement_id
- args['journal_id'] = data['form']['journal_id']
- if acc_id:
- args['account_id'] = acc_id.id
- args['amount'] = data['form']['amount'] or 0.0
- args['ref'] = "%s" %(data['form']['ref'] or '')
- args['name'] = "%s: %s "% (product_obj.browse(cr,uid,data['form']['product_id']).name, data['form']['name'].decode('utf8'))
- address_u = pool.get('res.users').browse(cr,uid,uid).address_id
- if address_u:
- partner_id = address_u.partner_id and address_u.partner_id.id or None
- args['partner_id'] = partner_id
- statement_line_id = pool.get('account.bank.statement.line').create(cr, uid, args)
-
- return {}
-
-class box_entries(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': entry_form % u'Entrée de caisse',
- 'fields': entry_fields,
- 'state': [('end', 'Cancel', 'gtk-cancel'), ('next', 'Make entries in the Cashbox', 'gtk-ok')]
- }
- },
- 'next': {
- 'actions': [],
- 'result': {
- 'type': 'action',
- 'action': _get_in,
- 'state': 'end'
- }
- },
- }
-
-box_entries('pos.entry')
-
-class box_out(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': entry_form % u'Sortie de caisse',
- 'fields': out_fields,
- 'state': [('end', 'Cancel', 'gtk-cancel'), ('next', 'Make Entries in the CashBox', 'gtk-ok')]
- }
- },
- 'next': {
- 'actions': [],
- 'result': {
- 'type': 'action',
- 'action': _get_out,
- 'state': 'end'
- }
- },
- }
-
-box_out('pos.out')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/point_of_sale/wizard/wizard_pos_sales_user.py b/addons/pos_sales_user.py
index 35b83148bbd..35b83148bbd 100644
--- a/addons/point_of_sale/wizard/wizard_pos_sales_user.py
+++ b/addons/pos_sales_user.py
diff --git a/addons/product/product.py b/addons/product/product.py
index fdc8bcbf68e..d51d0733e81 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -82,9 +82,9 @@ class product_uom(osv.osv):
'name': fields.char('Name', size=64, required=True, translate=True),
'category_id': fields.many2one('product.uom.categ', 'UoM Category', required=True, ondelete='cascade',
help="Unit of Measure of a category can be converted between each others in the same category."),
- 'factor': fields.float('Rate', digits=(12, 6), required=True,
+ 'factor': fields.float('Ratio', digits=(12, 6), required=True,
help='The coefficient for the formula:\n' \
- '1 (base unit) = coeff (this unit). Rate = 1 / Factor.'),
+ '1 (base unit) = coeff (this unit). Ratio = 1 / Factor.'),
'factor_inv': fields.function(_factor, digits=(12, 6),
method=True, string='Factor',
help='The coefficient for the formula:\n' \
@@ -93,6 +93,9 @@ class product_uom(osv.osv):
'rounding': fields.float('Rounding Precision', digits=(16, 3), required=True,
help="The computed quantity will be a multiple of this value. Use 1.0 for products that can not be split."),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the unit of measure without removing it."),
+ 'uom_factor': fields.selection([('bigger','Bigger than the Default'),
+ ('smaller','Smaller than the Default'),
+ ('','')],'UoM Factor'),
}
_defaults = {
@@ -100,6 +103,7 @@ class product_uom(osv.osv):
'factor_inv': lambda *a: 1.0,
'active': lambda *a: 1,
'rounding': lambda *a: 0.01,
+ 'uom_factor': lambda *a: 'smaller',
}
_sql_constraints = [
@@ -204,7 +208,13 @@ class product_category(osv.osv):
'parent_id': fields.many2one('product.category','Parent Category', select=True),
'child_id': fields.one2many('product.category', 'parent_id', string='Child Categories'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."),
+ 'type': fields.selection([('view','View'), ('normal','Normal')], 'Category Type'),
}
+
+ _defaults = {
+ 'type' : lambda *a : 'normal',
+ }
+
_order = "sequence"
def _check_recursion(self, cr, uid, ids):
level = 100
@@ -252,7 +262,7 @@ class product_template(osv.osv):
'produce_delay': fields.float('Manufacturing Lead Time', help="Average time to produce this product. This is only for the production order and, if it is a multi-level bill of material, it's only for the level of this product. Different lead times will be summed for all levels and purchase orders."),
'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Requisition Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the requisition request."),
'rental': fields.boolean('Can be Rent'),
- 'categ_id': fields.many2one('product.category','Category', required=True, change_default=True),
+ 'categ_id': fields.many2one('product.category','Category', required=True, change_default=True, domain="[('type','=','normal')]"),
'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Sale Price'), help="Base price for computing the customer price. Sometimes called the catalog price."),
'standard_price': fields.float('Cost Price', required=True, digits_compute=dp.get_precision('Account'), help="Product's cost for accounting stock valuation. It is the base price for the supplier price."),
'volume': fields.float('Volume', help="The volume in m3."),
@@ -441,7 +451,7 @@ class product_product(osv.osv):
'default_code' : fields.char('Code', size=64),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."),
'variants': fields.char('Variants', size=64),
- 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True),
+ 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=False),
'ean13': fields.char('EAN13', size=13),
'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')),
@@ -537,7 +547,7 @@ class product_product(osv.osv):
pricetype_obj = self.pool.get('product.price.type')
# Take the price_type currency from the product field
# This is right cause a field cannot be in more than one currency
- price_type_id = pricetype_obj.search(cr,ui,['field','=',ptype])[0]
+ price_type_id = pricetype_obj.search(cr, uid, [('field','=',ptype)])[0]
price_type_currency_id = pricetype_obj.browse(cr,uid,price_type_id).currency_id.id
res[product.id] = self.pool.get('res.currency').compute(cr, uid, price_type_currency_id,
context['currency_id'], res[product.id],context=context)
diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml
index 4ed27c81d1d..300a2b0f546 100644
--- a/addons/product/product_data.xml
+++ b/addons/product/product_data.xml
@@ -21,25 +21,31 @@
<field name="category_id" ref="product_uom_categ_unit"/>
<field name="name">PCE</field>
<field name="factor">1.0</field>
- <field name="factor_inv">1.0</field>
+ <field name="factor_inv_data">1.0</field>
</record>
<record id="product_uom_kgm" model="product.uom">
<field name="category_id" ref="product_uom_categ_kgm"/>
<field name="name">KGM</field>
<field name="factor">1.0</field>
- <field name="factor_inv">1.0</field>
+ <field name="factor_inv_data">1.0</field>
</record>
<record id="uom_hour" model="product.uom">
<field name="name">Hour</field>
<field eval="uom_categ_wtime" name="category_id"/>
<field name="factor">8.0</field>
- <field name="factor_inv">1.0</field>
+ <field name="factor_inv_data">1.0</field>
</record>
<record id="uom_day" model="product.uom">
<field name="name">Day</field>
<field eval="uom_categ_wtime" name="category_id"/>
<field name="factor">1.0</field>
- <field name="factor_inv">1.0</field>
+ <field name="factor_inv_data">1.0</field>
+ </record>
+ <record id="product_uom_ton" model="product.uom">
+ <field name="category_id" ref="product_uom_categ_kgm"/>
+ <field name="name">TON</field>
+ <field name="factor">1.0</field>
+ <field name="factor_inv_data">1.0</field>
</record>
<!--
diff --git a/addons/product/product_demo.xml b/addons/product/product_demo.xml
index 68054cec0f1..19761704e88 100644
--- a/addons/product/product_demo.xml
+++ b/addons/product/product_demo.xml
@@ -8,6 +8,7 @@
<record id="cat0" model="product.category">
<field name="parent_id" ref="null"/>
<field name="name">All products</field>
+ <field name="type">view</field>
</record>
<record id="cat1" model="product.category">
<field name="parent_id" ref="cat0"/>
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index ab0d2118bd7..a01649850c7 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -24,6 +24,10 @@
<newline/>
<group col='8' colspan='15' expand='1' string='Group by...'>
<filter string='Category' icon="terp-stock" domain="[]" context="{'group_by' : 'categ_id'}" />
+ <separator orientation="vertical"/>
+ <filter string='Default UOM' icon="terp-stock" domain="[]" context="{'group_by' : 'uom_id'}" />
+ <separator orientation="vertical"/>
+ <filter string='Type' icon="terp-stock" domain="[]" context="{'group_by' : 'type'}" />
</group>
</search>
</field>
@@ -41,6 +45,7 @@
<field name="categ_id" />
<field name="variants" groups="product.group_product_variant"/>
<field name="uom_id"/>
+ <field name="type"/>
<field name="qty_available"/>
<field name="virtual_available"/>
<field name="lst_price"/>
@@ -212,6 +217,7 @@
<field name="name" select="1"/>
<field name="parent_id"/>
<field name="sequence"/>
+ <field name="type"/>
<newline/>
</form>
</field>
@@ -302,9 +308,11 @@
<form string="Units of Measure">
<field name="name" select="1"/>
<field name="category_id" select="1"/>
- <field name="factor" select="1"/>
- <field name="factor_inv" select="1"/>
+ <field name="factor" select="1" attrs="{'readonly':[('uom_factor','=','bigger')]}"/>
+ <field name="factor_inv_data" select="1" string="Factor Data" attrs="{'readonly':[('uom_factor','=','smaller')]}"/>
+ <field name="factor_inv" invisible="1"/>
<field name="rounding"/>
+ <field name="uom_factor"/>
<field name="active"/>
</form>
</field>
diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml
index 9dca54aad1a..4d71b0d480a 100644
--- a/addons/product/security/product_security.xml
+++ b/addons/product/security/product_security.xml
@@ -17,7 +17,7 @@
</record>
<record id="product_comp_rule" model="ir.rule">
<field name="rule_group" ref="product_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record id="group_product_variant" model="res.groups" context="{'noadmin':True}">
diff --git a/addons/product_margin/__terp__.py b/addons/product_margin/__terp__.py
index b0e81f341a7..9272287371a 100644
--- a/addons/product_margin/__terp__.py
+++ b/addons/product_margin/__terp__.py
@@ -31,7 +31,7 @@ the report has several options to help you get the data you need.
""",
'author': 'Tiny',
'depends': ['base', 'product', 'account'],
- 'update_xml': ['product_margin_view.xml'],
+ 'update_xml': ['wizard/product_margin_view.xml','product_margin_view.xml'],
'demo_xml': [],
'installable': True,
'active': False,
diff --git a/addons/product_margin/product_margin_view.xml b/addons/product_margin/product_margin_view.xml
index 03dfbdf2280..36ed9a70a33 100644
--- a/addons/product_margin/product_margin_view.xml
+++ b/addons/product_margin/product_margin_view.xml
@@ -1,15 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
-
- <wizard id="action_open_margin" menu="False" model="product.product" name="product.margins" string="Product Margins"/>
-
-<!-- <menuitem id="menu_product_reporting"-->
-<!-- name="Reporting" parent ="product.menu_main_product"-->
-<!-- groups="product.group_product_manager"/>-->
-<!---->
-<!-- <menuitem icon="STOCK_JUSTIFY_FILL" action="action_open_margin" id="menu_action_product_margin" type="wizard" sequence="5" parent="menu_product_reporting" />-->
-
+
<record model="ir.ui.view" id="view_product_margin_graph">
<field name="name">product.margin.graph</field>
<field name="model">product.product</field>
diff --git a/addons/product_margin/wizard/__init__.py b/addons/product_margin/wizard/__init__.py
index 4e2ecc2e39a..e1f1680bccb 100644
--- a/addons/product_margin/wizard/__init__.py
+++ b/addons/product_margin/wizard/__init__.py
@@ -19,7 +19,7 @@
#
##############################################################################
-import wizard_product_margin
+import product_margin
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/product_margin/wizard/product_margin_view.xml b/addons/product_margin/wizard/product_margin_view.xml
new file mode 100644
index 00000000000..66869e120a5
--- /dev/null
+++ b/addons/product_margin/wizard/product_margin_view.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="product_margin_form_view" model="ir.ui.view">
+ <field name="name">product.margin.form</field>
+ <field name="model">product.margin</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Properties categories">
+ <separator colspan="4" string="General Information"/>
+ <field name="from_date" />
+ <field name="to_date" />
+ <field name="invoice_state" />
+ <group col="4" colspan="2">
+ <button special="cancel" string="Cancel" type="object"/>
+ <button name="action_open_window" string="Open Margins" type="object"/>
+ </group>
+ </form>
+ </field>
+ </record>
+<!--
+ <act_window name="Test Wizard"
+ res_model="product.margin"
+ src_model="product.product"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="product_margin_act_window"/>
+
+ -->
+
+ </data>
+</openerp> \ No newline at end of file
diff --git a/addons/product_margin/wizard/wizard_product_margin.py b/addons/product_margin/wizard/wizard_product_margin.py
index 625cfd4c1df..1907c6695c2 100644
--- a/addons/product_margin/wizard/wizard_product_margin.py
+++ b/addons/product_margin/wizard/wizard_product_margin.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,79 +15,82 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-
-import wizard
-import pooler
import time
+from osv import osv
+from osv import fields
+import netsvc
+import time
from tools.translate import _
+class product_margin(osv.osv_memory):
+ '''
+ Product Margin
+ '''
+ _name = 'product.margin'
+ _description = 'Product Margin'
-def _action_open_window(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'product', 'product_search_form_view')
- id = mod_obj.read(cr, uid, result, ['res_id'])
- cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.graph', 'graph'))
- view_res3 = cr.fetchone()[0]
- cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.form.inherit', 'form'))
- view_res2 = cr.fetchone()[0]
- cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.tree', 'tree'))
- view_res = cr.fetchone()[0]
- return {
- 'name': _('Product Margins'),
- 'context':{'date_from':data['form']['from_date'],'date_to':data['form']['to_date'],'invoice_state' : data['form']['invoice_state']},
- 'view_type': 'form',
- "view_mode": 'tree,form,graph',
- 'res_model':'product.product',
- 'type': 'ir.actions.act_window',
- 'views': [(view_res,'tree'), (view_res2,'form'), (view_res3,'graph')],
- 'view_id': False,
- 'search_view_id': id['res_id']
- }
+ def action_open_window(self, cr, uid, ids, context):
+ """
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: the ID or list of IDs if we want more than one
+
+ @return:
+ """
+ mod_obj = self.pool.get('ir.model.data')
+ result = mod_obj._get_id(cr, uid, 'product', 'product_search_form_view')
+ id = mod_obj.read(cr, uid, result, ['res_id'])
+ cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.graph', 'graph'))
+ view_res3 = cr.fetchone()[0]
+ cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.form.inherit', 'form'))
+ view_res2 = cr.fetchone()[0]
+ cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.tree', 'tree'))
+ view_res = cr.fetchone()[0]
+ #get the current product.margin object to obtain the values from it
+ product_margin_obj = self.browse(cr,uid,ids)[0]
-class product_margins(wizard.interface):
- form1 = '''<?xml version="1.0"?>
- <form string="View Stock of Products">
- <separator string="Select " colspan="4"/>
- <field name="from_date"/>
- <field name="to_date"/>
- <field name="invoice_state"/>
- </form>'''
- form1_fields = {
- 'from_date': {
- 'string': 'From',
- 'type': 'date',
- 'default': lambda *a:time.strftime('%Y-01-01'),
+ return {
+ 'name': _('Product Margins'),
+ 'context':{'date_from':product_margin_obj.from_date,'date_to':product_margin_obj.to_date,'invoice_state' : product_margin_obj.invoice_state},
+ 'view_type': 'form',
+ "view_mode": 'tree,form,graph',
+ 'res_model':'product.product',
+ 'type': 'ir.actions.act_window',
+ 'views': [(view_res,'tree'), (view_res2,'form'), (view_res3,'graph')],
+ 'view_id': False,
+ 'search_view_id': id['res_id']
+ }
- },
- 'to_date': {
- 'string': 'To',
- 'type': 'date',
- 'default': lambda *a:time.strftime('%Y-12-31'),
+ def action_cancel(self, cr, uid, ids, context=None):
+ """
+
- },
- 'invoice_state': {
- 'string': 'Invoice State',
- 'type': 'selection',
- 'selection': [('paid','Paid'),('open_paid','Open and Paid'),('draft_open_paid','Draft, Open and Paid'),],
- 'required': True,
- 'default': lambda *a:"open_paid",
- },
- }
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: the ID or list of IDs if we want more than one
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Margins','gtk-ok')]}
- },
- 'open': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
- }
+ @return:
+ """
+ return {'type':'ir.actions.act_window_close'}
+
+ _columns = {
+ #TODO : import time required to get currect date
+ 'from_date': fields.date('From'),
+ #TODO : import time required to get currect date
+ 'to_date': fields.date('To'),
+ 'invoice_state':fields.selection([
+ ('paid','Paid'),
+ ('open_paid','Open and Paid'),
+ ('draft_open_paid','Draft, Open and Paid'),
+ ],'Invoice State', select=True, required=True),
+ }
+ _defaults = {
+ 'from_date': lambda *a:time.strftime('%Y-01-01'),
+ 'to_date': lambda *a:time.strftime('%Y-01-01'),
+ 'invoice_state': lambda *a:"open_paid",
}
-product_margins('product.margins')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+product_margin()
diff --git a/addons/profile_crm/i18n/pt_BR.po b/addons/profile_crm/i18n/pt_BR.po
index efb7a9a8cbe..9dcdf808e07 100644
--- a/addons/profile_crm/i18n/pt_BR.po
+++ b/addons/profile_crm/i18n/pt_BR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: profile_crm
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 302fee6602f..b910515c950 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -207,7 +207,7 @@
<field name="remaining_hours" widget="float_time"/>
<group col="4" colspan="4">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
- <button icon="gtk-refresh" name="compute_hours" string="Update" type="object"/>
+ <button icon="gtk-refresh" name="compute_hours" string="Update" type="object" default_focus="1"/>
</group>
</form>
</field>
@@ -334,7 +334,7 @@
<field name="delegated_user_id" invisible="context.get('show_delegated', True)"/>
<field name="planned_hours" widget="float_time" />
<field name="total_hours" widget="float_time"/>
- <field name="remaining_hours" widget="float_time" sum="Remaining Hours" invisible="context.get('set_visible',False)"/>
+ <field name="remaining_hours" widget="float_time" avg="Remaining Hours" invisible="context.get('set_visible',False)"/>
<field name="date_deadline" invisible="context.get('set_visible',False)"/>
<field name="type" groups="base.group_extended" invisible="context.get('set_visible',False)"/>
<field name="date_start" invisible="1"/>
@@ -412,7 +412,6 @@
<field name="name" select="1"/>
<field name="project_id" select="1" widget="selection" default="context.get('project_id', False)">
<filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-project"/>
- <filter domain="[('project_id','=',False)]" help="Tasks not assigned to a project" icon="terp-project"/>
</field>
<field name="user_id" select="1" widget="selection">
<filter domain="[('user_id','=',uid)]" help="My Tasks" icon="gtk-execute" default="1"/>
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 948ed70ef80..dd271ee97da 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -32,7 +32,6 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Tasks">
- <group col="10" colspan="4">
<filter icon="terp-project" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Tasks performed in this year"/>
<filter icon="terp-project" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Tasks performed in this month"/>
<separator orientation="vertical"/>
@@ -41,8 +40,8 @@
<filter string="Deadline" icon="terp-project" domain="[('date_deadline','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter string="Closed" icon="terp-project" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
- <field name="project_id" select="1"/>
- <field name="user_id" select="1" widget="selection">
+ <field name="project_id"/>
+ <field name="user_id" widget="selection">
<filter icon="terp-project" string="My Task" domain="[('user_id','=',uid)]" default="1"/>
</field>
<newline/>
@@ -55,12 +54,11 @@
<filter string="Month" icon="terp-project" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-project" context="{'group_by':'name'}"/>
</group>
- </group>
</search>
</field>
</record>
- <record id="action_project_task_user_tree" model="ir.actions.act_window">
+ <record id="action_project_task_user_tree" model="ir.actions.act_window">
<field name="name">Tasks</field>
<field name="res_model">report.project.task.user</field>
<field name="view_type">form</field>
diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml
index 7c34807517a..7fcb2e6fedb 100644
--- a/addons/project/security/project_security.xml
+++ b/addons/project/security/project_security.xml
@@ -23,7 +23,7 @@
</record>
<record model="ir.rule" id="project_comp_rule">
<field name="rule_group" ref="project_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record model="ir.rule.group" id="task_comp_rule_group">
@@ -32,7 +32,7 @@
<field name="global" eval="True"/>
</record>
<record model="ir.rule" id="task_comp_rule">
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
<field name="rule_group" ref="task_comp_rule_group"/>
</record>
diff --git a/addons/project/wizard/compute_tasks_date.py b/addons/project/wizard/compute_tasks_date.py
index 7f9965367ae..9c81aefca1e 100644
--- a/addons/project/wizard/compute_tasks_date.py
+++ b/addons/project/wizard/compute_tasks_date.py
@@ -133,15 +133,15 @@ class wizard_compute_tasks(wizard.interface):
'init': {
'actions': [],
'result': {'type':'form', 'arch':compute_form, 'fields':compute_fields, 'state':[
- ('end', 'Cancel'),
- ('compute', 'Compute')
+ ('end', 'Cancel', 'gtk-cancel'),
+ ('compute', 'Compute', 'gtk-ok', True)
]},
},
'compute': {
'actions': [_compute_date],
- 'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok')]},
+ 'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok', 'gtk-ok', True)]},
}
}
wizard_compute_tasks('wizard.compute.tasks')
diff --git a/addons/project/wizard/task_delegate.py b/addons/project/wizard/task_delegate.py
index 1bb6c538593..0fe662dc3cb 100644
--- a/addons/project/wizard/task_delegate.py
+++ b/addons/project/wizard/task_delegate.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -96,7 +96,7 @@ class wizard_delegate(wizard.interface):
'actions': [_ask_auto_complete],
'result': {'type':'form', 'arch':ask_form, 'fields':ask_fields, 'state':[
('end', 'Cancel'),
- ('valid', 'Validate')
+ ('valid', 'Validate', '', True)
]},
},
'valid': {
diff --git a/addons/project_caldav/project_caldav_wizard.xml b/addons/project_caldav/project_caldav_wizard.xml
index 53c78a99bf2..2bb677eea46 100644
--- a/addons/project_caldav/project_caldav_wizard.xml
+++ b/addons/project_caldav/project_caldav_wizard.xml
@@ -1,5 +1,18 @@
<openerp>
<data>
+ <wizard string="Import .ics File" model="project.task"
+ name="calendar.event.import" id="caldav.wizard_cal_event_import" />
+
+ <wizard string="Subscribe"
+ model="project.task" name="calendar.event.subscribe"
+ id="caldav.wizard_cal_event_subscribe" />
+
+ <wizard string="Export .ics File" model="project.task"
+ name="calendar.event.export" id="caldav.wizard_cal_event_export" />
+
+ <wizard string="Edit this event" model="project.task"
+ name="calendar.event.edit.this" id="caldav.wizard_edit_this_event"
+ menu="False" />
</data>
</openerp>
diff --git a/addons/project_gtd/wizard/project_gtd_fill.py b/addons/project_gtd/wizard/project_gtd_fill.py
index 3bbb947c5ba..ca3964d34c5 100644
--- a/addons/project_gtd/wizard/project_gtd_fill.py
+++ b/addons/project_gtd/wizard/project_gtd_fill.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,7 +15,7 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@@ -61,7 +61,7 @@ class wiz_timebox_fill(wizard.interface):
'arch':_gtd_arch,
'fields':_gtd_field,
'state':[
- ('end','Cancel'),
+ ('end','Cancel', 'gtk-cancel'),
('process','Add to Timebox')
]
}
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index e1bff3750e2..be1fe6a6644 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data>
+
<record id="project_issue_categ_action" model="ir.actions.act_window">
<field name="name">Issue Categories</field>
<field name="res_model">crm.case.categ</field>
@@ -103,29 +104,28 @@
<field name="email"/>
<field name="canal_id"/>
<button
- string="Add a CC"
- name="%(crm.action_view_crm_email_add_cc_wizard)d"
- icon="gtk-add" type="action"/>
- </group>
- <newline/>
- <field name="description" colspan="4"
- nolabel="1" widget="text_tag" readonly="1" />
- <button colspan="4"
- string="Reply to Last Email"
- name="%(crm.action_crm_reply_mail)d"
- context="{'mail':'reply', 'model': 'project.issue'}"
- icon="gtk-undo" type="action" />
- </form>
- <tree string="Communication history">
- <field name="description"/>
- <field name="email"/>
- <field name="date"/>
- </tree>
- </field>
- <button colspan="4" string="Send New Email"
- name="%(crm.action_crm_send_mail)d"
- context="{'mail':'new', 'model': 'project.issue'}"
- icon="gtk-go-forward" type="action" />
+ string="Add a CC"
+ name="%(crm.action_view_crm_email_add_cc_wizard)d"
+ icon="gtk-add" type="action"/>
+ </group>
+ <newline/>
+ <field name="description" colspan="4" nolabel="1"/>
+ <button colspan="4"
+ string="Reply to Last Email"
+ name="%(crm.action_crm_reply_mail)d"
+ context="{'mail':'reply', 'model': 'project.issue'}"
+ icon="gtk-undo" type="action" />
+ </form>
+ <tree string="Communication history">
+ <field name="description"/>
+ <field name="email"/>
+ <field name="date"/>
+ </tree>
+ </field>
+ <button colspan="4" string="Send New Email"
+ name="%(crm.action_crm_send_mail)d"
+ context="{'mail':'new', 'model': 'project.issue'}"
+ icon="gtk-go-forward" type="action" />
</page>
<page string="Worklogs">
<separator string="Timesheets" colspan="4" />
diff --git a/addons/project_issue/report/project_issue_report.py b/addons/project_issue/report/project_issue_report.py
index 74444780b57..3ea0b196705 100644
--- a/addons/project_issue/report/project_issue_report.py
+++ b/addons/project_issue/report/project_issue_report.py
@@ -36,6 +36,10 @@ class project_issue_report(osv.osv):
c.project_id as project_id,
c.type_id as type_id,
count(*) as nbr,
+ sum(planned_revenue) as amount_revenue,
+ sum(planned_cost) as amount_costs,
+ sum(planned_revenue*probability/100)::decimal(16,2) as amount_revenue_prob,
+ avg(probability)::decimal(16,2) as probability,
to_char(avg(date_closed-c.create_date), 'DD"d" HH24:MI:SS') as delay_close
from
project_issue c
diff --git a/addons/project_long_term/wizard/compute_phases_date.py b/addons/project_long_term/wizard/compute_phases_date.py
index 48409bd46c5..61f3bb42251 100644
--- a/addons/project_long_term/wizard/compute_phases_date.py
+++ b/addons/project_long_term/wizard/compute_phases_date.py
@@ -165,8 +165,8 @@ class wizard_compute_phases(wizard.interface):
'init': {
'actions': [],
'result': {'type': 'form', 'arch': compute_form, 'fields': compute_fields, 'state':[
- ('end', 'Cancel'),
- ('compute', 'Compute')
+ ('end', 'Cancel', 'gtk-cancel'),
+ ('compute', 'Compute', 'gtk-ok', True)
]},
},
diff --git a/addons/project_long_term/wizard/compute_tasks_date.py b/addons/project_long_term/wizard/compute_tasks_date.py
index f327328305e..77e7bbd6512 100644
--- a/addons/project_long_term/wizard/compute_tasks_date.py
+++ b/addons/project_long_term/wizard/compute_tasks_date.py
@@ -76,7 +76,8 @@ class wizard_compute_tasks(wizard.interface):
if resource_id:
# resource = resource_obj.browse(cr, uid, resource_id, context=context)[0]
resource = resource_obj.read(cr, uid, resource_id, ['calendar_id','time_efficiency'], context=context)[0]
- leaves = wkcal.compute_leaves(cr, uid, calendar_id , resource_id[0], resource.get('calendar_id')[0])
+ if resource.get('calendar_id', False):
+ leaves = wkcal.compute_leaves(cr, uid, calendar_id , resource_id[0], resource['calendar_id'] and resource['calendar_id'][0] or False)
time_efficiency = resource.get('time_efficiency')
resources.append(classobj((user.name.encode('utf8')), (Resource,), {'__doc__': user.name,
'__name__': user.name,
@@ -147,8 +148,8 @@ class wizard_compute_tasks(wizard.interface):
'init': {
'actions': [],
'result': {'type': 'form', 'arch': compute_form, 'fields': compute_fields, 'state': [
- ('end', 'Cancel'),
- ('compute', 'Compute')
+ ('end', 'Cancel', 'gtk-cancel'),
+ ('compute', 'Compute', 'gtk-ok', True)
]},
},
'compute': {
diff --git a/addons/project_long_term/wizard/schedule_tasks.py b/addons/project_long_term/wizard/schedule_tasks.py
index 592f5a1dc5d..4a170859032 100644
--- a/addons/project_long_term/wizard/schedule_tasks.py
+++ b/addons/project_long_term/wizard/schedule_tasks.py
@@ -139,7 +139,7 @@ class wizard_schedule_task(wizard.interface):
states = {
'init': {
'actions': [_compute_date],
- 'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok')]},
+ 'result': {'type':'form','arch':success_msg,'fields':{}, 'state':[('end', 'Ok', 'gtk-ok', True)]},
}
}
wizard_schedule_task('phase.schedule.tasks')
diff --git a/addons/project_planning/project_planning.py b/addons/project_planning/project_planning.py
index 359fdd6887f..bfd2af5566c 100644
--- a/addons/project_planning/project_planning.py
+++ b/addons/project_planning/project_planning.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
-# OpenERP, Open Source Management Solution
+# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
@@ -70,7 +70,7 @@ class report_account_analytic_planning(osv.osv):
return result
def _check_planning_responsible(self, cr, uid, ids, context={}):
- for obj_plan in self.browse(cr,uid,ids):
+ for obj_plan in self.browse(cr, uid, ids, context=context):
cr.execute("""
SELECT id FROM report_account_analytic_planning plan
WHERE ( (%(date_from)s BETWEEN date_from AND date_to)
@@ -117,19 +117,19 @@ class report_account_analytic_planning(osv.osv):
]
def action_open(self, cr, uid, id, context={}):
- self.write(cr, uid, id, {'state' : 'open'})
+ self.write(cr, uid, id, {'state' : 'open'}, context=context)
return True
def action_cancel(self, cr, uid, id, context={}):
- self.write(cr, uid, id, {'state' : 'cancel'})
+ self.write(cr, uid, id, {'state' : 'cancel'}, context=context)
return True
def action_draft(self, cr, uid, id, context={}):
- self.write(cr, uid, id, {'state' : 'draft'})
+ self.write(cr, uid, id, {'state' : 'draft'}, context=context)
return True
def action_done(self, cr, uid, id, context={}):
- self.write(cr, uid, id, {'state' : 'done'})
+ self.write(cr, uid, id, {'state' : 'done'}, context=context)
return True
report_account_analytic_planning()
@@ -156,8 +156,9 @@ class report_account_analytic_planning_line(osv.osv):
return res
def _amount_base_uom(self, cr, uid, ids, name, args, context):
+ users_obj = self.pool.get('res.users')
result = {}
- tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
+ tm = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm and tm.factor:
div = tm.factor
else:
@@ -220,13 +221,14 @@ class report_account_analytic_planning_user(osv.osv):
def _get_tasks(self, cr, uid, ids, name, args, context):
+ users_obj = self.pool.get('res.users')
result = {}
- tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
+ tm = users_obj.browse(cr, uid, uid, context=context).company_id.project_time_mode_id
if tm and tm.factor:
div = tm.factor
else:
div = 1.0
- tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
+ tm2 = users_obj.browse(cr, uid, uid, context=context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -252,8 +254,9 @@ class report_account_analytic_planning_user(osv.osv):
return result
def _get_timesheets(self, cr, uid, ids, name, args, context):
+ users_obj = self.pool.get('res.users')
result = {}
- tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
+ tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -313,8 +316,8 @@ Business Days - (Time Allocation of Tasks + Time Allocation without Tasks + Holi
FROM hr_holidays holidays
WHERE holidays.employee_id IN
(
- SELECT emp.id
- FROM hr_employee emp, resource_resource res WHERE emp.resource_id = res.id and res.user_id = users.id
+ SELECT emp.id
+ FROM hr_employee emp, resource_resource res WHERE emp.resource_id = res.id and res.user_id = users.id
)
AND holidays.state IN ('validate')
AND holidays.type = 'remove'
@@ -360,13 +363,14 @@ class report_account_analytic_planning_account(osv.osv):
_auto = False
def _get_tasks(self, cr, uid, ids, name, args, context):
+ users_obj = self.pool.get('res.users')
result = {}
- tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
+ tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
if tm and tm.factor:
div = tm.factor
else:
div = 1.0
- tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
+ tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -384,8 +388,9 @@ class report_account_analytic_planning_account(osv.osv):
return result
def _get_timesheets(self, cr, uid, ids, name, args, context):
+ users_obj = self.pool.get('res.users')
result = {}
- tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
+ tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -456,8 +461,9 @@ class report_account_analytic_planning_stat(osv.osv):
_order = 'planning_id,user_id'
def _sum_amount_real(self, cr, uid, ids, name, args, context):
+ users_obj = self.pool.get('res.users')
result = {}
- tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
+ tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
@@ -473,13 +479,14 @@ where user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i
return result
def _sum_amount_tasks(self, cr, uid, ids, name, args, context):
+ users_obj = self.pool.get('res.users')
result = {}
- tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
+ tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
if tm and tm.factor:
div = tm.factor
else:
div = 1.0
- tm2 = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.planning_time_mode_id
+ tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
if tm2 and tm2.factor:
div2 = tm2.factor
else:
diff --git a/addons/project_planning/project_planning_view.xml b/addons/project_planning/project_planning_view.xml
index c9c746fbd79..7d0031c4177 100644
--- a/addons/project_planning/project_planning_view.xml
+++ b/addons/project_planning/project_planning_view.xml
@@ -223,7 +223,6 @@
<menuitem action="action_account_analytic_planning_form"
id="menu_report_account_analytic_planning" parent="planning_main" />
- <menuitem action="resource.action_resource_resource_tree" id="base.menu_resource_resource_tree" parent="planning_main" />
<!--
Planning statistics
@@ -357,7 +356,7 @@
<!--Added link to open the list of all tasks planned on all lines of this planning.-->
<act_window context="{'planning': active_id}"
- id="act_task_of_lines" name="Planning tasks" res_model="project.task"
+ id="act_task_of_lines" name="Tasks" res_model="project.task"
src_model="report_account_analytic.planning"
/>
diff --git a/addons/purchase/__terp__.py b/addons/purchase/__terp__.py
index 11f3ae2d809..dfa362a97c6 100644
--- a/addons/purchase/__terp__.py
+++ b/addons/purchase/__terp__.py
@@ -39,9 +39,9 @@
'purchase_workflow.xml',
'purchase_sequence.xml',
'purchase_data.xml',
+ 'wizard/purchase_order_group_view.xml',
'purchase_view.xml',
'purchase_report.xml',
- 'purchase_wizard.xml',
'stock_view.xml',
'partner_view.xml',
'process/purchase_process.xml',
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 887950bc746..0dc7926f428 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -32,7 +32,7 @@ from tools import config
from tools.translate import _
import decimal_precision as dp
-
+from osv.orm import browse_record, browse_null
#
# Model definition
@@ -394,7 +394,9 @@ class purchase_order(osv.osv):
istate = 'none'
if order.invoice_method=='picking':
istate = '2binvoiced'
+ pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.in')
picking_id = self.pool.get('stock.picking').create(cr, uid, {
+ 'name': pick_name,
'origin': order.name+((order.origin and (':'+order.origin)) or ''),
'type': 'in',
'address_id': order.dest_address_id.id or order.partner_address_id.id,
@@ -444,6 +446,114 @@ class purchase_order(osv.osv):
})
return super(purchase_order, self).copy(cr, uid, id, default, context)
+
+ def do_merge(self, cr, uid, ids, context):
+ """
+ To merge similar type of purchase orders.
+ Orders will only be merged if:
+ * Purchase Orders are in draft
+ * Purchase Orders belong to the same partner
+ * Purchase Orders are have same stock location, same pricelist
+ Lines will only be merged if:
+ * Order lines are exactly the same except for the quantity and unit
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+
+ @return: new purchase order id
+
+ """
+ wf_service = netsvc.LocalService("workflow")
+ def make_key(br, fields):
+ list_key = []
+ for field in fields:
+ field_val = getattr(br, field)
+ if field in ('product_id', 'move_dest_id', 'account_analytic_id'):
+ if not field_val:
+ field_val = False
+ if isinstance(field_val, browse_record):
+ field_val = field_val.id
+ elif isinstance(field_val, browse_null):
+ field_val = False
+ elif isinstance(field_val, list):
+ field_val = ((6, 0, tuple([v.id for v in field_val])),)
+ list_key.append((field, field_val))
+ list_key.sort()
+ return tuple(list_key)
+
+ # compute what the new orders should contain
+
+ new_orders = {}
+
+ for porder in [order for order in self.browse(cr, uid, ids) if order.state == 'draft']:
+ order_key = make_key(porder, ('partner_id', 'location_id', 'pricelist_id'))
+ new_order = new_orders.setdefault(order_key, ({}, []))
+ new_order[1].append(porder.id)
+ order_infos = new_order[0]
+ if not order_infos:
+ order_infos.update({
+ 'origin': porder.origin,
+ 'date_order': time.strftime('%Y-%m-%d'),
+ 'partner_id': porder.partner_id.id,
+ 'partner_address_id': porder.partner_address_id.id,
+ 'dest_address_id': porder.dest_address_id.id,
+ 'warehouse_id': porder.warehouse_id.id,
+ 'location_id': porder.location_id.id,
+ 'pricelist_id': porder.pricelist_id.id,
+ 'state': 'draft',
+ 'order_line': {},
+ 'notes': '%s' % (porder.notes or '',),
+ })
+ else:
+ #order_infos['name'] += ', %s' % porder.name
+ if porder.notes:
+ order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,))
+ if porder.origin:
+ order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin
+
+ for order_line in porder.order_line:
+ line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'notes', 'product_id', 'move_dest_id', 'account_analytic_id'))
+ o_line = order_infos['order_line'].setdefault(line_key, {})
+ if o_line:
+ # merge the line with an existing line
+ o_line['product_qty'] += order_line.product_qty * order_line.product_uom.factor / o_line['uom_factor']
+ else:
+ # append a new "standalone" line
+ for field in ('product_qty', 'product_uom'):
+ field_val = getattr(order_line, field)
+ if isinstance(field_val, browse_record):
+ field_val = field_val.id
+ o_line[field] = field_val
+ o_line['uom_factor'] = order_line.product_uom and order_line.product_uom.factor or 1.0
+
+
+
+ allorders = []
+ for order_key, (order_data, old_ids) in new_orders.iteritems():
+ # skip merges with only one order
+ if len(old_ids) < 2:
+ allorders += (old_ids or [])
+ continue
+
+ # cleanup order line data
+ for key, value in order_data['order_line'].iteritems():
+ del value['uom_factor']
+ value.update(dict(key))
+ order_data['order_line'] = [(0, 0, value) for value in order_data['order_line'].itervalues()]
+
+ # create the new order
+ neworder_id = self.create(cr, uid, order_data)
+ allorders.append(neworder_id)
+
+ # make triggers pointing to the old orders point to the new order
+ for old_id in old_ids:
+ wf_service.trg_redirect(uid, 'purchase.order', old_id, neworder_id, cr)
+ wf_service.trg_validate(uid, 'purchase.order', old_id, 'purchase_cancel', cr)
+ return allorders
+
purchase_order()
class purchase_order_line(osv.osv):
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index b8be61e1665..653238748b9 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -160,6 +160,7 @@
<filter icon="terp-partner" domain="[('create_uid','=',uid)]" help="My Purchase Orders"/>
</field>
</group>
+ <newline/>
<group expand="1" string="Group By..." colspan="4" col="10">
<filter string="Supplier" icon="terp-purchase" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
@@ -288,6 +289,15 @@
name="Product purchases"
res_model="purchase.order.line"
src_model="product.product"/>
-
+<!--
+ <record model="ir.values" id="action_merge_purchase_order">
+ <field name="object" eval="1" />
+ <field name="name">Purchase Order</field>
+ <field name="key2">client_action_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' + str(ref('action_view_purchase_order_group'))" />
+ <field name="key">action</field>
+ <field name="model">purchase.order</field>
+ </record>
+ -->
</data>
</openerp>
diff --git a/addons/purchase/purchase_wizard.xml b/addons/purchase/purchase_wizard.xml
index e7fd3ce6efc..d76ce1e3819 100644
--- a/addons/purchase/purchase_wizard.xml
+++ b/addons/purchase/purchase_wizard.xml
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
+ <!--
<wizard id="purchase_order_merge"
model="purchase.order"
multi="True"
keyword="client_action_multi"
name="purchase.order.merge"
string="Merge purchases"/>
+ -->
</data>
</openerp>
diff --git a/addons/purchase/security/purchase_security.xml b/addons/purchase/security/purchase_security.xml
index 84b9a87ff05..2685e52d909 100644
--- a/addons/purchase/security/purchase_security.xml
+++ b/addons/purchase/security/purchase_security.xml
@@ -18,7 +18,7 @@
<record model="ir.rule" id="purchase_order_comp_rule">
<field name="field_id" search="[('model','=','purchase.order'),('name','=','company_id')]" model="ir.model.fields"/>
<field name="rule_group" ref="purchase_order_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record model="ir.rule.group" id="purchase_order_line_comp_rule_group">
@@ -29,7 +29,7 @@
<record model="ir.rule" id="purchase_order_line_comp_rule">
<field name="field_id" search="[('model','=','purchase.order.line'),('name','=','company_id')]" model="ir.model.fields"/>
<field name="rule_group" ref="purchase_order_line_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</data>
diff --git a/addons/purchase/wizard/__init__.py b/addons/purchase/wizard/__init__.py
index e79d70fbaeb..73bb88500a8 100644
--- a/addons/purchase/wizard/__init__.py
+++ b/addons/purchase/wizard/__init__.py
@@ -19,7 +19,7 @@
#
##############################################################################
-import wizard_group
+import purchase_order_group
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/wizard/purchase_order_group.py b/addons/purchase/wizard/purchase_order_group.py
new file mode 100644
index 00000000000..8c4e0784a7b
--- /dev/null
+++ b/addons/purchase/wizard/purchase_order_group.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+from service import web_services
+import netsvc
+import pooler
+import time
+import wizard
+from osv.orm import browse_record, browse_null
+
+class purchase_order_group(osv.osv_memory):
+ _name = "purchase.order.group"
+ _description = "Purchase Wizard"
+ _columns = {
+
+ }
+
+ def merge_orders(self, cr, uid, ids, context):
+ """
+ To merge similar type of purchase orders.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+
+ @return: purchase order view
+
+ """
+ order_obj = self.pool.get('purchase.order')
+ mod_obj =self.pool.get('ir.model.data')
+ result = mod_obj._get_id(cr, uid, 'purchase', 'view_purchase_order_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'])
+
+
+ allorders = order_obj.do_merge(cr, uid, context.get('active_ids',[]), context)
+
+
+ return {
+ 'domain': "[('id','in', [" + ','.join(map(str, allorders)) + "])]",
+ 'name': 'Purchase Orders',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'purchase.order',
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ 'search_view_id': id['res_id']
+ }
+purchase_order_group()
+
diff --git a/addons/purchase/wizard/purchase_order_group_view.xml b/addons/purchase/wizard/purchase_order_group_view.xml
new file mode 100644
index 00000000000..aa835b36f0b
--- /dev/null
+++ b/addons/purchase/wizard/purchase_order_group_view.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_purchase_order_group" model="ir.ui.view">
+ <field name="name">Merger Purchase Orders</field>
+ <field name="model">purchase.order.group</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Merge orders">
+ <separator string="Are you sure you want to merge these orders ?" colspan="4"/>
+ <newline/>
+ <label string="
+Please note that: &#13; &#13;
+Orders will only be merged if: &#13;
+* Purchase Orders are in draft &#13;
+* Purchase Orders belong to the same partner &#13;
+* Purchase Orders are have same stock location, same pricelist &#13; &#13;
+Lines will only be merged if: &#13;
+* Order lines are exactly the same except for the quantity and unit &#13;
+" colspan="4"/>
+ <newline/>
+ <separator string="" colspan="4" />
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="merge_orders" string="Merge orders" type="object" icon="gtk-convert"/>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Merge Purchase orders"
+ res_model="purchase.order.group"
+ src_model="purchase.order"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_purchase_order_group"/>
+
+ </data>
+</openerp>
+
diff --git a/addons/purchase/wizard/wizard_group.py b/addons/purchase/wizard/wizard_group.py
deleted file mode 100644
index 050be8c88d6..00000000000
--- a/addons/purchase/wizard/wizard_group.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-
-import wizard
-import netsvc
-import pooler
-from osv.orm import browse_record, browse_null
-
-
-merge_form = """<?xml version="1.0"?>
-<form string="Merge orders">
- <separator string="Are you sure you want to merge these orders ?"/>
- <newline/>
- <label>Please note that:
- - orders will only be merged if:
- * their status is draft
- * they belong to the same partner
- * are going to the same location
- * have the same pricelist
- - lines will only be merged if:
- * they are exactly the same except for the quantity and unit</label>
-</form>
-"""
-
-merge_fields = {
-}
-
-ack_form = """<?xml version="1.0"?>
-<form string="Merge orders">
- <separator string="Orders merged"/>
-</form>"""
-
-ack_fields = {}
-
-
-def _merge_orders(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- order_obj = pool.get('purchase.order')
- mod_obj = pool.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'purchase', 'view_purchase_order_filter')
- id = mod_obj.read(cr, uid, result, ['res_id'])
-
- def make_key(br, fields):
- list_key = []
- for field in fields:
- field_val = getattr(br, field)
- if field in ('product_id', 'move_dest_id', 'account_analytic_id'):
- if not field_val:
- field_val = False
- if isinstance(field_val, browse_record):
- field_val = field_val.id
- elif isinstance(field_val, browse_null):
- field_val = False
- elif isinstance(field_val, list):
- field_val = ((6, 0, tuple([v.id for v in field_val])),)
- list_key.append((field, field_val))
- list_key.sort()
- return tuple(list_key)
-
- # compute what the new orders should contain
- new_orders = {}
- for porder in [order for order in order_obj.browse(cr, uid, data['ids']) if order.state == 'draft']:
- order_key = make_key(porder, ('partner_id', 'location_id', 'pricelist_id'))
-
- new_order = new_orders.setdefault(order_key, ({}, []))
- new_order[1].append(porder.id)
- order_infos = new_order[0]
- if not order_infos:
- order_infos.update({
- 'origin': porder.origin,
- 'date_order': time.strftime('%Y-%m-%d'),
- 'partner_id': porder.partner_id.id,
- 'partner_address_id': porder.partner_address_id.id,
- 'dest_address_id': porder.dest_address_id.id,
- 'warehouse_id': porder.warehouse_id.id,
- 'location_id': porder.location_id.id,
- 'pricelist_id': porder.pricelist_id.id,
- 'state': 'draft',
- 'order_line': {},
- 'notes': '%s' % (porder.notes or '',),
- })
- else:
- #order_infos['name'] += ', %s' % porder.name
- if porder.notes:
- order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,))
- if porder.origin:
- order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin
-
- for order_line in porder.order_line:
- line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'notes', 'product_id', 'move_dest_id', 'account_analytic_id'))
- o_line = order_infos['order_line'].setdefault(line_key, {})
- if o_line:
- # merge the line with an existing line
- o_line['product_qty'] += order_line.product_qty * order_line.product_uom.factor / o_line['uom_factor']
- else:
- # append a new "standalone" line
- for field in ('product_qty', 'product_uom'):
- field_val = getattr(order_line, field)
- if isinstance(field_val, browse_record):
- field_val = field_val.id
- o_line[field] = field_val
- o_line['uom_factor'] = order_line.product_uom and order_line.product_uom.factor or 1.0
-
- wf_service = netsvc.LocalService("workflow")
-
- allorders = []
- for order_key, (order_data, old_ids) in new_orders.iteritems():
- # skip merges with only one order
- if len(old_ids) < 2:
- allorders += (old_ids or [])
- continue
-
- # cleanup order line data
- for key, value in order_data['order_line'].iteritems():
- del value['uom_factor']
- value.update(dict(key))
- order_data['order_line'] = [(0, 0, value) for value in order_data['order_line'].itervalues()]
-
- # create the new order
- neworder_id = order_obj.create(cr, uid, order_data)
- allorders.append(neworder_id)
-
- # make triggers pointing to the old orders point to the new order
- for old_id in old_ids:
- wf_service.trg_redirect(uid, 'purchase.order', old_id, neworder_id, cr)
- wf_service.trg_validate(uid, 'purchase.order', old_id, 'purchase_cancel', cr)
-
- return {
- 'domain': "[('id','in', [" + ','.join(map(str, allorders)) + "])]",
- 'name': 'Purchase Orders',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'purchase.order',
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id']
- }
-
-
-class merge_orders(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': merge_form, 'fields' : merge_fields, 'state' : [('end', 'Cancel'), ('merge', 'Merge orders') ]}
- },
- 'merge': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _merge_orders, 'state': 'end'}
- },
- }
-
-merge_orders("purchase.order.merge")
-
diff --git a/addons/report_account/i18n/hr.po b/addons/report_account/i18n/hr.po
index 8fbac0905bd..0a30ded862a 100644
--- a/addons/report_account/i18n/hr.po
+++ b/addons/report_account/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * report_account
-#
+# * report_account
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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: 2009-11-17 10:14+0000\n"
-"Last-Translator: dzuvela <drazen@radez.hr>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 00:58+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:55+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: report_account
#: selection:report.invoice.created,type:0
@@ -31,27 +32,27 @@ msgstr ""
#. module: report_account
#: field:report.aged.receivable,name:0
msgid "Month Range"
-msgstr ""
+msgstr "Raspon Mjeseci"
#. module: report_account
#: selection:report.invoice.created,type:0
msgid "Customer Invoice"
-msgstr ""
+msgstr "Račun Stranke"
#. module: report_account
#: model:ir.actions.act_window,name:report_account.action_view_created_invoice_dashboard
msgid "Invoices Created Within Past 15 Days"
-msgstr ""
+msgstr "Računi kreirani u zadnjih 15 dana"
#. module: report_account
#: model:ir.model,name:report_account.model_report_invoice_created
msgid "Report of Invoices Created within Last 15 days"
-msgstr ""
+msgstr "Izvještaj o računima kreiranima u zadnjih 15 dana"
#. module: report_account
#: selection:report.invoice.created,type:0
msgid "Supplier Invoice"
-msgstr ""
+msgstr "Račun Dobavljača"
#. module: report_account
#: field:report.invoice.created,state:0
@@ -61,27 +62,27 @@ msgstr "Status"
#. module: report_account
#: selection:report.invoice.created,state:0
msgid "Draft"
-msgstr ""
+msgstr "Nacrt"
#. module: report_account
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nepravilno ime modela u definiciji radnje."
#. module: report_account
#: field:report.account.receivable,debit:0
msgid "Debit"
-msgstr ""
+msgstr "Dug"
#. module: report_account
#: field:report.account.receivable,type:0
msgid "Account Type"
-msgstr ""
+msgstr "Tip Tvrtke Kupca"
#. module: report_account
#: field:report.invoice.created,type:0
msgid "Type"
-msgstr ""
+msgstr "Tip"
#. module: report_account
#: field:report.invoice.created,name:0
@@ -96,47 +97,47 @@ msgstr "Ukupni iznos"
#. module: report_account
#: field:report.invoice.created,residual:0
msgid "Residual"
-msgstr ""
+msgstr "Preostali"
#. module: report_account
#: field:report.invoice.created,date_invoice:0
msgid "Date Invoiced"
-msgstr ""
+msgstr "Datum izrade računa"
#. module: report_account
#: view:report.account.receivable:0
msgid "Accounts by type"
-msgstr ""
+msgstr "Tvrtke kupci po tipu"
#. module: report_account
#: field:report.invoice.created,number:0
msgid "Invoice Number"
-msgstr ""
+msgstr "Broj računa"
#. module: report_account
#: field:report.invoice.created,amount_untaxed:0
msgid "Untaxed"
-msgstr ""
+msgstr "Bez poreza"
#. module: report_account
#: selection:report.invoice.created,state:0
msgid "Done"
-msgstr ""
+msgstr "Gotovo"
#. module: report_account
#: model:ir.model,name:report_account.model_report_aged_receivable
msgid "Aged Receivable Till Today"
-msgstr ""
+msgstr "Stara potraživanja do danas"
#. module: report_account
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Neispravan XML za Arhitekturu Prikaza!"
#. module: report_account
#: model:ir.model,name:report_account.model_report_account_receivable
msgid "Receivable accounts"
-msgstr ""
+msgstr "Konta Potraživanja"
#. module: report_account
#: field:report.invoice.created,date_due:0
@@ -146,22 +147,22 @@ msgstr "Datum dospijeća"
#. module: report_account
#: field:report.account.receivable,credit:0
msgid "Credit"
-msgstr ""
+msgstr "Kredit"
#. module: report_account
#: field:temp.range,name:0
msgid "Range"
-msgstr ""
+msgstr "Raspon"
#. module: report_account
#: model:ir.module.module,description:report_account.module_meta_information
msgid "A module that adds new reports based on the account module."
-msgstr ""
+msgstr "Modul koji dodaje nove izvještaje na osnovi ACCOUNT Modula"
#. module: report_account
#: selection:report.invoice.created,type:0
msgid "Supplier Refund"
-msgstr ""
+msgstr "Namirenje dobavljača"
#. module: report_account
#: selection:report.invoice.created,state:0
@@ -172,33 +173,33 @@ msgstr "Poništeno"
#: field:report.account.receivable,balance:0
#: field:report.aged.receivable,balance:0
msgid "Balance"
-msgstr ""
+msgstr "Saldo"
#. module: report_account
#: model:ir.module.module,shortdesc:report_account.module_meta_information
msgid "Account Reporting - Reporting"
-msgstr ""
+msgstr "Izvještavanje o tvrtki Kupcu - Izvještavanje"
#. module: report_account
#: field:report.invoice.created,origin:0
msgid "Origin"
-msgstr ""
+msgstr "Porijeklo"
#. module: report_account
#: model:ir.actions.act_window,name:report_account.action_account_receivable_graph
#: model:ir.ui.menu,name:report_account.menu_account_receivable_graph
msgid "Balance by Type of Account"
-msgstr ""
+msgstr "Saldo po tipu konta"
#. module: report_account
#: view:report.invoice.created:0
msgid "Invoices"
-msgstr ""
+msgstr "računi"
#. module: report_account
#: selection:report.invoice.created,state:0
msgid "Pro-forma"
-msgstr ""
+msgstr "Pro-forma"
#. module: report_account
#: field:report.invoice.created,currency_id:0
@@ -213,18 +214,18 @@ msgstr "Tjedan"
#. module: report_account
#: field:report.invoice.created,create_date:0
msgid "Create Date"
-msgstr ""
+msgstr "Kreiraj datum"
#. module: report_account
#: model:ir.actions.act_window,name:report_account.action_aged_receivable_graph
#: view:report.aged.receivable:0
msgid "Aged Receivable"
-msgstr ""
+msgstr "Stara potraživanja"
#. module: report_account
#: field:report.invoice.created,partner_id:0
msgid "Partner"
-msgstr ""
+msgstr "Partner"
#. module: report_account
#: field:report.invoice.created,amount_total:0
@@ -234,9 +235,9 @@ msgstr "Ukupno"
#. module: report_account
#: selection:report.invoice.created,state:0
msgid "Open"
-msgstr ""
+msgstr "Otvori"
#. module: report_account
#: view:report.invoice.created:0
msgid "Untaxed Amount"
-msgstr ""
+msgstr "Iznos bez poreza"
diff --git a/addons/report_analytic/i18n/hr.po b/addons/report_analytic/i18n/hr.po
index 5b903e730d2..ef3677a8475 100644
--- a/addons/report_analytic/i18n/hr.po
+++ b/addons/report_analytic/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * report_analytic
-#
+# * report_analytic
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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: 2009-11-17 10:14+0000\n"
-"Last-Translator: dzuvela <drazen@radez.hr>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:39+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:44+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: report_analytic
#: model:ir.model,name:report_analytic.model_report_analytic_account_close
@@ -26,36 +27,37 @@ msgstr ""
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: report_analytic
#: field:report.analytic.account.close,quantity_max:0
msgid "Max. Quantity"
-msgstr ""
+msgstr "Maks. količina"
#. module: report_analytic
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Neispravan XML za Arhitekturu Prikaza!"
#. module: report_analytic
#: field:report.analytic.account.close,name:0
msgid "Analytic account"
-msgstr ""
+msgstr "Analitički Konto"
#. module: report_analytic
#: field:report.analytic.account.close,state:0
msgid "State"
-msgstr ""
+msgstr "Stanje"
#. module: report_analytic
#: field:report.analytic.account.close,date_deadline:0
msgid "Deadline"
-msgstr ""
+msgstr "Rok"
#. module: report_analytic
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nepravilno ime modela u definiciji radnje."
#. module: report_analytic
#: model:ir.module.module,shortdesc:report_analytic.module_meta_information
@@ -65,19 +67,19 @@ msgstr "Izvještaji analitike"
#. module: report_analytic
#: field:report.analytic.account.close,partner_id:0
msgid "Partner"
-msgstr ""
+msgstr "Partner"
#. module: report_analytic
#: field:report.analytic.account.close,balance:0
msgid "Balance"
-msgstr ""
+msgstr "Saldo"
#. module: report_analytic
#: model:ir.actions.act_window,name:report_analytic.action_analytic_account_tree
#: model:ir.ui.menu,name:report_analytic.menu_action_analytic_account_tree
#: view:report.analytic.account.close:0
msgid "Expired analytic accounts"
-msgstr ""
+msgstr "Zastarjela Analitička Konta"
#. module: report_analytic
#: field:report.analytic.account.close,quantity:0
diff --git a/addons/report_analytic_line/i18n/hr.po b/addons/report_analytic_line/i18n/hr.po
index 48d5e8f2418..7c64c5f5968 100644
--- a/addons/report_analytic_line/i18n/hr.po
+++ b/addons/report_analytic_line/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * report_analytic_line
-#
+# * report_analytic_line
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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: 2009-12-22 12:39+0000\n"
-"Last-Translator: Jožek Prikratki <Unknown>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:46+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:48+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: report_analytic_line
#: model:ir.actions.act_window,name:report_analytic_line.act_acc_analytic_acc_2_report_acc_analytic_line_to_invoice
@@ -24,7 +25,7 @@ msgstr "Stavke za fakturiranje"
#. module: report_analytic_line
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr "Neispravan XML za izgradnju preglednog ekrana!"
+msgstr "Nevažeći XML za Arhitekturu Prikaza!"
#. module: report_analytic_line
#: field:report.account.analytic.line.to.invoice,product_id:0
@@ -78,7 +79,7 @@ msgstr "Analitičke stavke za ispis na fakturi"
#. module: report_analytic_line
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr "Pogrešno ime modela u definiciji akcije."
+msgstr "Pogrešno ime modela u definiciji Radnje"
#. module: report_analytic_line
#: field:report.account.analytic.line.to.invoice,unit_amount:0
diff --git a/addons/report_analytic_planning/i18n/hr.po b/addons/report_analytic_planning/i18n/hr.po
index 33103817671..fd213f045fa 100644
--- a/addons/report_analytic_planning/i18n/hr.po
+++ b/addons/report_analytic_planning/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * report_analytic_planning
-#
+# * report_analytic_planning
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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-10-01 07:47+0000\n"
-"Last-Translator: Miro Glavić <glavicmiro@gmail.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:49+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:43+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
@@ -24,170 +25,171 @@ msgstr ""
#. module: report_analytic_planning
#: view:report_account_analytic.planning:0
msgid "Planning by Account"
-msgstr ""
+msgstr "Planiranje po Kontu"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "Summary by project"
-msgstr ""
+msgstr "Sižetak po Projektu"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.line,amount_unit:0
msgid "Qty UoM"
-msgstr ""
+msgstr "Količina JM"
#. module: report_analytic_planning
#: field:report_account_analytic.planning,user_id:0
msgid "Responsible"
-msgstr ""
+msgstr "Odgovoran"
#. module: report_analytic_planning
#: model:ir.model,name:report_analytic_planning.model_report_account_analytic_planning_stat
msgid "Planning stat"
-msgstr ""
+msgstr "Stat Planiranja"
#. module: report_analytic_planning
#: field:report_account_analytic.planning,state:0
msgid "Status"
-msgstr ""
+msgstr "Status"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.line,account_id:0
msgid "Analytic account"
-msgstr ""
+msgstr "Analitički Konto"
#. module: report_analytic_planning
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nepravilno ime modela u definiciji radnje."
#. module: report_analytic_planning
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: report_analytic_planning
#: model:ir.actions.act_window,name:report_analytic_planning.action_account_analytic_planning_stat_form
#: model:ir.ui.menu,name:report_analytic_planning.menu_report_account_analytic_planning_stat
msgid "Planning Statistics"
-msgstr ""
+msgstr "Statistike Planiranja"
#. module: report_analytic_planning
#: model:ir.model,name:report_analytic_planning.model_report_account_analytic_planning_stat_account
msgid "Planning account stat"
-msgstr ""
+msgstr "Stat Planskog Konta"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.stat,sum_amount:0
msgid "Planned hours"
-msgstr ""
+msgstr "Planirani Sati"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "Real"
-msgstr ""
+msgstr "Stvarno"
#. module: report_analytic_planning
#: model:ir.actions.act_window,name:report_analytic_planning.action_account_analytic_planning_stat_my_form
#: model:ir.ui.menu,name:report_analytic_planning.menu_report_account_analytic_planning_stat_my
msgid "My Planning Statistics"
-msgstr ""
+msgstr "Moje Statistike Planiranja"
#. module: report_analytic_planning
#: model:ir.module.module,description:report_analytic_planning.module_meta_information
msgid "Planning on analytic accounts."
-msgstr ""
+msgstr "Planiranje Analitičkih konta"
#. module: report_analytic_planning
#: field:report_account_analytic.planning,name:0
msgid "Planning Name"
-msgstr ""
+msgstr "Ime Planiranja"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "Quantities"
-msgstr ""
+msgstr "Količine"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "HR Planning"
-msgstr ""
+msgstr "Planiranje Ljudskih resursa"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.stat,sum_amount_real:0
#: field:report_account_analytic.planning.stat.account,sum_amount_real:0
#: field:report_account_analytic.planning.stat.user,sum_amount_real:0
msgid "Timesheet"
-msgstr ""
+msgstr "Raspored"
#. module: report_analytic_planning
#: model:ir.model,name:report_analytic_planning.model_report_account_analytic_planning_line
#: view:report_account_analytic.planning:0
msgid "Planning Line"
-msgstr ""
+msgstr "Linija Planiranja"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "Responsible:"
-msgstr ""
+msgstr "Odgovoran :"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.line,amount:0
msgid "Quantity"
-msgstr ""
+msgstr "Količina"
#. module: report_analytic_planning
#: view:report_account_analytic.planning:0
msgid "Quantities by Account"
-msgstr ""
+msgstr "Količine po Kontu"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "From:"
-msgstr ""
+msgstr "Od:"
#. module: report_analytic_planning
#: view:report_account_analytic.planning:0
msgid "Time by Account"
-msgstr ""
+msgstr "Vrijeme po Kontu"
#. module: report_analytic_planning
#: field:report_account_analytic.planning,date_to:0
msgid "End Date"
-msgstr ""
+msgstr "Datum završetka"
#. module: report_analytic_planning
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nevažeći XML za Arhitekturu Prikaza!"
#. module: report_analytic_planning
#: view:report_account_analytic.planning:0
msgid "Time by User"
-msgstr ""
+msgstr "Vrijem po Korisniku"
#. module: report_analytic_planning
#: model:ir.actions.act_window,name:report_analytic_planning.action_account_analytic_planning_stat_my_manager_form
#: model:ir.ui.menu,name:report_analytic_planning.menu_report_account_analytic_planning_stat_my_manager
msgid "Planning Statistics of My Projects"
-msgstr ""
+msgstr "Dtatistike Planiranja za moje Projekte"
#. module: report_analytic_planning
#: model:ir.actions.act_window,name:report_analytic_planning.action_account_analytic_planning_form_current
#: model:ir.ui.menu,name:report_analytic_planning.menu_report_account_analytic_planning_current
msgid "Current Planning"
-msgstr ""
+msgstr "Tekuće Planiranje"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "Summary by user"
-msgstr ""
+msgstr "Sižetak prema Korisniku"
#. module: report_analytic_planning
#: view:report_account_analytic.planning:0
msgid "Analysis"
-msgstr ""
+msgstr "Analiza"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.line,user_id:0
@@ -195,7 +197,7 @@ msgstr ""
#: field:report_account_analytic.planning.stat,user_id:0
#: field:report_account_analytic.planning.stat.user,user_id:0
msgid "User"
-msgstr ""
+msgstr "Korisnik"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
@@ -205,97 +207,97 @@ msgstr ""
#. module: report_analytic_planning
#: view:report_account_analytic.planning:0
msgid "Total Timesheet"
-msgstr ""
+msgstr "Zbirni Raspored"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "Details of user's time by projects"
-msgstr ""
+msgstr "Detalji Vremena Korisnika po Projektima"
#. module: report_analytic_planning
#: model:ir.model,name:report_analytic_planning.model_report_account_analytic_planning_stat_user
msgid "Planning user stat"
-msgstr ""
+msgstr "Stat Planiranja Korisnika"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
#: field:report_account_analytic.planning.stat.account,quantity:0
#: field:report_account_analytic.planning.stat.user,quantity:0
msgid "Planned"
-msgstr ""
+msgstr "Planiran"
#. module: report_analytic_planning
#: field:report_account_analytic.planning,stat_ids:0
msgid "Planning analysis"
-msgstr ""
+msgstr "Analiza Planiranja"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "["
-msgstr ""
+msgstr "["
#. module: report_analytic_planning
#: field:report_account_analytic.planning,line_ids:0
msgid "Planning lines"
-msgstr ""
+msgstr "Linija Planiranja"
#. module: report_analytic_planning
#: model:ir.module.module,shortdesc:report_analytic_planning.module_meta_information
msgid "Analytic planning - Reporting"
-msgstr ""
+msgstr "Analitičko Planiranje - Izvještavanje"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
msgid "]"
-msgstr ""
+msgstr "]"
#. module: report_analytic_planning
#: model:ir.actions.act_window,name:report_analytic_planning.action_account_analytic_planning_form_my
#: model:ir.ui.menu,name:report_analytic_planning.menu_report_account_analytic_planning_my2
msgid "My Planning"
-msgstr ""
+msgstr "Moje Planiranje"
#. module: report_analytic_planning
#: field:report_account_analytic.planning,stat_user_ids:0
msgid "Planning by user"
-msgstr ""
+msgstr "Planiranje prema Korisniku"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.line,note:0
msgid "Note"
-msgstr ""
+msgstr "Bilješka"
#. module: report_analytic_planning
#: rml:report_account_analytic.planning.print:0
#: field:report_account_analytic.planning.stat,sum_amount_tasks:0
msgid "Tasks"
-msgstr ""
+msgstr "Zadaci"
#. module: report_analytic_planning
#: field:report_account_analytic.planning,stat_account_ids:0
msgid "Planning by account"
-msgstr ""
+msgstr "Planiranje po Kontu"
#. module: report_analytic_planning
#: view:report_account_analytic.planning:0
msgid "Quantities by User"
-msgstr ""
+msgstr "Količine prema Korisniku"
#. module: report_analytic_planning
#: model:ir.actions.act_window,name:report_analytic_planning.action_account_analytic_planning_form_current_my
#: model:ir.ui.menu,name:report_analytic_planning.menu_report_account_analytic_planning_current_my
msgid "My Current Planning"
-msgstr ""
+msgstr "Moje Tekuće Planiranje"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.stat.account,account_id:0
msgid "Analytic Account"
-msgstr ""
+msgstr "Analitički konto"
#. module: report_analytic_planning
#: field:report_account_analytic.planning.stat,manager_id:0
msgid "Manager"
-msgstr ""
+msgstr "Upravitelj"
#. module: report_analytic_planning
#: model:ir.actions.act_window,name:report_analytic_planning.action_account_analytic_planning_form
@@ -310,7 +312,7 @@ msgstr ""
#: field:report_account_analytic.planning.stat.account,planning_id:0
#: field:report_account_analytic.planning.stat.user,planning_id:0
msgid "Planning"
-msgstr ""
+msgstr "Planiranje"
#. module: report_analytic_planning
#: selection:report_account_analytic.planning,state:0
@@ -320,25 +322,25 @@ msgstr ""
#. module: report_analytic_planning
#: view:report_account_analytic.planning:0
msgid "Total Planned"
-msgstr ""
+msgstr "Ukupno planirano"
#. module: report_analytic_planning
#: field:report_account_analytic.planning,date_from:0
msgid "Start Date"
-msgstr ""
+msgstr "Datum početka"
#. module: report_analytic_planning
#: view:report_account_analytic.planning.stat:0
msgid "Planning statistics"
-msgstr ""
+msgstr "Statistike Planiranja"
#. module: report_analytic_planning
#: selection:report_account_analytic.planning,state:0
msgid "Open"
-msgstr ""
+msgstr "Otvori"
#. module: report_analytic_planning
#: model:ir.actions.act_window,name:report_analytic_planning.action_account_analytic_planning_form_new
#: model:ir.ui.menu,name:report_analytic_planning.menu_report_account_analytic_planning_new
msgid "New Planning"
-msgstr ""
+msgstr "Novo Planiranje"
diff --git a/addons/report_document/i18n/hr.po b/addons/report_document/i18n/hr.po
index 0cea7c6d5b7..1c0de4d901d 100644
--- a/addons/report_document/i18n/hr.po
+++ b/addons/report_document/i18n/hr.po
@@ -1,20 +1,21 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * report_document
-#
+# * report_document
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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-10-01 07:47+0000\n"
-"Last-Translator: Miro Glavić <glavicmiro@gmail.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:49+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 05:01+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: report_document
#: field:report.document.user,create_date:0
@@ -25,188 +26,189 @@ msgstr ""
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_files_by_partner
msgid "Files Per Month"
-msgstr ""
+msgstr "Spisi po Mjesecu"
#. module: report_document
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_wall
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document_report_shame
#: view:report.document.wall:0
msgid "Wall of Shame"
-msgstr ""
+msgstr "Zid Srama"
#. module: report_document
#: model:ir.model,name:report_document.model_report_files_partner
msgid "Files details by Partners"
-msgstr ""
+msgstr "Detalji Spisa po Partneru"
#. module: report_document
#: field:report.document.file,file_size:0
#: field:report.document.user,file_size:0
#: field:report.files.partner,file_size:0
msgid "File Size"
-msgstr ""
+msgstr "Veličina Spisa"
#. module: report_document
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nepravilno ime modela u definiciji radnje."
#. module: report_document
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document_report_all
msgid "All Months"
-msgstr ""
+msgstr "Svi mjeseci"
#. module: report_document
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document_report_all_myfile
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document_report_this_myfile
msgid "My files"
-msgstr ""
+msgstr "Moji Spisi"
#. module: report_document
#: view:report.document.user:0
msgid "Files by users"
-msgstr ""
+msgstr "Spisi po Korisniku"
#. module: report_document
#: view:report.document.user:0
msgid "Files"
-msgstr ""
+msgstr "Spisi"
#. module: report_document
#: view:report.files.partner:0
msgid "Files per Month"
-msgstr ""
+msgstr "Spisi po Mjesecu"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_my_document_tree1
msgid "My files (All months)"
-msgstr ""
+msgstr "Moji Spisi (Svi mjeseci)"
#. module: report_document
#: field:report.document.wall,file_name:0
msgid "Last Posted File Name"
-msgstr ""
+msgstr "Zadnje postavljeno Ime Spisa"
#. module: report_document
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document_report
msgid "Reporting"
-msgstr ""
+msgstr "Izvještavanje"
#. module: report_document
#: model:ir.model,name:report_document.model_report_document_wall
msgid "Users that did not inserted documents since one month"
-msgstr ""
+msgstr "Korisnici koji jedan mjesec nisu unijeli Dokument"
#. module: report_document
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document
msgid "Document Management"
-msgstr ""
+msgstr "Upravljanje Dokumentima"
#. module: report_document
#: field:report.document.user,type:0
#: field:report.files.partner,type:0
msgid "Directory Type"
-msgstr ""
+msgstr "Tip Direktorija"
#. module: report_document
#: view:report.files.partner:0
msgid "Files By Partner"
-msgstr ""
+msgstr "Spisi po Partneru"
#. module: report_document
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document_report_this
msgid "This Month"
-msgstr ""
+msgstr "Ovaj mjesec"
#. module: report_document
#: field:report.document.user,user:0
#: field:report.document.wall,user:0
msgid "User"
-msgstr ""
+msgstr "Korisnik"
#. module: report_document
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nevažeći XML za Arhitekturu Prikaza!"
#. module: report_document
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document_report_all_userfile
#: model:ir.ui.menu,name:report_document.menu_action_view_my_document_report_this_userfile
msgid "All Users files"
-msgstr ""
+msgstr "Svi Spisi Korisnika"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_my_document_tree
msgid "My files (This months)"
-msgstr ""
+msgstr "Moji Spisi (Ovaj mjesec)"
#. module: report_document
#: model:ir.model,name:report_document.model_report_document_user
msgid "Files details by Users"
-msgstr ""
+msgstr "Detalji Spisa prema Korisnicima"
#. module: report_document
#: field:report.document.user,user_id:0
#: field:report.document.wall,user_id:0
msgid "Owner"
-msgstr ""
+msgstr "Vlasnik"
#. module: report_document
#: field:report.document.file,nbr:0
#: field:report.document.user,nbr:0
#: field:report.files.partner,nbr:0
msgid "# of Files"
-msgstr ""
+msgstr "# Spisa"
#. module: report_document
#: field:report.document.user,directory:0
#: field:report.files.partner,directory:0
msgid "Directory"
-msgstr ""
+msgstr "Direktorij"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_user_graph
msgid "Files By Users"
-msgstr ""
+msgstr "Spisi prema Korisnicima"
#. module: report_document
#: model:ir.module.module,shortdesc:report_document.module_meta_information
msgid "Document Management - Reporting"
-msgstr ""
+msgstr "Upravljanje Dokumentima - Izvještavanje"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_all_document_tree1
msgid "All Users files (All months)"
-msgstr ""
+msgstr "Spisi svih Korisnika (Svi mjeseci)"
#. module: report_document
#: model:ir.model,name:report_document.model_report_document_file
msgid "Files details by Directory"
-msgstr ""
+msgstr "Detalji Spisa prema Direktoriju"
#. module: report_document
#: field:report.document.user,change_date:0
#: field:report.files.partner,change_date:0
msgid "Modified Date"
-msgstr ""
+msgstr "Izmjenjen Datum"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_size_month
#: view:report.document.file:0
msgid "File Size by Month"
-msgstr ""
+msgstr "Veličina spisa po Mjesecu"
#. module: report_document
#: field:report.document.user,file_title:0
#: field:report.files.partner,file_title:0
msgid "File Name"
-msgstr ""
+msgstr "Ime Spisa"
#. module: report_document
#: field:report.document.file,month:0
@@ -216,32 +218,32 @@ msgstr ""
#: field:report.document.wall,name:0
#: field:report.files.partner,name:0
msgid "Month"
-msgstr ""
+msgstr "Mjesec"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_files_by_month_graph
#: view:report.document.user:0
msgid "Files by Month"
-msgstr ""
+msgstr "Spisi po Mjesecu"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_document_by_resourcetype_graph
#: view:report.document.user:0
msgid "Files by Resource Type"
-msgstr ""
+msgstr "Spisi po tipu Izvora"
#. module: report_document
#: model:ir.actions.act_window,name:report_document.action_view_all_document_tree
msgid "All Users files (This month)"
-msgstr ""
+msgstr "Spisi svih Korisnika (Ovaj mjesec)"
#. module: report_document
#: field:report.document.wall,last:0
msgid "Last Posted Time"
-msgstr ""
+msgstr "Zadnje postavljeno Vrijeme"
#. module: report_document
#: field:report.document.user,partner:0
#: field:report.files.partner,partner:0
msgid "Partner"
-msgstr ""
+msgstr "Partner"
diff --git a/addons/report_intrastat/i18n/hr.po b/addons/report_intrastat/i18n/hr.po
index 7a38f85adfd..cdcc128a069 100644
--- a/addons/report_intrastat/i18n/hr.po
+++ b/addons/report_intrastat/i18n/hr.po
@@ -1,173 +1,175 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * report_intrastat
-#
+# * report_intrastat
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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: 2009-02-03 06:26+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:49+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: report_intrastat
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Canceled Invoice"
-msgstr ""
+msgstr "Poništen Račun"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Disc. (%)"
-msgstr ""
+msgstr "Popust (%)"
#. module: report_intrastat
#: model:ir.actions.act_window,name:report_intrastat.action_report_intrastat_tree
#: model:ir.ui.menu,name:report_intrastat.menu_report_intrastat
msgid "Intrastat (this month)"
-msgstr ""
+msgstr "Intrastat (Ovaj mjesec)"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Supplier Invoice"
-msgstr ""
+msgstr "Račun Dobavljača"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Unit Price"
-msgstr ""
+msgstr "Jedinična cijena"
#. module: report_intrastat
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Nepravilno ime modela u definiciji radnje."
#. module: report_intrastat
#: field:report.intrastat,name:0
msgid "Period"
-msgstr ""
+msgstr "Razdoblje"
#. module: report_intrastat
#: model:ir.ui.menu,name:report_intrastat.next_id_90
msgid "All Months"
-msgstr ""
+msgstr "Svi mjeseci"
#. module: report_intrastat
#: selection:report.intrastat,type:0
msgid "Import"
-msgstr ""
+msgstr "Uvoz"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "VAT :"
-msgstr ""
+msgstr "PDV :"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Document"
-msgstr ""
+msgstr "Dokument"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "PRO-FORMA"
-msgstr ""
+msgstr "PRO-FORMA"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Taxes:"
-msgstr ""
+msgstr "Porezi:"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
#: field:report.intrastat.code,description:0
msgid "Description"
-msgstr ""
+msgstr "Opis"
#. module: report_intrastat
#: field:report.intrastat,type:0
msgid "Type"
-msgstr ""
+msgstr "Tip"
#. module: report_intrastat
#: model:ir.actions.report.xml,name:report_intrastat.invoice_intrastat_id
msgid "Invoice Intrastat"
-msgstr ""
+msgstr "Intrastat Račun"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Invoice Date"
-msgstr ""
+msgstr "Datum Računa"
#. module: report_intrastat
#: model:ir.module.module,shortdesc:report_intrastat.module_meta_information
msgid "Intrastat Reporting - Reporting"
-msgstr ""
+msgstr "Intrastat Izvještavanje - Izvještavanje"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Tel. :"
-msgstr ""
+msgstr "Tel:"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Base"
-msgstr ""
+msgstr "Osnova"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Quantity"
-msgstr ""
+msgstr "Količina"
#. module: report_intrastat
#: model:ir.ui.menu,name:report_intrastat.next_id_89
msgid "This Month"
-msgstr ""
+msgstr "Ovaj mjesec"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Partner Ref."
-msgstr ""
+msgstr "Referenca Partnera"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Total (inclu. taxes):"
-msgstr ""
+msgstr "Ukupno (uklj. poreze)"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Refund"
-msgstr ""
+msgstr "Povrat novca"
#. module: report_intrastat
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nevažeći XML za Arhitekturu Prikaza!"
#. module: report_intrastat
#: model:ir.model,name:report_intrastat.model_report_intrastat
msgid "Intrastat report"
-msgstr ""
+msgstr "Intrastat Izvještaj"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Invoice"
-msgstr ""
+msgstr "Račun"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Taxes"
-msgstr ""
+msgstr "Porezi"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
@@ -177,29 +179,29 @@ msgstr ""
#. module: report_intrastat
#: view:report.intrastat:0
msgid "Intrastat Data"
-msgstr ""
+msgstr "Intrastat Podaci"
#. module: report_intrastat
#: field:report.intrastat,value:0
msgid "Value"
-msgstr ""
+msgstr "Vrijednost"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
#: model:ir.actions.act_window,name:report_intrastat.action_report_intrastat_tree_all
#: model:ir.ui.menu,name:report_intrastat.menu_report_intrastat_all
msgid "Intrastat"
-msgstr ""
+msgstr "Intrastat"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Draft Invoice"
-msgstr ""
+msgstr "Nacrt računa"
#. module: report_intrastat
#: field:report.intrastat,supply_units:0
msgid "Supply Units"
-msgstr ""
+msgstr "Jedinice Dobave"
#. module: report_intrastat
#: model:ir.model,name:report_intrastat.model_report_intrastat_code
@@ -207,67 +209,67 @@ msgstr ""
#: field:report.intrastat,intrastat_id:0
#: view:report.intrastat.code:0
msgid "Intrastat code"
-msgstr ""
+msgstr "Intrastat Kod"
#. module: report_intrastat
#: field:report.intrastat,ref:0
msgid "Origin"
-msgstr ""
+msgstr "Porijeklo"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
#: field:report.intrastat,weight:0
msgid "Weight"
-msgstr ""
+msgstr "Težina"
#. module: report_intrastat
#: field:res.country,intrastat:0
msgid "Intrastat member"
-msgstr ""
+msgstr "Intarstat Član"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Tax"
-msgstr ""
+msgstr "Porez"
#. module: report_intrastat
#: field:report.intrastat,code:0
msgid "Country code"
-msgstr ""
+msgstr "Kod Zemlje"
#. module: report_intrastat
#: field:report.intrastat,currency_id:0
msgid "Currency"
-msgstr ""
+msgstr "Valuta"
#. module: report_intrastat
#: selection:report.intrastat,type:0
msgid "Export"
-msgstr ""
+msgstr "Izvezi"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Fax :"
-msgstr ""
+msgstr "Fax :"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Supplier Refund"
-msgstr ""
+msgstr "Povrat Dobavljaču"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Total (excl. taxes):"
-msgstr ""
+msgstr "Ukupno (isklj. poreze)"
#. module: report_intrastat
#: rml:account.invoice.intrastat:0
msgid "Price"
-msgstr ""
+msgstr "Cijena"
#. module: report_intrastat
#: model:ir.actions.act_window,name:report_intrastat.action_report_intrastat_code_tree
#: model:ir.ui.menu,name:report_intrastat.menu_report_intrastat_code
#: field:report.intrastat.code,name:0
msgid "Intrastat Code"
-msgstr ""
+msgstr "Intrastat Kod"
diff --git a/addons/report_mrp/i18n/hr.po b/addons/report_mrp/i18n/hr.po
index 8f25955e687..43b0e877a21 100644
--- a/addons/report_mrp/i18n/hr.po
+++ b/addons/report_mrp/i18n/hr.po
@@ -1,83 +1,85 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
-# * report_mrp
-#
+# * report_mrp
+# Drazen Bosak <drazen.bosak@gmail.com>, 2010.
msgid ""
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-17 10:24+0000\n"
-"Last-Translator: nafterburner <nafterburner@gmail.com>\n"
-"Language-Team: \n"
+"PO-Revision-Date: 2010-03-25 10:49+0000\n"
+"Last-Translator: Drazen Bosak <Unknown>\n"
+"Language-Team: Vinteh\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-11 05:01+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
+"Language: hr\n"
#. module: report_mrp
#: field:report.mrp.inout,date:0
#: field:report.workcenter.load,name:0
msgid "Week"
-msgstr ""
+msgstr "Tjedni"
#. module: report_mrp
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nevažeći XML za Arhitekturu Prikaza!"
#. module: report_mrp
#: model:ir.ui.menu,name:report_mrp.next_id_77
msgid "Reporting"
-msgstr ""
+msgstr "Izvještavanje"
#. module: report_mrp
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Naziv Objekta mora početi s x_ i ne smije sadržavati bilo koji posebni znak !"
#. module: report_mrp
#: view:report.workcenter.load:0
msgid "Workcenters load"
-msgstr ""
+msgstr "Teret Radnih Centara"
#. module: report_mrp
#: model:ir.model,name:report_mrp.model_report_workcenter_load
msgid "Workcenter Load"
-msgstr ""
+msgstr "Teret Radnog Centra"
#. module: report_mrp
#: model:ir.module.module,shortdesc:report_mrp.module_meta_information
msgid "MRP Management - Reporting"
-msgstr ""
+msgstr "Upravljanje Proizvodnjom - Izvještavanje"
#. module: report_mrp
#: field:report.mrp.inout,value:0
msgid "Stock value"
-msgstr ""
+msgstr "Vrijednost Zalihe"
#. module: report_mrp
#: field:report.workcenter.load,cycle:0
msgid "Nbr of cycle"
-msgstr ""
+msgstr "Broj Ciklusa"
#. module: report_mrp
#: field:report.workcenter.load,hour:0
msgid "Nbr of hour"
-msgstr ""
+msgstr "Broj Sati"
#. module: report_mrp
#: field:report.workcenter.load,workcenter_id:0
msgid "Workcenter"
-msgstr ""
+msgstr "Radni Centar"
#. module: report_mrp
#: model:ir.actions.act_window,name:report_mrp.action_report_workcenter_load_tree
#: model:ir.ui.menu,name:report_mrp.menu_report_workcenter_load
msgid "Workcenter Loads"
-msgstr ""
+msgstr "Tereti Radnog Centra"
#. module: report_mrp
#: model:ir.actions.act_window,name:report_mrp.action_report_in_out_picking_tree
@@ -88,15 +90,15 @@ msgstr "Tjedna Varijacija Vrijednosti Zalihe"
#. module: report_mrp
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr "Pogrešno ime modela u definiciji akcije."
+msgstr "Pogrešno ime modela u definiciji Radnje."
#. module: report_mrp
#: model:ir.model,name:report_mrp.model_report_mrp_inout
#: view:report.mrp.inout:0
msgid "Stock value variation"
-msgstr ""
+msgstr "Varijacija vrijednosti Zalihe"
#. module: report_mrp
#: view:report.workcenter.load:0
msgid "Workcenter load"
-msgstr ""
+msgstr "Teret Radnog Centra"
diff --git a/addons/resource/resource_view.xml b/addons/resource/resource_view.xml
index aacac7cef42..f08b03600f8 100755
--- a/addons/resource/resource_view.xml
+++ b/addons/resource/resource_view.xml
@@ -35,9 +35,10 @@
<field name="model">resource.calendar</field>
<field name="type">search</field>
<field name="arch" type="xml">
- <search string="Search Resource Calendar">
+ <search string="Search Working Period">
<group col='15' colspan='4'>
- <field name="name" string="Working Calendar"/>
+ <field name="name" string="Name"/>
+ <!-- <field name="name" string="Working Calendar"/> -->
<field name="manager" string="Workgroup Manager" widget="selection"/>
<field name="company_id" string="Company" widget="selection"/>
</group>
@@ -50,7 +51,7 @@
<field name="model">resource.calendar.leaves</field>
<field name="type">search</field>
<field name="arch" type="xml">
- <search string="Search Resource Calendar Leaves">
+ <search string="Search Working Period Leaves">
<group col='15' colspan='4'>
<field name="name" string="Name"/>
<field name="company_id" string="Company" widget="selection"/>
@@ -70,7 +71,7 @@
<field name="model">resource.calendar</field>
<field name="type">form</field>
<field name="arch" type="xml">
- <form string="Resource Calendar">
+ <form string="Working Period">
<field name="name" select="1"/>
<field name="manager" select="1"/>
<field name="company_id" select="1"/>
@@ -85,7 +86,7 @@
<field name="model">resource.calendar</field>
<field name="type">tree</field>
<field name="arch" type="xml">
- <tree string="Resource Calendar">
+ <tree string="Working Period">
<field name="name"/>
<field name="manager" select="1"/>
<field name="company_id" select="1"/>
@@ -94,7 +95,7 @@
</record>
<record id="action_resource_calendar_form" model="ir.actions.act_window">
- <field name="name">Resource Calendar</field>
+ <field name="name">Working Period</field>
<field name="res_model">resource.calendar</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
@@ -181,10 +182,10 @@
<tree string="Resources">
<field name="name" />
<field name="company_id" />
- <field name="calendar_id" />
<field name="resource_type" />
- <field name="user_id" />
+ <field name="calendar_id" />
<field name="time_efficiency" />
+ <field name="user_id" />
</tree>
</field>
</record>
diff --git a/addons/sale/__terp__.py b/addons/sale/__terp__.py
index 51ddf03fe55..a6ff79b38cd 100644
--- a/addons/sale/__terp__.py
+++ b/addons/sale/__terp__.py
@@ -45,16 +45,16 @@
'depends': ['product', 'stock', 'mrp', 'process'],
'init_xml': [],
'update_xml': [
+ 'wizard/sale_make_invoice_advance.xml',
+ 'wizard/sale_line_invoice.xml',
'security/sale_security.xml',
'security/ir.model.access.csv',
'sale_workflow.xml',
'sale_sequence.xml',
'sale_data.xml',
- 'sale_wizard.xml',
'sale_view.xml',
'report/sale_report_view.xml',
'sale_report.xml',
- 'sale_wizard.xml',
'stock_view.xml',
'process/sale_process.xml',
],
diff --git a/addons/sale/i18n/hr.po b/addons/sale/i18n/hr.po
index 9eb8f513f8e..2dfc21f0d54 100644
--- a/addons/sale/i18n/hr.po
+++ b/addons/sale/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 501d9ac1ea7..8b77719171a 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -593,7 +593,9 @@ class sale_order(osv.osv):
location_id = order.shop_id.warehouse_id.lot_stock_id.id
if not picking_id:
loc_dest_id = order.partner_id.property_stock_customer.id
+ pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out')
picking_id = self.pool.get('stock.picking').create(cr, uid, {
+ 'name': pick_name,
'origin': order.name,
'type': 'out',
'state': 'auto',
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 7fa61108e4f..c62487cfe1e 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -85,6 +85,7 @@
<field name="invoiced_rate" widget="progressbar"/>
<field name="amount_untaxed" sum="Total Untaxed amount"/>
<field name="amount_total" sum="Total amount"/>
+ <field name="user_id"/>
<field name="state"/>
</tree>
</field>
@@ -150,7 +151,12 @@
<field name="state" select="2"/>
<group col="3" colspan="2">
<field name="invoiced" select="2"/>
- <button colspan="1" name="%(wizard_sale_order_line_invoice)d" states="confirmed" string="Make Invoice" type="action" icon="gtk-print"/>
+ <button colspan="1"
+ name="%(action_view_sale_order_line_make_invoice)d"
+ states="confirmed"
+ string="Make Invoice"
+ type="action"
+ icon="gtk-print" />
</group>
</page>
<page groups="base.group_extended" string="Extra Info">
@@ -262,6 +268,7 @@
<filter string="Customer" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
<filter string="Order Date" icon="terp-sale" domain="[]" context="{'group_by':'date_order'}"/>
+ <filter string="Salesman" icon="terp-sale" domain="[]" context="{'group_by':'user_id'}"/>
</group>
</search>
</field>
@@ -380,8 +387,14 @@
<separator colspan="4" string="States"/>
<field name="state" select="2"/>
<group col="2" colspan="2">
- <button name="button_done" states="confirmed,exception" string="Done" type="object" icon="gtk-jump-to"/>
- <button name="button_cancel" states="confirmed,exception" string="Cancel" type="object" icon="gtk-cancel" />
+ <button name="button_done"
+ states="confirmed,exception"
+ string="Done" type="object"
+ icon="gtk-jump-to" />
+ <button name="button_cancel"
+ states="confirmed,exception"
+ string="Cancel" type="object"
+ icon="gtk-cancel" />
</group>
</page>
<page string="Properties">
diff --git a/addons/sale/sale_wizard.xml b/addons/sale/sale_wizard.xml
deleted file mode 100644
index 9df05e8e5dd..00000000000
--- a/addons/sale/sale_wizard.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <wizard
- id="wizard_sale_order_make_invoice"
- keyword="client_action_multi"
- model="sale.order"
- name="sale.order.make_invoice"
- multi="True"
- string="Make invoices"/>
-
- <wizard
- id="wizard_sale_order_line_invoice"
- keyword="client_action_multi"
- model="sale.order.line"
- name="sale.order.line.make_invoice"
- multi="True"
- string="Make invoices"/>
-
- <wizard string="Advance Invoice"
- model="sale.order"
- name="sale.advance_payment_inv"
- id="sale.advance_payment"
- menu="True"/>
-
- </data>
-</openerp>
diff --git a/addons/sale/security/ir.model.access.csv b/addons/sale/security/ir.model.access.csv
index 937322578cd..44ce9f7d1fa 100644
--- a/addons/sale/security/ir.model.access.csv
+++ b/addons/sale/security/ir.model.access.csv
@@ -21,3 +21,10 @@
"access_sale_order_line_manager","sale.order.line.manager","model_sale_order_line","group_sale_manager",1,1,1,1
"access_sale_report","sale.report","model_sale_report","group_sale_user",1,1,1,0
"access_sale_report_manager","sale.report","model_sale_report","group_sale_manager",1,1,1,1
+"access_sale_order_line_make_invoice","sale.order.line.make.invoice","model_sale_order_line_make_invoice","group_sale_user",1,1,1,0
+"access_sale_order_line_make_invoice_manager","sale.order.line.make.invoice","model_sale_order_line_make_invoice","group_sale_manager",1,1,1,1
+"access_sale_advance_payment_inv","sale.advance.payment.inv","model_sale_advance_payment_inv","group_sale_user",1,1,1,0
+"access_sale_advance_payment_inv_manager","sale.advance.payment.inv","model_sale_advance_payment_inv","group_sale_manager",1,1,1,1
+"access_sale_open_invoice","sale.open.invoice","model_sale_open_invoice","group_sale_user",1,1,1,0
+"access_sale_open_invoice_manager","sale.open.invoice","model_sale_open_invoice","group_sale_manager",1,1,1,1
+
diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml
index 6f9bcc52bb1..590a849ab9a 100644
--- a/addons/sale/security/sale_security.xml
+++ b/addons/sale/security/sale_security.xml
@@ -9,7 +9,6 @@
<field name="name">Sale / Salesman</field>
</record>
-
<record model='ir.ui.menu' id='menu_action_shop_form'>
<field name="groups_id" eval="[(6,0,[ref('group_sale_manager')])]"/>
</record>
@@ -22,7 +21,7 @@
<record model="ir.rule" id="sale_order_comp_rule">
<field name="field_id" search="[('model','=','sale.order'),('name','=','company_id')]" model="ir.model.fields"/>
<field name="rule_group" ref="sale_order_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
<record model="ir.rule.group" id="sale_order_line_comp_rule_group">
@@ -33,7 +32,7 @@
<record model="ir.rule" id="sale_order_line_comp_rule">
<field name="field_id" search="[('model','=','sale.order.line'),('name','=','company_id')]" model="ir.model.fields"/>
<field name="rule_group" ref="sale_order_line_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
diff --git a/addons/sale/wizard/make_invoice_advance.py b/addons/sale/wizard/make_invoice_advance.py
index eaa1fc4a14b..6c9ca17b836 100644
--- a/addons/sale/wizard/make_invoice_advance.py
+++ b/addons/sale/wizard/make_invoice_advance.py
@@ -1,6 +1,5 @@
-# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,143 +14,167 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import wizard
-import pooler
from osv import fields, osv
+from service import web_services
from tools.translate import _
+import ir
+import netsvc
+import pooler
+import wizard
-form = """<?xml version="1.0"?>
-<form string="Advance Payment">
- <field name="product_id"/>
- <newline />
- <field name="qtty"/>
- <field name="amount"/>
- <newline />
-</form>
-"""
-fields = {
- 'product_id': {'string':'Product', 'type':'many2one','relation':'product.product','required':True},
- 'amount': {'string':'Unit Price', 'type':'float', 'size':(16,2),'required':True},
- 'qtty': {'string':'Quantity', 'type':'float', 'size':(16,2),'required':True, 'default': lambda *a: 1},
-}
-form_msg = """<?xml version="1.0"?>
-<form string="Invoices">
- <label string="You invoice has been successfully created !"/>
-</form>
-"""
-fields_msg = {}
+class sale_advance_payment_inv(osv.osv_memory):
+ _name = "sale.advance.payment.inv"
+ _description = "Sale Advance Payment Invoice"
+ _columns = {
+ 'product_id': fields.many2one('product.product', 'Product', required=True),
+ 'amount': fields.float('Unit Price', size=(16, 2), required=True),
+ 'qtty': fields.float('Quantity', size=(16, 2), required=True),
+ }
+ _default = {
+ 'qtty' : lambda *a: 1
+ }
+ def create_invoices(self, cr, uid, ids, context={}):
+ """
+ To create invoices.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ list_inv = []
+ obj_sale = self.pool.get('sale.order')
+ obj_lines = self.pool.get('account.invoice.line')
+ inv_obj = self.pool.get('account.invoice')
+
+ for sale_adv_obj in self.browse(cr, uid, ids):
+ for sale in obj_sale.browse(cr, uid, context['active_ids']):
+ address_contact = False
+ address_invoice = False
+ create_ids = []
+ ids_inv = []
+ if sale.order_policy == 'postpaid':
+ raise osv.except_osv(
+ _('Error'),
+ _("You cannot make an advance on a sale order \
+ that is defined as 'Automatic Invoice after delivery'."))
+ val = obj_lines.product_id_change(cr, uid, [], sale_adv_obj.product_id.id,
+ uom = False, partner_id = sale.partner_id.id, fposition_id=sale.fiscal_position.id)
+ line_id =obj_lines.create(cr, uid, {
+ 'name': val['value']['name'],
+ 'account_id': val['value']['account_id'],
+ 'price_unit': sale_adv_obj.amount,
+ 'quantity': sale_adv_obj.qtty,
+ 'discount': False,
+ 'uos_id': val['value']['uos_id'],
+ 'product_id': sale_adv_obj.product_id.id,
+ 'invoice_line_tax_id': [(6, 0, val['value']['invoice_line_tax_id'])],
+ 'account_analytic_id': sale.project_id.id or False,
+ #'note':'',
+ })
+ create_ids.append(line_id)
+ inv = {
+ 'name': sale.name,
+ 'origin': sale.name,
+ 'type': 'out_invoice',
+ 'reference': False,
+ 'account_id': sale.partner_id.property_account_receivable.id,
+ 'partner_id': sale.partner_id.id,
+ 'address_invoice_id':sale.partner_invoice_id.id,
+ 'address_contact_id':sale.partner_order_id.id,
+ 'invoice_line': [(6, 0, create_ids)],
+ 'currency_id' :sale.pricelist_id.currency_id.id,
+ 'comment': '',
+ 'payment_term':sale.payment_term.id,
+ 'fiscal_position': sale.partner_id.property_account_position.id
+ }
+
+ inv_id = inv_obj.create(cr, uid, inv)
-def _createInvoices(self, cr, uid, data, context={}):
- list_inv = []
- pool_obj = pooler.get_pool(cr.dbname)
- obj_sale = pool_obj.get('sale.order')
- data_sale = obj_sale.browse(cr,uid,data['ids'])
- obj_lines = pool_obj.get('account.invoice.line')
- for sale in data_sale:
- address_contact = False
- address_invoice = False
- create_ids = []
- ids_inv = []
- if sale.order_policy == 'postpaid':
- raise osv.except_osv(
- _('Error'),
- _("You cannot make an advance on a sale order that is defined as 'Automatic Invoice after delivery'."))
- val = obj_lines.product_id_change(cr, uid, [], data['form']['product_id'],uom = False, partner_id = sale.partner_id.id, fposition_id=sale.fiscal_position.id)
- line_id =obj_lines.create(cr, uid, {
- 'name': val['value']['name'],
- 'account_id':val['value']['account_id'],
- 'price_unit': data['form']['amount'],
- 'quantity': data['form']['qtty'],
- 'discount': False,
- 'uos_id': val['value']['uos_id'],
- 'product_id':data['form']['product_id'],
- 'invoice_line_tax_id': [(6,0,val['value']['invoice_line_tax_id'])],
- 'account_analytic_id': sale.project_id and sale.project_id.id or False,
- 'note':'',
- })
- create_ids.append(line_id)
- inv = {
- 'name': sale.name,
- 'origin': sale.name,
- 'type': 'out_invoice',
- 'reference': False,
- 'account_id': sale.partner_id.property_account_receivable.id,
- 'partner_id': sale.partner_id.id,
- 'address_invoice_id':sale.partner_invoice_id.id,
- 'address_contact_id':sale.partner_order_id.id,
- 'invoice_line': [(6,0,create_ids)],
- 'currency_id' :sale.pricelist_id.currency_id.id,
- 'comment': '',
- 'payment_term':sale.payment_term.id,
- 'fiscal_position': sale.partner_id.property_account_position.id
- }
- inv_obj = pool_obj.get('account.invoice')
- inv_id = inv_obj.create(cr, uid, inv)
+ for inv in sale.invoice_ids:
+ ids_inv.append(inv.id)
+ ids_inv.append(inv_id)
+ obj_sale.write(cr, uid, sale.id, {'invoice_ids':[(6, 0, ids_inv)]})
+ list_inv.append(inv_id)
+ #
+ # If invoice on picking: add the cost on the SO
+ # If not, the advance will be deduced when generating the final invoice
+ #
+ if sale.order_policy=='picking':
+ self.pool.get('sale.order.line').create(cr, uid, {
+ 'order_id': sale.id,
+ 'name': val['value']['name'],
+ 'price_unit': -sale_adv_obj.amount,
+ 'product_uom_qty': sale_adv_obj.qtty,
+ 'product_uos_qty': sale_adv_obj.qtty,
+ 'product_uos': val['value']['uos_id'],
+ 'product_uom': val['value']['uos_id'],
+ 'product_id': sale_adv_obj.product_id.id,
+ 'discount': False,
+ 'tax_id': [(6, 0, val['value']['invoice_line_tax_id'])],
+ }, context)
- for inv in sale.invoice_ids:
- ids_inv.append(inv.id)
- ids_inv.append(inv_id)
- obj_sale.write(cr,uid,sale.id,{'invoice_ids':[(6,0,ids_inv)]})
- list_inv.append(inv_id)
-#
-# If invoice on picking: add the cost on the SO
-# If not, the advance will be deduced when generating the final invoice
-#
- if sale.order_policy=='picking':
- pool_obj.get('sale.order.line').create(cr, uid, {
- 'order_id': sale.id,
- 'name': val['value']['name'],
- 'price_unit': -data['form']['amount'],
- 'product_uom_qty': data['form']['qtty'],
- 'product_uos_qty': data['form']['qtty'],
- 'product_uos': val['value']['uos_id'],
- 'product_uom': val['value']['uos_id'],
- 'product_id':data['form']['product_id'],
- 'discount': False,
- 'tax_id': [(6,0,val['value']['invoice_line_tax_id'])],
- }, context)
- return {'invoice_ids':list_inv}
+ return {#'invoice_ids':list_inv,
+ 'name': 'Open Invoice',
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'sale.open.invoice',
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': "{'invoice_ids'=%s}" % (list_inv)
+ }
+
+sale_advance_payment_inv()
+
+class sale_open_invoice(osv.osv_memory):
+ _name = "sale.open.invoice"
+ _description = "Sale Open Invoice"
+ _columns = {
+ }
-class sale_advance_payment(wizard.interface):
- def _open_invoice(self, cr, uid, data, context):
- pool_obj = pooler.get_pool(cr.dbname)
- mod_obj = pool_obj.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
- id = mod_obj.read(cr, uid, result, ['res_id'])
- model_data_ids = pool_obj.get('ir.model.data').search(cr,uid,[('model','=','ir.ui.view'),('name','=','invoice_form')])
- resource_id = pool_obj.get('ir.model.data').read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
+ def open_invoice(self, cr, uid, ids, context):
+ """
+ To open invoice.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ mod_obj = self.pool.get('ir.model.data')
+ invoices = []
+ #TODO: Can not get invoice ids here
+ for advance_pay in self.browse(cr, uid, ids):
+ result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
+ id = mod_obj.read(cr, uid, result, ['res_id'])
+ model_data_ids = mod_obj.search(cr, uid,
+ [('model', '=', 'ir.ui.view'), ('name', '=', 'invoice_form')])
+ resource_id = mod_obj.read(cr, uid, model_data_ids,
+ fields=['res_id'])[0]['res_id']
return {
- 'domain': "[('id','in', ["+','.join(map(str,data['form']['invoice_ids']))+"])]",
+# 'domain': "[('id','in', ["+','.join(map(str, invoices))+"])]", # TODO
'name': 'Invoices',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.invoice',
- 'views': [(False,'tree'),(resource_id,'form')],
+ 'views': [(False, 'tree'), (resource_id, 'form')],
'context': "{'type':'out_invoice'}",
'type': 'ir.actions.act_window',
'search_view_id': id['res_id']
- }
+ }
+sale_open_invoice()
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form' , 'arch' : form,'fields' : fields,'state' : [('end','Cancel','gtk-cancel'),('create','Create Advance Invoice','gtk-ok')]}
- },
- 'create': {
- 'actions': [_createInvoices],
- 'result': {'type' : 'form' ,'arch' : form_msg,'fields' : fields_msg, 'state':[('end','Close','gtk-close'),('open','Open Advance Invoice','gtk-open')]}
- },
- 'open': {
- 'actions': [],
- 'result': {'type':'action', 'action':_open_invoice, 'state':'end'}
- }
- }
-
-sale_advance_payment("sale.advance_payment_inv")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sale/wizard/sale_line_invoice.xml b/addons/sale/wizard/sale_line_invoice.xml
new file mode 100644
index 00000000000..a9ea13ea900
--- /dev/null
+++ b/addons/sale/wizard/sale_line_invoice.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_sale_order_line_make_invoice" model="ir.ui.view">
+ <field name="name">Sale OrderLine Make Invoice</field>
+ <field name="model">sale.order.line.make.invoice</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Create invoices">
+ <separator colspan="4" string="Do you really want to create the invoices ?" />
+ <field name="grouped" />
+ <separator string="" colspan="6" />
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="makeInvoices" string="Create Invoices" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Make Invoices"
+ res_model="sale.order.line.make.invoice"
+ src_model="sale.order.line"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_sale_order_line_make_invoice"/>
+
+ </data>
+</openerp>
diff --git a/addons/sale/wizard/sale_make_invoice_advance.xml b/addons/sale/wizard/sale_make_invoice_advance.xml
new file mode 100644
index 00000000000..5fc8b993921
--- /dev/null
+++ b/addons/sale/wizard/sale_make_invoice_advance.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_sale_advance_payment_inv" model="ir.ui.view">
+ <field name="name">Sale Advance Payment Invoive</field>
+ <field name="model">sale.advance.payment.inv</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Advance Payment">
+ <field name="product_id"/>
+ <newline />
+ <field name="qtty"/>
+ <field name="amount"/>
+ <newline />
+ <separator string="" colspan="4"/>
+ <label string="" colspan="2" />
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="create_invoices" string="Create Advance Invoice" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+
+
+ <act_window name="Advance Invoice"
+ res_model="sale.advance.payment.inv"
+ src_model="sale.order"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_sale_advance_payment_inv"/>
+
+
+ <record id="view_sale_open_invoice" model="ir.ui.view">
+ <field name="name">Open Invoice</field>
+ <field name="model">sale.open.invoice</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Invoices">
+ <label string="You invoice has been successfully created!" />
+ <newline />
+ <separator string="" colspan="4"/>
+ <group colspan="4">
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="open_invoice" string="Open Invoice" type="object" icon="gtk-open"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_view_sale_open_invoice" model="ir.actions.act_window">
+ <field name="name">Open Invoice</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.open.invoice</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+ </data>
+</openerp>
diff --git a/addons/sale/wizard/wizard_sale_line_invoice.py b/addons/sale/wizard/wizard_sale_line_invoice.py
index 8e1e49ab22d..4bf3074db54 100644
--- a/addons/sale/wizard/wizard_sale_line_invoice.py
+++ b/addons/sale/wizard/wizard_sale_line_invoice.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,107 +15,110 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
+from osv import fields, osv
+from service import web_services
import wizard
import netsvc
import ir
import pooler
-invoice_form = """<?xml version="1.0"?>
-<form string="Create invoices">
- <separator colspan="4" string="Do you really want to create the invoices ?" />
- <field name="grouped" />
-</form>
-"""
+class sale_order_line_make_invoice(osv.osv_memory):
+ _name = "sale.order.line.make.invoice"
+ _description = "Sale OrderLine Make_invoice"
+ _columns = {
+ 'grouped': fields.boolean('Group the invoices'),
+ }
+ _default = {
+ 'grouped' : lambda *a: False
+ }
-invoice_fields = {
- 'grouped' : {'string':'Group the invoices', 'type':'boolean', 'default': lambda *a: False}
-}
+ def make_invoices(self, cr, uid, ids, context):
+ """
+ To make invoices.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
-def _makeInvoices(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- res = False
- invoices = {}
+ res = False
+ invoices = {}
#TODO: merge with sale.py/make_invoice
- def make_invoice(order, lines):
- a = order.partner_id.property_account_receivable.id
- if order.partner_id and order.partner_id.property_payment_term.id:
- pay_term = order.partner_id.property_payment_term.id
- else:
- pay_term = False
- inv = {
- 'name': order.name,
- 'origin': order.name,
- 'type': 'out_invoice',
- 'reference': "P%dSO%d" % (order.partner_id.id, order.id),
- 'account_id': a,
- 'partner_id': order.partner_id.id,
- 'address_invoice_id': order.partner_invoice_id.id,
- 'address_contact_id': order.partner_invoice_id.id,
- 'invoice_line': [(6,0,lines)],
- 'currency_id' : order.pricelist_id.currency_id.id,
- 'comment': order.note,
- 'payment_term': pay_term,
- 'fiscal_position': order.partner_id.property_account_position.id
- }
- inv_id = pool.get('account.invoice').create(cr, uid, inv)
- return inv_id
-
- for line in pool.get('sale.order.line').browse(cr,uid,data['ids']):
- if (not line.invoiced) and (line.state not in ('draft','cancel')):
- if not line.order_id.id in invoices:
- invoices[line.order_id.id] = []
- line_id = pool.get('sale.order.line').invoice_line_create(cr, uid,
- [line.id])
- for lid in line_id:
- invoices[line.order_id.id].append((line, lid))
- pool.get('sale.order.line').write(cr, uid, [line.id],
- {'invoiced': True})
- flag = True
- data_sale = pool.get('sale.order').browse(cr,uid,line.order_id.id)
- for line in data_sale.order_line:
- if not line.invoiced:
- flag = False
- break
- if flag:
- wf_service = netsvc.LocalService('workflow')
- wf_service.trg_validate(uid, 'sale.order', line.order_id.id, 'all_lines', cr)
- pool.get('sale.order').write(cr,uid,[line.order_id.id],{'state' : 'progress'})
+ def make_invoice(order, lines):
+ """
+ To make invoices.
+
+ @param order:
+ @param lines:
+
+ @return:
+
+ """
+ a = order.partner_id.property_account_receivable.id
+ if order.partner_id and order.partner_id.property_payment_term.id:
+ pay_term = order.partner_id.property_payment_term.id
+ else:
+ pay_term = False
+ inv = {
+ 'name': order.name,
+ 'origin': order.name,
+ 'type': 'out_invoice',
+ 'reference': "P%dSO%d" % (order.partner_id.id, order.id),
+ 'account_id': a,
+ 'partner_id': order.partner_id.id,
+ 'address_invoice_id': order.partner_invoice_id.id,
+ 'address_contact_id': order.partner_invoice_id.id,
+ 'invoice_line': [(6,0,lines)],
+ 'currency_id' : order.pricelist_id.currency_id.id,
+ 'comment': order.note,
+ 'payment_term': pay_term,
+ 'fiscal_position': order.partner_id.property_account_position.id
+ }
+ inv_id = self.pool.get('account.invoice').create(cr, uid, inv)
+ return inv_id
- for result in invoices.values():
- order = result[0][0].order_id
- il = map(lambda x: x[1], result)
- res = make_invoice(order, il)
- cr.execute('INSERT INTO sale_order_invoice_rel \
- (order_id,invoice_id) values (%s,%s)', (order.id, res))
- return {}
+ sales_order_line_obj = self.pool.get('sale.order.line')
+ sales_order_obj = self.pool.get('sale.order')
+ wf_service = netsvc.LocalService('workflow')
+ for line in sales_order_line_obj.browse(cr,uid,context['active_ids']):
+ if (not line.invoiced) and (line.state not in ('draft','cancel')):
+ if not line.order_id.id in invoices:
+ invoices[line.order_id.id] = []
+ line_id = sales_order_line_obj.invoice_line_create(cr, uid,
+ [line.id])
+ for lid in line_id:
+ invoices[line.order_id.id].append((line, lid))
+ sales_order_line_obj.write(cr, uid, [line.id],
+ {'invoiced': True})
+ flag = True
+ data_sale = sales_order_obj.browse(cr,uid,line.order_id.id)
+ for line in data_sale.order_line:
+ if not line.invoiced:
+ flag = False
+ break
+ if flag:
+ wf_service.trg_validate(uid, 'sale.order', line.order_id.id, 'all_lines', cr)
+ sales_order_obj.write(cr,uid,[line.order_id.id],{'state' : 'progress'})
+ for result in invoices.values():
+ order = result[0][0].order_id
+ il = map(lambda x: x[1], result)
+ res = make_invoice(order, il)
+ cr.execute('INSERT INTO sale_order_invoice_rel \
+ (order_id,invoice_id) values (%s,%s)', (order.id, res))
+ return {}
-class line_make_invoice(wizard.interface):
- states = {
- 'init' : {
- 'actions': [],
- 'result': {
- 'type': 'form',
- 'arch': invoice_form,
- 'fields': invoice_fields,
- 'state': [
- ('end', 'Cancel'),
- ('invoice', 'Create invoices')
- ]
- }
- },
- 'invoice' : {
- 'actions' : [_makeInvoices],
- 'result' : {'type': 'state', 'state': 'end'}
- },
- }
-line_make_invoice("sale.order.line.make_invoice")
+sale_order_line_make_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/sale_analytic_plans/i18n/hr.po b/addons/sale_analytic_plans/i18n/hr.po
index 3c6f11c17c6..a126a2fc3c2 100644
--- a/addons/sale_analytic_plans/i18n/hr.po
+++ b/addons/sale_analytic_plans/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/sale_delivery_report/i18n/sv.po b/addons/sale_delivery_report/i18n/sv.po
index a57144ab3ad..f196cf650d3 100644
--- a/addons/sale_delivery_report/i18n/sv.po
+++ b/addons/sale_delivery_report/i18n/sv.po
@@ -7,29 +7,29 @@ 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: 2009-02-03 06:25+0000\n"
-"Last-Translator: <>\n"
+"PO-Revision-Date: 2010-03-24 14:36+0000\n"
+"Last-Translator: Jeanette <jd@mobilasystem.se>\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-03-11 05:04+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale_delivery_report
#: rml:sale.shipping:0
msgid "Order Date"
-msgstr ""
+msgstr "Orderdatum"
#. module: sale_delivery_report
#: rml:sale.shipping:0
msgid "Order Ref."
-msgstr ""
+msgstr "Order Ref."
#. module: sale_delivery_report
#: rml:sale.shipping:0
msgid "Weight"
-msgstr ""
+msgstr "Vikt"
#. module: sale_delivery_report
#: rml:sale.shipping:0
@@ -39,17 +39,17 @@ msgstr ""
#. module: sale_delivery_report
#: rml:sale.shipping:0
msgid "Delivery Order :"
-msgstr ""
+msgstr "Leveransorder:"
#. module: sale_delivery_report
#: model:ir.actions.report.xml,name:sale_delivery_report.report_shipping
msgid "Delivery order"
-msgstr ""
+msgstr "Leveransorder"
#. module: sale_delivery_report
#: model:ir.module.module,shortdesc:sale_delivery_report.module_meta_information
msgid "Print Delivery Order"
-msgstr ""
+msgstr "Skriv ut leveransorder"
#. module: sale_delivery_report
#: rml:sale.shipping:0
@@ -59,7 +59,7 @@ msgstr ""
#. module: sale_delivery_report
#: rml:sale.shipping:0
msgid "Invoiced to"
-msgstr ""
+msgstr "Fakturamottagare"
#. module: sale_delivery_report
#: rml:sale.shipping:0
@@ -74,4 +74,4 @@ msgstr ""
#. module: sale_delivery_report
#: rml:sale.shipping:0
msgid "Quantity"
-msgstr ""
+msgstr "Antal"
diff --git a/addons/sale_journal/i18n/hr.po b/addons/sale_journal/i18n/hr.po
index f4d2e7b297d..3f8e5efd873 100644
--- a/addons/sale_journal/i18n/hr.po
+++ b/addons/sale_journal/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/stock/__init__.py b/addons/stock/__init__.py
index a2df9bdd809..9cc33351689 100644
--- a/addons/stock/__init__.py
+++ b/addons/stock/__init__.py
@@ -24,8 +24,6 @@ import partner
import product
import report
import wizard
-import stock_wizard
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/__terp__.py b/addons/stock/__terp__.py
index 7a03b225dc2..5fa272238d5 100644
--- a/addons/stock/__terp__.py
+++ b/addons/stock/__terp__.py
@@ -41,11 +41,21 @@ Thanks to the double entry management, the inventory controlling is powerful and
"init_xml" : [],
"demo_xml" : ["stock_demo.xml"],
"update_xml" : [
- "stock_workflow.xml",
"stock_data.xml",
+ "wizard/stock_move_view.xml",
+ "wizard/stock_partial_picking_view.xml",
+ "wizard/stock_partial_move_view.xml",
+ "wizard/stock_inventory_set_stock_zero_view.xml",
+ "wizard/stock_fill_inventory_view.xml",
+ "wizard/stock_invoice_onshipping_view.xml",
+ "wizard/stock_location_product_view.xml",
+ "wizard/stock_inventory_line_split_view.xml",
+ "wizard/stock_change_standard_price_view.xml",
+
+ "wizard/stock_traceability_view.xml",
+ "stock_workflow.xml",
"stock_incoterms.xml",
- "stock_wizard.xml",
- "stock_wizard_view.xml",
+ "stock_wizard.xml",
"stock_view.xml",
"stock_report.xml",
"stock_sequence.xml",
diff --git a/addons/stock/i18n/fr.po b/addons/stock/i18n/fr.po
index a8230d8bcfb..52ff32ffb02 100644
--- a/addons/stock/i18n/fr.po
+++ b/addons/stock/i18n/fr.po
@@ -7,21 +7,16 @@ 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-17 10:46+0000\n"
-"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
+"PO-Revision-Date: 2010-03-25 14:13+0000\n"
+"Last-Translator: Numérigraphe <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-03-11 04:40+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 04:59+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock
-#: model:ir.actions.wizard,name:stock.return_picking
-msgid "Return packing"
-msgstr "Retour de livraison"
-
-#. module: stock
#: field:stock.move,product_uos_qty:0
msgid "Quantity (UOS)"
msgstr "Quantité (UdV)"
@@ -105,6 +100,11 @@ msgid "UoM"
msgstr "UdM"
#. module: stock
+#: model:ir.actions.wizard,name:stock.return_picking
+msgid "Return packing"
+msgstr "Colisage en retour"
+
+#. module: stock
#: field:product.category,property_stock_journal:0
msgid "Stock journal"
msgstr "Journal des stocks"
@@ -682,7 +682,7 @@ msgstr ""
#. module: stock
#: view:stock.tracking:0
msgid "Tracking/Serial"
-msgstr "Tracer N° Série"
+msgstr "Suivi/N° de série"
#. module: stock
#: selection:stock.location,icon:0
@@ -1094,7 +1094,7 @@ msgstr "STOCK_SPELL_CHECK"
#. module: stock
#: model:ir.model,name:stock.model_stock_tracking
msgid "Stock Tracking Lots"
-msgstr "Stock suivi par lot"
+msgstr "Lot de suivi de stock"
#. module: stock
#: rml:lot.stock.overview:0
@@ -1251,7 +1251,7 @@ msgstr "STOCK_STOP"
#. module: stock
#: wizard_view:stock.move.track,init:0
msgid "Tracking a move"
-msgstr "Tracer un mouvement"
+msgstr "Suivi de mouvement"
#. module: stock
#: selection:stock.location,icon:0
@@ -1525,7 +1525,7 @@ msgstr "STOCK_SORT_DESCENDING"
#: model:ir.actions.act_window,name:stock.action_tracking_form
#: model:ir.ui.menu,name:stock.menu_action_tracking_form
msgid "Tracking Lots"
-msgstr "Tracer les lots"
+msgstr "Lots de suivi"
#. module: stock
#: wizard_button:inventory.merge,init,merge:0
@@ -1656,7 +1656,7 @@ msgstr "STOCK_ZOOM_OUT"
#. module: stock
#: wizard_field:stock.move.track,init,tracking_prefix:0
msgid "Tracking prefix"
-msgstr "Préfix du Suivi"
+msgstr "Préfix du suivi"
#. module: stock
#: selection:stock.location,allocation_method:0
diff --git a/addons/stock/i18n/zh_CN.po b/addons/stock/i18n/zh_CN.po
index d046f9c0519..efb18200eb8 100644
--- a/addons/stock/i18n/zh_CN.po
+++ b/addons/stock/i18n/zh_CN.po
@@ -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-03-20 10:28+0000\n"
-"Last-Translator: Black Jack <onetimespeed@hotmail.com>\n"
+"PO-Revision-Date: 2010-03-29 01:06+0000\n"
+"Last-Translator: digitalsatori <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-03-21 04:42+0000\n"
+"X-Launchpad-Export-Date: 2010-03-29 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock
@@ -24,12 +24,12 @@ msgstr "后进先出"
#. module: stock
#: field:stock.location,chained_location_id:0
msgid "Chained Location If Fixed"
-msgstr "如果固定连锁库位"
+msgstr "固定连锁库位"
#. module: stock
#: selection:stock.location,icon:0
msgid "STOCK_SAVE"
-msgstr "保存"
+msgstr "STOCK_SAVE"
#. module: stock
#: model:stock.location,name:stock.stock_location_15
@@ -39,12 +39,12 @@ msgstr "子产品"
#. module: stock
#: selection:stock.location,icon:0
msgid "terp-account"
-msgstr "会计"
+msgstr "terp-account"
#. module: stock
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr "在这动作定义中有无效的模块名"
+msgstr "在动作定义使用了无效的模型名称。"
#. module: stock
#: model:ir.module.module,shortdesc:stock.module_meta_information
@@ -55,17 +55,17 @@ msgstr "库存管理"
#. module: stock
#: selection:stock.location,icon:0
msgid "STOCK_SORT_ASCENDING"
-msgstr "升序"
+msgstr "STOCK_SORT_ASCENDING"
#. module: stock
#: field:stock.production.lot.revision,indice:0
msgid "Revision"
-msgstr "修改"
+msgstr "修订版"
#. module: stock
#: selection:stock.location,icon:0
msgid "STOCK_MEDIA_FORWARD"
-msgstr "向前"
+msgstr "STOCK_MEDIA_FORWARD"
#. module: stock
#: rml:lot.location:0
@@ -75,7 +75,7 @@ msgstr "合计:"
#. module: stock
#: selection:stock.location,icon:0
msgid "STOCK_ZOOM_100"
-msgstr "放大100"
+msgstr "STOCK_ZOOM_100"
#. module: stock
#: rml:lot.stock.overview:0
@@ -86,7 +86,7 @@ msgstr "计量单位"
#. module: stock
#: model:ir.actions.wizard,name:stock.return_picking
msgid "Return packing"
-msgstr "退回包装"
+msgstr "退货"
#. module: stock
#: field:product.category,property_stock_journal:0
@@ -103,7 +103,7 @@ msgstr "填写具体库位盘存"
#: view:stock.picking:0
#: field:stock.picking.move.wizard,picking_id:0
msgid "Packing list"
-msgstr "包装单"
+msgstr "分拣单"
#. module: stock
#: rml:lot.stock.overview:0
@@ -114,13 +114,13 @@ msgstr "金额"
#. module: stock
#: view:stock.picking:0
msgid "Products Received"
-msgstr "产品接收"
+msgstr "已收到的货品"
#. module: stock
#: model:ir.actions.act_window,name:stock.action_picking_tree4
#: model:ir.ui.menu,name:stock.menu_action_picking_tree4
msgid "Incoming Products"
-msgstr "接收产品"
+msgstr "入库货品"
#. module: stock
#: field:stock.picking,name:0
@@ -147,7 +147,7 @@ msgstr "接收强制的生产批次"
#: field:stock.move,move_history_ids:0
#: field:stock.move,move_history_ids2:0
msgid "Move History"
-msgstr "移动历史记录"
+msgstr "库存移动记录"
#. module: stock
#: model:ir.model,name:stock.model_stock_production_lot
@@ -159,12 +159,12 @@ msgstr "生产批次"
#. module: stock
#: selection:stock.location,icon:0
msgid "STOCK_NEW"
-msgstr "新"
+msgstr "STOCK_NEW"
#. module: stock
#: selection:stock.location,icon:0
msgid "STOCK_CANCEL"
-msgstr "取消"
+msgstr "STOCK_CANCEL"
#. module: stock
#: selection:stock.location,usage:0
@@ -174,7 +174,7 @@ msgstr "内部库位"
#. module: stock
#: selection:stock.location,icon:0
msgid "STOCK_PRINT"
-msgstr "打印"
+msgstr "STOCK_PRINT"
#. module: stock
#: rml:stock.picking.list:0
@@ -654,7 +654,7 @@ msgstr "预计运送日期"
#. module: stock
#: rml:stock.picking.list:0
msgid "Shipping Address :"
-msgstr ""
+msgstr "运输地址"
#. module: stock
#: view:stock.tracking:0
diff --git a/addons/stock/product.py b/addons/stock/product.py
index 3e789fa7ecd..d771815a4d4 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -24,7 +24,127 @@ from tools.translate import _
class product_product(osv.osv):
- _inherit = "product.product"
+ _inherit = "product.product"
+
+ def do_change_standard_price(self, cr, uid, ids, datas, context={}):
+ """
+ Changes the Standard Price of Product.
+ And creates an account move accordingly.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param datas : dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ location_obj = self.pool.get('stock.location')
+ move_obj = self.pool.get('account.move')
+ move_line_obj = self.pool.get('account.move.line')
+
+ new_price = datas.get('new_price', 0.0)
+ stock_output_acc = datas.get('stock_output_account', False)
+ stock_input_acc = datas.get('stock_input_account', False)
+ journal_id = datas.get('stock_journal', False)
+
+ move_ids = []
+ for rec_id in ids:
+ loc_ids = location_obj.search(cr, uid, [('account_id','<>',False),('usage','=','internal')])
+ for location in location_obj.browse(cr, uid, loc_ids):
+ c = context.copy()
+ c.update({
+ 'location': location.id,
+ 'compute_child': False
+ })
+
+ product = self.browse(cr, uid, rec_id, context=c)
+ qty = product.qty_available
+ diff = product.standard_price - new_price
+ assert diff, _("Could not find any difference between standard price and new price!")
+ if qty:
+ location_account = location.account_id and location.account_id.id or False
+ company_id = location.company_id and location.company_id.id or False
+ assert location_account, _('Inventory Account is not specified for Location: %s' % (location.name))
+ assert company_id, _('Company is not specified in Location')
+ #
+ # Accounting Entries
+ #
+ if not journal_id:
+ journal_id = product.categ_id.property_stock_journal and product.categ_id.property_stock_journal.id or False
+ if not journal_id:
+ raise osv.except_osv(_('Error!'),
+ _('There is no journal defined '\
+ 'on the product category: "%s" (id: %d)') % \
+ (product.categ_id.name,
+ product.categ_id.id,))
+ move_id = move_obj.create(cr, uid, {
+ 'journal_id': journal_id,
+ 'company_id': company_id
+ })
+
+ move_ids.append(move_id)
+
+
+ if diff > 0:
+ if not stock_input_acc:
+ stock_input_acc = product.product_tmpl_id.\
+ property_stock_account_input.id
+ if not stock_input_acc:
+ stock_input_acc = product.categ_id.\
+ property_stock_account_input_categ.id
+ if not stock_input_acc:
+ raise osv.except_osv(_('Error!'),
+ _('There is no stock input account defined ' \
+ 'for this product: "%s" (id: %d)') % \
+ (product.name,
+ product.id,))
+ amount_diff = qty * diff
+ move_line_obj.create(cr, uid, {
+ 'name': product.name,
+ 'account_id': stock_input_acc,
+ 'debit': amount_diff,
+ 'move_id': move_id,
+ })
+ move_line_obj.create(cr, uid, {
+ 'name': location.name,
+ 'account_id': location_account,
+ 'credit': amount_diff,
+ 'move_id': move_id
+ })
+ elif diff < 0:
+ if not stock_output_acc:
+ stock_output_acc = product.product_tmpl_id.\
+ property_stock_account_output.id
+ if not stock_output_acc:
+ stock_output_acc = product.categ_id.\
+ property_stock_account_output_categ.id
+ if not stock_output_acc:
+ raise osv.except_osv(_('Error!'),
+ _('There is no stock output account defined ' \
+ 'for this product: "%s" (id: %d)') % \
+ (product.name,
+ product.id,))
+ amount_diff = qty * -diff
+ move_line_obj.create(cr, uid, {
+ 'name': product.name,
+ 'account_id': stock_output_acc,
+ 'credit': amount_diff,
+ 'move_id': move_id
+ })
+ move_line_obj.create(cr, uid, {
+ 'name': location.name,
+ 'account_id': location_account,
+ 'debit': amount_diff,
+ 'move_id': move_id
+ })
+
+ self.write(cr, uid, rec_id, {'standard_price': new_price})
+
+ return move_ids
+
def view_header_get(self, cr, user, view_id, view_type, context):
res = super(product_product, self).view_header_get(cr, user, view_id, view_type, context)
if res: return res
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index 9f9dd4b6ec2..d027465c34d 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -54,6 +54,20 @@
</field>
</record>
+ <record id="view_product_standard_price_form" model="ir.ui.view">
+ <field name="name">product.product.standard.price.form.inherit</field>
+ <field name="model">product.product</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="product.product_normal_form_view"/>
+ <field name="arch" type="xml">
+ <field name="standard_price" position="replace">
+ <group col="4" colspan="2">
+ <field name="standard_price" readonly="True"/>
+ <button name="%(action_view_change_standard_price)d" string="Change Price" type="action" icon="gtk-execute"/>
+ </group>
+ </field>
+ </field>
+ </record>
<record id="view_normal_property_acc_form" model="ir.ui.view">
<field name="name">product.normal.stock.acc.property.form.inherit</field>
diff --git a/addons/stock/report/report_stock_view.xml b/addons/stock/report/report_stock_view.xml
index 21f7d91a806..21b8a0a2f4e 100644
--- a/addons/stock/report/report_stock_view.xml
+++ b/addons/stock/report/report_stock_view.xml
@@ -12,10 +12,12 @@
<filter icon="terp-stock" string="Internal Locations" domain="[('location_id.usage', '=', 'internal')]" help="Internal Locations" default="1" />
<filter icon="terp-stock" string="Customer Locations" domain="[('location_id.usage', '=', 'customer')]" help="Customer Locations" />
<filter icon="terp-stock" string="Supplier Locations" domain="[('location_id.usage', '=', 'supplier')]" help="Supplier Locations" />
+
<separator orientation="vertical"/>
<field name="location_id" select="1" />
<field name="product_id" select="1" />
</group>
+ <newline/>
<group expand="1" string="Group By..." colspan="4" col="10">
<filter string="Location" icon="terp-stock" domain="[]" context="{'group_by':'location_id'}"/>
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
@@ -152,7 +154,7 @@
</record>
<record model="ir.actions.act_window" id="action_stock_line_date">
- <field name="name">Latest Inventory Date by Product</field>
+ <field name="name">Latest Inventories Dates by Product</field>
<field name="res_model">report.stock.lines.date</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv
index d00a55b0b9f..8e7db1c068b 100644
--- a/addons/stock/security/ir.model.access.csv
+++ b/addons/stock/security/ir.model.access.csv
@@ -22,5 +22,16 @@
"access_stock_move_consume","stock.move.consume","model_stock_move_consume","stock.group_stock_user",1,0,0,0
"access_stock_move_scrap","stock.move.scrap","model_stock_move_scrap","stock.group_stock_user",1,0,0,0
"access_stock_move_split","stock.move.split","model_stock_move_split","stock.group_stock_user",1,0,0,0
+"access_stock_move_split_lines","stock.move.split.lines","model_stock_move_split_lines","stock.group_stock_user",1,0,0,0"access_report_products_to_received_planned","report.products.to.received.planned","model_report_products_to_received_planned","stock.group_stock_user",1,0,0,0
+"access_report_delivery_products_planned","report.delivery.products.planned","model_report_delivery_products_planned","stock.group_stock_user",1,0,0,0
+"access_stock_move_track","stock.move.track","model_stock_move_track","stock.group_stock_user",1,0,0,0
+"access_stock_move_consume","stock.move.consume","model_stock_move_consume","stock.group_stock_user",1,0,0,0
+"access_stock_move_scrap","stock.move.scrap","model_stock_move_scrap","stock.group_stock_user",1,0,0,0
+"access_stock_move_split","stock.move.split","model_stock_move_split","stock.group_stock_user",1,0,0,0
"access_stock_move_split_lines","stock.move.split.lines","model_stock_move_split_lines","stock.group_stock_user",1,0,0,0
+"access_stock_inventory_set_stock_zero","stock.inventory.set.stock.zero","model_stock_inventory_set_stock_zero","stock.group_stock_user",1,0,0,0
+"access_stock_fill_inventory","stock.fill.inventory","model_stock_fill_inventory","stock.group_stock_user",1,0,0,0
+"access_stock_inventory_line_split","stock.inventory.line.split","model_stock_inventory_line_split","stock.group_stock_user",1,0,0,0
+"access_stock_invoice_onshipping","stock.invoice.onshipping","model_stock_invoice_onshipping","stock.group_stock_user",1,0,0,0
+"access_stock_location_product","stock.location.product","model_stock_location_product","stock.group_stock_user",1,0,0,0
"access_report_stock_picking","report.stock.picking","model_report_stock_picking","stock.group_stock_user",1,0,0,0
diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml
index 2d91d958957..e1e412690fc 100644
--- a/addons/stock/security/stock_security.xml
+++ b/addons/stock/security/stock_security.xml
@@ -25,14 +25,14 @@
<field name="global" eval="True"/>
</record>
<record model="ir.rule" id="stock_picking_rule">
- <field model="ir.model.fields" name="field_id" search="[('model','=','stock.picking'),('name','=','company_id')]"/>
- <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
- <field name="operator">child_of</field>
- <field name="operand">user.company_id.id</field>
+ <field model="ir.model.fields" name="field_id" search="[('model','=','stock.picking'),('name','=','company_id')]"/>
+ <field name="domain_force">['|',('company_id','=',False),,('company_id','=',False)]</field>
+ <field name="operator">child_of</field>
+ <field name="operand">user.company_id.id</field>
<field name="rule_group" ref="stock_picking_rule_group"/>
</record>
- <record model="ir.rule.group" id="stock_warehouse_comp_rule_group">
+ <record model="ir.rule.group" id="stock_warehouse_comp_rule_group">
<field name="name">Warehouse multi-company</field>
<field name="model_id" ref="model_stock_warehouse"/>
<field name="global" eval="True"/>
@@ -41,7 +41,7 @@
<record model="ir.rule" id="stock_warehouse_comp_rule">
<field name="field_id" search="[('model','=','stock.warehouse'),('name','=','company_id')]" model="ir.model.fields"/>
<field name="rule_group" ref="stock_warehouse_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),,('company_id','child_of',[user.company_id.id])]</field>
</record>
<record model="ir.rule.group" id="stock_location_comp_rule_group">
@@ -52,7 +52,7 @@
<record model="ir.rule" id="stock_location_comp_rule">
<field name="field_id" search="[('model','=','stock.location'),('name','=','company_id')]" model="ir.model.fields"/>
<field name="rule_group" ref="stock_location_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),,('company_id','child_of',[user.company_id.id])]</field>
</record>
<record model="ir.rule.group" id="stock_move_rule_group">
@@ -61,10 +61,10 @@
<field name="global" eval="True"/>
</record>
<record model="ir.rule" id="stock_move_rule">
- <field model="ir.model.fields" name="field_id" search="[('model','=','stock.move'),('name','=','company_id')]"/>
- <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
- <field name="operator">child_of</field>
- <field name="operand">user.company_id.id</field>
+ <field model="ir.model.fields" name="field_id" search="[('model','=','stock.move'),('name','=','company_id')]"/>
+ <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="operator">child_of</field>
+ <field name="operand">user.company_id.id</field>
<field name="rule_group" ref="stock_move_rule_group"/>
</record>
@@ -76,7 +76,7 @@
<record model="ir.rule" id="stock_inventory_line_comp_rule">
<field name="field_id" search="[('model','=','stock.inventory.line'),('name','=','company_id')]" model="ir.model.fields"/>
<field name="rule_group" ref="stock_inventory_line_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">['|',('company_id','=',False),,('company_id','child_of',[user.company_id.id])]</field>
</record>
<record model="ir.rule.group" id="stock_inventory_comp_rule_group">
@@ -87,7 +87,7 @@
<record model="ir.rule" id="stock_inventory_comp_rule">
<field name="field_id" search="[('model','=','stock.inventory'),('name','=','company_id')]" model="ir.model.fields"/>
<field name="rule_group" ref="stock_inventory_comp_rule_group"/>
- <field name="domain_force">['|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id])]</field>
+ <field name="domain_force">[('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</data>
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index e5696dde1e7..e824d670205 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -492,6 +492,7 @@ class stock_picking(osv.osv):
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
method=True, store=True, type='datetime', string='Max. Expected Date', select=2),
'move_lines': fields.one2many('stock.move', 'picking_id', 'Entry lines', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
+ 'delivery_line':fields.one2many('stock.delivery', 'picking_id', 'Delivery lines', readonly=True),
'auto_picking': fields.boolean('Auto-Picking'),
'address_id': fields.many2one('res.partner.address', 'Partner', help="Address of partner"),
'invoice_state': fields.selection([
@@ -552,6 +553,8 @@ class stock_picking(osv.osv):
def action_assign(self, cr, uid, ids, *args):
for pick in self.browse(cr, uid, ids):
move_ids = [x.id for x in pick.move_lines if x.state == 'confirmed']
+ if not move_ids:
+ raise osv.except_osv(_('Warning !'),_('Not Available. Moves are not confirmed.'))
self.pool.get('stock.move').action_assign(cr, uid, move_ids)
return True
@@ -862,6 +865,150 @@ class stock_picking(osv.osv):
continue
return super(stock_picking, self).unlink(cr, uid, ids, context=context)
+ def do_partial(self, cr, uid, ids, partial_datas, context={}):
+ """
+ @ partial_datas : dict. contain details of partial picking
+ like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom
+ """
+ res = {}
+ move_obj = self.pool.get('stock.move')
+ delivery_obj = self.pool.get('stock.delivery')
+ product_obj = self.pool.get('product.product')
+ currency_obj = self.pool.get('res.currency')
+ users_obj = self.pool.get('res.users')
+ uom_obj = self.pool.get('product.uom')
+ price_type_obj = self.pool.get('product.price.type')
+ sequence_obj = self.pool.get('ir.sequence')
+ wf_service = netsvc.LocalService("workflow")
+ partner_id = partial_datas.get('partner_id', False)
+ address_id = partial_datas.get('address_id', False)
+ delivery_date = partial_datas.get('delivery_date', False)
+ for pick in self.browse(cr, uid, ids, context=context):
+ new_picking = None
+ new_moves = []
+
+ complete, too_many, too_few = [], [], []
+ move_product_qty = {}
+ for move in pick.move_lines:
+ if move.state in ('done', 'cancel'):
+ continue
+ partial_data = partial_datas.get('move%s'%(move.id), False)
+ assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id))
+ product_qty = partial_data.get('product_qty',0.0)
+ move_product_qty[move.id] = product_qty
+ product_uom = partial_data.get('product_uom',False)
+ product_price = partial_data.get('product_price',0.0)
+ product_currency = partial_data.get('product_currency',False)
+ if move.product_qty == product_qty:
+ complete.append(move)
+ elif move.product_qty > product_qty:
+ too_few.append(move)
+ else:
+ too_many.append(move)
+
+ # Average price computation
+ if (pick.type == 'in') and (move.product_id.cost_method == 'average'):
+ product = product_obj.browse(cr, uid, move.product_id.id)
+ user = users_obj.browse(cr, uid, uid)
+ context['currency_id'] = move.company_id.currency_id.id
+ qty = uom_obj._compute_qty(cr, uid, product_uom, product_qty, product.uom_id.id)
+ pricetype = False
+ if user.company_id.property_valuation_price_type:
+ pricetype = price_type_obj.browse(cr, uid, user.company_id.property_valuation_price_type.id)
+ if pricetype and qty > 0:
+ new_price = currency_obj.compute(cr, uid, product_currency,
+ user.company_id.currency_id.id, product_price)
+ new_price = uom_obj._compute_price(cr, uid, product_uom, new_price,
+ product.uom_id.id)
+ if product.qty_available <= 0:
+ new_std_price = new_price
+ else:
+ # Get the standard price
+ amount_unit = product.price_get(pricetype.field, context)[product.id]
+ new_std_price = ((amount_unit * product.qty_available)\
+ + (new_price * qty))/(product.qty_available + qty)
+
+ # Write the field according to price type field
+ product_obj.write(cr, uid, [product.id],
+ {pricetype.field: new_std_price})
+ move_obj.write(cr, uid, [move.id], {'price_unit': new_price})
+
+
+ for move in too_few:
+ product_qty = move_product_qty[move.id]
+ if not new_picking:
+
+ new_picking = self.copy(cr, uid, pick.id,
+ {
+ 'name': sequence_obj.get(cr, uid, 'stock.picking.%s'%(pick.type)),
+ 'move_lines' : [],
+ 'state':'draft',
+ })
+ if product_qty != 0:
+
+ new_obj = move_obj.copy(cr, uid, move.id,
+ {
+ 'product_qty' : product_qty,
+ 'product_uos_qty': product_qty, #TODO: put correct uos_qty
+ 'picking_id' : new_picking,
+ 'state': 'assigned',
+ 'move_dest_id': False,
+ 'price_unit': move.price_unit,
+ })
+
+ move_obj.write(cr, uid, [move.id],
+ {
+ 'product_qty' : move.product_qty - product_qty,
+ 'product_uos_qty':move.product_qty - product_qty, #TODO: put correct uos_qty
+
+ })
+
+ if new_picking:
+ move_obj.write(cr, uid, [c.id for c in complete], {'picking_id': new_picking})
+ for move in too_many:
+ product_qty = move_product_qty[move.id]
+ move_obj.write(cr, uid, [move.id],
+ {
+ 'product_qty' : product_qty,
+ 'product_uos_qty': product_qty, #TODO: put correct uos_qty
+ 'picking_id': new_picking,
+ })
+ else:
+ for move in too_many:
+ product_qty = move_product_qty[move.id]
+ move_obj.write(cr, uid, [move.id],
+ {
+ 'product_qty': product_qty,
+ 'product_uos_qty': product_qty #TODO: put correct uos_qty
+ })
+
+ # At first we confirm the new picking (if necessary)
+ if new_picking:
+ wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
+ # Then we finish the good picking
+ if new_picking:
+ self.write(cr, uid, [pick.id], {'backorder_id': new_picking})
+ self.action_move(cr, uid, [new_picking])
+ wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_done', cr)
+ wf_service.trg_write(uid, 'stock.picking', pick.id, cr)
+ delivered_pack_id = new_picking
+ else:
+ self.action_move(cr, uid, [pick.id])
+ wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr)
+ delivered_pack_id = pick.id
+
+ delivered_pack = self.browse(cr, uid, delivered_pack_id, context=context)
+ delivery_id = delivery_obj.create(cr, uid, {
+ 'name': delivered_pack.name,
+ 'partner_id': partner_id,
+ 'address_id': address_id,
+ 'date': delivery_date,
+ 'picking_id' : pick.id,
+ 'move_delivered' : [(6,0, map(lambda x:x.id, delivered_pack.move_lines))]
+ }, context=context)
+ res[pick.id] = {'delivered_picking': delivered_pack.id or False}
+ return res
+
stock_picking()
@@ -959,7 +1106,23 @@ class stock_production_lot_revision(osv.osv):
}
stock_production_lot_revision()
-
+
+class stock_delivery(osv.osv):
+
+ """ Tracability of partialdeliveries """
+
+ _name = "stock.delivery"
+ _description = "Delivery"
+ _columns = {
+ 'name': fields.char('Name', size=60, required=True),
+ 'date': fields.datetime('Date', required=True),
+ 'partner_id': fields.many2one('res.partner', 'Partner', required=True),
+ 'address_id': fields.many2one('res.partner.address', 'Address', required=True),
+ 'move_delivered':fields.one2many('stock.move', 'delivered_id', 'Move Delivered'),
+ 'picking_id': fields.many2one('stock.picking', 'Picking list'),
+
+ }
+stock_delivery()
# ----------------------------------------------------
# Move
# ----------------------------------------------------
@@ -1043,6 +1206,7 @@ class stock_move(osv.osv):
'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Orders"),
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"),
'move_stock_return_history': fields.many2many('stock.move', 'stock_move_return_history', 'move_id', 'return_move_id', 'Move Return History',readonly=True),
+ 'delivered_id': fields.many2one('stock.delivery', 'Product delivered'),
'scraped': fields.boolean('Scraped'),
}
_constraints = [
@@ -1156,13 +1320,13 @@ class stock_move(osv.osv):
product = self.pool.get('product.product').browse(cr, uid, [prod_id], context=ctx)[0]
uos_id = product.uos_id and product.uos_id.id or False
result = {
- 'name': product.partner_ref,
'product_uom': product.uom_id.id,
'product_uos': uos_id,
'product_qty': 1.00,
'product_uos_qty' : self.pool.get('stock.move').onchange_quantity(cr, uid, ids, prod_id, 1.00, product.uom_id.id, uos_id)['value']['product_uos_qty']
}
-
+ if not ids:
+ result['name'] = product.partner_ref
if loc_id:
result['location_id'] = loc_id
if loc_dest_id:
@@ -1285,7 +1449,7 @@ class stock_move(osv.osv):
if done:
count += len(done)
self.write(cr, uid, done, {'state': 'assigned'})
-
+
if count:
for pick_id in pickings:
wf_service = netsvc.LocalService("workflow")
@@ -1318,8 +1482,8 @@ class stock_move(osv.osv):
for id in ids:
wf_service.trg_trigger(uid, 'stock.move', id, cr)
#self.action_cancel(cr,uid, ids2, context)
- return True
-
+ return True
+
def action_done(self, cr, uid, ids, context=None):
track_flag = False
picking_ids = []
@@ -1451,7 +1615,7 @@ class stock_move(osv.osv):
ir_sequence_obj = self.pool.get('ir.sequence')
sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
if not sequence:
- raise wizard.except_wizard(_('Error!'), _('No production sequence defined'))
+ raise osv.except_osv(_('Error!'), _('No production sequence defined'))
prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix': prefix}, {'product_id': product_id})
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
ref = ','.join(map(lambda x:str(x),ids))
@@ -1489,7 +1653,8 @@ class stock_move(osv.osv):
new_move = self.copy(cr, uid, move.id, default_val)
#self.write(cr, uid, [new_move], {'move_history_ids':[(4,move.id)]}) #TODO : to track scrap moves
res += [new_move]
- self.action_done(cr, uid, res)
+
+ self.action_done(cr, uid, res)
return res
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None):
@@ -1624,7 +1789,134 @@ class stock_move(osv.osv):
self.write(cr, uid, [move.id], update_val)
self.action_done(cr, uid, res)
- return res
+ return res
+
+ def do_partial(self, cr, uid, ids, partial_datas, context={}):
+ """
+ @ partial_datas : dict. contain details of partial picking
+ like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom
+ """
+ res = {}
+ picking_obj = self.pool.get('stock.picking')
+ delivery_obj = self.pool.get('stock.delivery')
+ product_obj = self.pool.get('product.product')
+ currency_obj = self.pool.get('res.currency')
+ users_obj = self.pool.get('res.users')
+ uom_obj = self.pool.get('product.uom')
+ price_type_obj = self.pool.get('product.price.type')
+ sequence_obj = self.pool.get('ir.sequence')
+ wf_service = netsvc.LocalService("workflow")
+ partner_id = partial_datas.get('partner_id', False)
+ address_id = partial_datas.get('address_id', False)
+ delivery_date = partial_datas.get('delivery_date', False)
+
+ new_moves = []
+
+ complete, too_many, too_few = [], [], []
+ move_product_qty = {}
+ for move in self.browse(cr, uid, ids, context=context):
+ if move.state in ('done', 'cancel'):
+ continue
+ partial_data = partial_datas.get('move%s'%(move.id), False)
+ assert partial_data, _('Do not Found Partial data of Stock Move Line :%s' %(move.id))
+ product_qty = partial_data.get('product_qty',0.0)
+ move_product_qty[move.id] = product_qty
+ product_uom = partial_data.get('product_uom',False)
+ product_price = partial_data.get('product_price',0.0)
+ product_currency = partial_data.get('product_currency',False)
+ if move.product_qty == product_qty:
+ complete.append(move)
+ elif move.product_qty > product_qty:
+ too_few.append(move)
+ else:
+ too_many.append(move)
+
+ # Average price computation
+ if (move.picking_id.type == 'in') and (move.product_id.cost_method == 'average'):
+ product = product_obj.browse(cr, uid, move.product_id.id)
+ user = users_obj.browse(cr, uid, uid)
+ context['currency_id'] = move.company_id.currency_id.id
+ qty = uom_obj._compute_qty(cr, uid, product_uom, product_qty, product.uom_id.id)
+ pricetype = False
+ if user.company_id.property_valuation_price_type:
+ pricetype = price_type_obj.browse(cr, uid, user.company_id.property_valuation_price_type.id)
+ if pricetype and qty > 0:
+ new_price = currency_obj.compute(cr, uid, product_currency,
+ user.company_id.currency_id.id, product_price)
+ new_price = uom_obj._compute_price(cr, uid, product_uom, new_price,
+ product.uom_id.id)
+ if product.qty_available <= 0:
+ new_std_price = new_price
+ else:
+ # Get the standard price
+ amount_unit = product.price_get(pricetype.field, context)[product.id]
+ new_std_price = ((amount_unit * product.qty_available)\
+ + (new_price * qty))/(product.qty_available + qty)
+
+ # Write the field according to price type field
+ product_obj.write(cr, uid, [product.id],
+ {pricetype.field: new_std_price})
+ self.write(cr, uid, [move.id], {'price_unit': new_price})
+
+ for move in too_few:
+ product_qty = move_product_qty[move.id]
+ if product_qty != 0:
+ new_move = self.copy(cr, uid, move.id,
+ {
+ 'product_qty' : product_qty,
+ 'product_uos_qty': product_qty,
+ 'picking_id' : move.picking_id.id,
+ 'state': 'assigned',
+ 'move_dest_id': False,
+ 'price_unit': move.price_unit,
+ })
+ complete.append(self.browse(cr, uid, new_move))
+ self.write(cr, uid, move.id,
+ {
+ 'product_qty' : move.product_qty - product_qty,
+ 'product_uos_qty':move.product_qty - product_qty,
+ })
+
+
+ for move in too_many:
+ self.write(cr, uid, move.id,
+ {
+ 'product_qty': product_qty,
+ 'product_uos_qty': product_qty
+ })
+ complete.append(move)
+
+ for move in complete:
+ self.action_done(cr, uid, [move.id])
+
+ # TOCHECK : Done picking if all moves are done
+ cr.execute("""
+ SELECT move.id FROM stock_picking pick
+ RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
+ WHERE pick.id = %s""",
+ ('done', move.picking_id.id))
+ res = cr.fetchall()
+ if len(res) == len(move.picking_id.move_lines):
+ picking_obj.action_move(cr, uid, [move.picking_id.id])
+ wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
+
+ ref = {}
+ done_move_ids = []
+ for move in complete:
+ done_move_ids.append(move.id)
+ if move.picking_id.id not in ref:
+ delivery_id = delivery_obj.create(cr, uid, {
+ 'partner_id': partner_id,
+ 'address_id': address_id,
+ 'date': delivery_date,
+ 'name' : move.picking_id.name,
+ 'picking_id': move.picking_id.id
+ }, context=context)
+ ref[move.picking_id.id] = delivery_id
+ delivery_obj.write(cr, uid, ref[move.picking_id.id], {
+ 'move_delivered' : [(4,move.id)]
+ })
+ return done_move_ids
stock_move()
@@ -1646,10 +1938,12 @@ class stock_inventory(osv.osv):
'state': lambda *a: 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c)
}
+
+
+ def _inventory_line_hook(self, cr, uid, inventory_line, move_vals):
+ '''Creates a stock move from an inventory line'''
+ return self.pool.get('stock.move').create(cr, uid, move_vals)
- #
- # Update to support tracking
- #
def action_done(self, cr, uid, ids, context=None):
for inv in self.browse(cr, uid, ids):
move_ids = []
@@ -1689,7 +1983,7 @@ class stock_inventory(osv.osv):
'prodlot_id': lot_id,
'product_qty': line.product_qty
})
- move_ids.append(self.pool.get('stock.move').create(cr, uid, value))
+ move_ids.append(self._inventory_line_hook(cr, uid, line, value))
if len(move_ids):
self.pool.get('stock.move').action_done(cr, uid, move_ids,
context=context)
@@ -1721,8 +2015,10 @@ class stock_inventory_line(osv.osv):
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
'product_qty': fields.float('Quantity'),
'company_id': fields.related('inventory_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
- 'prod_lot_id': fields.many2one('stock.production.lot', 'Production Lot', domain="[('product_id','=',product_id)]")
+ 'prod_lot_id': fields.many2one('stock.production.lot', 'Production Lot', domain="[('product_id','=',product_id)]"),
+ 'state': fields.related('inventory_id','state',type='char',string='State',readonly=True),
}
+
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False):
if not product:
return {}
@@ -1754,7 +2050,7 @@ class stock_warehouse(osv.osv):
_defaults = {
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c),
}
-stock_warehouse()
+stock_warehouse()
# Move wizard :
diff --git a/addons/stock/stock_report.xml b/addons/stock/stock_report.xml
index d72106eead6..7b8d9eb13b3 100644
--- a/addons/stock/stock_report.xml
+++ b/addons/stock/stock_report.xml
@@ -1,19 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
-
<report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Future Stock Forecast"/>
-
-
-<!-- <report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Picking list" xml="stock/report/picking.xml" xsl="stock/report/picking.xsl"/>-->
<report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Picking list" rml="stock/report/picking.rml"/>
<report id="report_move_labels" model="stock.move" name="stock.move.label" string="Print Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
-
<report auto="False" id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Overview" rml="stock/report/lot_overview.rml"/>
-
<report auto="False" id="report_lot_location" model="stock.location" name="lot.location" rml="stock/report/lot_location.rml" string="Lots by location"/>
-
<report id="report_location_overview_all" model="stock.location" name="lot.stock.overview_all" string="Location Content (With children)" rml="stock/report/lot_overview_all.rml"/>
-
</data>
</openerp>
diff --git a/addons/stock/stock_sequence.xml b/addons/stock/stock_sequence.xml
index d002b62ae83..9c5083d13b4 100644
--- a/addons/stock/stock_sequence.xml
+++ b/addons/stock/stock_sequence.xml
@@ -2,18 +2,59 @@
<openerp>
<data noupdate="1">
<!--
- Sequences for pickings
+ Sequence types for pickings
-->
- <record id="seq_type_picking" model="ir.sequence.type">
- <field name="name">Picking</field>
- <field name="code">stock.picking</field>
+ <record id="seq_type_picking_in" model="ir.sequence.type">
+ <field name="name">Picking IN</field>
+ <field name="code">stock.picking.in</field>
+ </record>
+
+ <record id="seq_type_picking_out" model="ir.sequence.type">
+ <field name="name">Picking OUT</field>
+ <field name="code">stock.picking.out</field>
+ </record>
+
+ <record id="seq_type_picking_internal" model="ir.sequence.type">
+ <field name="name">Picking INT</field>
+ <field name="code">stock.picking.internal</field>
+ </record>
+
+ <record id="seq_type_picking_delivery" model="ir.sequence.type">
+ <field name="name">Picking Delivery</field>
+ <field name="code">stock.picking.delivery</field>
+ </record>
+
+ <!--
+ Sequences for pickings
+ -->
+
+ <record id="seq_picking_in" model="ir.sequence">
+ <field name="name">Picking IN</field>
+ <field name="code">stock.picking.in</field>
+ <field name="prefix">IN/</field>
+ <field name="padding">5</field>
+ </record>
+
+ <record id="seq_picking_out" model="ir.sequence">
+ <field name="name">Picking OUT</field>
+ <field name="code">stock.picking.out</field>
+ <field name="prefix">OUT/</field>
+ <field name="padding">5</field>
+ </record>
+
+ <record id="seq_picking_internal" model="ir.sequence">
+ <field name="name">Picking INT</field>
+ <field name="code">stock.picking.internal</field>
+ <field name="prefix">INT/</field>
+ <field name="padding">5</field>
</record>
- <record id="seq_picking" model="ir.sequence">
- <field name="name">Picking</field>
- <field name="code">stock.picking</field>
- <field name="prefix">PACK</field>
+ <record id="seq_picking_delivery" model="ir.sequence">
+ <field name="name">Picking DLV</field>
+ <field name="code">stock.picking.delivery</field>
+ <field name="prefix">DLV/</field>
+ <field name="padding">5</field>
</record>
<!--
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 3cada5cbb6d..877ea313d1b 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -4,7 +4,7 @@
<menuitem icon="terp-stock" id="menu_stock_root" name="Warehouse" sequence="2"/>
<menuitem id="menu_stock_warehouse_mgmt" name="Warehouse Management" parent="menu_stock_root" sequence="1"/>
<menuitem id="menu_stock_product" name="Product" parent="menu_stock_root" sequence="3"/>
- <menuitem action="product.product_normal_action" id="menu_stock_products_menu" parent="menu_stock_product" sequence="1"/>
+ <menuitem action="product.product_normal_action" id="menu_stock_products_menu" parent="menu_stock_product" sequence="1"/>
<menuitem id="menu_stock_configuration" name="Configuration" parent="menu_stock_root" sequence="6"/>
<menuitem id="menu_stock_inventory_control" name="Inventory Control" parent="menu_stock_root" sequence="2"/>
@@ -18,6 +18,9 @@
<field name="product_qty"/>
<field name="product_uom"/>
<field name="prod_lot_id"/>
+ <button name="%(stock.action_view_stock_inventory_line_split)d"
+ string="Split inventory lines"
+ type="action" icon="gtk-justify-fill"/>
<field name="location_id"/>
</tree>
</field>
@@ -32,8 +35,10 @@
<field name="product_qty"/>
<field name="product_uom"/>
<field name="prod_lot_id"/>
- <field colspan="4" domain="[('usage','=','internal')]" name="location_id" select="1"/>
- <button name="%(split_inventory_lots)d" string="Split Inventory Lines" type="action" icon="gtk-justify-fill"/>
+ <field colspan="4" domain="[('usage','=','internal')]" name="location_id" select="1"/>
+ <button name="%(stock.action_view_stock_inventory_line_split)d"
+ string="Split inventory lines"
+ type="action" icon="gtk-justify-fill"/>
</form>
</field>
</record>
@@ -50,6 +55,7 @@
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
</group>
</search>
+
</field>
</record>
@@ -64,6 +70,7 @@
<field name="state"/>
</tree>
</field>
+
</record>
<record id="view_inventory_form" model="ir.ui.view">
<field name="name">stock.inventory.form</field>
@@ -83,17 +90,22 @@
<field name="product_uom"/>
<field name="prod_lot_id"/>
<field colspan="4" domain="[('usage','=','internal')]" name="location_id" select="1"/>
+ <field name="state" invisible="1"/>
+ <button name="%(stock.action_view_stock_inventory_line_split)d"
+ string="Split inventory lines"
+ type="action" icon="gtk-justify-fill" states="draft"/>
</tree>
<form string="Inventory Lines">
<field colspan="4" context="location=location_id,uom=product_uom" name="product_id" on_change="on_change_product_id(location_id,product_id,product_uom)" select="1" domain="[('type','&lt;&gt;','service')]"/>
<field name="product_qty"/>
<field name="product_uom"/>
<field domain="[('usage','=','internal')]" name="location_id" select="1"/>
+ <field name="prod_lot_id"/>
<group colspan="2" col="3">
- <field name="prod_lot_id"/>
- <button name="%(split_inventory_lots)d" string="Split in Production Lots" type="action" icon="gtk-justify-fill"/>
+ <button name="%(stock.action_view_stock_inventory_line_split)d"
+ string="Split inventory lines"
+ type="action" icon="gtk-justify-fill"/>
</group>
-
</form>
</field>
</page><page string="Posted Inventory">
@@ -106,6 +118,7 @@
<button name="action_cancel" states="cancel" string="Set to Draft" type="object" icon="gtk-cancel"/>
<button name="action_cancel_inventary" states="draft" string="Cancel Inventory" type="object" icon="gtk-cancel"/>
</group>
+
</form>
</field>
</record>
@@ -138,7 +151,7 @@
<field name="name" select="1"/>
<field name="serial" select="1"/>
<field name="date" select="1"/>
- <field name="active" />
+ <field name="active" select="1"/>
</form>
</field>
</record>
@@ -259,6 +272,7 @@
<field name="product_id" select="1"/>
<field name="date" select="1"/>
</group>
+ <newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
</group>
@@ -266,7 +280,6 @@
</field>
</record>
-
<record id="action_production_lot_form" model="ir.actions.act_window">
<field name="name">Production Lots</field>
<field name="type">ir.actions.act_window</field>
@@ -325,31 +338,31 @@
</field>
</record>
- <wizard
+ <!--wizard
id="action_lot2"
model="stock.production.lot"
name="stock.traceability.lot.upstream"
- string="Upstream traceability"/>
+ string="Upstream traceability"/-->
- <wizard
+ <!--wizard
id="action_lot4"
model="stock.production.lot"
name="stock.traceability.lot.downstream"
- string="Downstream traceability"/>
+ string="Downstream traceability"/-->
- <wizard
+ <!--wizard
id="action4"
model="stock.tracking"
name="stock.traceability.upstream"
- string="Upstream traceability"/>
+ string="Upstream traceability"/-->
- <wizard
+ <!--wizard
id="action2"
model="stock.tracking"
name="stock.traceability.downstream"
- string="Downstream traceability"/>
+ string="Downstream traceability"/-->
- <record id="action3" model="ir.actions.act_window">
+ <!--record id="action3" model="ir.actions.act_window">
<field name="name">Downstream traceability</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.move</field>
@@ -378,7 +391,7 @@
<field name="name">Upstream traceability</field>
<field eval="'ir.actions.act_window,'+str(action5)" name="value"/>
<field eval="True" name="object"/>
- </record>
+ </record-->
<record id="view_location_form" model="ir.ui.view">
<field name="name">stock.location.form</field>
@@ -413,6 +426,7 @@
</form>
</field>
</record>
+
<record id="view_location_tree2" model="ir.ui.view">
<field name="name">stock.location.tree</field>
<field name="model">stock.location</field>
@@ -524,7 +538,7 @@
<field name="auto_refresh" eval="1"/>
<field name="target">new</field>
<field name="context">{'action_id': active_id}</field>
- </record>
+ </record>
<record model="ir.ui.view" id="stock_picking_calendar">
<field name="name">stock.picking.calendar</field>
@@ -551,7 +565,7 @@
<field name="date"/>
<field name="min_date"/>
<field name="state"/>
- <button name="%(partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-go-forward" help="Validate Picking"/>
+ <button name="%(action_partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-go-forward" help="Validate Picking"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel" help="Cancel" confirm="This operation will cancel the picking. Do you want to continue?"/>
</tree>
</field>
@@ -571,6 +585,18 @@
<field name="min_date" select="1"/>
<field name="type"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
+ <button name="%(make_picking)d"
+ states="confirmed,assigned"
+ string="Make Picking"
+ type="action"
+ icon="gtk-go-forward"
+ help="Make Picking" colspan="2"/>
+ <button name="%(return_picking)d"
+ states="done"
+ string="Return Picking"
+ type="action"
+ icon="gtk-go-back"
+ help="Return Picking" colspan="2"/>
</group>
<notebook colspan="4">
<page string="General Information">
@@ -585,55 +611,55 @@
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="date_planned"/>
- <field name="state"/>
+ <field name="state"/>
<button
- name="%(stock.track_line)d"
- string="Split in production lots"
- type="action" icon="gtk-justify-fill"
- states="draft,waiting,confirmed,assigned" />
- <button
- name="%(stock.move_scrap)d"
- string="D" type="action"
- icon="gtk-convert"
- states="draft,waiting,confirmed,assigned" />
+ name="%(stock.track_line)d"
+ string="Split in production lots"
+ type="action" icon="gtk-justify-fill"
+ states="draft,waiting,confirmed,assigned" />
+
+ <button name="%(stock.move_scrap)d"
+ string="Scrap Products" type="action"
+ icon="gtk-convert" context="{'scrap': True}"
+ states="draft,waiting,confirmed,assigned" />
</tree>
<form string="Stock Moves">
- <notebook colspan="4">
- <page string="General Information">
- <separator colspan="4" string="Move Information"/>
- <field name="location_id" select="1" domain="[('usage','=','internal')]"/>
- <field name="location_dest_id" select="1" domain="[('usage','=','internal')]"/>
- <field colspan="4" context="location=location_id" name="product_id" on_change="onchange_product_id(product_id, location_id, location_dest_id)" select="1"/>
- <field name="product_qty" select="1" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
- <field name="product_uom" select="1"/>
- <field groups="product.group_uos" name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
- <field groups="product.group_uos" name="product_uos_qty"/>
- <field colspan="4" invisible="1" name="name" select="1"/>
- <field invisible="1" name="date"/>
- <field name="date_planned"/>
- <field name="address_id" select="1" context="{'contact_display':'partner'}"/>
- <field groups="base.group_extended" name="product_packaging"/>
- <field name="prodlot_id" select="2"
- context="{'location_id':location_id, 'product_id':product_id}"
- domain="[('product_id','=?',product_id)]"
- on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
- <field groups="base.group_extended" name="tracking_id" select="2"/>
- <newline/>
- <label/>
- <button name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill"/>
+ <notebook colspan="4">
+ <page string="General Information">
+ <separator colspan="4" string="Move Information"/>
+ <field name="location_id" select="1" domain="[('usage','=','internal')]"/>
+ <field name="location_dest_id" select="1" domain="[('usage','=','internal')]"/>
+ <field colspan="4" context="location=location_id" name="product_id" on_change="onchange_product_id(product_id, location_id, location_dest_id)" select="1"/>
+ <field name="product_qty" select="1" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+ <field name="product_uom" select="1"/>
+ <field groups="product.group_uos" name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+ <field groups="product.group_uos" name="product_uos_qty"/>
+ <field colspan="4" invisible="1" name="name" select="1"/>
+ <field invisible="1" name="date"/>
+ <field name="date_planned"/>
+ <field name="address_id" select="1" context="{'contact_display':'partner'}"/>
+ <field groups="base.group_extended" name="product_packaging"/>
+ <field name="prodlot_id" select="2"
+ context="{'location_id':location_id, 'product_id':product_id}"
+ domain="[('product_id','=?',product_id)]"
+ on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
+ <field groups="base.group_extended" name="tracking_id" select="2"/>
+ <newline/>
+ <label/>
+ <button name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill"/>
<button name="%(move_scrap)d" string="Scrap Move Line" type="action" icon="gtk-justify-fill"/>
- <separator colspan="4" string="Move State"/>
- <field name="state" select="1"/>
- <group>
- <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
- <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon="gtk-no"/>
- <button name="action_cancel" states="assigned" string="Cancel" type="object" icon="gtk-cancel"/>
- </group>
- </page>
- <page string="Return Picking History">
- <field name="move_stock_return_history" nolabel="1"/>
- </page>
- </notebook>
+ <separator colspan="4" string="Move State"/>
+ <field name="state" select="1"/>
+ <group>
+ <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
+ <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon="gtk-no"/>
+ <button name="action_cancel" states="assigned" string="Cancel" type="object" icon="gtk-cancel"/>
+ </group>
+ </page>
+ <page string="Return Picking History">
+ <field name="move_stock_return_history" nolabel="1"/>
+ </page>
+ </notebook>
</form>
</field>
<group col="7" colspan="4">
@@ -646,7 +672,7 @@
<button name="draft_validate" states="draft" string="Process Now" type="object" icon="gtk-media-play"/>
<button name="action_assign" states="confirmed" string="Check Availability" type="object" icon="gtk-find"/>
<button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
- <button name="%(partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-apply"/>
+ <button name="%(action_partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-apply"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel"/>
</group>
</page>
@@ -661,12 +687,11 @@
<newline/>
<field name="move_type"/>
</page>
- </notebook>
+ </notebook>
</form>
</field>
</record>
-
<record id="view_stock_picking_filter" model="ir.ui.view">
<field name="name">stock.picking.list.select</field>
<field name="model">stock.picking</field>
@@ -683,7 +708,8 @@
<field name="location_dest_id" select="1"/>
<field name="name" select="1"/>
<field name="address_id" select="1"/>
- </group>
+ </group>
+ <newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
@@ -706,7 +732,7 @@
<field name="date" select="1"/>
<field name="min_date" select="1"/>
<field name="state" select="1"/>
- <button name="%(partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-go-forward" help="Validate Delivery"/>
+ <button name="%(action_partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-go-forward" help="Validate Delivery"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel" help="Cancel" confirm="This operation will cancel the delivery. Do you want to continue?"/>
</tree>
</field>
@@ -726,6 +752,18 @@
<field name="min_date" select="1"/>
<field name="type"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
+ <button name="%(make_picking)d"
+ states="assigned"
+ string="Make Picking"
+ type="action"
+ icon="gtk-go-forward"
+ help="Make Picking" colspan="2"/>
+ <button name="%(return_picking)d"
+ states="done"
+ string="Return Picking"
+ type="action"
+ icon="gtk-go-back"
+ help="Return Picking" colspan="2"/>
</group>
<notebook colspan="4">
<page string="General Information">
@@ -740,50 +778,49 @@
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="date_planned"/>
- <field name="state"/>
+ <field name="state"/>
<button
- name="%(stock.track_line)d"
- string="Split in production lots"
- type="action" icon="gtk-justify-fill"
- states="draft,waiting,confirmed,assigned" />
- <button
- name="%(stock.move_scrap)d"
- string="D" type="action"
- icon="gtk-convert"
- states="draft,waiting,confirmed,assigned" />
+ name="%(stock.track_line)d"
+ string="Split in production lots"
+ type="action" icon="gtk-justify-fill"
+ states="draft,waiting,confirmed,assigned" />
+ <button name="%(stock.move_scrap)d"
+ string="Scrap Products" type="action"
+ icon="gtk-convert" context="{'scrap': True}"
+ states="draft,waiting,confirmed,assigned" />
</tree>
<form string="Stock Moves">
- <notebook colspan="4">
- <page string="General Information">
- <separator colspan="4" string="Move Information"/>
- <field name="location_id" select="1" domain="[('usage','=','internal')]"/>
- <field name="location_dest_id" select="1" domain="[('usage','&lt;&gt;','view')]"/>
- <field colspan="4" context="location=location_id" name="product_id" on_change="onchange_product_id(product_id, location_id, location_dest_id)" select="1"/>
- <field name="product_qty" select="1" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
- <field name="product_uom" select="1"/>
- <field groups="product.group_uos" name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
- <field groups="product.group_uos" name="product_uos_qty"/>
- <field colspan="4" invisible="1" name="name" select="1"/>
- <field invisible="1" name="date"/>
- <field name="date_planned"/>
- <field groups="base.group_extended" name="product_packaging"/>
- <field name="prodlot_id" select="2"
- context="{'location_id':location_id, 'product_id':product_id}"
- domain="[('product_id','=?',product_id)]"
- on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
- <field groups="base.group_extended" name="tracking_id" select="1"/>
- <separator colspan="4" string="Move State"/>
- <field name="state" select="1"/>
- <group>
- <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
- <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon="gtk-find"/>
- <button name="action_cancel" states="assigned" string="Cancel" type="object" icon="gtk-cancel"/>
- </group>
- </page>
- <page string="Return Picking History">
- <field name="move_stock_return_history" nolabel="1"/>
- </page>
- </notebook>
+ <notebook colspan="4">
+ <page string="General Information">
+ <separator colspan="4" string="Move Information"/>
+ <field name="location_id" select="1" domain="[('usage','=','internal')]"/>
+ <field name="location_dest_id" select="1" domain="[('usage','&lt;&gt;','view')]"/>
+ <field colspan="4" context="location=location_id" name="product_id" on_change="onchange_product_id(product_id, location_id, location_dest_id)" select="1"/>
+ <field name="product_qty" select="1" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+ <field name="product_uom" select="1"/>
+ <field groups="product.group_uos" name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+ <field groups="product.group_uos" name="product_uos_qty"/>
+ <field colspan="4" invisible="1" name="name" select="1"/>
+ <field invisible="1" name="date"/>
+ <field name="date_planned"/>
+ <field groups="base.group_extended" name="product_packaging"/>
+ <field name="prodlot_id" select="2"
+ context="{'location_id':location_id, 'product_id':product_id}"
+ domain="[('product_id','=?',product_id)]"
+ on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
+ <field groups="base.group_extended" name="tracking_id" select="1"/>
+ <separator colspan="4" string="Move State"/>
+ <field name="state" select="1"/>
+ <group>
+ <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
+ <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon="gtk-find"/>
+ <button name="action_cancel" states="assigned" string="Cancel" type="object" icon="gtk-cancel"/>
+ </group>
+ </page>
+ <page string="Return Picking History">
+ <field name="move_stock_return_history" nolabel="1"/>
+ </page>
+ </notebook>
</form>
</field>
<group col="7" colspan="4">
@@ -796,7 +833,7 @@
<button name="draft_validate" states="draft" string="Process Now" type="object" icon="gtk-media-play"/>
<button name="action_assign" states="confirmed" string="Check Availability" type="object" icon="gtk-find"/>
<button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
- <button name="%(partial_picking)d" states="assigned" string="Products Sent" type="action" icon="gtk-go-forward"/>
+ <button name="%(action_partial_picking)d" states="assigned" string="Products Sent" type="action" icon="gtk-go-forward"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel"/>
</group>
</page>
@@ -811,7 +848,7 @@
<field name="date_done" select="2"/>
<field name="move_type"/>
</page>
- </notebook>
+ </notebook>
</form>
</field>
</record>
@@ -831,7 +868,8 @@
<field name="name" select="1"/>
<field name="address_id" select="1"/>
<field name="origin" select="1"/>
- </group>
+ </group>
+ <newline/>
<group expand="1" string="Group By..." colspan="4" col="10">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
@@ -888,11 +926,8 @@
<field name="min_date"/>
<field name="invoice_state"/>
<field name="state"/>
- <button name="%(partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-go-forward" help="Validate Picking"/>
+ <button name="%(action_partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-go-forward" help="Validate Picking"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel" help="Cancel" confirm="This operation will cancel the picking. Do you want to continue?"/>
- <button name="%(wizard_invoice_onshipping)d" states="done" string="Invoice" type="action"
- icon="gtk-execute" help="Create invoice"
- attrs="{'invisible': [('invoice_state', '!=', '2binvoiced')]}" />
</tree>
</field>
</record>
@@ -911,6 +946,18 @@
<field name="backorder_id" select="2" readonly="1"/>
<field name="origin" select="2" readonly="1"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
+ <button name="%(make_picking)d"
+ states="assigned"
+ string="Make Picking"
+ type="action"
+ icon="gtk-go-forward"
+ help="Make Picking" colspan="2"/>
+ <button name="%(return_picking)d"
+ states="done"
+ string="Return Picking"
+ type="action"
+ icon="gtk-go-back"
+ help="Return Picking" colspan="2"/>
</group>
<notebook colspan="4">
<page string="General Information">
@@ -925,53 +972,53 @@
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="date_planned"/>
- <field name="state"/>
+ <field name="state"/>
<button
- name="%(stock.track_line)d"
- string="Split in production lots"
- type="action" icon="gtk-justify-fill"
- states="draft,waiting,confirmed,assigned" />
- <button
- name="%(stock.move_scrap)d"
- string="D" type="action"
- icon="gtk-convert"
- states="draft,waiting,confirmed,assigned" />
+ name="%(stock.track_line)d"
+ string="Split in production lots"
+ type="action" icon="gtk-justify-fill"
+ states="draft,waiting,confirmed,assigned" />
+ <button
+ name="%(stock.move_scrap)d"
+ string="D" type="action"
+ icon="gtk-convert"
+ states="draft,waiting,confirmed,assigned" />
</tree>
<form string="Stock Moves">
- <notebook colspan="4">
- <page string="General Information">
- <separator colspan="4" string="Move Information"/>
- <field name="location_id" select="1" domain="[('usage','=','internal')]"/>
- <field name="location_dest_id" select="1" domain="[('usage','&lt;&gt;','view')]"/>
- <field colspan="4" context="location=location_id" name="product_id" on_change="onchange_product_id(product_id, location_id, location_dest_id)" select="1"/>
- <field name="product_qty" select="1" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" />
- <field name="product_uom" select="1"/>
- <field groups="product.group_uos" name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
- <field groups="product.group_uos" name="product_uos_qty"/>
- <field colspan="4" invisible="1" name="name" select="1"/>
- <field invisible="1" name="date"/>
- <field name="date_planned"/>
- <field groups="base.group_extended" name="product_packaging"/>
- <field name="prodlot_id" select="1"
- context="{'location_id':location_id, 'product_id':product_id}"
- domain="[('product_id','=?',product_id)]"
- on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
- <field groups="base.group_extended" name="tracking_id" select="1"/>
- <label/>
- <button name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill"/>
- <separator colspan="4" string="Move State"/>
- <field name="state" select="1"/>
- <group>
- <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
- <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon="gtk-no"/>
- <button name="action_cancel" states="assigned" string="Cancel" type="object" icon="gtk-cancel"/>
- </group>
- </page>
- <page string="Return Picking History">
- <field name="move_stock_return_history" nolabel="1"/>
- </page>
- </notebook>
- </form>
+ <notebook colspan="4">
+ <page string="General Information">
+ <separator colspan="4" string="Move Information"/>
+ <field name="location_id" select="1" domain="[('usage','=','internal')]"/>
+ <field name="location_dest_id" select="1" domain="[('usage','&lt;&gt;','view')]"/>
+ <field colspan="4" context="location=location_id" name="product_id" on_change="onchange_product_id(product_id, location_id, location_dest_id)" select="1"/>
+ <field name="product_qty" select="1" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" />
+ <field name="product_uom" select="1"/>
+ <field groups="product.group_uos" name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+ <field groups="product.group_uos" name="product_uos_qty"/>
+ <field colspan="4" invisible="1" name="name" select="1"/>
+ <field invisible="1" name="date"/>
+ <field name="date_planned"/>
+ <field groups="base.group_extended" name="product_packaging"/>
+ <field name="prodlot_id" select="1"
+ context="{'location_id':location_id, 'product_id':product_id}"
+ domain="[('product_id','=?',product_id)]"
+ on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
+ <field groups="base.group_extended" name="tracking_id" select="1"/>
+ <label/>
+ <button name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill"/>
+ <separator colspan="4" string="Move State"/>
+ <field name="state" select="1"/>
+ <group>
+ <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
+ <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon="gtk-no"/>
+ <button name="action_cancel" states="assigned" string="Cancel" type="object" icon="gtk-cancel"/>
+ </group>
+ </page>
+ <page string="Return Picking History">
+ <field name="move_stock_return_history" nolabel="1"/>
+ </page>
+ </notebook>
+ </form>
</field>
<group col="7" colspan="4">
<label colspan="6"/>
@@ -983,10 +1030,13 @@
<button name="draft_validate" states="draft" string="Process Now" type="object" icon="gtk-yes"/>
<button name="action_assign" states="confirmed" string="Check Availability" type="object" groups="base.group_extended" icon="gtk-apply"/>
<button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
- <button name="%(partial_picking)d" states="assigned" string="Picking Done" type="action" icon="gtk-execute"/>
+ <button name="%(action_partial_picking)d" states="assigned" string="Picking Done" type="action" icon="gtk-execute"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel"/>
</group>
</page>
+ <page string="Delivery Info">
+ <field colspan="4" name="delivery_line" nolabel="1"/>
+ </page>
<page string="Notes">
<field colspan="4" name="note" nolabel="1"/>
</page>
@@ -1003,25 +1053,26 @@
</field>
</record>
- <record id="view_picking_out_search" model="ir.ui.view">
+ <record id="view_picking_out_search" model="ir.ui.view">
<field name="name">stock.picking.out.search</field>
<field name="model">stock.picking</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Picking list">
- <group col="8" colspan="4">
+ <group col="8" colspan="4">
<filter icon="terp-stock" string="Available" domain="[('state','=','assigned')]" help="Assigned Outgoing Orders"/>
<filter icon="terp-stock" string="Confirmed" domain="[('state','=','confirmed')]" help="Confirmed Outgoing Orders"/>
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="address_id" select="1"/>
<field name="company_id" select="1" widget="selection"/>
- </group>
- <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
+ </group>
+ <newline/>
+ <group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
- <filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
- </group>
+ <filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
+ </group>
</search>
</field>
</record>
@@ -1053,7 +1104,7 @@
<field name="view_mode">calendar</field>
<field name="act_window_id" ref="action_picking_tree"/>
</record>
-<!-- <menuitem action="action_picking_tree" id="menu_action_picking_tree" parent="menu_stock_root" sequence="19"/>-->
+ <menuitem action="action_picking_tree" id="menu_action_picking_tree" parent="menu_stock_warehouse_mgmt" sequence="5"/>
<record id="view_picking_in_tree" model="ir.ui.view">
<field name="name">stock.picking.in.tree</field>
@@ -1069,7 +1120,7 @@
<field name="min_date"/>
<field name="invoice_state"/>
<field name="state"/>
- <button name="%(partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-ok" help="Receive products"/>
+ <button name="%(action_partial_picking)d" states="assigned" string="Validate" type="action" icon="gtk-ok" help="Receive products"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel" help="Cancel" confirm="This operation will cancel the shipment. Do you want to continue?" />
</tree>
</field>
@@ -1090,6 +1141,18 @@
<field name="invoice_state" select="2" string="Invoice Control"/>
<field name="type"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
+ <button name="%(make_picking)d"
+ states="confirmed,assigned"
+ string="Make Picking"
+ type="action"
+ icon="gtk-go-forward"
+ help="Make Picking" colspan="2"/>
+ <button name="%(return_picking)d"
+ states="done"
+ string="Return Picking"
+ type="action"
+ icon="gtk-go-back"
+ help="Return Picking" colspan="2"/>
</group>
<notebook colspan="4">
<page string="General Information">
@@ -1102,50 +1165,49 @@
<field name="prodlot_id"/>
<field name="state"/>
<button
- name="%(stock.track_line)d"
- string="Split in production lots"
- type="action" icon="gtk-justify-fill"
- states="draft,waiting,confirmed,assigned" />
- <button
- name="%(stock.move_scrap)d"
- string="D" type="action"
- icon="gtk-convert"
- states="draft,waiting,confirmed,assigned" />
- </tree>
+ name="%(stock.track_line)d"
+ string="Split in production lots"
+ type="action" icon="gtk-justify-fill"
+ states="draft,waiting,confirmed,assigned" />
+ <button name="%(stock.move_scrap)d"
+ string="Scrap Products" type="action"
+ icon="gtk-convert" context="{'scrap': True}"
+ states="draft,waiting,confirmed,assigned" />
+ </tree>
<form string="Stock Moves">
- <notebook colspan="4">
- <page string="General Information">
- <separator colspan="4" string="Move Information"/>
- <field name="location_id" select="1" domain="[('usage','&lt;&gt;','view')]"/>
- <field domain="[('usage','=','internal')]" name="location_dest_id" select="1"/>
- <field colspan="4" context="location=location_id" name="product_id" on_change="onchange_product_id(product_id, location_id, location_dest_id)" select="1"/>
- <field name="product_qty" select="1" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
- <field name="product_uom" select="1"/>
- <field groups="product.group_uos" name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
- <field groups="product.group_uos" name="product_uos_qty"/>
- <field colspan="4" invisible="1" name="name" select="1"/>
- <field groups="base.group_extended" name="date_planned"/>
- <newline/>
- <newline/>
- <field groups="base.group_extended" name="product_packaging"/>
- <newline/>
- <field name="prodlot_id" select="1"
- context="{'location_id':location_id, 'product_id':product_id}"
- domain="[('product_id','=?',product_id)]"
- on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
- <field groups="base.group_extended" name="tracking_id" select="1"/>
- <newline/>
- <label/>
- <button groups="base.group_extended" name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill"/>
- <separator colspan="4" string="Move State"/>
- <field name="state" select="1"/>
- <group>
- <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon=""/>
- <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon=""/>
- <button name="action_cancel" states="assigned" string="Cancel" type="object" icon=""/>
- </group>
- </page>
- <page string="Return Picking History">
+ <notebook colspan="4">
+ <page string="General Information">
+ <separator colspan="4" string="Move Information"/>
+ <field name="location_id" select="1" domain="[('usage','&lt;&gt;','view')]"/>
+ <field domain="[('usage','=','internal')]" name="location_dest_id" select="1"/>
+ <field colspan="4" context="location=location_id" name="product_id" on_change="onchange_product_id(product_id, location_id, location_dest_id)" select="1"/>
+ <field name="product_qty" select="1" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+ <field name="product_uom" select="1"/>
+ <field groups="product.group_uos" name="product_uos" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+ <field groups="product.group_uos" name="product_uos_qty"/>
+ <field colspan="4" invisible="1" name="name" select="1"/>
+ <field groups="base.group_extended" name="date_planned"/>
+ <newline/>
+ <newline/>
+ <field groups="base.group_extended" name="product_packaging"/>
+ <newline/>
+ <field name="prodlot_id" select="1"
+ context="{'location_id':location_id, 'product_id':product_id}"
+ domain="[('product_id','=?',product_id)]"
+ on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
+ <field groups="base.group_extended" name="tracking_id" select="1"/>
+ <newline/>
+ <label/>
+ <button groups="base.group_extended" name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill"/>
+ <separator colspan="4" string="Move State"/>
+ <field name="state" select="1"/>
+ <group>
+ <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon=""/>
+ <button name="cancel_assign" states="assigned" string="Cancel Availability" type="object" icon=""/>
+ <button name="action_cancel" states="assigned" string="Cancel" type="object" icon=""/>
+ </group>
+ </page>
+ <page string="Return Picking History">
<field name="move_stock_return_history" nolabel="1"/>
</page>
</notebook>
@@ -1161,10 +1223,13 @@
<button name="draft_validate" states="draft" string="Process Now" type="object" icon="gtk-media-play"/>
<button name="action_assign" states="confirmed" string="Check Availability" type="object" icon="gtk-find"/>
<button name="force_assign" states="confirmed" string="Force Availability" type="object" groups="base.group_extended" icon="gtk-jump-to"/>
- <button name="%(partial_picking)d" states="assigned" string="Products Received" type="action" icon="gtk-ok"/>
+ <button name="%(action_partial_picking)d" states="assigned" string="Products Received" type="action" icon="gtk-ok"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="Cancel" icon="gtk-cancel"/>
</group>
</page>
+ <page string="Delivery Info">
+ <field colspan="4" name="delivery_line" nolabel="1"/>
+ </page>
<page string="Notes">
<field colspan="4" name="note" nolabel="1"/>
</page>
@@ -1187,7 +1252,8 @@
<field name="name" select="1"/>
<field name="address_id" select="1"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company" />
- </group>
+ </group>
+ <newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
@@ -1240,7 +1306,8 @@
<field name="name" select="1"/>
<field name="origin" select="1"/>
<field name="company_id" select="1" widget="selection"/>
- </group>
+ </group>
+ <newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
@@ -1278,7 +1345,7 @@
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="date_planned"/>
- <field name="state"/>
+ <field name="state"/>
</tree>
</field>
</record>
@@ -1297,6 +1364,7 @@
<group colspan="2" col="2">
<separator colspan="2" string="Move Information"/>
<field name="name" select="2"/>
+ <field name="delivered_id"/>
<field name="product_id" select="1" on_change="onchange_product_id(product_id,location_id,location_dest_id)"/>
<field name="product_qty" select="2" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
<field name="product_uom" select="2"/>
@@ -1317,17 +1385,17 @@
<field name="date"/>
<field name="date_planned"/>
<field name="priority"/>
- </group>
+ </group>
<group colspan="2" col="4">
- <separator string="Tracability" colspan="4" />
+ <separator string="Traceability" colspan="4" />
<field name="tracking_id" select="1" colspan="4" />
<field name="prodlot_id" select="2"
context="{'location_id':location_id, 'product_id':product_id}"
domain="[('product_id','=?',product_id)]"
on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
<button name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill" colspan="2" />
- </group>
+ </group>
</page>
<page string="Return Picking History">
<field name="move_stock_return_history" nolabel="1"/>
@@ -1359,7 +1427,8 @@
<field name="location_id" select="1"/>
<field name="location_dest_id" select="1"/>
<field name="product_id" select="1"/>
- </group>
+ </group>
+ <newline/>
<group expand="1" string="Group By..." colspan="4" col="8">
<filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
@@ -1398,11 +1467,11 @@
</record>
<menuitem action="action_picking_all" id="menu_action_picking_all" parent="menu_stock_warehouse_mgmt" sequence="3"/>
- ====================================
+ ====================================
Reception Picking (By Stock Move)
====================================
- <record id="view_move_tree_reception_picking" model="ir.ui.view">
+ <record id="view_move_tree_reception_picking" model="ir.ui.view">
<field name="name">stock.move.tree2</field>
<field name="model">stock.move</field>
<field name="type">tree</field>
@@ -1410,7 +1479,7 @@
<field name="arch" type="xml">
<tree colors="grey:state in ('cancel','done');black:state not in ('cancel','done')" string="Moves">
<field name="picking_id" string="Reference"/>
- <field name="origin" string="Purchase Order"/>
+ <field name="origin" string="Latest Requisition"/>
<field name="partner_id" string="Supplier"/>
<field name="product_id"/>
<field name="product_qty" />
@@ -1419,89 +1488,91 @@
<field name="date_planned"/>
<field name="backorder_id"/>
<field name="state"/>
- <button name="%(partial_move)d" string="Partial" type="action" states="assigned" icon="gtk-justify-fill"/>
+ <button name="%(action_partial_move)d" string="Partial" type="action" states="assigned" icon="gtk-justify-fill"/>
<button name="action_cancel" states="assigned,confirmed" string="Cancel" type="object" icon="gtk-cancel"/>
</tree>
</field>
</record>
- <record id="view_move_form_reception_picking" model="ir.ui.view">
+ <record id="view_move_form_reception_picking" model="ir.ui.view">
<field name="name">stock.move.form2</field>
<field name="model">stock.move</field>
<field name="type">form</field>
<field eval="6" name="priority"/>
<field name="arch" type="xml">
<form string="Moves">
- <notebook colspan="4">
- <page string="General Information">
- <separator colspan="4" string="Move Information"/>
- <field name="location_id" select="1"/>
- <field name="location_dest_id" select="1"/>
- <field colspan="4" name="product_id" select="1" on_change="onchange_product_id(product_id,location_id,location_dest_id)"/>
- <field name="product_qty" select="2" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
- <field name="product_uom" select="2"/>
- <field name="product_uos" select="2"/>
- <field colspan="4" name="name" select="2"/>
- <field name="date"/>
- <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
- <field name="date_planned"/>
- <field name="priority"/>
- <field name="address_id" select="2" context="{'contact_display':'partner'}"/>
- <newline/>
- <field name="picking_id" select="2"/>
- <newline/>
- <field name="prodlot_id" select="2"
- context="{'location_id':location_id, 'product_id':product_id}"
- domain="[('product_id','=?',product_id)]"
- on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
- <field name="tracking_id" select="2"/>
- <newline/>
- <label/>
- <button name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill"/>
- <separator colspan="4" string="Move State"/>
- <field name="state" select="1"/>
- <group col="5" colspan="2">
- <button name="action_confirm" states="draft" string="Confirm" type="object" icon="gtk-apply"/>
- <button name="action_assign" states="confirmed" string="Set Available" type="object" icon="gtk-yes"/>
- <button name="action_cancel" states="assigned,confirmed" string="Cancel" type="object" icon="gtk-cancel"/>
- <button name="%(partial_move)d" states="assigned" string="Partial" type="action" icon="gtk-justify-fill"/>
- <button name="action_done" states="assigned" string="Done" type="object" icon="gtk-jump-to"/>
- </group>
- </page>
- <page string="Return Picking History">
- <field name="move_stock_return_history" nolabel="1"/>
- </page>
- </notebook>
+ <notebook colspan="4">
+ <page string="General Information">
+ <separator colspan="4" string="Move Information"/>
+ <field name="delivered_id"/>
+ <field name="location_id" select="1"/>
+ <field name="location_dest_id" select="1"/>
+ <field colspan="4" name="product_id" select="1" on_change="onchange_product_id(product_id,location_id,location_dest_id)"/>
+ <field name="product_qty" select="2" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
+ <field name="product_uom" select="2"/>
+ <field name="product_uos" select="2"/>
+ <field colspan="4" name="name" select="2"/>
+ <field name="date"/>
+ <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
+ <field name="date_planned"/>
+ <field name="priority"/>
+ <field name="address_id" select="2" context="{'contact_display':'partner'}"/>
+ <newline/>
+ <field name="picking_id" select="2"/>
+ <newline/>
+ <field name="prodlot_id" select="2"
+ context="{'location_id':location_id, 'product_id':product_id}"
+ domain="[('product_id','=?',product_id)]"
+ on_change="onchange_lot_id(prodlot_id,product_qty, location_id, product_id)"/>
+ <field name="tracking_id" select="2"/>
+ <newline/>
+ <label/>
+ <button name="%(track_line)d" string="Split in production lots" type="action" icon="gtk-justify-fill"/>
+ <separator colspan="4" string="Move State"/>
+ <field name="state" select="1"/>
+ <group col="5" colspan="2">
+ <button name="action_confirm" states="draft" string="Confirm" type="object" icon="gtk-apply"/>
+ <button name="action_assign" states="confirmed" string="Set Available" type="object" icon="gtk-yes"/>
+ <button name="action_cancel" states="assigned,confirmed" string="Cancel" type="object" icon="gtk-cancel"/>
+ <button name="%(action_partial_move)d" states="assigned" string="Partial" type="action" icon="gtk-justify-fill"/>
+ <button name="action_done" states="assigned" string="Done" type="object" icon="gtk-jump-to"/>
+ </group>
+ </page>
+ <page string="Return Picking History">
+ <field name="move_stock_return_history" nolabel="1"/>
+ </page>
+ </notebook>
</form>
</field>
</record>
- <record id="view_move_search_reception_picking" model="ir.ui.view">
+ <record id="view_move_search_reception_picking" model="ir.ui.view">
<field name="name">stock.move.search2</field>
<field name="model">stock.move</field>
<field name="type">search</field>
<field eval="6" name="priority"/>
<field name="arch" type="xml">
- <search string="Stock Moves">
- <group col="8" colspan="4">
- <filter icon="terp-stock" string="To Receive" domain="[('state','in',('confirmed','assigned'))]" default="1" help="Stock to be received"/>
- <filter icon="terp-stock" string="Back Orders" domain="[('backorder_id','!=',False)]" help="Back Orders"/>
- <filter icon="terp-stock" string="Planned Today" domain="[('date_planned::date','=',time.strftime('%%Y-%%m-%%d'))]" help="Orders planned for today"/>
- <separator orientation="vertical"/>
- <field name="origin" string="Purchase Order" select="1"/>
- <field name="partner_id" string="Supplier" select="1"/>
- <field name="product_id"/>
+ <search string="Stock Moves">
+ <group col="8" colspan="4">
+ <filter icon="terp-stock" string="To Receive" domain="[('state','in',('confirmed','assigned'))]" default="1" help="Stock to be received"/>
+ <filter icon="terp-stock" string="Back Orders" domain="[('backorder_id','!=',False)]" help="Back Orders"/>
+ <filter icon="terp-stock" string="Planned Today" domain="[('date_planned::date','=',time.strftime('%%Y-%%m-%%d'))]" help="Orders planned for today"/>
+ <separator orientation="vertical"/>
+ <field name="origin" string="Latest Requisition" select="1"/>
+ <field name="partner_id" string="Supplier" select="1"/>
+ <field name="product_id"/>
+ </group>
+ <newline/>
+ <group expand="1" string="Group By..." colspan="4" col="8">
+ <filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
+ <filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
+ <filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
</group>
- <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
- <filter string="Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
- <filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
- <filter string="Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>
- </group>
- </search>
+ </search>
</field>
</record>
- <record id="action_reception_picking_move" model="ir.actions.act_window">
+ <record id="action_reception_picking_move" model="ir.actions.act_window">
<field name="name">Incoming Products</field>
<field name="res_model">stock.move</field>
<field name="type">ir.actions.act_window</field>
@@ -1513,17 +1584,17 @@
</record>
<record model="ir.actions.act_window.view" id="action_move_reception_picking_tree">
- <field name="sequence" eval="1"/>
- <field name="view_mode">tree</field>
- <field name="view_id" ref="view_move_tree_reception_picking"/>
- <field name="act_window_id" ref="action_reception_picking_move"/>
- </record>
+ <field name="sequence" eval="1"/>
+ <field name="view_mode">tree</field>
+ <field name="view_id" ref="view_move_tree_reception_picking"/>
+ <field name="act_window_id" ref="action_reception_picking_move"/>
+ </record>
<record model="ir.actions.act_window.view" id="action_move_reception_picking_form">
- <field name="sequence" eval="2"/>
- <field name="view_mode">form</field>
- <field name="view_id" ref="view_move_form_reception_picking"/>
- <field name="act_window_id" ref="action_reception_picking_move"/>
- </record>
+ <field name="sequence" eval="2"/>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="view_move_form_reception_picking"/>
+ <field name="act_window_id" ref="action_reception_picking_move"/>
+ </record>
<!-- <menuitem action="action_reception_picking_move" id="menu_action_reception_picking_move" parent="menu_stock_warehouse_mgmt" sequence="4"/>-->
@@ -1606,82 +1677,132 @@
<field name="key2">tree_but_open</field>
<field name="model">stock.location</field>
<field name="name">Open Products</field>
- <field eval="'ir.actions.wizard,%d'%ref('location_product')" name="value"/>
+ <field eval="'ir.actions.act_window,%d'%action_view_stock_location_product" name="value"/>
<field eval="True" name="object"/>
</record>  
- <!-- Graph Views -->
- <!-- Products To Received Vs Planned -->
- <record model="ir.ui.view" id="view_move_graph_reception_picking_tree">
- <field name="name">Products To Received</field>
- <field name="model">report.products.to.received.planned</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <tree string="Products To Received" >
- <field name="qty" />
- <field name="planned_qty" />
- <field name="date"/>
- </tree>
- </field>
- </record>
-
- <record model="ir.ui.view" id="view_move_graph_reception_picking">
- <field name="name">Products To Received</field>
- <field name="model">report.products.to.received.planned</field>
- <field name="type">graph</field>
- <field name="arch" type="xml">
- <graph string="Products To Received" type="bar" orientation="vertical">
- <field name="date"/>
- <field name="qty" operator="+"/>
- <field name="planned_qty" operator="+"/>
- </graph>
- </field>
- </record>
-
- <record id="action_move_graph_reception_picking" model="ir.actions.act_window">
- <field name="name">Number of Products to receive Vs planned</field>
- <field name="res_model">report.products.to.received.planned</field>
- <field name="type">ir.actions.act_window</field>
- <field name="view_type">form</field>
- <field name="view_mode">graph,tree</field>
- <field name="view_id" ref="view_move_graph_reception_picking"/>
- </record>
-
- <!-- Delivery Product Vs Planned -->
- <record model="ir.ui.view" id="view_move_delivery_products_planned_tree">
- <field name="name">Delivery Products</field>
- <field name="model">report.delivery.products.planned</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <tree string="Products To Received" >
- <field name="qty" />
- <field name="planned_qty" />
- <field name="date"/>
- </tree>
- </field>
- </record>
-
- <record model="ir.ui.view" id="view_move_delivery_products_planned_graph">
- <field name="name">Delivery Products</field>
- <field name="model">report.delivery.products.planned</field>
- <field name="type">graph</field>
- <field name="arch" type="xml">
- <graph string="Products To Received" type="bar" orientation="vertical">
- <field name="date"/>
- <field name="qty" operator="+"/>
- <field name="planned_qty" operator="+"/>
- </graph>
- </field>
- </record>
-
- <record id="action_move_delivery_products_planned" model="ir.actions.act_window">
- <field name="name">Delivery Products Vs Planned</field>
- <field name="res_model">report.delivery.products.planned</field>
- <field name="type">ir.actions.act_window</field>
- <field name="view_type">form</field>
- <field name="view_mode">graph,tree</field>
- <field name="view_id" ref="view_move_delivery_products_planned_graph"/>
- </record>
+ <!-- Graph Views -->
+ <!-- Products To Received Vs Planned -->
+ <record model="ir.ui.view" id="view_move_graph_reception_picking_tree">
+ <field name="name">Products To Received</field>
+ <field name="model">report.products.to.received.planned</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Products To Received" >
+ <field name="qty" />
+ <field name="planned_qty" />
+ <field name="date"/>
+ </tree>
+ </field>
+ </record>
+
+ <record model="ir.ui.view" id="view_move_graph_reception_picking">
+ <field name="name">Products To Received</field>
+ <field name="model">report.products.to.received.planned</field>
+ <field name="type">graph</field>
+ <field name="arch" type="xml">
+ <graph string="Products To Received" type="bar" orientation="vertical">
+ <field name="date"/>
+ <field name="qty" operator="+"/>
+ <field name="planned_qty" operator="+"/>
+ </graph>
+ </field>
+ </record>
+
+ <record id="action_move_graph_reception_picking" model="ir.actions.act_window">
+ <field name="name">Number of Products to receive Vs planned</field>
+ <field name="res_model">report.products.to.received.planned</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">graph,tree</field>
+ <field name="view_id" ref="view_move_graph_reception_picking"/>
+ </record>
+
+ <!-- Delivery Product Vs Planned -->
+ <record model="ir.ui.view" id="view_move_delivery_products_planned_tree">
+ <field name="name">Delivery Products</field>
+ <field name="model">report.delivery.products.planned</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Products To Received" >
+ <field name="qty" />
+ <field name="planned_qty" />
+ <field name="date"/>
+ </tree>
+ </field>
+ </record>
+
+ <record model="ir.ui.view" id="view_move_delivery_products_planned_graph">
+ <field name="name">Delivery Products</field>
+ <field name="model">report.delivery.products.planned</field>
+ <field name="type">graph</field>
+ <field name="arch" type="xml">
+ <graph string="Products To Received" type="bar" orientation="vertical">
+ <field name="date"/>
+ <field name="qty" operator="+"/>
+ <field name="planned_qty" operator="+"/>
+ </graph>
+ </field>
+ </record>
+ <record id="action_move_delivery_products_planned" model="ir.actions.act_window">
+ <field name="name">Delivery Products Vs Planned</field>
+ <field name="res_model">report.delivery.products.planned</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">graph,tree</field>
+ <field name="view_id" ref="view_move_delivery_products_planned_graph"/>
+ </record>
+ <!-- Product Delivered -->
+ <record id="view_stock_delivery_form" model="ir.ui.view">
+ <field name="name">stock.delivery.from</field>
+ <field name="model">stock.delivery</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Product">
+ <field name="name"/>
+ <field name="date"/>
+ <field name="partner_id"/>
+ <field name="address_id"/>
+ <field name="picking_id"/>
+ <separator string="Product Delivered Information" colspan="4" />
+ <field name="move_delivered" colspan="4" nolabel="1" widget="one2many" mode="tree,form">
+ <tree string="Stock Moves" editable="top">
+ <field name="picking_id" string="Reference"/>
+ <field name="origin" string="Latest Requisition"/>
+ <field name="partner_id" string="Supplier"/>
+ <field name="product_id"/>
+ <field name="product_qty" />
+ <field name="product_uom" string="UOM"/>
+ <field name="prodlot_id" string="Lot"/>
+ </tree>
+ </field>
+ </form>
+ </field>
+ </record>
+ <record id="view_stock_delivery_tree" model="ir.ui.view">
+ <field name="name">stock.delivery.tree</field>
+ <field name="model">stock.delivery</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Delivered Product">
+ <field name="name"/>
+ <field name="date"/>
+ <field name="partner_id"/>
+ <field name="address_id"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="action_stock_delivery" model="ir.actions.act_window">
+ <field name="name">Delivered Products</field>
+ <field name="res_model">stock.delivery</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form,tree</field>
+ <field name="view_id" ref="view_stock_delivery_tree"/>
+ </record>
+
+ <menuitem action="action_stock_delivery" id="menu_action_picking_all" parent="menu_traceability" sequence="4"/>
</data>
</openerp>
diff --git a/addons/stock/stock_wizard.xml b/addons/stock/stock_wizard.xml
index 5db1269d42c..f9a2dfc93b0 100644
--- a/addons/stock/stock_wizard.xml
+++ b/addons/stock/stock_wizard.xml
@@ -13,20 +13,23 @@
multi="True"
name="stock.move.split"
string="Split move line"/>
-
- <wizard
- id="partial_picking"
- model="stock.picking"
- multi="True"
- name="stock.partial_picking"
- string="Partial picking"/>
-
- <wizard
- id="partial_move"
- model="stock.move"
- multi="True"
- name="stock.partial_move"
- string="Partial Move"/>
+
+
+ <wizard
+ id="make_picking"
+ model="stock.picking"
+ menu="False"
+ keyword="client_action_multi"
+ name="stock.picking.make"
+ string="Make Picking"/>
+
+ <wizard
+ id="return_picking"
+ model="stock.picking"
+ menu="False"
+ keyword="client_action_multi"
+ name="stock.return.picking"
+ string="Return picking"/>
<wizard
id="split_inventory_lots"
@@ -35,49 +38,13 @@
name="stock.inventory.line.split"
string="Split inventory lines"/>
- <wizard id="make_picking" model="stock.picking" multi="True" name="stock.picking.make" string="Make picking"/>
-
- <wizard
- id="return_picking"
- model="stock.picking"
- name="stock.return.picking"
- string="Return picking"/>
-
- <wizard
- id="wizard_invoice_onshipping"
- keyword="client_action_multi"
- model="stock.picking"
- name="stock.invoice_onshipping"
- string="Create invoice"/>
-
- <wizard
- string="Set Stock to 0"
- model="stock.inventory"
- name="inventory.merge.stock.zero"
- keyword="client_action_multi"
- id="wizard_merge_inventory_zero"/>
-
- <wizard
+ <!--wizard
string="Merge inventories"
model="stock.inventory"
name="inventory.merge"
keyword="client_action_multi"
multi="True"
- id="wizard_merge_inventory"/>
+ id="wizard_merge_inventory"/-->
- <wizard
- string="Fill Inventory"
- model="stock.inventory"
- name="stock.fill_inventory"
- keyword="client_action_multi"
- id="wizard_fill_inventory"
- />
-
- <wizard
- id="location_product"
- model="stock.location"
- name="stock.location.products"
- string="Products by Location"/>
-
- </data>
+ </data>
</openerp>
diff --git a/addons/stock/wizard/__init__.py b/addons/stock/wizard/__init__.py
index 6a15449a151..6f5a83a07b3 100644
--- a/addons/stock/wizard/__init__.py
+++ b/addons/stock/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,24 +15,26 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import stock_traceability
-import wizard_partial_picking
-import wizard_partial_move
+import stock_move
+import stock_partial_picking
+import stock_partial_move
import wizard_picking_make
import wizard_replacement
import wizard_return
import wizard_split_lot_line
import wizard_ups
-import wizard_invoice_onshipping
-import wizard_location_product
-import wizard_inventory
-import wizard_split_inventory_lots
-import inventory_merge_zero
import inventory_merge
+import stock_inventory_set_stock_zero
+import stock_fill_inventory
+import stock_inventory_line_split
+import stock_invoice_onshipping
+import stock_location_product
+import stock_change_standard_price
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/inventory_merge.py b/addons/stock/wizard/inventory_merge.py
deleted file mode 100644
index 7be8eb2b3e3..00000000000
--- a/addons/stock/wizard/inventory_merge.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-
-import wizard
-import pooler
-from tools.translate import _
-
-
-_form = """<?xml version="1.0"?>
-<form string="Merge inventories">
- <separator colspan="4" string="Merge inventories" />
- <label string="Do you want to merge theses inventories ?"/>
-</form>
-"""
-
-
-def do_merge(self, cr, uid, data, context):
-
- invent_obj = pooler.get_pool(cr.dbname).get('stock.inventory')
- invent_line_obj = pooler.get_pool(cr.dbname).get('stock.inventory.line')
-
- invent_lines = {}
-
- if len(data['ids']) < 2:
- raise wizard.except_wizard(_('Warning'),
- _('Please select at least two inventories.'))
-
-
-
- for inventory in invent_obj.browse(cr, uid, data['ids'], context=context):
- if inventory.state == "done":
- raise wizard.except_wizard(_('Warning'),
- _('Merging is only allowed on draft inventories.'))
-
- for line in inventory.inventory_line_id:
- key = (line.location_id.id, line.product_id.id, line.product_uom.id)
- if key in invent_lines:
- invent_lines[key] += line.product_qty
- else:
- invent_lines[key] = line.product_qty
-
-
- new_invent = invent_obj.create(cr, uid, {
- 'name': 'Merged inventory'
- }, context=context)
-
- for key, quantity in invent_lines.items():
- invent_line_obj.create(cr, uid, {
- 'inventory_id': new_invent,
- 'location_id': key[0],
- 'product_id': key[1],
- 'product_uom': key[2],
- 'product_qty': quantity,
- })
-
- return {}
-
-
-class merge_inventory(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : _form,
- 'fields' : {},
- 'state' : [('end', 'Cancel', 'gtk-cancel'),
- ('merge', 'Yes', 'gtk-apply', True) ]}
- },
- 'merge' : {
- 'actions' : [],
- 'result' : {'type' : 'action',
- 'action': do_merge,
- 'state' : 'end'}
- },
- }
-merge_inventory("inventory.merge")
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/inventory_merge_zero.py b/addons/stock/wizard/inventory_merge_zero.py
index 3aa2b1e9fd9..63296b69875 100644
--- a/addons/stock/wizard/inventory_merge_zero.py
+++ b/addons/stock/wizard/inventory_merge_zero.py
@@ -19,76 +19,66 @@
#
##############################################################################
-
-import wizard
-import pooler
+from osv import fields, osv
+from service import web_services
+from tools.misc import UpdateableStr, UpdateableDict
from tools.translate import _
+import netsvc
+import pooler
+import time
+import wizard
-_form = """<?xml version="1.0"?>
-<form string="Set Stock to Zero">
- <separator colspan="4" string="Set Stocks to Zero" />
- <field name="location_id"/>
- <newline/>
- <label colspan="4" string="Do you want to set stocks to zero ?"/>
-</form>
-"""
-_inventory_fields = {
- 'location_id' : {
- 'string':'Location',
- 'type':'many2one',
- 'relation':'stock.location',
- 'required':True
- }
-}
-
-
-def do_merge(self, cr, uid, data, context):
- invent_obj = pooler.get_pool(cr.dbname).get('stock.inventory')
- invent_line_obj = pooler.get_pool(cr.dbname).get('stock.inventory.line')
- prod_obj = pooler.get_pool(cr.dbname).get('product.product')
-
- if len(data['ids']) <> 1:
- raise wizard.except_wizard(_('Warning'),
- _('Please select one and only one inventory !'))
-
- loc = str(data['form']['location_id'])
-
- cr.execute('select distinct location_id,product_id from stock_inventory_line where inventory_id=%s', (data['ids'][0],))
- inv = cr.fetchall()
- cr.execute('select distinct product_id from stock_move where location_dest_id=%s or location_id=%s',(loc,loc,))
- stock = cr.fetchall()
- for s in stock:
- if (loc,s[0]) not in inv:
- p = prod_obj.browse(cr, uid, s[0])
- invent_line_obj.create(cr, uid, {
- 'inventory_id': data['ids'][0],
- 'location_id': loc,
- 'product_id': s[0],
- 'product_uom': p.uom_id.id,
- 'product_qty': 0.0,
- })
- return {}
-
+class inventory_set_stock_zero(osv.osv_memory):
+ _name = "stock.inventory.set.stock.zero"
+ _description = "Set Stock to 0"
+ _columns = {
+ 'location_id': fields.many2one('stock.location', 'Location', required=True),
+ }
+
+ def do_merge(self, cr, uid, ids, context):
+ """
+ To set stock to Zero
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ invent_obj = pooler.get_pool(cr.dbname).get('stock.inventory')
+ invent_line_obj = pooler.get_pool(cr.dbname).get('stock.inventory.line')
+ prod_obj = pooler.get_pool(cr.dbname).get('product.product')
+
+ if len(context['active_ids']) <> 1:
+ raise osv.except_osv(_('Warning'),
+ _('Please select one and only one inventory !'))
+ for id in ids:
+ datas = self.read(cr, uid, id)
+ loc = str(datas['location_id'])
+
+ cr.execute('select distinct location_id,product_id \
+ from stock_inventory_line \
+ where inventory_id=%s', (context['active_id'],))
+ inv = cr.fetchall()
+ cr.execute('select distinct product_id from stock_move where \
+ location_dest_id=%s or location_id=%s', (loc, loc,))
+ stock = cr.fetchall()
+ for s in stock:
+ if (loc, s[0]) not in inv:
+ p = prod_obj.browse(cr, uid, s[0])
+ invent_line_obj.create(cr, uid, {
+ 'inventory_id': context['active_id'],
+ 'location_id': loc,
+ 'product_id': s[0],
+ 'product_uom': p.uom_id.id,
+ 'product_qty': 0.0,
+ })
+ return {}
-class merge_inventory(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : _form,
- 'fields' : _inventory_fields,
- 'state' : [('end', 'Cancel', 'gtk-cancel'),
- ('merge', 'Set to Zero', 'gtk-apply', True) ]}
- },
- 'merge' : {
- 'actions' : [],
- 'result' : {'type' : 'action',
- 'action': do_merge,
- 'state' : 'end'}
- },
- }
-merge_inventory("inventory.merge.stock.zero")
+inventory_set_stock_zero()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/stock_change_standard_price.py b/addons/stock/wizard/stock_change_standard_price.py
new file mode 100644
index 00000000000..8e2ec5f555e
--- /dev/null
+++ b/addons/stock/wizard/stock_change_standard_price.py
@@ -0,0 +1,115 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+
+class change_standard_price(osv.osv_memory):
+ _name = "stock.change.standard.price"
+ _description = "Change Standard Price"
+ _columns = {
+ 'new_price': fields.float('Price', required=True),
+ 'stock_account_input':fields.many2one('account.account', 'Stock Input Account'),
+ 'stock_account_output':fields.many2one('account.account', 'Stock Output Account'),
+ 'stock_journal':fields.many2one('account.journal', 'Stock journal', required=True),
+ 'enable_stock_in_out_acc':fields.boolean('Enable Related Account',),
+ }
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ product_obj = self.pool.get('product.product').browse(cr, uid, context.get('active_id', False))
+ res = super(change_standard_price, self).default_get(cr, uid, fields, context=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
+
+ stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False
+ if not stock_output_acc:
+ stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False
+
+ price = product_obj.standard_price
+ journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False
+
+ if 'new_price' in fields:
+ res.update({'new_price': price})
+ if 'stock_account_input' in fields:
+ res.update({'stock_account_input': stock_input_acc})
+ if 'stock_account_output' in fields:
+ res.update({'stock_account_output': stock_output_acc})
+ if 'stock_journal' in fields:
+ res.update({'stock_journal': journal_id})
+ if 'enable_stock_in_out_acc' in fields:
+ res.update({'enable_stock_in_out_acc': True})
+
+
+ return res
+
+ def onchange_price(self, cr, uid, ids, new_price, context = {}):
+ product_obj = self.pool.get('product.product').browse(cr, uid, context.get('active_id', False))
+ price = product_obj.standard_price
+ diff = price - new_price
+ if diff > 0 :
+ return {'value' : {'enable_stock_in_out_acc':True}}
+ else :
+ return {'value' : {'enable_stock_in_out_acc':False}}
+
+ def change_price(self, cr, uid, ids, context):
+ """
+ Changes the Standard Price of Product.
+ And creates an account move accordingly.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ rec_id = context and context.get('active_id', False)
+ assert rec_id, _('Active ID is not set in Context')
+ prod_obj = self.pool.get('product.product')
+ res = self.browse(cr, uid, ids)
+ datas = {
+ 'new_price' : res[0].new_price,
+ 'stock_output_account' : res[0].stock_account_output.id,
+ 'stock_input_account' : res[0].stock_account_input.id,
+ 'stock_journal' : res[0].stock_journal.id
+ }
+ prod_obj.do_change_standard_price(cr, uid, [rec_id], datas, context)
+ return {}
+
+change_standard_price()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/stock_change_standard_price_view.xml b/addons/stock/wizard/stock_change_standard_price_view.xml
new file mode 100644
index 00000000000..ffca108390d
--- /dev/null
+++ b/addons/stock/wizard/stock_change_standard_price_view.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_change_standard_price" model="ir.ui.view">
+ <field name="name">Change Standard Price</field>
+ <field name="model">stock.change.standard.price</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Change Standard Price">
+ <field name="new_price"/>
+ <separator string="" colspan="4" />
+ <label string="" colspan="2"/>
+ <group col="2" colspan="2">
+ <button special="cancel" string="_Cancel" icon="gtk-cancel"/>
+ <button name="change_price" string="_Apply" type="object" icon="gtk-apply"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_view_change_standard_price" model="ir.actions.act_window">
+ <field name="name">Change Standard Price</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">stock.change.standard.price</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="view_change_standard_price"/>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
diff --git a/addons/stock/wizard/stock_fill_inventory_view.xml b/addons/stock/wizard/stock_fill_inventory_view.xml
new file mode 100644
index 00000000000..ef95a3bf447
--- /dev/null
+++ b/addons/stock/wizard/stock_fill_inventory_view.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_stock_fill_inventory" model="ir.ui.view">
+ <field name="name">Fill Inventory</field>
+ <field name="model">stock.fill.inventory</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Fill Inventory">
+ <separator string="Fill Inventory for specific location" colspan="4" />
+ <field name="location_id"/>
+ <newline/>
+ <field name="recursive"/>
+ <newline/>
+ <separator string="" colspan="4" />
+ <button special="cancel" string="Cancel" icon='gtk-cancel'/>
+ <button name="fill_inventory" string="Fill Inventory" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Fill Inventory"
+ res_model="stock.fill.inventory"
+ src_model="stock.inventory"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_stock_fill_inventory"/>
+
+ </data>
+</openerp>
diff --git a/addons/stock/wizard/stock_inventory_line_split_view.xml b/addons/stock/wizard/stock_inventory_line_split_view.xml
new file mode 100644
index 00000000000..42b8a4648da
--- /dev/null
+++ b/addons/stock/wizard/stock_inventory_line_split_view.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="view_stock_inventory_line_split" model="ir.ui.view">
+ <field name="name">Split inventory lines</field>
+ <field name="model">stock.inventory.line.split</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Split inventory lines in lots">
+ <field name="product_id" colspan="4" readonly="1"/>
+ <newline/>
+ <field name="line_ids" colspan="4" nolabel="1">
+ <tree string="Lots Number" editable="top">
+ <field name="name" string="Lots"/>
+ <field name="quantity" />
+ <field name="use_exist" />
+ </tree>
+ <form string="Lots Number">
+ <field name="name" string="Lots"/>
+ <field name="quantity" />
+ <field name="use_exist" />
+ </form>
+ </field>
+ <separator string="" colspan="4" />
+ <label string="" colspan="2" />
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="split_lot" string="Ok"
+ type="object" icon="gtk-ok" />
+ </form>
+ </field>
+ </record>
+
+
+ <record id="action_view_stock_inventory_line_split" model="ir.actions.act_window">
+ <field name="name">Split inventory lines</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">stock.inventory.line.split</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
diff --git a/addons/stock/wizard/stock_inventory_merge.py b/addons/stock/wizard/stock_inventory_merge.py
new file mode 100644
index 00000000000..64620054ff8
--- /dev/null
+++ b/addons/stock/wizard/stock_inventory_merge.py
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+from service import web_services
+from tools.misc import UpdateableStr, UpdateableDict
+from tools.translate import _
+import netsvc
+import pooler
+import time
+import wizard
+
+class stock_inventory_merge(osv.osv_memory):
+ _name = "stock.inventory.merge"
+ _description = "Merge Inventory"
+ _columns = {
+
+ }
+
+ def do_merge(self, cr, uid, ids, context):
+
+ invent_obj = self.pool.get('stock.inventory')
+ invent_line_obj = self.pool.get('stock.inventory.line')
+
+ invent_lines = {}
+
+ if len(context['active_ids']) < 2:
+ raise osv.except_osv(_('Warning'),
+ _('Please select at least two inventories.'))
+
+
+
+ for inventory in invent_obj.browse(cr, uid, context['active_ids'], context=context):
+ print"-------active-ids----",context['active_ids']
+ if inventory.state == "done":
+ raise osv.except_osv(_('Warning'),
+ _('Merging is only allowed on draft inventories.'))
+
+ for line in inventory.inventory_line_id:
+ key = (line.location_id.id, line.product_id.id, line.product_uom.id)
+ if key in invent_lines:
+ invent_lines[key] += line.product_qty
+ else:
+ invent_lines[key] = line.product_qty
+
+
+ new_invent = invent_obj.create(cr, uid, {
+ 'name': 'Merged inventory'
+ }, context=context)
+
+ for key, quantity in invent_lines.items():
+ invent_line_obj.create(cr, uid, {
+ 'inventory_id': new_invent,
+ 'location_id': key[0],
+ 'product_id': key[1],
+ 'product_uom': key[2],
+ 'product_qty': quantity,
+ })
+
+ return {}
+
+stock_inventory_merge()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml b/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml
new file mode 100644
index 00000000000..0ee84d2045d
--- /dev/null
+++ b/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="view_inventory_set_stock_zero" model="ir.ui.view">
+ <field name="name">Set Stock to Zero</field>
+ <field name="model">stock.inventory.set.stock.zero</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Set Stock to Zero">
+ <separator string="Set Stocks to Zero" colspan="4" />
+ <field name="location_id"/>
+ <newline/>
+ <label colspan="4" string="Do you want to set stocks to zero ?"/>
+ <separator string="" colspan="4" />
+ <button special="cancel" icon='gtk-cancel' string="Cancel" />
+ <button name="do_merge" string="Set Stock to Zero" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Set Stock to Zero"
+ res_model="stock.inventory.set.stock.zero"
+ src_model="stock.inventory"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_inventory_set_stock_zero"/>
+
+ </data>
+</openerp>
diff --git a/addons/stock/wizard/stock_invoice_onshipping_view.xml b/addons/stock/wizard/stock_invoice_onshipping_view.xml
new file mode 100644
index 00000000000..62689019af0
--- /dev/null
+++ b/addons/stock/wizard/stock_invoice_onshipping_view.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_stock_invoice_onshipping" model="ir.ui.view">
+ <field name="name">Stock Invoice Onshipping</field>
+ <field name="model">stock.invoice.onshipping</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Create invoices">
+ <separator colspan="4" string="Create invoices" />
+ <field name="journal_id"/>
+ <newline/>
+ <field name="group"/>
+ <newline/>
+ <field name="type"/>
+ <newline/>
+ <field name="invoice_date" />
+ <separator string="" colspan="4" />
+ <button special="cancel" string="Cancel" icon='gtk-cancel'/>
+ <button name="create_invoice" string="Create Invoices" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Create Invoice"
+ res_model="stock.invoice.onshipping"
+ src_model="stock.picking"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_stock_invoice_onshipping"/>
+ </data>
+</openerp>
diff --git a/addons/stock/wizard/stock_location_product_view.xml b/addons/stock/wizard/stock_location_product_view.xml
new file mode 100644
index 00000000000..518bc6eab35
--- /dev/null
+++ b/addons/stock/wizard/stock_location_product_view.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_stock_location_product" model="ir.ui.view">
+ <field name="name">Products by Location</field>
+ <field name="model">stock.location.product</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="View Stock of Products">
+ <separator string="Stock Location Analysis" colspan="4"/>
+ <field name="from_date" colspan="4"/>
+ <newline/>
+ <field name="to_date" colspan="4"/>
+ <newline/>
+ <label string=""/>
+ <label string="(Keep empty to open the current situation. Adjust HH:MM:SS to 00:00:00 to filter all resources of the day for the 'From' date and 23:59:59 for the 'To' date)" align="0.0" colspan="3"/>
+ <separator string="" colspan="4" />
+ <label string=""/>
+ <button special="cancel" string="Cancel" icon="gtk-cancel" />
+ <button name="action_open_window" string="Open Product" type="object" icon="gtk-ok"/>
+ </form>
+ </field>
+ </record>
+
+
+ <act_window name="Products by Location"
+ res_model="stock.location.product"
+ src_model="stock.location"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_stock_location_product"/>
+ </data>
+</openerp>
diff --git a/addons/stock/stock_wizard.py b/addons/stock/wizard/stock_move.py
index eb522c2e2fe..500b0bdc372 100644
--- a/addons/stock/stock_wizard.py
+++ b/addons/stock/wizard/stock_move.py
@@ -36,6 +36,18 @@ class stock_move_track(osv.osv_memory):
}
def track_lines(self, cr, uid, ids, context={}):
+ """
+ To track stock moves lines
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
datas = self.read(cr, uid, ids)[0]
move_obj = self.pool.get('stock.move')
move_obj._track_lines(cr, uid, context['active_id'], datas, context=context)
@@ -52,32 +64,46 @@ class stock_move_consume(osv.osv_memory):
'product_qty': fields.float('Quantity', required=True),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
'location_id': fields.many2one('stock.location', 'Location', required=True)
- }
+ }
- def _get_product_id(self, cr, uid, context):
- move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
- return move.product_id.id
-
- def _get_product_qty(self, cr, uid, context):
- move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
- return move.product_qty
-
- def _get_product_uom(self, cr, uid, context):
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ Get default values
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
+
+ @return: default values of fields
+
+ """
+ res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
- return move.product_uom.id
-
- def _get_location_id(self, cr, uid, context):
- move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
- return move.location_id.id
-
- _defaults = {
- 'product_id': _get_product_id,
- 'product_qty': _get_product_qty,
- 'product_uom': _get_product_uom,
- 'location_id': _get_location_id
- }
-
+ if 'product_id' in fields:
+ res.update({'product_id': move.product_id.id})
+ if 'product_uom' in fields:
+ res.update({'product_uom': move.product_uom.id})
+ if 'product_qty' in fields:
+ res.update({'product_qty': move.product_qty})
+ if 'location_id' in fields:
+ res.update({'location_id': move.location_id.id})
+ return res
+
def do_move_consume(self, cr, uid, ids, context={}):
+ """
+ To move consumed products
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
for data in self.read(cr, uid, ids):
@@ -99,6 +125,18 @@ class stock_move_scrap(osv.osv_memory):
}
def move_scrap(self, cr, uid, ids, context={}):
+ """
+ To move scraped products
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
for data in self.read(cr, uid, ids):
@@ -114,24 +152,60 @@ class split_in_production_lot(osv.osv_memory):
_name = "stock.move.split"
_description = "Split in Production lots"
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ Get default values
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
+
+ @return: default values of fields
+
+ """
+
+ res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
+ move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
+ if 'product_id' in fields:
+ res.update({'product_id': move.product_id.id})
+ return res
+
_columns = {
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Lots Number')
}
-
- def _get_product_id(self, cr, uid, context):
- move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
- return move.product_id.id
-
- _defaults = {
- 'product_id': _get_product_id,
- }
-
def split_lot(self, cr, uid, ids, context=None):
+ """
+ To split a lot
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
self.split(cr, uid, ids, context.get('active_ids'), context=context)
return {}
def split(self, cr, uid, ids, move_ids, context=None):
+ """
+ To split stock moves into production lot
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param move_ids: the ID or list of IDs of stock move we want to split
+ @param context: A standard dictionary
+
+ @return:
+
+ """
prodlot_obj = self.pool.get('stock.production.lot')
ir_sequence_obj = self.pool.get('ir.sequence')
move_obj = self.pool.get('stock.move')
@@ -182,8 +256,6 @@ class split_in_production_lot(osv.osv_memory):
update_val['product_qty'] = quantity_rest
update_val['product_uos_qty'] = uos_qty_rest
move_obj.write(cr, uid, [move.id], update_val)
-
-
return new_move
split_in_production_lot()
diff --git a/addons/stock/stock_wizard_view.xml b/addons/stock/wizard/stock_move_view.xml
index 55fc8a6d8a7..55fc8a6d8a7 100644
--- a/addons/stock/stock_wizard_view.xml
+++ b/addons/stock/wizard/stock_move_view.xml
diff --git a/addons/stock/wizard/stock_partial_move.py b/addons/stock/wizard/stock_partial_move.py
new file mode 100644
index 00000000000..bf8d1058aa2
--- /dev/null
+++ b/addons/stock/wizard/stock_partial_move.py
@@ -0,0 +1,217 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+from service import web_services
+from tools.translate import _
+import netsvc
+import pooler
+import time
+
+class stock_partial_move(osv.osv_memory):
+ _name = "stock.partial.move"
+ _description = "Partial Move"
+ _columns = {
+ 'date': fields.datetime('Date', required=True),
+ 'partner_id': fields.many2one('res.partner',string="Partner", required=True),
+ 'address_id': fields.many2one('res.partner.address', 'Delivery Address', help="Address where goods are to be delivered", required=True),
+
+ }
+
+ def view_init(self, cr, uid, fields_list, context=None):
+ res = super(stock_partial_move, self).view_init(cr, uid, fields_list, context=context)
+ move_obj = self.pool.get('stock.move')
+ if not context:
+ context={}
+ moveids = []
+ for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
+ if m.state in ('done', 'cancel'):
+ continue
+ if 'move%s_product_id'%(m.id) not in self._columns:
+ self._columns['move%s_product_id'%(m.id)] = fields.many2one('product.product',string="Product")
+ if 'move%s_product_qty'%(m.id) not in self._columns:
+ self._columns['move%s_product_qty'%(m.id)] = fields.float("Quantity")
+ if 'move%s_product_uom'%(m.id) not in self._columns:
+ self._columns['move%s_product_uom'%(m.id)] = fields.many2one('product.uom',string="Product UOM")
+
+ if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
+ if 'move%s_product_price'%(m.id) not in self._columns:
+ self._columns['move%s_product_price'%(m.id)] = fields.float("Price")
+ if 'move%s_product_currency'%(m.id) not in self._columns:
+ self._columns['move%s_product_currency'%(m.id)] = fields.many2one('res.currency',string="Currency")
+ return res
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False):
+ result = super(stock_partial_move, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)
+ move_obj = self.pool.get('stock.move')
+ move_ids = context.get('active_ids', False)
+ move_ids = move_obj.search(cr, uid, [('id','in',move_ids)])
+ _moves_arch_lst = """<form string="Deliver Products">
+ <separator colspan="4" string="Delivery Information"/>
+ <field name="date" colspan="4" />
+ <field name="partner_id"/>
+ <field name="address_id"/>
+ <newline/>
+ <separator colspan="4" string="Move Detail"/>
+ """
+ _moves_fields = result['fields']
+ if move_ids and view_type in ['form']:
+ for m in move_obj.browse(cr, uid, move_ids, context):
+ if m.state in ('done', 'cancel'):
+ continue
+ _moves_fields.update({
+ 'move%s_product_id'%(m.id) : {
+ 'string': _('Product'),
+ 'type' : 'many2one',
+ 'relation': 'product.product',
+ 'required' : True,
+ 'readonly' : True,
+ },
+ 'move%s_product_qty'%(m.id) : {
+ 'string': _('Quantity'),
+ 'type' : 'float',
+ 'required': True,
+ },
+ 'move%s_product_uom'%(m.id) : {
+ 'string': _('Product UOM'),
+ 'type' : 'many2one',
+ 'relation': 'product.uom',
+ 'required' : True,
+ 'readonly' : True,
+ }
+ })
+
+ _moves_arch_lst += """
+ <group colspan="4" col="10">
+ <field name="move%s_product_id" nolabel="1"/>
+ <field name="move%s_product_qty" string="Qty" />
+ <field name="move%s_product_uom" nolabel="1" />
+ """%(m.id, m.id, m.id)
+ if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
+ _moves_fields.update({
+ 'move%s_product_price'%(m.id) : {
+ 'string': _('Price'),
+ 'type' : 'float',
+ },
+ 'move%s_product_currency'%(m.id): {
+ 'string': _('Currency'),
+ 'type' : 'float',
+ 'type' : 'many2one',
+ 'relation': 'res.currency',
+ }
+ })
+ _moves_arch_lst += """
+ <field name="move%s_product_price" />
+ <field name="move%s_product_currency" nolabel="1"/>
+ """%(m.id, m.id)
+ _moves_arch_lst += """
+ </group>
+ """
+ _moves_arch_lst += """
+ <separator string="" colspan="4" />
+ <label string="" colspan="2"/>
+ <group col="2" colspan="2">
+ <button icon='gtk-cancel' special="cancel"
+ string="_Cancel" />
+ <button name="do_partial" string="_Deliver"
+ colspan="1" type="object" icon="gtk-apply" />
+ </group>
+ </form>"""
+ result['arch'] = _moves_arch_lst
+ result['fields'] = _moves_fields
+ return result
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+
+ res = super(stock_partial_move, self).default_get(cr, uid, fields, context=context)
+ move_obj = self.pool.get('stock.move')
+ if not context:
+ context={}
+ moveids = []
+ if 'date' in fields:
+ res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')})
+ for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
+ if m.state in ('done', 'cancel'):
+ continue
+ if 'move%s_product_id'%(m.id) in fields:
+ res['move%s_product_id'%(m.id)] = m.product_id.id
+ if 'move%s_product_qty'%(m.id) in fields:
+ res['move%s_product_qty'%(m.id)] = m.product_qty
+ if 'move%s_product_uom'%(m.id) in fields:
+ res['move%s_product_uom'%(m.id)] = m.product_uom.id
+
+ if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
+ price = 0
+ if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
+ price = m.purchase_line_id.price_unit
+
+ currency = False
+ if hasattr(m.picking_id, 'purchase_id') and m.picking_id.purchase_id:
+ currency = m.picking_id.purchase_id.pricelist_id.currency_id.id
+
+ if 'move%s_product_price'%(m.id) in fields:
+ res['move%s_product_price'%(m.id)] = price
+ if 'move%s_product_currency'%(m.id) in fields:
+ res['move%s_product_currency'%(m.id)] = currency
+ return res
+
+ def do_partial(self, cr, uid, ids, context):
+ move_obj = self.pool.get('stock.move')
+ move_ids = context.get('active_ids', False)
+ partial = self.browse(cr, uid, ids[0], context)
+ partial_datas = {
+ 'partner_id' : partial.partner_id and partial.partner_id.id or False,
+ 'address_id' : partial.address_id and partial.address_id.id or False,
+ 'delivery_date' : partial.date
+ }
+ for m in move_obj.browse(cr, uid, move_ids):
+ if m.state in ('done', 'cancel'):
+ continue
+ partial_datas['move%s'%(m.id)] = {
+ 'product_id' : getattr(partial, 'move%s_product_id'%(m.id)).id,
+ 'product_qty' : getattr(partial, 'move%s_product_qty'%(m.id)),
+ 'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id
+ }
+
+ if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
+ partial_datas['move%s'%(m.id)].update({
+ 'product_price' : getattr(partial, 'move%s_product_price'%(m.id)),
+ 'product_currency': getattr(partial, 'move%s_product_currency'%(m.id)).id
+ })
+
+ res = move_obj.do_partial(cr, uid, move_ids, partial_datas, context=context)
+ return {}
+
+stock_partial_move()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/stock/wizard/stock_partial_move_view.xml b/addons/stock/wizard/stock_partial_move_view.xml
new file mode 100644
index 00000000000..30b7f3fca0e
--- /dev/null
+++ b/addons/stock/wizard/stock_partial_move_view.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="view_stock_partial_move" model="ir.ui.view">
+ <field name="name">Delivery Product</field>
+ <field name="model">stock.partial.move</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Delivery Product">
+
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Delivery Product"
+ res_model="stock.partial.move"
+ src_model="stock.move"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_partial_move"/>
+
+ </data>
+</openerp>
diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py
new file mode 100644
index 00000000000..eba095718cd
--- /dev/null
+++ b/addons/stock/wizard/stock_partial_picking.py
@@ -0,0 +1,235 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from osv import fields, osv
+from service import web_services
+from tools.translate import _
+import netsvc
+import pooler
+import time
+
+class stock_partial_picking(osv.osv_memory):
+ _name = "stock.partial.picking"
+ _description = "Partial Picking"
+ _columns = {
+ 'date': fields.datetime('Date', required=True),
+ 'partner_id': fields.many2one('res.partner',string="Partner", required=True),
+ 'address_id': fields.many2one('res.partner.address', 'Delivery Address', help="Address where goods are to be delivered", required=True),
+
+ }
+
+ def view_init(self, cr, uid, fields_list, context=None):
+ res = super(stock_partial_picking, self).view_init(cr, uid, fields_list, context=context)
+ pick_obj = self.pool.get('stock.picking')
+ if not context:
+ context={}
+ moveids = []
+ for pick in pick_obj.browse(cr, uid, context.get('active_ids', [])):
+ for m in pick.move_lines:
+ if m.state in ('done', 'cancel'):
+ continue
+ if 'move%s_product_id'%(m.id) not in self._columns:
+ self._columns['move%s_product_id'%(m.id)] = fields.many2one('product.product',string="Product")
+ if 'move%s_product_qty'%(m.id) not in self._columns:
+ self._columns['move%s_product_qty'%(m.id)] = fields.float("Quantity")
+ if 'move%s_product_uom'%(m.id) not in self._columns:
+ self._columns['move%s_product_uom'%(m.id)] = fields.many2one('product.uom',string="Product UOM")
+
+ if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
+ if 'move%s_product_price'%(m.id) not in self._columns:
+ self._columns['move%s_product_price'%(m.id)] = fields.float("Price")
+ if 'move%s_product_currency'%(m.id) not in self._columns:
+ self._columns['move%s_product_currency'%(m.id)] = fields.many2one('res.currency',string="Currency")
+ return res
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False):
+ result = super(stock_partial_picking, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)
+ pick_obj = self.pool.get('stock.picking')
+ picking_ids = context.get('active_ids', False)
+ picking_ids = pick_obj.search(cr, uid, [('id', 'in', picking_ids)])
+ _moves_arch_lst = """<form string="Deliver Products">
+ <separator colspan="4" string="Delivery Information"/>
+ <field name="date" colspan="4" />
+ <field name="partner_id"/>
+ <field name="address_id"/>
+ <newline/>
+ <separator colspan="4" string="Move Detail"/>
+ """
+ _moves_fields = result['fields']
+ if picking_ids and view_type in ['form']:
+ for pick in pick_obj.browse(cr, uid, picking_ids, context):
+ for m in pick.move_lines:
+ if m.state in ('done', 'cancel'):
+ continue
+ _moves_fields.update({
+ 'move%s_product_id'%(m.id) : {
+ 'string': _('Product'),
+ 'type' : 'many2one',
+ 'relation': 'product.product',
+ 'required' : True,
+ 'readonly' : True,
+ },
+ 'move%s_product_qty'%(m.id) : {
+ 'string': _('Quantity'),
+ 'type' : 'float',
+ 'required': True,
+ },
+ 'move%s_product_uom'%(m.id) : {
+ 'string': _('Product UOM'),
+ 'type' : 'many2one',
+ 'relation': 'product.uom',
+ 'required' : True,
+ 'readonly' : True,
+ }
+ })
+
+ _moves_arch_lst += """
+ <group colspan="4" col="10">
+ <field name="move%s_product_id" nolabel="1"/>
+ <field name="move%s_product_qty" string="Qty" />
+ <field name="move%s_product_uom" nolabel="1" />
+ """%(m.id, m.id, m.id)
+ if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
+ _moves_fields.update({
+ 'move%s_product_price'%(m.id) : {
+ 'string': _('Price'),
+ 'type' : 'float',
+ },
+ 'move%s_product_currency'%(m.id): {
+ 'string': _('Currency'),
+ 'type' : 'float',
+ 'type' : 'many2one',
+ 'relation': 'res.currency',
+ }
+ })
+ _moves_arch_lst += """
+ <field name="move%s_product_price" />
+ <field name="move%s_product_currency" nolabel="1"/>
+ """%(m.id, m.id)
+ _moves_arch_lst += """
+ </group>
+ """
+ _moves_arch_lst += """
+ <separator string="" colspan="4" />
+ <label string="" colspan="2"/>
+ <group col="2" colspan="2">
+ <button icon='gtk-cancel' special="cancel"
+ string="_Cancel" />
+ <button name="do_partial" string="_Deliver"
+ colspan="1" type="object" icon="gtk-apply" />
+ </group>
+ </form>"""
+ result['arch'] = _moves_arch_lst
+ result['fields'] = _moves_fields
+ return result
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+
+ res = super(stock_partial_picking, self).default_get(cr, uid, fields, context=context)
+ pick_obj = self.pool.get('stock.picking')
+ if not context:
+ context={}
+ moveids = []
+ if 'date' in fields:
+ res.update({'date': time.strftime('%Y-%m-%d %H:%M:%S')})
+ for pick in pick_obj.browse(cr, uid, context.get('active_ids', [])):
+ if 'partner_id' in fields:
+ res.update({'partner_id': pick.address_id.partner_id.id})
+ if 'address_id' in fields:
+ res.update({'address_id': pick.address_id.id})
+ for m in pick.move_lines:
+ if m.state in ('done', 'cancel'):
+ continue
+ if 'move%s_product_id'%(m.id) in fields:
+ res['move%s_product_id'%(m.id)] = m.product_id.id
+ if 'move%s_product_qty'%(m.id) in fields:
+ res['move%s_product_qty'%(m.id)] = m.product_qty
+ if 'move%s_product_uom'%(m.id) in fields:
+ res['move%s_product_uom'%(m.id)] = m.product_uom.id
+
+ if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
+ price = 0
+ if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
+ price = m.purchase_line_id.price_unit
+
+ currency = False
+ if hasattr(pick, 'purchase_id') and pick.purchase_id:
+ currency = pick.purchase_id.pricelist_id.currency_id.id
+
+ if 'move%s_product_price'%(m.id) in fields:
+ res['move%s_product_price'%(m.id)] = price
+ if 'move%s_product_currency'%(m.id) in fields:
+ res['move%s_product_currency'%(m.id)] = currency
+ return res
+
+ def do_partial(self, cr, uid, ids, context):
+ pick_obj = self.pool.get('stock.picking')
+ picking_ids = context.get('active_ids', False)
+ partial = self.browse(cr, uid, ids[0], context)
+ partial_datas = {
+ 'partner_id' : partial.partner_id and partial.partner_id.id or False,
+ 'address_id' : partial.address_id and partial.address_id.id or False,
+ 'delivery_date' : partial.date
+ }
+ for pick in pick_obj.browse(cr, uid, picking_ids):
+ for m in pick.move_lines:
+ if m.state in ('done', 'cancel'):
+ continue
+ partial_datas['move%s'%(m.id)] = {
+ 'product_id' : getattr(partial, 'move%s_product_id'%(m.id)).id,
+ 'product_qty' : getattr(partial, 'move%s_product_qty'%(m.id)),
+ 'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id
+ }
+
+ if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
+ partial_datas['move%s'%(m.id)].update({
+ 'product_price' : getattr(partial, 'move%s_product_price'%(m.id)),
+ 'product_currency': getattr(partial, 'move%s_product_currency'%(m.id)).id
+ })
+ res = pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context)
+ return {}
+
+stock_partial_picking()
+
+
+
+#_moves_arch_end = '''<?xml version="1.0"?>
+#<form string="Picking result">
+# <label string="The picking has been successfully made !" colspan="4"/>
+# <field name="back_order_notification" colspan="4" nolabel="1"/>
+#</form>'''
+
+#_moves_fields_end = {
+# 'back_order_notification': {'string':'Back Order' ,'type':'text', 'readonly':True}
+# }
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/stock/wizard/stock_partial_picking_view.xml b/addons/stock/wizard/stock_partial_picking_view.xml
new file mode 100644
index 00000000000..2f901b9884d
--- /dev/null
+++ b/addons/stock/wizard/stock_partial_picking_view.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="action_partial_picking" model="ir.actions.act_window">
+ <field name="name">Making Picking</field>
+ <field name="res_model">stock.partial.picking</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
diff --git a/addons/stock/wizard/wizard_picking_make.py b/addons/stock/wizard/stock_picking_make.py
index df4c9f63e8d..6ac54ee3bc1 100644
--- a/addons/stock/wizard/wizard_picking_make.py
+++ b/addons/stock/wizard/stock_picking_make.py
@@ -19,9 +19,21 @@
#
##############################################################################
-import wizard
-import pooler
+from osv import fields, osv
+from service import web_services
+from tools.misc import UpdateableStr, UpdateableDict
+from tools.translate import _
import netsvc
+import pooler
+import time
+import wizard
+
+class stock_picking_make(osv.osv_memory):
+ _name = "stock.picking.make"
+ _description = "Make picking"
+ _columns = {
+ 'pickings': fields.many2many('stock.picking', 'Picking', required=True),
+ }
ARCH = '''<?xml version="1.0"?>
<form string="Make picking">
@@ -32,7 +44,7 @@ ARCH = '''<?xml version="1.0"?>
FIELDS = {
'pickings': {
'string': 'Picking',
- 'type': 'one2many',
+ 'type': 'many2many',
'relation': 'stock.picking',
'readonly': True,
},
@@ -52,8 +64,8 @@ def _make_packing(obj, cursor, user, data, context):
wkf_service = netsvc.LocalService('workflow')
pool = pooler.get_pool(cursor.dbname)
picking_obj = pool.get('stock.picking')
- ids = [x[1] for x in data['form']['pickings']]
-
+ ids = data['form']['pickings'][0][2]
+ print"-------ids--------",ids
picking_obj.force_assign(cursor, user, ids)
picking_obj.action_move(cursor, user, ids)
for picking_id in ids:
diff --git a/addons/stock/wizard/stock_traceability.py b/addons/stock/wizard/stock_traceability.py
index 58cc26a3224..120fa658b1c 100644
--- a/addons/stock/wizard/stock_traceability.py
+++ b/addons/stock/wizard/stock_traceability.py
@@ -23,63 +23,91 @@ import wizard
import netsvc
import time
import pooler
-
from osv import osv
-def action_traceability(type='move_history_ids', field='tracking_id'):
- def open_tab(self, cr, uid, data, context):
- obj = pooler.get_pool(cr.dbname).get('stock.move')
- ids = obj.search(cr, uid, [(field, 'in', data['ids'])])
- cr.execute('select id from ir_ui_view where model=%s and field_parent=%s and type=%s', ('stock.move', type, 'tree'))
+class action_traceability(osv.osv_memory):
+ """
+ This class defines a function action_traceability for wizard
+
+ """
+ _name = "action.traceability"
+ _description = "Action traceability "
+
+ def action_traceability(self, cr, uid, ids, context={}):
+ """
+ It traces the information of a product
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return: A dictionary of values
+
+ """
+ type1 = context['type'] or 'move_history_ids'
+ field = context['field'] or 'tracking_id'
+ obj = self.pool.get('stock.move')
+ ids = obj.search(cr, uid, [(field, 'in',context['active_ids'])])
+ cr.execute('select id from ir_ui_view where model=%s and field_parent=%s and type=%s', ('stock.move', type1, 'tree'))
view_id = cr.fetchone()[0]
value = {
'domain': "[('id','in',["+','.join(map(str, ids))+"])]",
- 'name': ((type=='move_history_ids') and 'Upstream Traceability') or 'Downstream Traceability',
+ 'name': ((type1=='move_history_ids') and 'Upstream Traceability') or 'Downstream Traceability',
'view_type': 'tree',
'res_model': 'stock.move',
- 'field_parent': type,
+ 'field_parent': type1,
'view_id': (view_id,'View'),
'type': 'ir.actions.act_window'
- }
+ }
return value
- return open_tab
+
+action_traceability()
+
+class stock_traceability_downstream(osv.osv_memory):
+ """
+ This class is defined for Stock traceability downstream wizard
+
+ """
+ _name = "stock.traceability.downstream"
+ _inherit = "action.traceability"
+ _description = "Stock traceability downstream"
+
+stock_traceability_downstream()
+
+class stock_traceability_upstream(osv.osv_memory):
+ """
+ This class is defined for Stock traceability upstream wizard
+
+ """
+ _name = "stock.traceability.upstream"
+ _inherit = "action.traceability"
+ _description = "Stock traceability upstream"
+
+stock_traceability_upstream()
+
+class stock_traceability_lot_upstream(osv.osv_memory):
+ """
+ This class is defined for Stock traceability lot upstream wizard
-class wiz_journal(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'action', 'action': action_traceability('move_history_ids2'), 'state':'end'}
- }
- }
-wiz_journal('stock.traceability.downstream')
+ """
+ _name = "stock.traceability.lot.upstream"
+ _inherit = "action.traceability"
+ _description = "Stock traceability lot upstream"
-class wiz_journal2(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'action', 'action': action_traceability(), 'state':'end'}
- }
- }
-wiz_journal2('stock.traceability.upstream')
+stock_traceability_lot_upstream()
-class wiz_journal3(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'action', 'action': action_traceability(field='prodlot_id'), 'state':'end'}
- }
- }
-wiz_journal3('stock.traceability.lot.upstream')
+class stock_traceability_lot_downstream(osv.osv_memory):
+ """
+ This class is defined for Stock traceability lot downstream wizard
-class wiz_journal4(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'action', 'action': action_traceability('move_history_ids2', 'prodlot_id'), 'state':'end'}
- }
- }
-wiz_journal4('stock.traceability.lot.downstream')
+ """
+ _name = "stock.traceability.lot.downstream"
+ _inherit = "action.traceability"
+ _description = "Stock traceability lot downstream"
+stock_traceability_lot_downstream()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/stock_traceability_view.xml b/addons/stock/wizard/stock_traceability_view.xml
new file mode 100644
index 00000000000..4a1f6b11b25
--- /dev/null
+++ b/addons/stock/wizard/stock_traceability_view.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+<!-- =========stock.traceability.downstream================= -->
+
+ <record id="view_stock_traceability_downstream" model="ir.ui.view">
+ <field name="name">Stock traceability downstream</field>
+ <field name="model">stock.traceability.downstream</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Downstream traceability">
+
+ <label string="It will give information about the stock of a product as per the Tracking Lot" colspan="2" />
+ <separator string="" colspan="4" />
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="action_traceability" string="Downstream traceability" type="object" context="{'type': 'move_history_ids2','field': ''}"/>
+
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Downstream traceability"
+ res_model="stock.traceability.downstream"
+ src_model="stock.tracking"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_stock_traceability_downstream"/>
+
+<!-- =========stock.traceability.upstream================= -->
+
+ <record id="view_stock_traceability_upstream" model="ir.ui.view">
+ <field name="name">Stock traceability upstream</field>
+ <field name="model">stock.traceability.upstream</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Upstream traceability">
+
+ <label string="It will give information about the stock of a product as per the Tracking Lot" colspan="2" />
+ <separator string="" colspan="4" />
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="action_traceability" string="Upstream traceability" type="object" context="{'type': '','field': ''}"/>
+
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Upstream traceability"
+ res_model="stock.traceability.upstream"
+ src_model="stock.tracking"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_stock_traceability_upstream"/>
+
+<!-- =========stock.traceability.lot.upstream================= -->
+
+<record id="view_stock_traceability_lot_upstream" model="ir.ui.view">
+ <field name="name">Stock traceability lot upstream</field>
+ <field name="model">stock.traceability.lot.upstream</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Stock traceability lot upstream">
+
+ <label string="It will give information about the stock of a product as per the Production Lot" colspan="2" />
+ <separator string="" colspan="4" />
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="action_traceability" string="Upstream traceability" type="object" context="{'type': '', 'field': 'prodlot_id'}"/>
+
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Upstream traceability"
+ res_model="stock.traceability.lot.upstream"
+ src_model="stock.production.lot"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_stock_traceability_lot_upstream"/>
+
+<!-- =========stock.traceability.lot.downstream================= -->
+
+<record id="view_stock_traceability_lot_downstream" model="ir.ui.view">
+ <field name="name">Stock traceability lot downstream</field>
+ <field name="model">stock.traceability.lot.downstream</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Stock traceability lot downstream">
+
+ <label string="It will give information about the stock of a product as per the Production Lot" colspan="2" />
+ <separator string="" colspan="4" />
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="action_traceability" string="Downstream traceability" type="object" context="{'type': 'move_history_ids2', 'field': 'prodlot_id'}"/>
+
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Downstream traceability"
+ res_model="stock.traceability.lot.downstream"
+ src_model="stock.production.lot"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_view_stock_traceability_lot_downstream"/>
+
+ </data>
+</openerp>
+
diff --git a/addons/stock/wizard/wizard_inventory.py b/addons/stock/wizard/wizard_inventory.py
index 42345353866..c96638c8d52 100644
--- a/addons/stock/wizard/wizard_inventory.py
+++ b/addons/stock/wizard/wizard_inventory.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,97 +15,90 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
+from osv import fields, osv
+from service import web_services
+from tools.misc import UpdateableStr, UpdateableDict
+from tools.translate import _
+import netsvc
+import pooler
import time
import wizard
-import ir
-import pooler
-from osv.osv import except_osv
-from osv import fields,osv
-import netsvc
-from tools.translate import _
-
-inventory_form = """<?xml version="1.0"?>
-<form string="Fill Inventory">
- <separator colspan="4" string="Fill Inventory for specific location" />
- <field name="location_id"/>
- <newline/>
- <field name="recursive"/>
- <newline/>
-
-</form>
-"""
-
-inventory_fields = {
- 'location_id' : {
- 'string':'Location',
- 'type':'many2one',
- 'relation':'stock.location',
- 'required':True
- },
- 'recursive' : {'string':'Include all childs for the location', 'type':'boolean'}
-}
-
-
-
-def _fill_inventory(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- inventory_line_obj = pooler.get_pool(cr.dbname).get('stock.inventory.line')
- location_obj = pooler.get_pool(cr.dbname).get('stock.location')
- res={}
- res_location={}
- if data['form']['recursive'] :
- location_ids = location_obj.search(cr, uid, [('location_id', 'child_of', [data['form']['location_id']])])
- for location in location_ids :
- res=location_obj._product_get(cr, uid, location)
- res_location[location]=res
- else:
- context.update({'compute_child':False})
- res=location_obj._product_get(cr, uid, data['form']['location_id'],context=context)
- res_location[data['form']['location_id']]=res
-
- product_ids=[]
- for location in res_location.keys():
- res=res_location[location]
- for product_id in res.keys():
- #product_ids.append(product_id)
- prod = pool.get('product.product').browse(cr, uid, [product_id])[0]
- uom = prod.uom_id.id
- context.update({'uom': uom})
- amount=pool.get('stock.location')._product_get(cr, uid, location, [product_id], context=context)[product_id]
-
- if(amount):
- line_ids=inventory_line_obj.search(cr,uid,[('inventory_id','=',data['id']),('location_id','=',location),('product_id','=',product_id),('product_uom','=',uom),('product_qty','=',amount)])
- if not len(line_ids):
- inventory_line={'inventory_id':data['id'],'location_id':location,'product_id':product_id,'product_uom':uom,'product_qty':amount}
- inventory_line_obj.create(cr, uid, inventory_line)
- product_ids.append(product_id)
-
- if(len(product_ids)==0):
- raise wizard.except_wizard(_('Message !'), _('No product in this location.'))
- return {}
-
-
-
-class fill_inventory(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : inventory_form,
- 'fields' : inventory_fields,
- 'state' : [('end', 'Cancel', 'gtk-cancel'),('fill_inventory', 'Fill Inventory', 'gtk-apply', True) ]}
- },
- 'fill_inventory' : {
- 'actions' : [],
- 'result' : {'type' : 'action', 'action': _fill_inventory, 'state' : 'end'}
- },
- }
-fill_inventory("stock.fill_inventory")
+class stock_fill_inventory(osv.osv_memory):
+ _name = "stock.fill.inventory"
+ _description = "Fill Inventory"
+ _columns = {
+ 'location_id': fields.many2one('stock.location', 'Location', required=True),
+ 'recursive': fields.boolean("Include all childs for the location"),
+ }
+
+ def fill_inventory(self, cr, uid, ids, context):
+ """
+ To fill stock inventory according to products available in the selected locations..
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ inventory_line_obj = self.pool.get('stock.inventory.line')
+ location_obj = self.pool.get('stock.location')
+ product_obj = self.pool.get('product.product')
+ stock_location_obj = self.pool.get('stock.location')
+ for fill_inventory in self.browse(cr, uid, ids):
+ res = {}
+ res_location = {}
+ if fill_inventory.recursive :
+ location_ids = location_obj.search(cr, uid, [('location_id',
+ 'child_of', fill_inventory.location_id.id)])
+ for location in location_ids :
+ res = location_obj._product_get(cr, uid, location)
+ res_location[location] = res
+ else:
+ context.update({'compute_child': False})
+ res = location_obj._product_get(cr, uid,
+ fill_inventory.location_id.id, context=context)
+ res_location[fill_inventory.location_id.id] = res
+
+ product_ids = []
+ for location in res_location.keys():
+ res = res_location[location]
+ for product_id in res.keys():
+ prod = product_obj.browse(cr, uid, [product_id])[0]
+ uom = prod.uom_id.id
+ context.update({'uom': uom})
+ amount = stock_location_obj._product_get(cr, uid,
+ location, [product_id], context=context)[product_id]
+
+ if(amount):
+ line_ids=inventory_line_obj.search(cr, uid,
+ [('inventory_id', '=', context['active_ids']),
+ ('location_id', '=', location),
+ ('product_id', '=', product_id),
+ ('product_uom', '=', uom),
+ ('product_qty', '=', amount)])
+ if not len(line_ids):
+ inventory_line = {'inventory_id': context['active_ids'][0],
+ 'location_id': location,
+ 'product_id': product_id,
+ 'product_uom': uom,
+ 'product_qty': amount}
+ inventory_line_obj.create(cr, uid, inventory_line)
+ product_ids.append(product_id)
+
+ if(len(product_ids) == 0):
+ raise osv.except_osv(_('Message !'), _('No product in this location.'))
+ return {}
+
+stock_fill_inventory()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/wizard_invoice_onshipping.py b/addons/stock/wizard/wizard_invoice_onshipping.py
index 22cdbc97e70..22e48631f8b 100644
--- a/addons/stock/wizard/wizard_invoice_onshipping.py
+++ b/addons/stock/wizard/wizard_invoice_onshipping.py
@@ -19,149 +19,117 @@
#
##############################################################################
-import wizard
-import pooler
+from osv import fields, osv
+from service import web_services
+from tools.misc import UpdateableStr, UpdateableDict
from tools.translate import _
+import netsvc
+import pooler
+import time
+import wizard
-invoice_form = """<?xml version="1.0"?>
-<form string="Create invoices">
- <separator colspan="4" string="Create invoices" />
- <field name="journal_id"/>
- <newline/>
- <field name="group"/>
- <newline/>
- <field name="type"/>
- <newline/>
- <field name="invoice_date" />
-</form>
-"""
-
-invoice_fields = {
- 'journal_id': {
- 'string': 'Destination Journal',
- 'type': 'many2one',
- 'relation': 'account.journal',
- 'required': True
- },
- 'group': {
- 'string': 'Group by partner',
- 'type': 'boolean'
- },
- 'type': {
- 'string': 'Type',
- 'type': 'selection',
- 'selection': [],
- 'required': True
- },
- 'invoice_date': {'string': 'Invoiced date', 'type':'date' }
-}
-
-
-def _get_type(obj, cr, uid, data, context):
- picking_obj = pooler.get_pool(cr.dbname).get('stock.picking')
- usage = 'customer'
- pick = picking_obj.browse(cr, uid, data['id'], context)
- if pick.invoice_state == 'invoiced':
- raise wizard.except_wizard(_('UserError'), _('Invoice is already created.'))
- if pick.invoice_state == 'none':
- raise wizard.except_wizard(_('UserError'), _('Invoice cannot be created from Picking.'))
-
- if pick.move_lines:
- usage = pick.move_lines[0].location_id.usage
-
- if pick.type =='out':
- invoice_fields['type']['selection'] = [
- ('out_invoice', 'Customer Invoice'),
- ('in_refund', 'Supplier Refund'),
- ]
- elif pick.type =='in':
- invoice_fields['type']['selection'] = [
- ('in_invoice', 'Supplier Invoice'),
- ('out_refund', 'Customer Refund'),
- ]
- else:
- invoice_fields['type']['selection']=[
- ('out_invoice', 'Customer Invoice'),
- ('in_invoice', 'Supplier Invoice'),
- ('out_refund', 'Customer Refund'),
- ('in_refund', 'Supplier Refund'),
- ]
-
- if pick.type == 'out' and usage == 'supplier':
- type = 'in_refund'
- elif pick.type == 'out' and usage == 'customer':
- type = 'out_invoice'
- elif pick.type == 'in' and usage == 'supplier':
- type = 'in_invoice'
- elif pick.type == 'in' and usage == 'customer':
- type = 'out_refund'
- else:
- type = 'out_invoice'
- return {'type': type}
-
-
-def _create_invoice(obj, cr, uid, data, context):
- if data['form'].get('new_picking', False):
- data['id'] = data['form']['new_picking']
- data['ids'] = [data['form']['new_picking']]
- pool = pooler.get_pool(cr.dbname)
- picking_obj = pooler.get_pool(cr.dbname).get('stock.picking')
- mod_obj = pool.get('ir.model.data')
- act_obj = pool.get('ir.actions.act_window')
-
- type = data['form']['type']
-
- context['date_inv'] = data['form']['invoice_date']
- res = picking_obj.action_invoice_create(cr, uid, data['ids'],
- journal_id = data['form']['journal_id'], group=data['form']['group'],
- type=type, context= context)
-
- invoice_ids = res.values()
- if not invoice_ids:
- raise wizard.except_wizard(_('Error'), _('Invoice is not created'))
-
- if type == 'out_invoice':
- xml_id = 'action_invoice_tree1'
- elif type == 'in_invoice':
- xml_id = 'action_invoice_tree2'
- elif type == 'out_refund':
- xml_id = 'action_invoice_tree3'
- else:
- xml_id = 'action_invoice_tree4'
-
- result = mod_obj._get_id(cr, uid, 'account', xml_id)
- id = mod_obj.read(cr, uid, result, ['res_id'])
- result = act_obj.read(cr, uid, id['res_id'])
- result['res_id'] = invoice_ids
- return result
-
-
-class make_invoice_onshipping(wizard.interface):
- states = {
- 'init': {
- 'actions': [_get_type],
- 'result': {
- 'type': 'form',
- 'arch': invoice_form,
- 'fields': invoice_fields,
- 'state': [
- ('end', 'Cancel', 'gtk-cancel'),
- ('create_invoice', 'Create invoice', 'gtk-apply', True)
- ]
+class stock_invoice_onshipping(osv.osv_memory):
+ _name = "stock.invoice.onshipping"
+ _description = "Stock Invoice Onshipping"
+ _columns = {
+ 'journal_id': fields.many2one('account.journal', 'Destination Journal', required=True),
+ 'group': fields.boolean("Group by partner"),
+ 'type': fields.selection([('out_invoice', 'Customer Invoice'),
+ ('in_invoice', 'Supplier Invoice'),
+ ('out_refund', 'Customer Refund'),
+ ('in_refund', 'Supplier Refund')] , 'Type', required=True),
+ 'invoice_date': fields.date('Invoiced date'),
}
- },
- 'create_invoice': {
- 'actions': [],
- 'result': {
- 'type': 'action',
- 'action': _create_invoice,
- 'state': 'end'
- }
- },
- }
-
-make_invoice_onshipping("stock.invoice_onshipping")
+ def _get_type(self, cr, uid, context):
+ """
+ To get invoice type
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return: invoice type
+
+ """
+ picking_obj = self.pool.get('stock.picking')
+ usage = 'customer'
+ pick = picking_obj.browse(cr, uid, context['active_id'])
+ if pick.invoice_state == 'invoiced':
+ raise osv.except_osv(_('UserError'), _('Invoice is already created.'))
+ if pick.invoice_state == 'none':
+ raise osv.except_osv(_('UserError'), _('Invoice cannot be created from Picking.'))
+ if pick.move_lines:
+ usage = pick.move_lines[0].location_id.usage
+
+ if pick.type == 'out' and usage == 'supplier':
+ type = 'in_refund'
+ elif pick.type == 'out' and usage == 'customer':
+ type = 'out_invoice'
+ elif pick.type == 'in' and usage == 'supplier':
+ type = 'in_invoice'
+ elif pick.type == 'in' and usage == 'customer':
+ type = 'out_refund'
+ else:
+ type = 'out_invoice'
+ return type
+
+ _defaults = {
+ 'type': _get_type,
+ }
+
+ def create_invoice(self, cr, uid, ids, context):
+ """
+ To create invoice
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return: invoice ids
+
+ """
+ result = []
+ picking_obj = self.pool.get('stock.picking')
+ mod_obj = self.pool.get('ir.model.data')
+ act_obj = self.pool.get('ir.actions.act_window')
+
+ for onshipdata_obj in self.read(cr, uid, ids, ['journal_id', 'group', 'type', 'invoice_date']):
+ if context.get('new_picking', False):
+ onshipdata_obj[id] = onshipdata_obj.new_picking
+ onshipdata_obj[ids] = onshipdata_obj.new_picking
+
+ type = onshipdata_obj['type']
+ context['date_inv'] = onshipdata_obj['invoice_date']
+ res = picking_obj.action_invoice_create(cr, uid,context['active_ids'],
+ journal_id = onshipdata_obj['journal_id'],
+ group=onshipdata_obj['group'],
+ type=type,
+ context=context)
+ invoice_ids = res.values()
+ if not invoice_ids:
+ raise osv.except_osv(_('Error'), _('Invoice is not created'))
+
+ if type == 'out_invoice':
+ xml_id = 'action_invoice_tree1'
+ elif type == 'in_invoice':
+ xml_id = 'action_invoice_tree2'
+ elif type == 'out_refund':
+ xml_id = 'action_invoice_tree3'
+ else:
+ xml_id = 'action_invoice_tree4'
+
+ result = mod_obj._get_id(cr, uid, 'account', xml_id)
+ id = mod_obj.read(cr, uid, result, ['res_id'])
+ result = act_obj.read(cr, uid, id['res_id'])
+ result['res_id'] = invoice_ids
+ return result
+
+stock_invoice_onshipping()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/wizard_location_product.py b/addons/stock/wizard/wizard_location_product.py
index c423c426832..d3ee334bac0 100755
--- a/addons/stock/wizard/wizard_location_product.py
+++ b/addons/stock/wizard/wizard_location_product.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@@ -15,62 +15,47 @@
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import wizard
-import pooler
-import time
+from osv import fields, osv
-def _action_open_window(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- mod_obj = pool.get('ir.model.data')
- result = mod_obj._get_id(cr, uid, 'product', 'product_search_form_view')
- id = mod_obj.read(cr, uid, result, ['res_id'])
- return {
- 'name': False,
- 'view_type': 'form',
- "view_mode": 'tree,form',
- 'res_model': 'product.product',
- 'type': 'ir.actions.act_window',
- 'context':{'location': data['ids'][0],'from_date':data['form']['from_date'],'to_date':data['form']['to_date']},
- 'domain':[('type','<>','service')],
- 'search_view_id': id['res_id']
+class stock_location_product(osv.osv_memory):
+ _name = "stock.location.product"
+ _description = "Products by Location"
+ _columns = {
+ 'from_date': fields.datetime('From'),
+ 'to_date': fields.datetime('To'),
}
+ def action_open_window(self, cr, uid, ids, context):
+ """
+ To open location wise product information specific to given duration
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return: invoice type
+
+ """
+ mod_obj = self.pool.get('ir.model.data')
+ for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date']):
+ return {
+ 'name': False,
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'product.product',
+ 'type': 'ir.actions.act_window',
+ 'context': {'location': context['active_id'],
+ 'from_date': location_obj['from_date'],
+ 'to_date': location_obj['to_date']},
+ 'domain': [('type', '<>', 'service')],
+ }
-class product_by_location(wizard.interface):
- form1 = '''<?xml version="1.0"?>
- <form string="View Stock of Products">
- <separator string="Stock Location Analysis" colspan="4"/>
- <field name="from_date"/>
- <newline/>
- <field name="to_date"/>
- <newline/>
- <label string=""/>
- <label string="(Keep empty to open the current situation. Adjust HH:MM:SS to 00:00:00 to filter all resources of the day for the 'From' date and 23:59:59 for the 'To' date)" align="0.0" colspan="3"/>
- </form>'''
- form1_fields = {
- 'from_date': {
- 'string': 'From',
- 'type': 'datetime',
- },
- 'to_date': {
- 'string': 'To',
- 'type': 'datetime',
- },
- }
+stock_location_product()
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel', 'gtk-cancel'),('open', 'Open Products', 'gtk-apply', True)]}
- },
- 'open': {
- 'actions': [],
- 'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
- }
- }
-product_by_location('stock.location.products')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/wizard_partial_move.py b/addons/stock/wizard/wizard_partial_move.py
deleted file mode 100644
index 928d96461c8..00000000000
--- a/addons/stock/wizard/wizard_partial_move.py
+++ /dev/null
@@ -1,220 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-import netsvc
-from tools.misc import UpdateableStr, UpdateableDict
-import pooler
-
-import wizard
-from osv import osv
-import tools
-from tools.translate import _
-
-_moves_arch = UpdateableStr()
-_moves_fields = UpdateableDict()
-
-_moves_arch_end = '''<?xml version="1.0"?>
-<form string="Picking result">
- <label string="Move(s) have been successfully Done !" colspan="4"/>
-</form>'''
-
-def make_default(val):
- def fct(uid, data, state):
- return val
- return fct
-
-def _to_xml(s):
- return (s or '').replace('&','&amp;').replace('<','&lt;').replace('>','&gt;')
-
-def _get_moves(self, cr, uid, data, context):
- move_obj = pooler.get_pool(cr.dbname).get('stock.move')
- move_lines = move_obj.browse(cr, uid, data['ids'], context)
- res = {}
-
- _moves_fields.clear()
- _moves_arch_lst = ['<?xml version="1.0"?>', '<form string="Partial Stock Moves">']
-
- for move in move_lines:
- quantity = move.product_qty
- if move.state != 'assigned':
- quantity = 0
-
- _moves_arch_lst.append('<field name="move%s" />' % (move.id,))
- _moves_fields['move%s' % move.id] = {
- 'string': _to_xml(move.name),
- 'type' : 'float', 'required' : True, 'default' : make_default(quantity)}
-
- if (move.picking_id.type == 'in') and (move.product_id.cost_method == 'average'):
- price = 0
- if hasattr(move, 'purchase_line_id') and move.purchase_line_id:
- price = move.purchase_line_id.price_unit
-
- currency = 0
- if hasattr(move.picking_id, 'purchase_id') and move.picking_id.purchase_id:
- currency = move.picking_id.purchase_id.pricelist_id.currency_id.id
-
- _moves_arch_lst.append('<group col="6"><field name="uom%s" nolabel="1"/>\
- <field name="price%s"/>' % (move.id, move.id,))
-
- _moves_fields['price%s' % move.id] = {'string': 'Unit Price',
- 'type': 'float', 'required': True, 'default': make_default(price)}
-
- _moves_fields['uom%s' % move.id] = {'string': 'UOM', 'type': 'many2one',
- 'relation': 'product.uom', 'required': True,
- 'default': make_default(move.product_uom.id)}
-
- _moves_arch_lst.append('<field name="currency%d" nolabel="1"/></group>' % (move.id,))
- _moves_fields['currency%s' % m.id] = {'string': 'Currency',
- 'type': 'many2one', 'relation': 'res.currency',
- 'required': True, 'default': make_default(currency)}
-
- _moves_arch_lst.append('<newline/>')
- res.setdefault('moves', []).append(move.id)
-
- _moves_arch_lst.append('</form>')
- _moves_arch.string = '\n'.join(_moves_arch_lst)
- return res
-
-def _do_split(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- move_obj = pool.get('stock.move')
- pick_obj = pool.get('stock.picking')
- product_obj = pool.get('product.product')
- currency_obj = pool.get('res.currency')
- users_obj = pool.get('res.users')
- uom_obj = pool.get('product.uom')
- move_lines = move_obj.browse(cr, uid, data['ids'])
- wf_service = netsvc.LocalService("workflow")
- complete, too_few, too_many = [], [], []
- for move in move_lines:
- states = []
-
- if move.product_qty == data['form']['move%s' % move.id]:
- complete.append(move)
- elif move.product_qty > data['form']['move%s' % move.id]:
- too_few.append(move)
- else:
- too_many.append(move)
- # Average price computation
- if (move.picking_id.type == 'in') and (move.product_id.cost_method == 'average'):
- product = move.product_id
- user = users_obj.browse(cr, uid, uid)
- qty = data['form']['move%s' % move.id]
- uom = data['form']['uom%s' % move.id]
- price = data['form']['price%s' % move.id]
- currency = data['form']['currency%s' % move.id]
-
- qty = uom_obj._compute_qty(cr, uid, uom, qty, product.uom_id.id)
- pricetype=pool.get('product.price.type').browse(cr,uid,user.company_id.property_valuation_price_type.id)
-
- if (qty > 0):
- new_price = currency_obj.compute(cr, uid, currency,
- user.company_id.currency_id.id, price)
- new_price = uom_obj._compute_price(cr, uid, uom, new_price,
- product.uom_id.id)
- if product.qty_available<=0:
- new_std_price = new_price
- else:
- # Get the standard price
- amount_unit=product.price_get(pricetype.field, context)[product.id]
- new_std_price = ((amount_unit * product.qty_available)\
- + (new_price * qty))/(product.qty_available + qty)
-
- product_obj.write(cr, uid, [product.id],
- {pricetype.field: new_std_price})
- move_obj.write(cr, uid, move.id, {'price_unit': new_price})
-
- for move in too_few:
- if data['form']['move%s' % move.id] != 0:
- new_move = move_obj.copy(cr, uid, move.id,
- {
- 'product_qty' : data['form']['move%s' % move.id],
- 'product_uos_qty':data['form']['move%s' % move.id],
- 'picking_id' : move.picking_id.id,
- 'state': 'assigned',
- 'move_dest_id': False,
- 'price_unit': move.price_unit,
- })
- complete.append(move_obj.browse(cr, uid, new_move))
- move_obj.write(cr, uid, move.id,
- {
- 'product_qty' : move.product_qty - data['form']['move%s' % move.id],
- 'product_uos_qty':move.product_qty - data['form']['move%s' % move.id],
- })
-
-
- for move in too_many:
- move_obj.write(cr, uid, move.id,
- {
- 'product_qty': data['form']['move%s' % move.id],
- 'product_uos_qty': data['form']['move%s' % move.id]
- })
- complete.append(move)
-
- for move in complete:
- move_obj.action_done(cr, uid, [move.id])
-
- # TOCHECK : Done picking if all moves are done
- cr.execute('select move.id from stock_picking pick \
- right join stock_move move on move.picking_id = pick.id and move.state = ''%s'' where pick.id = %s',
- ('done', move.picking_id.id))
- res = cr.fetchall()
- if len(res) == len(move.picking_id.move_lines):
- pick_obj.action_move(cr, uid, [move.picking_id.id])
- wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
-
- return {}
-
-
-
-class partial_move(wizard.interface):
-
- states = {
- 'init': {
- 'actions': [ _get_moves ],
- 'result': {'type': 'form', 'arch': _moves_arch, 'fields': _moves_fields,
- 'state' : (
- ('end', 'Cancel', 'gtk-cancel'),
- ('split', 'Partial', 'gtk-apply', True)
- )
- },
- },
- 'split': {
- 'actions': [ _do_split ],
- 'result': {'type': 'state', 'state': 'end2'},
- },
- 'end2': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': _moves_arch_end,
- 'fields': {},
- 'state': (
- ('end', 'Close'),
- )
- },
- },
- }
-
-partial_move('stock.partial_move')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/wizard_partial_picking.py b/addons/stock/wizard/wizard_partial_picking.py
deleted file mode 100644
index db3e9a48bdd..00000000000
--- a/addons/stock/wizard/wizard_partial_picking.py
+++ /dev/null
@@ -1,252 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-import netsvc
-from tools.misc import UpdateableStr, UpdateableDict
-import pooler
-
-import wizard
-from osv import osv
-import tools
-from tools.translate import _
-
-_moves_arch = UpdateableStr()
-_moves_fields = UpdateableDict()
-
-_moves_arch_end = '''<?xml version="1.0"?>
-<form string="Picking result">
- <label string="The picking has been successfully made !" colspan="4"/>
- <field name="back_order_notification" colspan="4" nolabel="1"/>
-</form>'''
-_moves_fields_end = {
- 'back_order_notification': {'string':'Back Order' ,'type':'text', 'readonly':True}
- }
-
-def make_default(val):
- def fct(uid, data, state):
- return val
- return fct
-
-def _to_xml(s):
- return (s or '').replace('&','&amp;').replace('<','&lt;').replace('>','&gt;')
-
-def _get_moves(self, cr, uid, data, context):
- pick_obj = pooler.get_pool(cr.dbname).get('stock.picking')
- pick = pick_obj.browse(cr, uid, [data['id']], context)[0]
- res = {}
-
- _moves_fields.clear()
- _moves_arch_lst = ['<?xml version="1.0"?>', '<form string="Make picking">']
-
- for m in pick.move_lines:
- if m.state in ('done', 'cancel'):
- continue
- quantity = m.product_qty
- if m.state!='assigned':
- quantity = 0
-
- _moves_arch_lst.append('<field name="move%s" />' % (m.id,))
- _moves_fields['move%s' % m.id] = {
- 'string': _to_xml(m.name),
- 'type' : 'float', 'required' : True, 'default' : make_default(quantity)}
-
- if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
- price=0
- if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
- price=m.purchase_line_id.price_unit
-
- currency=0
- if hasattr(pick, 'purchase_id') and pick.purchase_id:
- currency=pick.purchase_id.pricelist_id.currency_id.id
-
- _moves_arch_lst.append('<group col="6"><field name="uom%s" nolabel="1"/>\
- <field name="price%s"/>' % (m.id,m.id,))
-
- _moves_fields['price%s' % m.id] = {'string': 'Unit Price',
- 'type': 'float', 'required': True, 'default': make_default(price)}
-
- _moves_fields['uom%s' % m.id] = {'string': 'UOM', 'type': 'many2one',
- 'relation': 'product.uom', 'required': True,
- 'default': make_default(m.product_uom.id)}
-
- _moves_arch_lst.append('<field name="currency%d" nolabel="1"/></group>' % (m.id,))
- _moves_fields['currency%s' % m.id] = {'string': 'Currency',
- 'type': 'many2one', 'relation': 'res.currency',
- 'required': True, 'default': make_default(currency)}
-
- _moves_arch_lst.append('<newline/>')
- res.setdefault('moves', []).append(m.id)
-
- _moves_arch_lst.append('</form>')
- _moves_arch.string = '\n'.join(_moves_arch_lst)
- return res
-
-def _do_split(self, cr, uid, data, context):
- move_obj = pooler.get_pool(cr.dbname).get('stock.move')
- pick_obj = pooler.get_pool(cr.dbname).get('stock.picking')
- pick = pick_obj.browse(cr, uid, [data['id']])[0]
- new_picking = None
- new_moves = []
-
- complete, too_many, too_few = [], [], []
- pool = pooler.get_pool(cr.dbname)
- for move in move_obj.browse(cr, uid, data['form'].get('moves',[])):
- if move.product_qty == data['form']['move%s' % move.id]:
- complete.append(move)
- elif move.product_qty > data['form']['move%s' % move.id]:
- too_few.append(move)
- else:
- too_many.append(move)
-
- # Average price computation
- if (pick.type == 'in') and (move.product_id.cost_method == 'average'):
- product_obj = pool.get('product.product')
- currency_obj = pool.get('res.currency')
- users_obj = pool.get('res.users')
- uom_obj = pool.get('product.uom')
-
- product = product_obj.browse(cr, uid, [move.product_id.id])[0]
- user = users_obj.browse(cr, uid, [uid])[0]
- context['currency_id']=move.company_id.currency_id.id
-
- qty = data['form']['move%s' % move.id]
- uom = data['form']['uom%s' % move.id]
- price = data['form']['price%s' % move.id]
- currency = data['form']['currency%s' % move.id]
-
- qty = uom_obj._compute_qty(cr, uid, uom, qty, product.uom_id.id)
- pricetype=pool.get('product.price.type').browse(cr,uid,user.company_id.property_valuation_price_type.id)
- if (qty > 0):
- new_price = currency_obj.compute(cr, uid, currency,
- user.company_id.currency_id.id, price)
- new_price = uom_obj._compute_price(cr, uid, uom, new_price,
- product.uom_id.id)
- if product.qty_available<=0:
- new_std_price = new_price
- else:
- # Get the standard price
- amount_unit=product.price_get(pricetype.field, context)[product.id]
- new_std_price = ((amount_unit * product.qty_available)\
- + (new_price * qty))/(product.qty_available + qty)
-
- # Write the field according to price type field
- product_obj.write(cr, uid, [product.id],
- {pricetype.field: new_std_price})
- move_obj.write(cr, uid, [move.id], {'price_unit': new_price})
-
- for move in too_few:
- if not new_picking:
-
- new_picking = pick_obj.copy(cr, uid, pick.id,
- {
- 'name': pool.get('ir.sequence').get(cr, uid, 'stock.picking'),
- 'move_lines' : [],
- 'state':'draft',
- })
- if data['form']['move%s' % move.id] != 0:
- new_obj = move_obj.copy(cr, uid, move.id,
- {
- 'product_qty' : data['form']['move%s' % move.id],
- 'product_uos_qty':data['form']['move%s' % move.id],
- 'picking_id' : new_picking,
- 'state': 'assigned',
- 'move_dest_id': False,
- 'price_unit': move.price_unit,
- })
- move_obj.write(cr, uid, [move.id],
- {
- 'product_qty' : move.product_qty - data['form']['move%s' % move.id],
- 'product_uos_qty':move.product_qty - data['form']['move%s' % move.id],
- })
-
- if new_picking:
- move_obj.write(cr, uid, [c.id for c in complete], {'picking_id': new_picking})
- for move in too_many:
- move_obj.write(cr, uid, [move.id],
- {
- 'product_qty' : data['form']['move%s' % move.id],
- 'product_uos_qty': data['form']['move%s' % move.id],
- 'picking_id': new_picking,
- })
- else:
- for move in too_many:
- move_obj.write(cr, uid, [move.id],
- {
- 'product_qty': data['form']['move%s' % move.id],
- 'product_uos_qty': data['form']['move%s' % move.id]
- })
-
- # At first we confirm the new picking (if necessary)
- wf_service = netsvc.LocalService("workflow")
- if new_picking:
- wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
- # Then we finish the good picking
- if new_picking:
- pick_obj.write(cr, uid, [pick.id], {'backorder_id': new_picking})
- pick_obj.action_move(cr, uid, [new_picking])
- wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_done', cr)
- wf_service.trg_write(uid, 'stock.picking', pick.id, cr)
- else:
- pick_obj.action_move(cr, uid, [pick.id])
- wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr)
- bo_name = ''
- if new_picking:
- bo_name = pick_obj.read(cr, uid, [new_picking], ['name'])[0]['name']
- return {'new_picking':new_picking or False, 'back_order':bo_name}
-
-def _get_default(self, cr, uid, data, context):
- if data['form']['back_order']:
- data['form']['back_order_notification'] = _('Back Order %s Assigned to this Picking.') % (tools.ustr(data['form']['back_order']),)
- return data['form']
-
-class partial_picking(wizard.interface):
-
- states = {
- 'init': {
- 'actions': [ _get_moves ],
- 'result': {'type': 'form', 'arch': _moves_arch, 'fields': _moves_fields,
- 'state' : (
- ('end', 'Cancel', 'gtk-cancel'),
- ('split', 'Make Picking', 'gtk-apply', True)
- )
- },
- },
- 'split': {
- 'actions': [ _do_split ],
- 'result': {'type': 'state', 'state': 'end2'},
- },
- 'end2': {
- 'actions': [ _get_default ],
- 'result': {'type': 'form', 'arch': _moves_arch_end,
- 'fields': _moves_fields_end,
- 'state': (
- ('end', 'Close'),
- )
- },
- },
- }
-
-partial_picking('stock.partial_picking')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/stock/wizard/wizard_split_inventory_lots.py b/addons/stock/wizard/wizard_split_inventory_lots.py
index 92963f0b145..9fe71582c7f 100644
--- a/addons/stock/wizard/wizard_split_inventory_lots.py
+++ b/addons/stock/wizard/wizard_split_inventory_lots.py
@@ -1,98 +1,117 @@
-import wizard
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+from service import web_services
+from tools.misc import UpdateableStr, UpdateableDict
+from tools.translate import _
import netsvc
import pooler
-
import time
-from osv import osv
-from tools.translate import _
-
-inv_form = '''<?xml version="1.0"?>
-<form string="Split Inventory Line">
- <field name="prefix"/>
- <newline/>
- <field name="quantity"/>
-</form>
-'''
-inv_fields = {
- 'prefix': {
- 'string': 'Prefix',
- 'type': 'char',
- 'size': 64,
- },
- 'quantity': {
- 'string': 'Quantity per lot',
- 'type': 'float',
- 'default': 1,
- }
-}
-
-def _check_production_lot(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- inv_obj = pool.get('stock.inventory.line').browse(cr, uid, data['id'])
- if not inv_obj.prod_lot_id:
- raise wizard.except_wizard(_('Caution!'), _('Before splitting the inventory lines, make sure the production lot is assigned to this product.'))
- return data['form']
-
-def _split_lines(self, cr, uid, data, context):
- inv_id = data['id']
-
- pool = pooler.get_pool(cr.dbname)
- inv_line_obj = pool.get('stock.inventory.line')
- prodlot_obj = pool.get('stock.production.lot')
+import wizard
- ir_sequence_obj = pool.get('ir.sequence')
+class stock_inventory_line_split(osv.osv_memory):
+ _inherit = "stock.move.split"
+ _name = "stock.inventory.line.split"
+ _description = "Split inventory lines"
- sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
- if not sequence:
- raise wizard.except_wizard(_('Error!'), _('No production sequence defined'))
- if data['form']['prefix']:
- sequence=data['form']['prefix']+'/'+(sequence or '')
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To check the availability of production lot.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
- inv = inv_line_obj.browse(cr, uid, [inv_id])[0]
- quantity=data['form']['quantity']
- prodlot_obj.write(cr, uid, inv.prod_lot_id.id, {'name':sequence})
+ """
+ record_id = context and context.get('active_id',False)
+ res = super(stock_inventory_line_split, self).default_get(cr, uid, fields, context=context)
+ line= self.pool.get('stock.inventory.line').browse(cr, uid, record_id)
+ if 'product_id' in fields:
+ res.update({'product_id':line.product_id.id})
+ return res
- if quantity <= 0 or inv.product_qty == 0:
- return {}
-
- quantity_rest = inv.product_qty%quantity
+ def split(self, cr, uid, ids, line_ids, context=None):
+ """
+ To split stock inventory lines according to production lot
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param line_ids: the ID or list of IDs of inventory lines we want to split
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ prodlot_obj = self.pool.get('stock.production.lot')
+ ir_sequence_obj = self.pool.get('ir.sequence')
+ line_obj = self.pool.get('stock.inventory.line')
+ new_line = []
+ for data in self.browse(cr, uid, ids):
+ for inv_line in line_obj.browse(cr, uid, line_ids):
+ line_qty = inv_line.product_qty
+ quantity_rest = inv_line.product_qty
+ new_line = []
+ for line in data.line_ids:
+ quantity = line.quantity
+
- update_val = {
- 'product_qty': quantity,
- }
+ if quantity <= 0 or line_qty == 0:
+ continue
+ quantity_rest -= quantity
+ if quantity_rest <= 0:
+ quantity_rest = quantity
+ break
+ default_val = {
+ 'product_qty': quantity,
+ }
+ current_line = line_obj.copy(cr, uid, inv_line.id, default_val)
+ new_line.append(current_line)
+ prodlot_id = False
+ if line.use_exist and line.name:
+ prodlot_id = prodlot_obj.search(cr, uid, [('prefix','=',line.name),('product_id','=',data.product_id.id)])
+ if prodlot_id:
+ prodlot_id = prodlot_id[0]
+ if not prodlot_id:
+ sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
+ prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix' : line.name},
+ {'product_id': data.product_id.id})
+ line_obj.write(cr, uid, [current_line], {'prod_lot_id': prodlot_id})
+ prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
+
+ update_val = {}
+ if quantity_rest > 0:
+ update_val['product_qty'] = quantity_rest
+ line_obj.write(cr, uid, [inv_line.id], update_val)
- new_line = []
- for idx in range(int(inv.product_qty//quantity)):
- if idx:
- current_line = inv_line_obj.copy(cr, uid, inv.id, {'prod_lot_id': inv.prod_lot_id.id})
- new_line.append(current_line)
- else:
- current_line = inv.id
- inv_line_obj.write(cr, uid, [current_line], update_val)
-
- if quantity_rest > 0:
- idx = int(inv.product_qty//quantity)
- update_val['product_qty']=quantity_rest
-
- if idx:
- current_line = inv_line_obj.copy(cr, uid, inv.id, {'prod_lot_id': inv.prod_lot_id.id})
- new_line.append(current_line)
- else:
- current_line = inv.id
- inv_line_obj.write(cr, uid, [current_line], update_val)
-
- return {}
+
+ return new_line
+stock_inventory_line_split()
-class wizard_split_inventory_lots(wizard.interface):
- states = {
- 'init': {
- 'actions': [_check_production_lot],
- 'result': {'type': 'form', 'arch': inv_form, 'fields': inv_fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('split', 'Ok', 'gtk-apply', True)]},
- },
- 'split': {
- 'actions': [_split_lines],
- 'result': {'type':'state', 'state':'end'}
- }
- }
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-wizard_split_inventory_lots('stock.inventory.line.split') \ No newline at end of file
diff --git a/addons/stock_invoice_directly/i18n/pt_BR.po b/addons/stock_invoice_directly/i18n/pt_BR.po
index 82da1f47308..34ca6b82f62 100644
--- a/addons/stock_invoice_directly/i18n/pt_BR.po
+++ b/addons/stock_invoice_directly/i18n/pt_BR.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-03-24 04:53+0000\n"
+"X-Launchpad-Export-Date: 2010-03-27 05:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: stock_invoice_directly
diff --git a/addons/mrp/wizard/wizard_price.py b/addons/stock_planning/__init__.py
index dd84ad23be2..f0fea471a21 100644
--- a/addons/mrp/wizard/wizard_price.py
+++ b/addons/stock_planning/__init__.py
@@ -1,8 +1,7 @@
-# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+# Copyright (C) 2004-2009 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
@@ -19,31 +18,7 @@
#
##############################################################################
-import wizard
-
-price_form = '''<?xml version="1.0"?>
-<form string="Paid ?">
- <field name="number"/>
-</form>'''
-
-price_fields = {
- 'number': {'string':'Number of products to produce', 'type':'integer', 'required':True},
-}
-
-class wizard_price(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':price_form, 'fields':price_fields, 'state':[('end','Cancel'),('price','Print product price') ]}
- },
- 'price': {
- 'actions': [],
- 'result': {'type':'print', 'report':'product.price', 'state':'end'}
- }
- }
-wizard_price('product_price')
-
-
+import stock_planning
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock_planning/__terp__.py b/addons/stock_planning/__terp__.py
new file mode 100644
index 00000000000..1ff4e8d0b10
--- /dev/null
+++ b/addons/stock_planning/__terp__.py
@@ -0,0 +1,146 @@
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 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/>.
+#
+##############################################################################
+
+{
+ "name":"Master Procurement Schedule",
+ "version":"1.1",
+ "author":"Tiny and Grzegorz Grzelak (Cirrus)",
+ "category":"Custom",
+ "depends":["hr","stock","sale"],
+ "description": """
+This module is based on original Tiny module stock_planning version 1.0 of the same name Master Procurement Schedule.
+
+Purpose of MPS is to allow create a manual procurement (requisition) apart of MRP scheduler (which works automatically on minimum stock rules).
+
+Terms used in the module:
+- Stock and Sales Period - is the time (between Start Date and End Date) for which you plan Stock and Sales Forecast and make Procurement Planning.
+- Stock and Sales Forecast - is the quantity of products you plan to sell in the Period.
+- Stock Planning - is the quantity of products you plan to purchase or produce for the Period.
+
+Because we have another module sale_forecast which uses terms "Sales Forecast" and "Planning" as amount values we will use terms "Stock and Sales Forecast" and "Stock Planning" to emphasize that we use quantity values.
+
+Activity with this module is divided to three steps:
+- Creating Periods. Mandatory step.
+- Creating Sale Forecasts and entering quantities to them. Optional step but useful for farther planning.
+- Creating Planning lines, entering quantities to them and making Procurement. Making procurement is the final step for the Period.
+
+Periods
+=======
+You have two menu items for Periods in "Sales Management - Configuration". There are:
+- "Create Sales Periods" - Which automates creating daily, weekly or monthly periods.
+- "Stock and sales Periods" - Which allows to create any type of periods, change the dates and change the State of period.
+
+Creating periods is the first step you have to do to use modules features. You can create custom periods using "New" button in "Stock and Sales Periods" form or view but it is recommended to use automating tool.
+
+Remarks:
+- These periods (officially Stock and Sales Periods) are separated of Financial or other periods in the system.
+- Periods are not assigned to companies (when you use multicompany feature at all). Module suppose that you use the same periods across companies. If you wish to use different periods for different companies define them as you wish (they can overlap). Later on in this text will be indications how to use such periods.
+- When periods are created automatically their start and finish dates are with with start hour 00:00:00 and end hour 23:59:00. Fe. when you create daily periods they will have start date 31.01.2010 00:00:00 and end date 31.01.2010 23:59:00. It works only in automatic creation of periods. When you create periods manually you have to take care about hours because you can have incorrect values form sales or stock.
+- If you use overlapping periods for the same product, warehouse and company results can be unpredictable.
+- If current date doesn't belong to any period or you have holes between periods results can be unpredictable.
+
+Sales Forecasts
+===============
+You have few menus for Sales forecast in "Sales Management - Sales Forecasts".
+- "Create Sales Forecasts for Sales Periods" - which automates creating forecasts lines according to some parameters.
+- "Sales Forecasts" - few menus for working with forecasts lists and forms.
+
+Menu "Create Sales Forecasts for Sales Periods" creates Forecasts for products from selected Category, for selected Period and for selected Warehouse. It is an option "Copy Last Forecast" to copy forecast and other settings of period before this one to created one.
+
+Remarks:
+- This tool doesn't create lines if relevant lines (for the same Product, Period, Warehouse and validated or created by you) already exists. If you wish to create another forecast if relevant lines exists you have to do it manually using menus described bellow.
+- When created lines are validated by someone else you can use this tool to create another lines for the same Period, Product and Warehouse.
+- When you choose "Copy Last Forecast" created line takes quantity and some settings from your (validated by you or created by you if not validated yet) forecast which is for last period before period of created forecast. If there are few your forecasts for period before this one (it is possible) system takes one of them (no rule which of them).
+
+
+Menus "Sales Forecasts"
+On "Sales Forecast" form mainly you have to enter a forecast quantity in "Product Quantity". Farther calculation can work for draft forecasts. But validation can save your data against any accidental changes. You can click "Validate" button but it is not mandatory.
+
+Instead of forecast quantity you can enter amount of forecast sales in field "Product Amount". System will count quantity from amount according to Sale price of the Product.
+
+All values on the form are expressed in unit of measure selected on form. You can select one of unit of measure from default category or from second category. When you change unit of measure the quanities will be recalculated according to new UoM: editable values (blue fields) immediately, non edited fields after clicking of "Calculate Planning" button.
+
+To find proper value for Sale Forecast you can use "Sales History" table for this product. You have to enter parameters to the top and left of this table and system will count sale quantities according to these parameters. So you can select fe. your department (at the top) then (to the left): last period, period before last and period year ago.
+
+Remarks:
+
+
+Procurement Planning
+====================
+Menu for Planning you can find in "Warehouse - Stock Planning".
+- "Create Stock Planning Lines" - allows you to automate creating planning lines according to some parameters.
+- "Master Procurement Scheduler" - is the most important menu of the module which allows to create procurement.
+
+As Sales forecast is phase of planning sales. The Procurement Planning (Planning) is the phase of scheduling Purchasing or Producing. You can create Procurement Planning quickly using tool from menu "Create Stock Planning Lines", then you can review created planning and make procurement using menu "Master Procurement Schedule".
+
+Menu "Create Stock Planning Lines" allows you to create quickly Planning lines for products from selected Category, for selected Period, and for selected Warehouse. When you check option "All Products with Forecast" system creates lines for all products having forecast for selected Period and Warehouse. Selected Category will be ignored in this case.
+
+Under menu "Master Procurement Scheduler" you can generally change the values "Planned Out" and "Planned In" to observe the field "Stock Simulation" and decide if this value would be accurate for end of the Period.
+"Planned Out" can be based on "Warehouse Forecast" which is the sum of all forecasts for Period and Warehouse. But your planning can be based on any other information you have. It is not necessary to have any forecast.
+"Planned In" quantity is used to calculate field "Incoming Left" which is the quantity to be procured to make stock as indicated in "Stock Simulation" at the and of Period. You can compare "Stock Simulation" quantity to minimum stock rules visible on the form. But you can plan different quantity than in Minimum Stock Rules. Calculation is made for whole Warehouse by default. But if you want to see values for Stock location of calculated warehouse you can use check box "Stock Location Only".
+
+If after few tries you decide that you found correct quantities for "Planned Out" and "Planned In" and you are satisfied with end of period stock calculated in "Stock Simulation" you can click "Procure Incoming Left" button to procure quantity of field "Incoming Left" into the Warehouse. System creates appropriate Procurement Order. You can decide if procurement will be made to Stock or Input location of calculated Warehouse.
+
+If you don't want to Produce or Buy the product but just pick calculated quantity from another warehouse you can click "Supply from Another Warehouse" (instead of "Procure Incoming Left"). System creates pick list with move from selected source Warehouse to calculated Warehouse (as destination). You can also decide if this pick should be done from Stock or Output location of source warehouse. Destination location (Stock or Input) of destination warehouse will be used as set for "Procure Incoming Left".
+
+To see proper quantities in fields "Confirmed In", "Confirmed Out", "Confirmed In Before", "Planned Out Before" and "Stock Simulation" you have to click button "Calculate Planning".
+
+All values on the form are expressed in unit of measure selected on form. You can select one of unit of measure from default category or from second category. When you change unit of measure the quanities will be recalculated according to new UoM: editable values (blue fields) immediately, non edited fields after clicking of "Calculate Planning" button.
+
+How Stock Simulation field is calculated:
+Generally Stock Simulation shows the stock for end of the calculated period according to some planned or confirmed stock moves. Calculation always starts with quantity of real stock of beginning of current period. Then calculation adds or subtracts quantities of calculated period or periods before calculated.
+When you are in the same period (current period is the same as calculated) Stock Simulation is calculated as follows:
+Stock Simulation =
+ Stock of beginning of current Period
+ - Planned Out
+ + Planned In
+
+When you calculate period next to current:
+Stock Simulation =
+ Stock of beginning of current Period
+ - Planned Out of current Period
+ + Confirmed In of current Period (incl. Already In)
+ - Planned Out of calculated Period
+ + Planned In of calculated Period .
+
+As you see calculated Period is taken the same way like in case above. But calculation of current Period are made a little bit different. First you should note that system takes for current Period only Confirmed In moves. It means that you have to make planning and procurement for current Period before this calculation (for Period next to current).
+
+When you calculate Period ahead:
+Stock Simulation =
+ Stock of beginning of current Period
+ - Sum of Planned Out of Periods before calculated
+ + Sum of Confirmed In of Periods before calculated (incl. Already In)
+ - Planned Out of calculated Period
+ + Planned In of calculated Period.
+
+Periods before calculated means periods starting from current till period before calculated.
+
+Remarks:
+- Remember to make planning for all periods before calculated because omitting these quantities and procurements can cause wrong suggestions for procurements few periods ahead.
+- If you made planning few periods ahead and you find that real Confirmed Out is bigger than Planned Out in some periods before you can repeat Planning and make another procurement. You should do it in the same planning line. If you create another planning line the suggestions can be wrong.
+- When you wish to work with different periods for some part of products define two kinds of periods (fe. Weekly and Monthly) and use them for different products. Example: If you use always Weekly periods for Products A, and Monthly periods for Products B your all calculations will work correctly. You can also use different kind of periods for the same products from different warehouse or companies. But you cannot use overlapping periods for the same product, warehouse and company because results can be unpredictable. The same apply to Forecasts lines.
+""",
+ "demo_xml":[],
+ "update_xml":["security/ir.model.access.csv","stock_planning_view.xml"],
+ "active": False,
+ "installable": True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/stock_planning/security/ir.model.access.csv b/addons/stock_planning/security/ir.model.access.csv
new file mode 100644
index 00000000000..b0ee2853b87
--- /dev/null
+++ b/addons/stock_planning/security/ir.model.access.csv
@@ -0,0 +1,7 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_stock_planning","stock.planning","model_stock_planning","stock.group_stock_user",1,1,1,1
+"access_stock_period_create_lines","stock.period.createlines","model_stock_period_createlines","stock.group_stock_user",1,1,1,1
+"access_stock_period","stock.period","model_stock_period","stock.group_stock_user",1,1,1,1
+"access_stock_sale_forecast_createlines","stock.sale.forecast.createlines","model_stock_sale_forecast_createlines","stock.group_stock_user",1,1,1,1
+"access_stock_sale_forecast","stock.sale.forecast","model_stock_sale_forecast","stock.group_stock_user",1,1,1,1
+"access_stock_planning_createlines","stock.planning.createlines","model_stock_planning_createlines","stock.group_stock_user",1,1,1,1
diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py
new file mode 100644
index 00000000000..fa0bec2f5b1
--- /dev/null
+++ b/addons/stock_planning/stock_planning.py
@@ -0,0 +1,1009 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
+#
+# 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.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields,osv
+import pooler
+from tools import config
+import time
+import netsvc
+import math
+import mx.DateTime
+from mx.DateTime import RelativeDateTime, now, DateTime, localtime
+from tools.translate import _
+
+def rounding(fl, round_value):
+ if not round_value:
+ return fl
+ return round(fl / round_value) * round_value
+
+
+# Object creating periods quickly
+# changed that stop_date is created with hour 23:59:00 when it was 00:00:00 stop date was excluded from period
+class stock_period_createlines(osv.osv_memory):
+ _name = "stock.period.createlines"
+
+ def _get_new_period_start(self,cr,uid,context={}):
+ cr.execute("select max(date_stop) from stock_period")
+ result=cr.fetchone()
+ last_date = result and result[0] or False
+ if last_date:
+ period_start = mx.DateTime.strptime(last_date,"%Y-%m-%d %H:%M:%S")+ RelativeDateTime(days=1)
+ period_start = period_start - RelativeDateTime(hours=period_start.hour, minutes=period_start.minute, seconds=period_start.second)
+ else:
+ period_start = mx.DateTime.today()
+ return period_start.strftime('%Y-%m-%d')
+
+
+ _columns = {
+ 'name': fields.char('Period Name', size=64),
+ 'date_start': fields.date('Start Date', required=True),
+ 'date_stop': fields.date('End Date', required=True),
+ 'period_ids': fields.one2many('stock.period', 'planning_id', 'Periods'),
+ }
+ _defaults={
+ 'date_start':_get_new_period_start,
+ }
+
+ def create_period_weekly(self,cr, uid, ids, context={}):
+ res=self.create_period(cr, uid, ids, context, 6, 'Weekly')
+ return {
+ 'view_type': 'form',
+ "view_mode": 'tree',
+ 'res_model': 'stock.period',
+ 'type': 'ir.actions.act_window',
+ }
+
+ def create_period_monthly(self,cr, uid, ids, context={},interval=1):
+ for p in self.browse(cr, uid, ids, context):
+ dt = p.date_start
+ ds = mx.DateTime.strptime(p.date_start, '%Y-%m-%d')
+ while ds.strftime('%Y-%m-%d')<p.date_stop:
+ de = ds + RelativeDateTime(months=interval, minutes=-1)
+ self.pool.get('stock.period').create(cr, uid, {
+ 'name': ds.strftime('%Y/%m'),
+ 'date_start': ds.strftime('%Y-%m-%d'),
+ 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'),
+ })
+ ds = ds + RelativeDateTime(months=interval)
+ return {
+ 'view_type': 'form',
+ "view_mode": 'tree',
+ 'res_model': 'stock.period',
+ 'type': 'ir.actions.act_window',
+ }
+
+ def create_period(self,cr, uid, ids, context={}, interval=0, name='Daily'):
+ for p in self.browse(cr, uid, ids, context):
+ dt = p.date_start
+ ds = mx.DateTime.strptime(p.date_start, '%Y-%m-%d')
+ while ds.strftime('%Y-%m-%d')<p.date_stop:
+ de = ds + RelativeDateTime(days=interval, minutes =-1)
+ if name=='Daily':
+ new_name=de.strftime('%Y-%m-%d')
+ if name=="Weekly":
+ new_name=de.strftime('%Y, week %W')
+ self.pool.get('stock.period').create(cr, uid, {
+ 'name': new_name,
+ 'date_start': ds.strftime('%Y-%m-%d'),
+ 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'),
+ })
+ ds = ds + RelativeDateTime(days=interval) + 1
+ return {
+ 'view_type': 'form',
+ "view_mode": 'tree',
+ 'res_model': 'stock.period',
+ 'type': 'ir.actions.act_window',
+ }
+stock_period_createlines()
+
+# Periods have no company_id field as they can be shared across similar companies.
+# If somone thinks different it can be improved.
+class stock_period(osv.osv):
+ _name = "stock.period"
+ _columns = {
+ 'name': fields.char('Period Name', size=64),
+ 'date_start': fields.datetime('Start Date', required=True),
+ 'date_stop': fields.datetime('End Date', required=True),
+ 'state' : fields.selection([('draft','Draft'),('open','Open'),('close','Close')],'State')
+ }
+ _defaults = {
+ 'state' : lambda * a : 'draft'
+ }
+stock_period()
+
+# Creates forecasts records for products from selected Product Category for selected 'Warehouse - Period'
+# Object added by contributor in ver 1.1
+class stock_sale_forecast_createlines(osv.osv_memory):
+ _name = "stock.sale.forecast.createlines"
+
+# FIXME Add some period sugestion like below
+
+# def _get_latest_period(self,cr,uid,context={}):
+# cr.execute("select max(date_stop) from stock_period")
+# result=cr.fetchone()
+# return result and result[0] or False
+
+
+ _columns = {
+ 'company_id': fields.many2one('res.company', 'Company', required=True, select=1),
+ 'warehouse_id1': fields.many2one('stock.warehouse' , 'Warehouse', required=True, \
+ help='Warehouse which forecasts will concern. '\
+ 'If during stock planning you will need sales forecast for all warehouses choose any warehouse now.'),
+ 'period_id1': fields.many2one('stock.period' , 'Period', required=True, help = 'Period which forecasts will concern.' ),
+ 'product_categ_id1': fields.many2one('product.category' , 'Product Category', required=True, \
+ help ='Product Category of products which created forecasts will concern.'),
+ 'copy_forecast' : fields.boolean('Copy Last Forecast', help="Copy quantities from last Stock and Sale Forecast."),
+ }
+
+ _defaults = {
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.sale.forecast.createlines', context=c),
+ }
+
+ def create_forecast(self,cr, uid, ids, context={}):
+ product_obj = self.pool.get('product.product')
+ forecast_obj=self.pool.get('stock.sale.forecast')
+ for f in self.browse(cr, uid, ids, context):
+ prod_categ_obj=self.pool.get('product.category')
+ template_obj=self.pool.get('product.template')
+ categ_ids = f.product_categ_id1.id and [f.product_categ_id1.id] or []
+ prod_categ_ids=prod_categ_obj.search(cr,uid,[('parent_id','child_of',categ_ids)])
+ templates_ids = template_obj.search(cr,uid,[('categ_id','in',prod_categ_ids)])
+ products_ids = product_obj.search(cr,uid,[('product_tmpl_id','in',templates_ids)])
+ if len(products_ids)==0:
+ raise osv.except_osv(_('Error !'), _('No products in selected category !'))
+ copy = f.copy_forecast
+ for p in product_obj.browse(cr, uid, products_ids,{}):
+ if len(forecast_obj.search(cr, uid, [('product_id','=',p.id) , \
+ ('period_id','=',f.period_id1.id), \
+ ('user_id','=',uid), \
+ ('warehouse_id','=',f.warehouse_id1.id)]))== 0:
+ forecast_qty = 0.0
+# Not sure if it is expected quantity for this feature (copying forecast from previous period)
+# because it can take incidental forecast of this warehouse, this product and this user (creating, writing or validating forecast).
+# It takes only one forecast line (no sum). If user creates only one forecast per period it will be OK. If not I have no idea how to count it.
+
+ prod_uom = False
+ if copy:
+ cr.execute("SELECT period.date_stop, forecast.product_qty, forecast.product_uom \
+ FROM stock_sale_forecast AS forecast \
+ LEFT JOIN stock_period AS period \
+ ON forecast.period_id = period.id \
+ WHERE (forecast.user_id = %s OR forecast.create_uid = %s OR forecast.write_uid = %s) \
+ AND forecast.warehouse_id = %s AND forecast.product_id = %s \
+ AND period.date_stop < %s \
+ ORDER BY period.date_stop DESC",
+ (uid, uid, uid, f.warehouse_id1.id, p.id, f.period_id1.date_stop) )
+ ret=cr.fetchone()
+ if ret:
+ forecast_qty = ret[1]
+ prod_uom = ret[2]
+ prod_uom = prod_uom or p.uom_id.id
+ prod_uos_categ = False
+ if p.uos_id:
+ prod_uos_categ = p.uos_id.category_id.id
+ forecast_obj.create(cr, uid, {
+ 'company_id' : f.warehouse_id1.company_id.id,
+ 'period_id': f.period_id1.id,
+ 'warehouse_id': f.warehouse_id1.id,
+ 'product_id': p.id,
+ 'product_qty' : forecast_qty,
+ 'product_amt' : 0.0,
+ 'product_uom' : prod_uom,
+ 'active_uom' : prod_uom,
+ 'product_uom_categ' : p.uom_id.category_id.id,
+ 'product_uos_categ' : prod_uos_categ,
+ })
+ return {
+ 'view_type': 'form',
+ "view_mode": 'tree',
+ 'res_model': 'stock.sale.forecast',
+ 'type': 'ir.actions.act_window',
+ }
+stock_sale_forecast_createlines()
+
+
+# Stock and Sales Forecast object. Previously stock_planning_sale_prevision.
+# A lot of changes in 1.1
+class stock_sale_forecast(osv.osv):
+ _name = "stock.sale.forecast"
+
+ _columns = {
+ 'company_id': fields.many2one('res.company', 'Company', required=True),
+ 'create_uid': fields.many2one('res.users', 'Responsible'),
+ 'name' : fields.char('Name', size=64, readonly=True, states={'draft':[('readonly',False)]}),
+ 'user_id': fields.many2one('res.users' , 'Created/Validated by',readonly=True, \
+ help='Shows who created this forecast, or who validated.'),
+ 'warehouse_id': fields.many2one('stock.warehouse' , 'Warehouse', required=True, readonly=True, states={'draft':[('readonly',False)]}, \
+ help='Shows which warehouse this forecast concerns. '\
+ 'If during stock planning you will need sales forecast for all warehouses choose any warehouse now.'),
+ 'period_id': fields.many2one('stock.period' , 'Period', required=True, readonly=True, states={'draft':[('readonly',False)]}, \
+ help = 'Shows which period this forecast concerns.'),
+ 'product_id': fields.many2one('product.product' , 'Product', readonly=True, required=True, states={'draft':[('readonly',False)]}, \
+ help = 'Shows which product this forecast concerns.'),
+ 'product_qty' : fields.float('Product Quantity', required=True, readonly=True, states={'draft':[('readonly',False)]}, \
+ help= 'Forecasted quantity.'),
+ 'product_amt' : fields.float('Product Amount', readonly=True, states={'draft':[('readonly',False)]}, \
+ help='Forecast value which will be converted to Product Quantity according to prices.'),
+ 'product_uom_categ' : fields.many2one('product.uom.categ', 'Product UoM Category'), # Invisible field for product_uom domain
+ 'product_uom' : fields.many2one('product.uom', 'Product UoM', required=True, readonly=True, states={'draft':[('readonly',False)]}, \
+ help = "Unit of Measure used to show the quanities of stock calculation." \
+ "You can use units form default category or from second category (UoS category)."),
+ 'product_uos_categ' : fields.many2one('product.uom.categ', 'Product UoS Category'), # Invisible field for product_uos domain
+# Field used in onchange_uom to check what uom was before change and recalculate quantities acording to old uom (active_uom) and new uom.
+ 'active_uom' :fields.many2one('product.uom', string = "Active UoM"),
+ 'state' : fields.selection([('draft','Draft'),('validated','Validated')],'State',readonly=True),
+ 'analyzed_period1_id' : fields.many2one('stock.period' , 'Period1', readonly=True, states={'draft':[('readonly',False)]},),
+ 'analyzed_period2_id' : fields.many2one('stock.period' , 'Period2', readonly=True, states={'draft':[('readonly',False)]},),
+ 'analyzed_period3_id' : fields.many2one('stock.period' , 'Period3', readonly=True, states={'draft':[('readonly',False)]},),
+ 'analyzed_period4_id' : fields.many2one('stock.period' , 'Period4', readonly=True, states={'draft':[('readonly',False)]},),
+ 'analyzed_period5_id' : fields.many2one('stock.period' , 'Period5', readonly=True, states={'draft':[('readonly',False)]},),
+ 'analyzed_user_id' : fields.many2one('res.users' , 'This User', required=False, readonly=True, states={'draft':[('readonly',False)]},),
+ 'analyzed_dept_id' : fields.many2one('hr.department' , 'This Department', required=False, \
+ readonly=True, states={'draft':[('readonly',False)]},),
+ 'analyzed_warehouse_id' : fields.many2one('stock.warehouse' , 'This Warehouse', required=False, \
+ readonly=True, states={'draft':[('readonly',False)]}),
+ 'analyze_company' : fields.boolean('Per Company', readonly=True, states={'draft':[('readonly',False)]}, \
+ help = "Check this box to see the sales for whole company."),
+ 'analyzed_period1_per_user' : fields.float('This User Period1', readonly=True),
+ 'analyzed_period2_per_user' : fields.float('This User Period2', readonly=True),
+ 'analyzed_period3_per_user' : fields.float('This User Period3', readonly=True),
+ 'analyzed_period4_per_user' : fields.float('This User Period4', readonly=True),
+ 'analyzed_period5_per_user' : fields.float('This User Period5', readonly=True),
+ 'analyzed_period1_per_dept' : fields.float('This Dept Period1', readonly=True),
+ 'analyzed_period2_per_dept' : fields.float('This Dept Period2', readonly=True),
+ 'analyzed_period3_per_dept' : fields.float('This Dept Period3', readonly=True),
+ 'analyzed_period4_per_dept' : fields.float('This Dept Period4', readonly=True),
+ 'analyzed_period5_per_dept' : fields.float('This Dept Period5', readonly=True),
+ 'analyzed_period1_per_warehouse' : fields.float('This Warehouse Period1', readonly=True),
+ 'analyzed_period2_per_warehouse' : fields.float('This Warehouse Period2', readonly=True),
+ 'analyzed_period3_per_warehouse' : fields.float('This Warehouse Period3', readonly=True),
+ 'analyzed_period4_per_warehouse' : fields.float('This Warehouse Period4', readonly=True),
+ 'analyzed_period5_per_warehouse' : fields.float('This Warehouse Period5', readonly=True),
+ 'analyzed_period1_per_company' : fields.float('This Copmany Period1', readonly=True),
+ 'analyzed_period2_per_company' : fields.float('This Company Period2', readonly=True),
+ 'analyzed_period3_per_company' : fields.float('This Company Period3', readonly=True),
+ 'analyzed_period4_per_company' : fields.float('This Company Period4', readonly=True),
+ 'analyzed_period5_per_company' : fields.float('This Company Period5', readonly=True),
+ }
+ _defaults = {
+ 'user_id': lambda obj, cr, uid, context: uid,
+ 'state': lambda *args: 'draft',
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.sale.forecast', context=c),
+ }
+
+ def action_validate(self, cr, uid, ids, *args):
+ self.write(cr, uid, ids, {'state':'validated','user_id':uid})
+ return True
+
+ def unlink(self, cr, uid, ids, context={}):
+ forecasts = self.read(cr, uid, ids, ['state'])
+ unlink_ids = []
+ for t in forecasts:
+ if t['state'] in ('draft'):
+ unlink_ids.append(t['id'])
+ else:
+ raise osv.except_osv(_('Invalid action !'), _('Cannot delete Validated Sale Forecasts !'))
+ osv.osv.unlink(self, cr, uid, unlink_ids,context=context)
+ return True
+
+ def onchange_company(self, cr, uid, ids, company_id):
+ result = {}
+ if company_id:
+ result['warehouse_id'] = False
+ result['analyzed_user_id'] = False
+ result['analyzed_dept_id'] = False
+ result['analyzed_warehouse_id'] = False
+ return {'value': result}
+
+ def product_id_change(self, cr, uid, ids, product_id):
+ ret={}
+ if product_id:
+ product_rec = self.pool.get('product.product').browse(cr, uid, product_id)
+ ret['product_uom'] = product_rec.uom_id.id
+ ret['product_uom_categ'] = product_rec.uom_id.category_id.id
+ ret['product_uos_categ'] = product_rec.uos_id and product_rec.uos_id.category_id.id or False
+ ret['active_uom'] = product_rec.uom_id.id
+ else:
+ ret['product_uom'] = False
+ ret['product_uom_categ'] = False
+ ret['product_uos_categ'] = False
+ res = {'value': ret}
+ return res
+
+ def onchange_uom(self, cr, uid, ids, product_uom=False, product_qty=0.0, active_uom=False ):
+ ret={}
+ val1 = self.browse(cr, uid, ids)
+ val = val1[0]
+ coeff_uom2def = self._to_default_uom_factor(cr, uid, val, active_uom, {})
+ coeff_def2uom, round_value = self._from_default_uom_factor( cr, uid, val, product_uom, {})
+ coeff = coeff_uom2def * coeff_def2uom
+ ret['product_qty'] = rounding(coeff * product_qty, round_value)
+ ret['active_uom'] = product_uom
+ return {'value': ret}
+
+ def product_amt_change(self, cr, uid, ids, product_amt = 0.0, product_uom=False):
+ ret={}
+ if product_amt:
+ coeff_def2uom = 1
+ val1 = self.browse(cr, uid, ids)
+ val = val1[0]
+ if (product_uom != val.product_id.uom_id.id):
+ coeff_def2uom, rounding = self._from_default_uom_factor( cr, uid, val, product_uom, {})
+ ret['product_qty'] = rounding(coeff_def2uom * product_amt/(val.product_id.product_tmpl_id.list_price), round_value)
+ res = {'value': ret}
+ return res
+
+ def _to_default_uom_factor(self, cr, uid, val, uom_id, context):
+ uom_obj = self.pool.get('product.uom')
+ uom = uom_obj.browse(cr, uid, uom_id, context=context)
+ coef = uom.factor
+ if uom.category_id.id <> val.product_id.uom_id.category_id.id:
+ coef = coef / val.product_id.uos_coeff
+ return val.product_id.uom_id.factor / coef
+
+ def _from_default_uom_factor(self, cr, uid, val, uom_id, context):
+ uom_obj = self.pool.get('product.uom')
+ uom = uom_obj.browse(cr, uid, uom_id, context=context)
+ res = uom.factor
+ if uom.category_id.id <> val.product_id.uom_id.category_id.id:
+ res = res / val.product_id.uos_coeff
+ return res / val.product_id.uom_id.factor, uom.rounding
+
+ def _sales_per_users(self, cr, uid, so, so_line, company, users):
+ cr.execute("SELECT sum(sol.product_uom_qty) FROM sale_order_line AS sol LEFT JOIN sale_order AS s ON (s.id = sol.order_id) " \
+ "WHERE (sol.id IN (%s)) AND (s.state NOT IN (\'draft\',\'cancel\')) AND (s.id IN (%s)) AND (s.company_id=%s) " \
+ "AND (s.user_id IN (%s)) " %(so_line, so, company, users))
+ ret = cr.fetchone()[0] or 0.0
+ return ret
+
+ def _sales_per_warehouse(self, cr, uid, so, so_line, company, shops):
+ cr.execute("SELECT sum(sol.product_uom_qty) FROM sale_order_line AS sol LEFT JOIN sale_order AS s ON (s.id = sol.order_id) " \
+ "WHERE (sol.id IN (%s)) AND (s.state NOT IN (\'draft\',\'cancel\')) AND (s.id IN (%s))AND (s.company_id=%s) " \
+ "AND (s.shop_id IN (%s))" %(so_line, so, company, shops))
+ ret = cr.fetchone()[0] or 0.0
+ return ret
+
+ def _sales_per_company(self, cr, uid, so, so_line, company, ):
+ cr.execute("SELECT sum(sol.product_uom_qty) FROM sale_order_line AS sol LEFT JOIN sale_order AS s ON (s.id = sol.order_id) " \
+ "WHERE (sol.id IN (%s)) AND (s.state NOT IN (\'draft\',\'cancel\')) AND (s.id IN (%s)) AND (s.company_id=%s)"%(so_line, so, company))
+ ret = cr.fetchone()[0] or 0.0
+ return ret
+
+ def calculate_sales_history(self, cr, uid, ids, context, *args):
+ sales=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],]
+ for obj in self.browse(cr, uid, ids):
+ periods =obj.analyzed_period1_id, obj.analyzed_period2_id, obj.analyzed_period3_id, obj.analyzed_period4_id, obj.analyzed_period5_id
+ so_obj = self.pool.get('sale.order')
+ so_line_obj= self.pool.get('sale.order.line')
+ so_line_product_ids = so_line_obj.search(cr, uid, [('product_id','=', obj.product_id.id)], context = context)
+ if so_line_product_ids:
+ so_line_product_set = ','.join(map(str,so_line_product_ids))
+ if obj.analyzed_warehouse_id:
+ shops = self.pool.get('sale.shop').search(cr, uid,[('warehouse_id','=', obj.analyzed_warehouse_id.id)], context = context)
+ shops_set = ','.join(map(str,shops))
+ else:
+ shops = False
+ if obj.analyzed_dept_id:
+ dept_obj = self.pool.get('hr.department')
+ dept_id = obj.analyzed_dept_id.id and [obj.analyzed_dept_id.id] or []
+ dept_ids = dept_obj.search(cr,uid,[('parent_id','child_of',dept_id)])
+ dept_ids_set = ','.join(map(str,dept_ids))
+ cr.execute("SELECT user_id FROM hr_department_user_rel WHERE (department_id IN (%s))" %(dept_ids_set))
+ dept_users = [x for x, in cr.fetchall()]
+ dept_users_set = ','.join(map(str,dept_users))
+ else:
+ dept_users = False
+ factor, round_value = self._from_default_uom_factor(cr, uid, obj, obj.product_uom.id, context=context)
+ for i, period in enumerate(periods):
+ if period:
+ so_period_ids = so_obj.search(cr, uid, [('date_order','>=',period.date_start), ('date_order','<=',period.date_stop)], context = context)
+ if so_period_ids:
+ so_period_set = ','.join(map(str,so_period_ids))
+ if obj.analyzed_user_id:
+ user_set = str(obj.analyzed_user_id.id)
+ sales[i][0] =self._sales_per_users(cr, uid, so_period_set, so_line_product_set, obj.company_id.id, user_set)
+ sales[i][0] *=factor
+ if dept_users:
+ sales[i][1]= self._sales_per_users(cr, uid, so_period_set, so_line_product_set, obj.company_id.id, dept_users_set)
+ sales[i][1]*=factor
+ if shops:
+ sales[i][2]= self._sales_per_warehouse(cr, uid, so_period_set, so_line_product_set, obj.company_id.id, shops_set)
+ sales[i][2]*=factor
+ if obj.analyze_company:
+ sales[i][3]= self._sales_per_company(cr, uid, so_period_set, so_line_product_set, obj.company_id.id, )
+ sales[i][3]*=factor
+ self.write(cr, uid, ids, {
+ 'analyzed_period1_per_user':sales[0][0],
+ 'analyzed_period2_per_user':sales[1][0],
+ 'analyzed_period3_per_user':sales[2][0],
+ 'analyzed_period4_per_user':sales[3][0],
+ 'analyzed_period5_per_user':sales[4][0],
+ 'analyzed_period1_per_dept':sales[0][1],
+ 'analyzed_period2_per_dept':sales[1][1],
+ 'analyzed_period3_per_dept':sales[2][1],
+ 'analyzed_period4_per_dept':sales[3][1],
+ 'analyzed_period5_per_dept':sales[4][1],
+ 'analyzed_period1_per_warehouse':sales[0][2],
+ 'analyzed_period2_per_warehouse':sales[1][2],
+ 'analyzed_period3_per_warehouse':sales[2][2],
+ 'analyzed_period4_per_warehouse':sales[3][2],
+ 'analyzed_period5_per_warehouse':sales[4][2],
+ 'analyzed_period1_per_company':sales[0][3],
+ 'analyzed_period2_per_company':sales[1][3],
+ 'analyzed_period3_per_company':sales[2][3],
+ 'analyzed_period4_per_company':sales[3][3],
+ 'analyzed_period5_per_company':sales[4][3],
+ })
+ return True
+
+
+stock_sale_forecast()
+
+# Creates stock planning records for products from selected Product Category for selected 'Warehouse - Period'
+# Object added by contributor in ver 1.1
+class stock_planning_createlines(osv.osv_memory):
+ _name = "stock.planning.createlines"
+
+ def onchange_company(self, cr, uid, ids, company_id):
+ result = {}
+ if company_id:
+ result['warehouse_id2'] = False
+ return {'value': result}
+
+ _columns = {
+ 'company_id': fields.many2one('res.company', 'Company', required = True),
+ 'period_id2': fields.many2one('stock.period' , 'Period', required=True, help = 'Period which planning will concern.'),
+ 'warehouse_id2': fields.many2one('stock.warehouse' , 'Warehouse', required=True, help = 'Warehouse which planning will concern.'),
+ 'product_categ_id2': fields.many2one('product.category' , 'Product Category', \
+ help = 'Planning will be created for products from Product Category selected by this field. '\
+ 'This field is ignored when you check \"All Forecasted Product\" box.' ),
+ 'forecasted_products': fields.boolean('All Products with Forecast', \
+ help = "Check this box to create planning for all products having any forecast for selected Warehouse and Period. "\
+ "Product Category field will be ignored."),
+ }
+
+ _defaults = {
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.planning', context=c),
+ }
+
+ def create_planning(self,cr, uid, ids, context={}):
+ product_obj = self.pool.get('product.product')
+ planning_obj=self.pool.get('stock.planning')
+
+ for f in self.browse(cr, uid, ids, context=context):
+ if f.forecasted_products:
+ cr.execute("SELECT product_id \
+ FROM stock_sale_forecast \
+ WHERE (period_id = %s) AND (warehouse_id = %s)", (f.period_id2.id, f.warehouse_id2.id))
+ products_id1 = [x for x, in cr.fetchall()]
+ else:
+ prod_categ_obj=self.pool.get('product.category')
+ template_obj=self.pool.get('product.template')
+ categ_ids = f.product_categ_id2.id and [f.product_categ_id2.id] or []
+ prod_categ_ids=prod_categ_obj.search(cr,uid,[('parent_id','child_of',categ_ids)])
+ templates_ids = template_obj.search(cr,uid,[('categ_id','in',prod_categ_ids)])
+ products_id1 = product_obj.search(cr,uid,[('product_tmpl_id','in',templates_ids)])
+ if len(products_id1)==0:
+ raise osv.except_osv(_('Error !'), _('No forecasts for selected period or no products in selected category !'))
+
+ for p in product_obj.browse(cr, uid, products_id1,context=context):
+ if len(planning_obj.search(cr, uid, [('product_id','=',p.id),
+ ('period_id','=',f.period_id2.id),
+ ('warehouse_id','=',f.warehouse_id2.id)]))== 0:
+ cr.execute("SELECT period.date_stop, planning.product_uom, planning.planned_outgoing, planning.to_procure, \
+ planning.stock_only, planning.procure_to_stock, planning.confirmed_forecasts_only, \
+ planning.supply_warehouse_id, planning.stock_supply_location \
+ FROM stock_planning AS planning \
+ LEFT JOIN stock_period AS period \
+ ON planning.period_id = period.id \
+ WHERE (planning.create_uid = %s OR planning.write_uid = %s) \
+ AND planning.warehouse_id = %s AND planning.product_id = %s \
+ AND period.date_stop < %s \
+ ORDER BY period.date_stop DESC",
+ (uid, uid, f.warehouse_id2.id, p.id, f.period_id2.date_stop) )
+ ret=cr.fetchone()
+# forecast_qty = ret and ret[0] or 0.0
+ if ret:
+# raise osv.except_osv(_('Error !'), _('ret is %s %s %s %s %s %s')%(ret[0],ret[2],ret[3],ret[4],ret[5],ret[6],))
+ prod_uom = ret[1]
+ planned_out = ret[2]
+ to_procure = ret[3]
+ stock_only = ret[4]
+ procure_to_stock = ret[5]
+ confirmed_forecasts_only = ret[6]
+ supply_warehouse_id = ret[7]
+ stock_supply_location = ret[8]
+ else:
+ prod_uom = p.uom_id.id
+ planned_out = False
+ to_procure = False
+ stock_only = False
+ procure_to_stock = False
+ confirmed_forecasts_only = False
+ supply_warehouse_id = False
+ stock_supply_location = False
+ prod_uos_categ = False
+ if p.uos_id:
+ prod_uos_categ = p.uos_id.category_id.id
+ planning_obj.create(cr, uid, {
+ 'company_id' : f.warehouse_id2.company_id.id,
+ 'period_id': f.period_id2.id,
+ 'warehouse_id' : f.warehouse_id2.id,
+ 'product_id': p.id,
+ 'product_uom' : prod_uom,
+ 'product_uom_categ' : p.uom_id.category_id.id,
+ 'product_uos_categ' : prod_uos_categ,
+ 'active_uom' : prod_uom,
+ 'planned_outgoing': planned_out,
+ 'to_procure': to_procure,
+ 'stock_only': stock_only,
+ 'procure_to_stock': procure_to_stock,
+ 'confirmed_forecasts_only': confirmed_forecasts_only,
+ 'supply_warehouse_id': supply_warehouse_id,
+ 'stock_supply_location': stock_supply_location,
+
+ })
+ return {
+ 'view_type': 'form',
+ "view_mode": 'tree',
+ 'res_model': 'stock.planning',
+ 'type': 'ir.actions.act_window',
+ }
+stock_planning_createlines()
+
+
+# The main Stock Planning object
+# A lot of changes by contributor in ver 1.1
+class stock_planning(osv.osv):
+ _name = "stock.planning"
+
+ def _get_in_out(self, cr, uid, val, date_start, date_stop, direction, done, context):
+# res = {}
+# if not context:
+# context = {}
+ mapping = {'in': {
+ 'field': "incoming_qty",
+ 'adapter': lambda x: x,
+ },
+ 'out': {
+ 'field': "outgoing_qty",
+ 'adapter': lambda x: -x,
+ },
+ }
+ context['from_date'] = date_start
+ context['to_date'] = date_stop
+ locations = [val.warehouse_id.lot_stock_id.id,]
+ if not val.stock_only:
+ locations.extend([val.warehouse_id.lot_input_id.id, val.warehouse_id.lot_output_id.id])
+ context['location'] = locations
+ context['compute_child'] = True
+ product_obj = self.pool.get('product.product')
+ prod_id = val.product_id.id
+ if done:
+ c1=context.copy()
+ c1.update({ 'states':('done',), 'what':(direction,) })
+ prod_ids = [prod_id]
+ st = product_obj.get_product_available(cr,uid, prod_ids, context=c1)
+ res = mapping[direction]['adapter'](st.get(prod_id,0.0))
+ else:
+ product=product_obj.read(cr, uid, prod_id,[], context)
+ product_qty = product[mapping[direction]['field']]
+ res = mapping[direction]['adapter'](product_qty)
+# res[val.id] = product_obj['incoming_qty']
+ return res
+
+ def _get_outgoing_before(self, cr, uid, val, date_start, date_stop, context):
+ cr.execute("SELECT sum(planning.planned_outgoing), planning.product_uom \
+ FROM stock_planning AS planning \
+ LEFT JOIN stock_period AS period \
+ ON (planning.period_id = period.id) \
+ WHERE (period.date_stop >= %s) AND (period.date_stop <= %s) \
+ AND (planning.product_id = %s) AND (planning.company_id = %s) \
+ GROUP BY planning.product_uom", \
+ (date_start, date_stop, val.product_id.id, val.company_id.id,))
+ planning_qtys = cr.fetchall()
+ res = self._to_planning_uom(cr, uid, val, planning_qtys, context)
+ return res
+
+ def _to_planning_uom(self, cr, uid, val, qtys, context):
+ res_qty = 0
+ if qtys:
+ uom_obj = self.pool.get('product.uom')
+ for qty, prod_uom in qtys:
+ coef = self._to_default_uom_factor(cr, uid, val, prod_uom, context=context)
+ res_coef, round_value = self._from_default_uom_factor(cr, uid, val, val.product_uom.id, context=context)
+ coef = coef * res_coef
+ res_qty += rounding(qty * coef, round_value)
+ return res_qty
+
+
+ def _get_forecast(self, cr, uid, ids, field_names, arg, context):
+ res = {}
+ for val in self.browse(cr, uid, ids):
+ res[val.id]={}
+ valid_part = val.confirmed_forecasts_only and " AND state = 'validated'" or ""
+ cr.execute('SELECT sum(product_qty), product_uom \
+ FROM stock_sale_forecast \
+ WHERE product_id = %s AND period_id = %s AND company_id = %s '+valid_part+ \
+ 'GROUP BY product_uom', \
+ (val.product_id.id,val.period_id.id, val.company_id.id))
+ company_qtys = cr.fetchall()
+ res[val.id]['company_forecast'] = self._to_planning_uom(cr, uid, val, company_qtys, context)
+
+ cr.execute('SELECT sum(product_qty), product_uom \
+ FROM stock_sale_forecast \
+ WHERE product_id = %s and period_id = %s AND warehouse_id = %s ' + valid_part + \
+ 'GROUP BY product_uom', \
+ (val.product_id.id,val.period_id.id, val.warehouse_id.id))
+ warehouse_qtys = cr.fetchall()
+ res[val.id]['warehouse_forecast'] = self._to_planning_uom(cr, uid, val, warehouse_qtys, context)
+ res[val.id]['warehouse_forecast'] = rounding(res[val.id]['warehouse_forecast'], val.product_id.uom_id.rounding)
+ return res
+
+ def _get_stock_start(self, cr, uid, val, date, context):
+ context['from_date'] = None
+ context['to_date'] = date
+ locations = [val.warehouse_id.lot_stock_id.id,]
+ if not val.stock_only:
+ locations.extend([val.warehouse_id.lot_input_id.id, val.warehouse_id.lot_output_id.id])
+ context['location'] = locations
+ context['compute_child'] = True
+ product_obj = self.pool.get('product.product').read(cr, uid,val.product_id.id,[], context)
+ res = product_obj['qty_available'] # value for stock_start
+ return res
+
+ def _get_past_future(self, cr, uid, ids, field_names, arg, context):
+ res = {}
+ for val in self.browse(cr, uid, ids, context=context):
+ if val.period_id.date_stop < time.strftime('%Y-%m-%d'):
+ res[val.id] = 'Past'
+ else:
+ res[val.id] = 'Future'
+ return res
+
+ def _get_op(self, cr, uid, ids, field_names, arg, context): # op = OrderPoint
+ res = {}
+ for val in self.browse(cr, uid, ids, context=context):
+ res[val.id]={}
+ cr.execute("SELECT product_min_qty, product_max_qty, product_uom \
+ FROM stock_warehouse_orderpoint \
+ WHERE warehouse_id = %s AND product_id = %s AND active = 'TRUE'", (val.warehouse_id.id, val.product_id.id))
+ ret = cr.fetchone() or [0.0,0.0,False]
+ coef = 1
+ round_value = 1
+ if ret[2]:
+ coef = self._to_default_uom_factor(cr, uid, val, ret[2], context)
+ res_coef, round_value = self._from_default_uom_factor(cr, uid, val, val.product_uom.id, context=context)
+ coef = coef * res_coef
+ res[val.id]['minimum_op'] = rounding(ret[0]*coef, round_value)
+ res[val.id]['maximum_op'] = ret[1]*coef
+ return res
+
+ def onchange_company(self, cr, uid, ids, company_id):
+ result = {}
+ if company_id:
+ result['warehouse_id'] = False
+ return {'value': result}
+
+ def onchange_uom(self, cr, uid, ids, product_uom, ):
+ if not product_uom:
+ return {}
+ ret={}
+ val1 = self.browse(cr, uid, ids)
+ val = val1[0]
+ coeff_uom2def = self._to_default_uom_factor(cr, uid, val, val.active_uom.id, {})
+ coeff_def2uom, round_value = self._from_default_uom_factor( cr, uid, val, product_uom, {})
+ coeff = coeff_uom2def * coeff_def2uom
+ ret['planned_outgoing'] = rounding(coeff * val.planned_outgoing, round_value)
+ ret['to_procure'] = rounding(coeff * val.to_procure, round_value)
+ ret['active_uom'] = product_uom
+ return {'value': ret}
+
+ _columns = {
+ 'company_id': fields.many2one('res.company', 'Company', required = True),
+ 'history' : fields.text('Procurement History', readonly=True, help = "History of procurement or internal supply of this planning line."),
+ 'state' : fields.selection([('draft','Draft'),('done','Done')],'State',readonly=True),
+ 'period_id': fields.many2one('stock.period' , 'Period', required=True, \
+ help = 'Period for this planning. Requisition will be created for beginning of the period.'),
+ 'warehouse_id' : fields.many2one('stock.warehouse','Warehouse', required=True),
+ 'product_id': fields.many2one('product.product' , 'Product', required=True, help = 'Product which this planning is created for.'),
+ 'product_uom_categ' : fields.many2one('product.uom.categ', 'Product UoM Category'), # Invisible field for product_uom domain
+ 'product_uom' : fields.many2one('product.uom', 'UoM', required=True, help = "Unit of Measure used to show the quanities of stock calculation." \
+ "You can use units form default category or from second category (UoS category)."),
+ 'product_uos_categ' : fields.many2one('product.uom.categ', 'Product UoM Category'), # Invisible field for product_uos domain
+# Field used in onchange_uom to check what uom was before change to recalculate quantities acording to old uom (active_uom) and new uom.
+ 'active_uom' :fields.many2one('product.uom', string = "Active UoM"),
+ 'planned_outgoing' : fields.float('Planned Out', required=True, \
+ help = 'Enter planned outgoing quantity from selected Warehouse during the selected Period of selected Product. '\
+ 'To plan this value look at Confirmed Out or Sales Forecasts. This value should be equal or greater than Confirmed Out.'),
+ 'company_forecast': fields.function(_get_forecast, method=True, string ='Company Forecast', multi = 'company', \
+ help = 'All sales forecasts for whole company (for all Warehouses) of selected Product during selected Period.'),
+ 'warehouse_forecast': fields.function(_get_forecast, method=True, string ='Warehouse Forecast', multi = 'warehouse',\
+ help = 'All sales forecasts for selected Warehouse of selected Product during selected Period.'),
+ 'stock_simulation': fields.float('Stock Simulation', readonly =True, \
+ help = 'Stock simulation at the end of selected Period.\n For current period it is: \n' \
+ 'Initial Stock - Already Out + Already In - Expected Out + Incoming Left.\n' \
+ 'For periods ahead it is: \nInitial Stock - Planned Out Before + Incoming Before - Planned Out + Planned In.'),
+ 'incoming': fields.float('Confirmed In', readonly=True, \
+ help = 'Quantity of all confirmed incoming moves in calculated Period.'),
+ 'outgoing': fields.float('Confirmed Out', readonly=True, \
+ help = 'Quantity of all confirmed outgoing moves in calculated Period.'),
+ 'incoming_left': fields.float('Incoming Left', readonly=True, \
+ help = 'Quantity left to Planned incoming quantity. This is calculated difference between Planned In and Confirmed In. ' \
+ 'For current period Already In is also calculated. This value is used to create procurement for lacking quantity.'),
+ 'outgoing_left': fields.float('Expected Out', readonly=True, \
+ help = 'Quantity expected to go out in selected period. As a difference between Planned Out and Confirmed Out. ' \
+ 'For current period Already Out is also calculated'),
+ 'to_procure': fields.float(string='Planned In', required=True, \
+ help = 'Enter quantity which (by your plan) should come in. Change this value and observe Stock simulation. ' \
+ 'This value should be equal or greater than Confirmed In.'),
+ 'line_time' : fields.function(_get_past_future, method=True,type='char', string='Past/Future'),
+ 'minimum_op' : fields.function(_get_op, method=True, type='float', string = 'Minimum Rule', multi= 'minimum', \
+ help = 'Minimum quantity set in Minimum Stock Rules for this Warhouse'),
+ 'maximum_op' : fields.function(_get_op, method=True, type='float', string = 'Maximum Rule', multi= 'maximum', \
+ help = 'Maximum quantity set in Minimum Stock Rules for this Warhouse'),
+ 'outgoing_before' : fields.float('Planned Out Before', readonly=True, \
+ help= 'Planned Out in periods before calculated. '\
+ 'Between start date of current period and one day before start of calculated period.'),
+ 'incoming_before': fields.float('Incoming Before', readonly = True, \
+ help= 'Confirmed incoming in periods before calculated (Including Already In). '\
+ 'Between start date of current period and one day before start of calculated period.'),
+ 'stock_start' : fields.float('Initial Stock', readonly=True, \
+ help= 'Stock quantity one day before current period.'),
+ 'already_out' : fields.float('Already Out', readonly=True, \
+ help= 'Quantity which is already dispatched out of this warehouse in current period.'),
+ 'already_in' : fields.float('Already In', readonly=True, \
+ help= 'Quantity which is already picked up to this warehouse in current period.'),
+ 'stock_only' : fields.boolean("Stock Location Only", help = "Check to calculate stock location of selected warehouse only. " \
+ "If not selected calculation is made for input, stock and output location of warehouse."),
+ "procure_to_stock" : fields.boolean("Procure To Stock Location", help = "Chect to make procurement to stock location of selected warehouse. " \
+ "If not selected procurement will be made into input location of warehouse."),
+ "confirmed_forecasts_only" : fields.boolean("Validated Forecasts", help = "Check to take validated forecasts only. " \
+ "If not checked system takes validated and draft forecasts."),
+ 'supply_warehouse_id' : fields.many2one('stock.warehouse','Source Warehouse', help = "Warehouse used as source in supply pick move created by 'Supply from Another Warhouse'."),
+ "stock_supply_location" : fields.boolean("Stock Supply Location", help = "Check to supply from Stock location of Supply Warehouse. " \
+ "If not checked supply will be made from Output location of Supply Warehouse. Used in 'Supply from Another Warhouse' with Supply Warehouse."),
+
+ }
+
+ _defaults = {
+ 'state': lambda *args: 'draft' ,
+ 'to_procure' : 0.0,
+ 'planned_outgoing' : 0.0,
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.planning', context=c),
+ }
+
+ _order = 'period_id'
+
+ def _to_default_uom_factor(self, cr, uid, val, uom_id, context):
+ uom_obj = self.pool.get('product.uom')
+ uom = uom_obj.browse(cr, uid, uom_id, context=context)
+ coef = uom.factor
+ if uom.category_id.id != val.product_id.uom_id.category_id.id:
+ coef = coef / val.product_id.uos_coeff
+ return val.product_id.uom_id.factor / coef
+
+
+ def _from_default_uom_factor(self, cr, uid, val, uom_id, context):
+ uom_obj = self.pool.get('product.uom')
+ uom = uom_obj.browse(cr, uid, uom_id, context=context)
+ res = uom.factor
+ if uom.category_id.id != val.product_id.uom_id.category_id.id:
+ res = res / val.product_id.uos_coeff
+ return res / val.product_id.uom_id.factor, uom.rounding
+
+ def calculate_planning(self, cr, uid, ids, context, *args):
+ one_minute = RelativeDateTime(minutes=1)
+ current_date_beginning_c = mx.DateTime.today()
+ current_date_end_c = current_date_beginning_c + RelativeDateTime(days=1, minutes=-1) # to get hour 23:59:00
+ current_date_beginning = current_date_beginning_c.strftime('%Y-%m-%d %H:%M:%S')
+ current_date_end = current_date_end_c.strftime('%Y-%m-%d %H:%M:%S')
+ for val in self.browse(cr, uid, ids, context=context):
+ day = mx.DateTime.strptime(val.period_id.date_start, '%Y-%m-%d %H:%M:%S')
+ dbefore = mx.DateTime.DateTime(day.year, day.month, day.day) - one_minute
+ day_before_calculated_period = dbefore.strftime('%Y-%m-%d %H:%M:%S') # one day before start of calculated period
+ cr.execute("SELECT date_start \
+ FROM stock_period AS period \
+ LEFT JOIN stock_planning AS planning \
+ ON (planning.period_id = period.id) \
+ WHERE (period.date_stop >= %s) AND (period.date_start <= %s) AND \
+ planning.product_id = %s", (current_date_end, current_date_end, val.product_id.id,)) #
+ date = cr.fetchone()
+ start_date_current_period = date and date[0] or False
+ start_date_current_period = start_date_current_period or current_date_beginning
+ day = mx.DateTime.strptime(start_date_current_period, '%Y-%m-%d %H:%M:%S')
+ dbefore = mx.DateTime.DateTime(day.year, day.month, day.day) - one_minute
+ date_for_start = dbefore.strftime('%Y-%m-%d %H:%M:%S') # one day before current period
+ already_out = self._get_in_out(cr, uid, val, start_date_current_period, current_date_end, direction='out', done = True, context=context),
+ already_in = self._get_in_out(cr, uid, val, start_date_current_period, current_date_end, direction='in', done = True, context=context),
+ outgoing = self._get_in_out(cr, uid, val, val.period_id.date_start, val.period_id.date_stop, direction='out', done = False, context=context),
+ incoming = self._get_in_out(cr, uid, val, val.period_id.date_start, val.period_id.date_stop, direction='in', done = False, context=context),
+ outgoing_before = self._get_outgoing_before(cr, uid, val, start_date_current_period, day_before_calculated_period, context=context),
+ incoming_before = self._get_in_out(cr, uid, val, start_date_current_period, day_before_calculated_period, direction='in', done = False, context=context),
+ stock_start = self._get_stock_start(cr, uid, val, date_for_start, context=context),
+ if start_date_current_period == val.period_id.date_start: # current period is calculated
+ current=True
+ else:
+ current=False
+ factor, round_value = self._from_default_uom_factor(cr, uid, val, val.product_uom.id, context=context)
+ self.write(cr, uid, ids, {
+ 'already_out': rounding(already_out[0]*factor,round_value),
+ 'already_in': rounding(already_in[0]*factor,round_value),
+ 'outgoing': rounding(outgoing[0]*factor,round_value),
+ 'incoming': rounding(incoming[0]*factor,round_value),
+ 'outgoing_before' : rounding(outgoing_before[0]*factor,round_value),
+ 'incoming_before': rounding((incoming_before[0]+ (not current and already_in[0]))*factor,round_value),
+ 'outgoing_left': rounding(val.planned_outgoing - (outgoing[0] + (current and already_out[0]))*factor,round_value),
+ 'incoming_left': rounding(val.to_procure - (incoming[0] + (current and already_in[0]))*factor,round_value),
+ 'stock_start' : rounding(stock_start[0]*factor,round_value),
+ 'stock_simulation': rounding(val.to_procure - val.planned_outgoing + (stock_start[0]+ incoming_before[0] - outgoing_before[0] \
+ + (not current and already_in[0]))*factor,round_value),
+ })
+ return True
+
+# method below converts quantities and uoms to general OpenERP standard with UoM Qty, UoM, UoS Qty, UoS.
+# from stock_planning standard where you have one Qty and one UoM (any from UoM or UoS category)
+# so if UoM is from UoM category it is used as UoM in standard and if product has UoS the UoS will be calcualated.
+# If UoM is from UoS category it is recalculated to basic UoS from product (in planning you can use any UoS from UoS category)
+# and basic UoM is calculated.
+ def _qty_to_standard(self, cr, uid, val, context):
+ uos = False
+ uos_qty = 0.0
+ if val.product_uom.category_id.id == val.product_id.uom_id.category_id.id:
+ uom_qty = val.incoming_left
+ uom = val.product_uom.id
+ if val.product_id.uos_id:
+ uos = val.product_id.uos_id.id
+ coeff_uom2def = self._to_default_uom_factor(cr, uid, val, val.product_uom.id, {})
+ coeff_def2uom, round_value = self._from_default_uom_factor(cr, uid, val, uos, {})
+ uos_qty = rounding(val.incoming_left * coeff_uom2def * coeff_def2uom, round_value)
+ elif val.product_uom.category_id.id == val.product_id.uos_id.category_id.id:
+ coeff_uom2def = self._to_default_uom_factor(cr, uid, val, val.product_uom.id, {})
+ uos = val.product_id.uos_id.id
+ coeff_def2uom, round_value = self._from_default_uom_factor(cr, uid, val, uos, {})
+ uos_qty = rounding(val.incoming_left * coeff_uom2def * coeff_def2uom, round_value)
+ uom = val.product_id.uom_id.id
+ coeff_def2uom, round_value = self._from_default_uom_factor(cr, uid, val, uom, {})
+ uom_qty = rounding(val.incoming_left * coeff_uom2def * coeff_def2uom, round_value)
+ return uom_qty, uom, uos_qty, uos
+
+ def procure_incomming_left(self, cr, uid, ids, context, *args):
+ for obj in self.browse(cr, uid, ids):
+ if obj.incoming_left <= 0:
+ raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !'))
+ uom_qty, uom, uos_qty, uos = self._qty_to_standard(cr, uid, obj, context)
+ user = self.pool.get('res.users').browse(cr, uid, uid, context)
+ proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
+ 'company_id' : obj.company_id.id,
+ 'name': _('Manual planning for ') + obj.period_id.name,
+ 'origin': _('MPS(') + str(user.login) +') '+ obj.period_id.name,
+ 'date_planned': obj.period_id.date_start,
+ 'product_id': obj.product_id.id,
+ 'product_qty': uom_qty,
+ 'product_uom': uom,
+ 'product_uos_qty': uos_qty,
+ 'product_uos': uos,
+ 'location_id': obj.procure_to_stock and obj.warehouse_id.lot_stock_id.id or obj.warehouse_id.lot_input_id.id,
+ 'procure_method': 'make_to_order',
+ 'note' : _("Procurement created in MPS by user: ") + str(user.login) + _(" Creation Date: ") + \
+ time.strftime('%Y-%m-%d %H:%M:%S') + \
+ _("\nFor period: ") + obj.period_id.name + _(" according to state:") + \
+ _("\n Warehouse Forecast: ") + str(obj.warehouse_forecast) + \
+ _("\n Initial Stock: ") + str(obj.stock_start) + \
+ _("\n Planned Out: ") + str(obj.planned_outgoing) + _(" Planned In: ") + str(obj.to_procure) + \
+ _("\n Already Out: ") + str(obj.already_out) + _(" Already In: ") + str(obj.already_in) + \
+ _("\n Confirmed Out: ") + str(obj.outgoing) + _(" Confirmed In: ") + str(obj.incoming) + \
+ _("\n Planned Out Before: ") + str(obj.outgoing_before) + _(" Confirmed In Before: ") + \
+ str(obj.incoming_before) + \
+ _("\n Expected Out: ") + str(obj.outgoing_left) + _(" Incoming Left: ") + str(obj.incoming_left) + \
+ _("\n Stock Simulation: ") + str(obj.stock_simulation) + _(" Minimum stock: ") + str(obj.minimum_op),
+
+ }, context=context)
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
+ self.calculate_planning(cr, uid, ids, context)
+ prev_text = obj.history or ""
+ self.write(cr, uid, ids, {
+ 'history' : prev_text + _('Requisition (') + str(user.login) + ", " + time.strftime('%Y.%m.%d %H:%M) ') + str(obj.incoming_left) + \
+ " " + obj.product_uom.name + "\n",
+ })
+ return True
+
+ def internal_supply(self, cr, uid, ids, context, *args):
+ for obj in self.browse(cr, uid, ids):
+ if obj.incoming_left <= 0:
+ raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !'))
+ if not obj.supply_warehouse_id:
+ raise osv.except_osv(_('Error !'), _('You must specify a Source Warehouse !'))
+ if obj.supply_warehouse_id.id == obj.warehouse_id.id:
+ raise osv.except_osv(_('Error !'), _('You must specify a Source Warehouse different than calculated (destination) Warehouse !'))
+ uom_qty, uom, uos_qty, uos = self._qty_to_standard(cr, uid, obj, context)
+ user = self.pool.get('res.users').browse(cr, uid, uid, context)
+ picking_id = self.pool.get('stock.picking').create(cr, uid, {
+ 'origin': _('MPS(') + str(user.login) +') '+ obj.period_id.name,
+ 'type': 'internal',
+ 'state': 'auto',
+ 'date' : obj.period_id.date_start,
+ 'move_type': 'direct',
+ 'invoice_state': 'none',
+ 'company_id': obj.company_id.id,
+ 'note': _("Pick created from MPS by user: ") + str(user.login) + _(" Creation Date: ") + \
+ time.strftime('%Y-%m-%d %H:%M:%S') + \
+ _("\nFor period: ") + obj.period_id.name + _(" according to state:") + \
+ _("\n Warehouse Forecast: ") + str(obj.warehouse_forecast) + \
+ _("\n Initial Stock: ") + str(obj.stock_start) + \
+ _("\n Planned Out: ") + str(obj.planned_outgoing) + _(" Planned In: ") + str(obj.to_procure) + \
+ _("\n Already Out: ") + str(obj.already_out) + _(" Already In: ") + str(obj.already_in) + \
+ _("\n Confirmed Out: ") + str(obj.outgoing) + _(" Confirmed In: ") + str(obj.incoming) + \
+ _("\n Planned Out Before: ") + str(obj.outgoing_before) + _(" Confirmed In Before: ") + \
+ str(obj.incoming_before) + \
+ _("\n Expected Out: ") + str(obj.outgoing_left) + _(" Incoming Left: ") + str(obj.incoming_left) + \
+ _("\n Stock Simulation: ") + str(obj.stock_simulation) + _(" Minimum stock: ") + str(obj.minimum_op),
+ })
+
+ move_id = self.pool.get('stock.move').create(cr, uid, {
+ 'name': _('MPS(') + str(user.login) +') '+ obj.period_id.name,
+ 'picking_id': picking_id,
+ 'product_id': obj.product_id.id,
+ 'date_planned': obj.period_id.date_start,
+ 'product_qty': uom_qty,
+ 'product_uom': uom,
+ 'product_uos_qty': uos_qty,
+ 'product_uos': uos,
+ 'location_id': obj.stock_supply_location and obj.supply_warehouse_id.lot_stock_id.id or \
+ obj.supply_warehouse_id.lot_output_id.id,
+ 'location_dest_id': obj.procure_to_stock and obj.warehouse_id.lot_stock_id.id or \
+ obj.warehouse_id.lot_input_id.id,
+ 'tracking_id': False,
+ 'company_id': obj.company_id.id,
+ })
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
+
+ self.calculate_planning(cr, uid, ids, context)
+ prev_text = obj.history or ""
+ pick_name = self.pool.get('stock.picking').browse(cr, uid, picking_id).name
+ self.write(cr, uid, ids, {
+ 'history' : prev_text + _('Pick List ')+ pick_name + " (" + str(user.login) + ", " + time.strftime('%Y.%m.%d %H:%M) ') \
+ + str(obj.incoming_left) +" " + obj.product_uom.name + "\n",
+ })
+
+ return True
+
+ def product_id_change(self, cr, uid, ids, product_id):
+ ret={}
+ if product_id:
+ product_rec = self.pool.get('product.product').browse(cr, uid, product_id)
+ ret['product_uom'] = product_rec.uom_id.id
+ ret['active_uom'] = product_rec.uom_id.id
+ ret['product_uom_categ'] = product_rec.uom_id.category_id.id
+ ret['product_uos_categ'] = product_rec.uos_id and product_rec.uos_id.category_id.id or False
+ else:
+ ret['product_uom'] = False
+ ret['product_uom_categ'] = False
+ ret['product_uos_categ'] = False
+ res = {'value': ret}
+ return res
+
+stock_planning()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock_planning/stock_planning_view.xml b/addons/stock_planning/stock_planning_view.xml
new file mode 100644
index 00000000000..e90d68cf855
--- /dev/null
+++ b/addons/stock_planning/stock_planning_view.xml
@@ -0,0 +1,432 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+ <menuitem id="menu_stock_period_main"
+ name="Stock and Sales Periods"
+ parent="base.menu_base_config"/>
+
+<!-- Creating periods section -->
+
+ <record id="view_stock_period_createlines_form" model="ir.ui.view">
+ <field name="name">stock.period.createlines.form</field>
+ <field name="model">stock.period.createlines</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Stock and Sales Periods">
+ <separator colspan="4" string="Create periods for Stock and Sales Planning"/>
+ <field name="date_start"/>
+ <field name="date_stop"/>
+ <separator colspan="4" string=""/>
+ <group col="3" colspan="4">
+ <button name="create_period" string="Create Daily Periods" type="object"/>
+ <button name="create_period_weekly" string="Create Weekly Periods" type="object"/>
+ <button name="create_period_monthly" string="Create Monthly Periods" type="object"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_stock_period_createlines_form" model="ir.actions.act_window">
+ <field name="name">Stock and Sales Planning Periods</field>
+ <field name="res_model">stock.period.createlines</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="view_stock_period_createlines_form"/>
+ <field name="target">new</field>
+ </record>
+
+ <menuitem id="menu_stock_period_creatlines"
+ name="Create Stock and Sales Periods"
+ parent="menu_stock_period_main"
+ action="action_stock_period_createlines_form"
+ sequence = "5"/>
+
+<!-- Periods tree and form section -->
+
+ <record id="view_stock_period_form" model="ir.ui.view">
+ <field name="name">stock.period.form</field>
+ <field name="model">stock.period</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Stock and Sales Periods">
+ <field name="name"/>
+ <field name="date_start"/>
+ <field name="state" select="1"/>
+ <field name="date_stop"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_stock_period_tree" model="ir.ui.view">
+ <field name="name">stock.period.tree</field>
+ <field name="model">stock.period</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Stock and Sales Period" editable="bottom">
+ <field name="name"/>
+ <field name="date_start"/>
+ <field name="date_stop"/>
+ <field name="state" select="1"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="action_stock_period_form" model="ir.actions.act_window">
+ <field name="name">Stock and Sales Periods</field>
+ <field name="res_model">stock.period</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ </record>
+
+
+ <menuitem
+ id="menu_stock_period"
+ parent="menu_stock_period_main"
+ action="action_stock_period_form"
+ sequence = "10"/>
+
+<!-- Create Forecast section -->
+
+ <record id="view_stock_sale_forecast_createlines_form" model="ir.ui.view">
+ <field name="name">stock.sale.forecast.createlines</field>
+ <field name="model">stock.sale.forecast.createlines</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Stock and Sales Forecasts">
+ <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+ <newline/>
+ <field name="period_id1" widget="selection"/>
+ <newline/>
+ <field name="warehouse_id1" domain = "[('company_id','=',company_id)] "/>
+ <newline/>
+ <field name="product_categ_id1" widget="selection"/>
+ <newline/>
+ <field name="copy_forecast"/>
+ <separator colspan ="4" string="Forecast lines creation"/>
+ <label colspan ="4" string="Creates forecast lines for selected warehouse and period. Doesn't duplicate existing lines created by you."/>
+ <group colspan="4">
+ <button icon="gtk-cancel" special="cancel" string="Cancel"/>
+ <button icon="gtk-execute" name="create_forecast" string="Create Forecasts" type="object" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_stock_sale_forecast_createlines_form" model="ir.actions.act_window">
+ <field name="name">Create Stock and Sales Forecasts</field>
+ <field name="res_model">stock.sale.forecast.createlines</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="view_stock_sale_forecast_createlines_form"/>
+ <field name="target">new</field>
+ </record>
+
+ <menuitem id="menu_stock_sale_forecast" name="Stock and Sales Forecasts" parent="base.menu_base_partner"/>
+
+ <menuitem id="menu_stock_sale_forecast_createlines" name="Create Stock and Sales Forecasts" parent="menu_stock_sale_forecast" action="action_stock_sale_forecast_createlines_form" sequence = "5"/>
+
+ <record id="view_stock_sale_forecast_form" model="ir.ui.view">
+ <field name="name">stock.sale.forecast.form</field>
+ <field name="model">stock.sale.forecast</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Stock and Sales Forecast">
+ <group colspan = "4" col = "4">
+ <group colspan = "2" col="2" >
+ <field name="company_id" select="1"
+ groups="base.group_multi_company"
+ widget="selection"
+ on_change="onchange_company(company_id)"/>
+ <field name="warehouse_id" select="1" domain = "[('company_id','=',company_id)] "/>
+ <field name="period_id" select="1" />
+ <field name="product_id" select="1" on_change="product_id_change(product_id)" />
+ <field name="product_uom_categ" invisible = "True"/>
+ <field name="product_uos_categ" invisible = "True"/>
+ <field name="product_uom"
+ domain = "[('category_id','in',[product_uom_categ,product_uos_categ])]"
+ on_change = "onchange_uom(product_uom, product_qty, active_uom)"/>
+ <field name="active_uom" invisible = "True" />
+ </group>
+ <group colspan = "2" col="2" >
+ <field name="user_id"/>
+ <field name="product_amt" on_change="product_amt_change( product_amt, product_uom)" />
+ <field name="product_qty" />
+ <field name="state"/>
+ <button name="action_validate" string="Validate" states="draft" type="object" colspan = "2"/>
+ </group>
+ </group>
+ <separator colspan ="4" string="Sales history"/>
+ <group colspan = "4" col = "5">
+ <label string = " "/>
+ <label string = "Per User :"/>
+ <label string = "Per Department :"/>
+ <label string = "Per Warehouse :"/>
+ <label string = "Per Company :"/>
+ <label string = "Periods :"/>
+ <field name="analyzed_user_id" nolabel = "1" domain = "[('company_id','=',company_id)] "/>
+ <field name="analyzed_dept_id" nolabel = "1" domain = "[('company_id','=',company_id)] " />
+ <field name="analyzed_warehouse_id" nolabel = "1" domain = "[('company_id','=',company_id)] " />
+ <group colspan = "1" col = "2">
+ <field name = "analyze_company"/>
+ </group>
+ <field name = "analyzed_period1_id" nolabel = "1" />
+ <field name = "analyzed_period1_per_user" nolabel = "1" />
+ <field name = "analyzed_period1_per_dept" nolabel = "1" />
+ <field name = "analyzed_period1_per_warehouse" nolabel = "1" />
+ <field name = "analyzed_period1_per_company" nolabel = "1"/>
+ <field name = "analyzed_period2_id" nolabel = "1" />
+ <field name = "analyzed_period2_per_user" nolabel = "1" />
+ <field name = "analyzed_period2_per_dept" nolabel = "1" />
+ <field name = "analyzed_period2_per_warehouse" nolabel = "1" />
+ <field name = "analyzed_period2_per_company" nolabel = "1" />
+ <field name = "analyzed_period3_id" nolabel = "1"/>
+ <field name = "analyzed_period3_per_user" nolabel = "1" />
+ <field name = "analyzed_period3_per_dept" nolabel = "1" />
+ <field name = "analyzed_period3_per_warehouse" nolabel = "1" />
+ <field name = "analyzed_period3_per_company" nolabel = "1" />
+ <field name = "analyzed_period4_id" nolabel = "1" />
+ <field name = "analyzed_period4_per_user" nolabel = "1" />
+ <field name = "analyzed_period4_per_dept" nolabel = "1" />
+ <field name = "analyzed_period4_per_warehouse" nolabel = "1" />
+ <field name = "analyzed_period4_per_company" nolabel = "1" />
+ <field name = "analyzed_period5_id" nolabel = "1" />
+ <field name = "analyzed_period5_per_user" nolabel = "1" />
+ <field name = "analyzed_period5_per_dept" nolabel = "1" />
+ <field name = "analyzed_period5_per_warehouse" nolabel = "1" />
+ <field name = "analyzed_period5_per_company" nolabel = "1" />
+ <button name="calculate_sales_history" icon="gtk-execute"
+ string="Calculate Sales History" type="object" colspan = "1" states="draft" />
+ </group>
+
+ </form>
+ </field>
+ </record>
+
+ <record id="view_stock_sale_forecast_tree" model="ir.ui.view">
+ <field name="name">stock.sale.forecast.tree</field>
+ <field name="model">stock.sale.forecast</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Stock and Sales Forecasts" editable="bottom">
+ <field name="warehouse_id" select="1"/>
+ <field name="user_id"/>
+ <field name="period_id" select="1"/>
+ <field name="product_id" on_change="product_id_change(product_id)" />
+ <field name="product_qty"/>
+ <field name="product_uom" />
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_stock_sale_forecast_graph" model="ir.ui.view">
+ <field name="name">stock.sale.forecast.graph</field>
+ <field name="model">stock.sale.forecast</field>
+ <field name="type">graph</field>
+ <field name="arch" type="xml">
+ <graph string="Stock and Sales Forecast" type = "bar">
+ <field name="period_id"/>
+ <field name="product_qty"/>
+ <field name="product_id"/>
+ </graph>
+ </field>
+ </record>
+
+
+ <record id="view_stock_sale_forecast_filter" model="ir.ui.view">
+ <field name="name">stock.sale.forecast.list.select</field>
+ <field name="model">stock.sale.forecast</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Search Stock and Sales Forecast">
+ <group col='10' colspan='4'>
+ <filter icon="terp-purchase" string="Validated" domain="[('state','=','validated')]" separator="1"/>
+ <field name="company_id" select="1" widget="selection"/>
+ <field name="warehouse_id" select="1" widget="selection"/>
+ <field name="period_id" select="1" widget="selection"/>
+ <field name="product_id" select="1" widget="selection"/>
+ <field name="create_uid" select="1" widget="selection">
+ <filter icon="terp-purchase" domain="[('create_uid','=',uid)]" help="My Forecasts"/>
+ </field>
+ </group>
+ </search>
+ </field>
+ </record>
+
+
+ <record id="action_view_stock_sale_forecast_form" model="ir.actions.act_window">
+ <field name="name">Stock and Sales Forecast</field>
+ <field name="res_model">stock.sale.forecast</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form,graph</field>
+ <field name="search_view_id" ref="view_stock_sale_forecast_filter"/>
+ </record>
+
+ <menuitem id="menu_stock_sale_forecast_all"
+ name="Stock and Sales Forecasts"
+ parent="menu_stock_sale_forecast"
+ action="action_view_stock_sale_forecast_form"/>
+
+<!-- Create Planning section -->
+
+ <menuitem id="menu_stock_planning_main" name="Stock Planning" parent="stock.menu_stock_root"/>
+
+ <record id="view_stock_planning_createlines_form" model="ir.ui.view">
+ <field name="name">stock.planning.createlines.form</field>
+ <field name="model">stock.planning.createlines</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Stock Planning">
+ <field name="company_id" widget= "selection" on_change="onchange_company(company_id)" groups="base.group_multi_company"/>
+ <newline/>
+ <field name="period_id2" widget="selection"/>
+ <newline/>
+ <field name="warehouse_id2" domain = "[('company_id','=',company_id)] "/>
+ <newline/>
+ <field name="forecasted_products"/>
+ <newline/>
+ <field name="product_categ_id2" attrs="{'required':[('forecasted_products','=',0)]}" widget="selection"/>
+ <separator colspan ="4" string="Stock planning lines creation"/>
+ <label colspan ="4" string="Creates planning lines for selected period and warehouse. Doesn't duplicate existing lines created by you."/>
+ <group colspan="4">
+ <button icon="gtk-cancel" special="cancel" string="Cancel"/>
+ <button icon="gtk-ok" name="create_planning" string="Create Stock Planning" type="object"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_stock_planning_createlines_form" model="ir.actions.act_window">
+ <field name="name">Create Stock Planning Lines</field>
+ <field name="res_model">stock.planning.createlines</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="view_stock_planning_createlines_form"/>
+ <field name="target">new</field>
+ </record>
+
+ <menuitem
+ id="menu_stock_planning_createlines"
+ parent="menu_stock_planning_main"
+ action="action_stock_planning_createlines_form" sequence = "5"/>
+
+<!-- Planning section -->
+
+ <record id="view_stock_planning_form" model="ir.ui.view">
+ <field name="name">stock.planning.form</field>
+ <field name="model">stock.planning</field>
+ <field name="type">form</field>
+ <field name="priority">50</field>
+ <field name="arch" type="xml">
+ <form string="Stock Planning">
+ <group colspan="4" col="7">
+ <group colspan ="3" col="2">
+ <separator colspan ="2" string = "General Info"/>
+
+ <field name="company_id" select = "1" widget= "selection"
+ on_change="onchange_company(company_id)" groups="base.group_multi_company"/>
+ <field name="warehouse_id" select="1" domain = "[('company_id','=',company_id)] " />
+ <field name="period_id" select="1" />
+ <field name="product_id" on_change="product_id_change(product_id)" />
+ <field name="product_uom_categ" invisible = "True"/>
+ <field name="product_uos_categ" invisible = "True"/>
+ <field name="product_uom"
+ domain = "[('category_id','in',[product_uom_categ,product_uos_categ])]"
+ on_change = "onchange_uom(product_uom)"/>
+<!-- <field name="state"/> -->
+ <separator colspan ="2" string = "Forecasts"/>
+ <field name="warehouse_forecast"/>
+ <field name="company_forecast"/>
+ <field name="confirmed_forecasts_only"/>
+
+
+ </group>
+ <group colspan ="2" col="2">
+ <separator colspan ="2" string = "Current Period Situation"/>
+ <field name="stock_start"/>
+ <field name="already_out"/>
+ <field name="already_in"/>
+ <separator colspan ="2" string = "Planning and Situation for Calculated Period"/>
+ <field name="planned_outgoing"/>
+ <field name="outgoing"/>
+ <field name="outgoing_left"/>
+ <field name="to_procure"/>
+ <field name="incoming"/>
+ <field name="incoming_left"/>
+ <button name="calculate_planning" string="Calculate Planning" type="object" colspan="2"/>
+ <field name="stock_only"/>
+ </group>
+ <group colspan ="2" col="2">
+ <separator colspan ="2" string = "Minimum Stock Rule Indicators"/>
+ <field name="minimum_op"/>
+ <field name="maximum_op"/>
+ <separator colspan ="2" string = "Calculated Period Simulation"/>
+ <field name="outgoing_before"/>
+ <field name="incoming_before"/>
+ <field name="stock_simulation"/>
+ <button name="procure_incomming_left" string="Procure Incoming Left" type="object" colspan="2"/>
+ <field name="procure_to_stock"/>
+ <separator colspan ="2" string = "Internal Supply"/>
+ <button name="internal_supply" string="Supply from Another Warehouse" type="object" colspan="2"/>
+ <field name="supply_warehouse_id" domain = "[('company_id','=',company_id)] "/>
+ <field name="stock_supply_location"/>
+ </group>
+ </group>
+ <separator colspan ="4" string = "Requisition history"/>
+ <field name = "history" colspan = "2" nolabel = "1"/>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_stock_planning_filter" model="ir.ui.view">
+ <field name="name">stock.planning.list.select</field>
+ <field name="model">stock.planning</field>
+ <field name="type">search</field>
+ <field name="arch" type="xml">
+ <search string="Search Stock Planning">
+ <group col='10' colspan='4'>
+<!-- Doesn't work ! <filter icon="terp-purchase" string="Current" domain="[('line_time','=','Future')]" separator="1"/> -->
+ <filter icon="terp-purchase" string="No Requisition" domain="[('history','=',False)]" separator="1"/>
+ <field name="company_id" select="1" widget="selection"/>
+ <field name="warehouse_id" select="1" widget="selection"/>
+ <field name="period_id" select="1" widget="selection"/>
+ <field name="product_id" select="1" widget="selection"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+
+ <record id="view_stock_planning_tree" model="ir.ui.view">
+ <field name="name">stock.planning.tree</field>
+ <field name="model">stock.planning</field>
+ <field name="type">tree</field>
+ <field name="arch" type="xml">
+ <tree string="Master Procurement Schedule" colors ="blue:line_time=='Past';black:line_time=='Future'">
+ <field name="warehouse_id" domain = "[('company_id','=',company_id)] " />
+ <field name="period_id"/>
+ <field name="product_id" on_change="product_id_change(product_id)" />
+ <field name="product_uom"/>
+ <field name="warehouse_forecast" string="Forecast"/>
+ <field name="planned_outgoing"/>
+ <field name="to_procure"/>
+ <field name="stock_simulation" string="Stock"/> <!-- previously stock_start -->
+ </tree>
+ </field>
+ </record>
+
+ <record id="action_view_stock_planning_form" model="ir.actions.act_window">
+ <field name="name">Master Procurement Schedule</field>
+ <field name="res_model">stock.planning</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_stock_planning_filter"/>
+ </record>
+
+ <menuitem
+ id="menu_stock_planning"
+ parent="menu_stock_planning_main"
+ action="action_view_stock_planning_form"/>
+
+</data>
+</openerp>
diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py
index 3a0fa73abc9..d3aa9020444 100644
--- a/addons/thunderbird/partner/partner.py
+++ b/addons/thunderbird/partner/partner.py
@@ -83,14 +83,11 @@ class tinythunderbird_partner(osv.osv):
def thunderbird_mailcreate(self,cr,user,vals):
dictcreate = dict(vals)
- for val in vals:
- if val[0] == 'object':
- object = val[1]
import email
header_name = email.Header.decode_header(dictcreate['name'])
dictcreate['name'] = header_name and header_name[0] and header_name[0][0]
add_obj=self.pool.get('res.partner.address')
- case_pool=self.pool.get(object)
+ case_pool=self.pool.get('crm.case')
partner_ids=add_obj.search(cr,user,[('email','=',dictcreate['email_from'])])
partner=add_obj.read(cr,user,partner_ids,['partner_id'])
if partner:
@@ -98,7 +95,7 @@ class tinythunderbird_partner(osv.osv):
search_id = self.pool.get('res.request.link').search(cr,user,[('object','=',dictcreate['ref'].split(',')[0])])
if not search_id:
create_link_id = self.pool.get('res.request.link').create(cr,user,{'name':dictcreate['ref'].split(',')[0],'object':dictcreate['ref'].split(',')[0]})
- create_id = self.pool.get(object).create(cr, user, dictcreate)
+ create_id = self.pool.get('crm.case').create(cr, user, dictcreate)
cases=case_pool.browse(cr,user,[create_id])
case_pool._history(cr, user, cases, _('Archive'), history=True, email=False)
return create_id
diff --git a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi
index d48a837cbbd..7fb57818c15 100755
--- a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi
+++ b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi
Binary files differ