diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index ca5caee014d..0afe7f878e0 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -68,6 +68,8 @@ module named account_voucherss
'wizard/account_validate_move_view.xml',
'wizard/account_statement_from_invoice_view.xml',
'wizard/account_pay_invoice_view.xml',
+ 'wizard/account_unreconcile_view.xml',
+ 'wizard/account_invoice_state_view.xml',
'project/wizard/project_account_analytic_line_view.xml',
'account_view.xml',
'account_end_fy.xml',
diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml
index 09ae2bafede..148491fb2a1 100644
--- a/addons/account/account_wizard.xml
+++ b/addons/account/account_wizard.xml
@@ -49,7 +49,7 @@
-
+
-
+
+
+
-
-
+ />-->
+
-
-
+-->
diff --git a/addons/hr_timesheet/hr_timesheet_wizard.xml b/addons/hr_timesheet/hr_timesheet_wizard.xml
index 8d84a261ba6..f0a2d7175b3 100644
--- a/addons/hr_timesheet/hr_timesheet_wizard.xml
+++ b/addons/hr_timesheet/hr_timesheet_wizard.xml
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/addons/hr_timesheet/report/users_timesheet.py b/addons/hr_timesheet/report/users_timesheet.py
index c179c3d3fff..9755d2d5871 100644
--- a/addons/hr_timesheet/report/users_timesheet.py
+++ b/addons/hr_timesheet/report/users_timesheet.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -42,24 +42,24 @@ def emp_create_xml(cr, id, som, eom):
"and line.user_id=%s and line.date >= %s and line.date < %s "
"order by line.date",
(id, som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
-
+
# Sum by day
month = {}
for presence in cr.dictfetchall():
day = int(presence['date'][-2:])
month[day] = month.get(day, 0.0) + presence['amount']
-
+
xml = '''
%.2f
'''
time_xml = ([xml % (day, amount) for day, amount in month.iteritems()])
-
+
# Computing the employee
cr.execute("select name from res_users where id=%s", (id,))
emp = cr.fetchone()[0]
-
+
# Computing the xml
xml = '''
@@ -73,13 +73,13 @@ class report_custom(report_rml):
def get_month_name(self, cr, uid, month):
_months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")}
return _months[month]
-
+
def get_weekday_name(self, cr, uid, weekday):
_weekdays = {1:_('Mon'), 2:_('Tue'), 3:_('Wed'), 4:_('Thu'), 5:_('Fri'), 6:_('Sat'), 7:_('Sun')}
return _weekdays[weekday]
def create_xml(self, cr, uid, ids, data, context):
-
+
# Computing the dates (start of month: som, and end of month: eom)
som = datetime.date(data['form']['year'], data['form']['month'], 1)
eom = som + datetime.timedelta(lengthmonth(som.year, som.month))
@@ -87,9 +87,9 @@ class report_custom(report_rml):
date_xml += ['' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)]
date_xml.append('')
date_xml.append('2.5cm%s,2cm\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
-
+
emp_xml=''
- for id in data['form']['user_ids'][0][2]:
+ for id in data['form']['user_ids']:
emp_xml += emp_create_xml(cr, id, som, eom)
# Computing the xml
diff --git a/addons/hr_timesheet/wizard/__init__.py b/addons/hr_timesheet/wizard/__init__.py
index 88b1cb40415..8619dcbcfea 100644
--- a/addons/hr_timesheet/wizard/__init__.py
+++ b/addons/hr_timesheet/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,13 +15,13 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
import sign_in_out
-import wizard_print_timesheet
-import wizard_print_timesheet_users
+import hr_timesheet_print_employee
+import hr_timesheet_print_users
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py b/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py
new file mode 100644
index 00000000000..d2e9a54f836
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+import datetime
+
+from osv import osv, fields
+
+class analytical_timesheet_employee(osv.osv_memory):
+ _name = 'hr.analytical.timesheet.employee'
+ _description = 'Print Employee Timesheet & Print My Timesheet'
+ _columns = {
+ 'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
+ 'Month', required=True),
+ 'year': fields.integer('Year', required=True),
+ 'user_id': fields.many2one('res.users', 'User', required=True)
+ }
+
+ def _get_user(self, cr, uid, context=None):
+ return uid
+
+ _defaults = {
+ 'month': datetime.date.today().month,
+ 'year': datetime.date.today().year,
+ 'user_id': _get_user
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, context=context)[0]
+ datas = {
+ 'ids': [],
+ 'model': 'hr.employee',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'hr.analytical.timesheet',
+ 'datas': datas,
+ }
+analytical_timesheet_employee()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml b/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml
new file mode 100644
index 00000000000..a3b53a05d22
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+ hr.analytical.timesheet.employee.form
+ hr.analytical.timesheet.employee
+ form
+
+
+
+
+
+
+ Employee Timesheet
+ hr.analytical.timesheet.employee
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
+
+ hr.analytical.timesheet.my.form
+ hr.analytical.timesheet.employee
+ form
+
+
+
+
+
+
+ Print My Timesheet
+ hr.analytical.timesheet.employee
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_users.py b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py
new file mode 100644
index 00000000000..3931e41e185
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_users.py
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import datetime
+
+from osv import osv, fields
+
+class analytical_timesheet_employees(osv.osv_memory):
+ _name = 'hr.analytical.timesheet.users'
+ _description = 'Print Employees Timesheet'
+ _columns = {
+ 'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
+ 'Month', required=True),
+ 'year': fields.integer('Year', required=True),
+ 'user_ids': fields.many2many('res.users', 'timesheet_users_rel', 'timesheet_id', 'user_id', 'Users', required=True)
+ }
+
+ _defaults = {
+ 'month': datetime.date.today().month,
+ 'year': datetime.date.today().year,
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ data = self.read(cr, uid, ids, context=context)[0]
+ datas = {
+ 'ids': [],
+ 'model': 'hr.employee',
+ 'form': data
+ }
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'hr.analytical.timesheet_users',
+ 'datas': datas,
+ }
+
+analytical_timesheet_employees()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_users_view.xml b/addons/hr_timesheet/wizard/hr_timesheet_print_users_view.xml
new file mode 100644
index 00000000000..4e12f4f2333
--- /dev/null
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_users_view.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ hr.analytical.timesheet.users.form
+ hr.analytical.timesheet.users
+ form
+
+
+
+
+
+
+ Employees Timesheet
+ hr.analytical.timesheet.users
+ form
+ tree,form
+
+ new
+
+
+
+
+
+
+
diff --git a/addons/hr_timesheet/wizard/sign_in_out.py b/addons/hr_timesheet/wizard/sign_in_out.py
index 4aea035f829..ff532afc260 100644
--- a/addons/hr_timesheet/wizard/sign_in_out.py
+++ b/addons/hr_timesheet/wizard/sign_in_out.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -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 .
+# along with this program. If not, see .
#
##############################################################################
@@ -25,7 +25,7 @@ import time
import pooler
from tools.translate import _
-si_form ='''
+si_form ='''
@@ -262,6 +271,7 @@
+
@@ -280,5 +290,58 @@
name="Product purchases"
res_model="purchase.order.line"
src_model="product.product"/>
+
+
+ Purchase Order Lines
+ ir.actions.act_window
+ purchase.order.line
+ tree,form
+
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
+
+
+
+ Uninvoiced Purchase Order Lines
+ ir.actions.act_window
+ purchase.order.line
+ [('state','in',('confirmed','done')), ('invoiced','=',False)]
+ form
+ tree,form
+
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
+
+
+
diff --git a/addons/purchase/wizard/__init__.py b/addons/purchase/wizard/__init__.py
index 73bb88500a8..dbc3fc5e31b 100644
--- a/addons/purchase/wizard/__init__.py
+++ b/addons/purchase/wizard/__init__.py
@@ -20,6 +20,7 @@
##############################################################################
import purchase_order_group
-
+import purchase_installer
+import purchase_line_invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase_manual/wizard/__init__.py b/addons/purchase/wizard/purchase_installer.py
similarity index 73%
rename from addons/purchase_manual/wizard/__init__.py
rename to addons/purchase/wizard/purchase_installer.py
index e93c28bfe14..da2c3f41cca 100644
--- a/addons/purchase_manual/wizard/__init__.py
+++ b/addons/purchase/wizard/purchase_installer.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
+# Copyright (C) 2004-2009 Tiny SPRL ().
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -15,8 +15,17 @@
# 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 .
+# along with this program. If not, see .
#
##############################################################################
+from osv import fields, osv
+
+class purchase_installer(osv.osv_memory):
+ _name = 'purchase.installer'
+ _inherit = 'res.config.installer'
+
+ _columns = {
+ 'purchase_requisition':fields.boolean('Purchase Requisition'),
+ }
+purchase_installer()
-import wizard_purchase_line_invoice
diff --git a/addons/purchase/wizard/purchase_installer.xml b/addons/purchase/wizard/purchase_installer.xml
new file mode 100644
index 00000000000..efa8ec19887
--- /dev/null
+++ b/addons/purchase/wizard/purchase_installer.xml
@@ -0,0 +1,43 @@
+
+
+
+
+ Purchase Requisition
+ purchase.installer
+ form
+
+
+
+
+ Purchase Modules Installation
+
+
+ This module allows you to manage your Purchase Requisition.
+
+
+
+
+
+
+
+
+
+
+
+ Purchase Profile : Install Extra Modules
+ ir.actions.act_window
+ purchase.installer
+
+ form
+ form
+ new
+
+
+
+
+ 3
+
+
+
+
diff --git a/addons/purchase/wizard/purchase_line_invoice.py b/addons/purchase/wizard/purchase_line_invoice.py
new file mode 100644
index 00000000000..12024df71ad
--- /dev/null
+++ b/addons/purchase/wizard/purchase_line_invoice.py
@@ -0,0 +1,132 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import netsvc
+import ir
+from osv import osv
+from tools.translate import _
+
+class purchase_line_invoice(osv.osv_memory):
+
+ """ To create invoice for purchase order line"""
+
+ _name = 'purchase.order.line_invoice'
+ _description = 'Purchase Order Line Make Invoice'
+
+ def makeInvoices(self, cr, uid, ids, context):
+ """
+ To get Purchase Order line and create Invoice
+ @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 view of Invoice
+ """
+ record_ids = context.get('active_ids',[])
+ if record_ids:
+ res = False
+ invoices = {}
+ invoice_obj=self.pool.get('account.invoice')
+ purchase_line_obj=self.pool.get('purchase.order.line')
+ property_obj=self.pool.get('ir.property')
+ account_fiscal_obj=self.pool.get('account.fiscal.position')
+ invoice_line_obj=self.pool.get('account.invoice.line')
+
+ def make_invoice(order, lines):
+ a = order.partner_id.property_account_payable.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': 'in_invoice',
+ 'reference': "P%dPO%d" % (order.partner_id.id, order.id),
+ 'account_id': a,
+ 'partner_id': order.partner_id.id,
+ 'address_invoice_id': order.partner_address_id.id,
+ 'address_contact_id': order.partner_address_id.id,
+ 'invoice_line': [(6,0,lines)],
+ 'currency_id' : order.pricelist_id.currency_id.id,
+ 'comment': order.notes,
+ 'payment_term': pay_term,
+ 'fiscal_position': order.partner_id.property_account_position.id
+ }
+ inv_id = invoice_obj.create(cr, uid, inv)
+ return inv_id
+
+ for line in purchase_line_obj.browse(cr,uid,record_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] = []
+ if line.product_id:
+ a = line.product_id.product_tmpl_id.property_account_expense.id
+ if not a:
+ a = line.product_id.categ_id.property_account_expense_categ.id
+ if not a:
+ raise osv.except_osv(_('Error !'),
+ _('There is no expense account defined ' \
+ 'for this product: "%s" (id:%d)') % \
+ (line.product_id.name, line.product_id.id,))
+ else:
+ a = property_obj.get(cr, uid,
+ 'property_account_expense_categ', 'product.category',
+ context=context)
+ fpos = line.order_id.fiscal_position or False
+ a = account_fiscal_obj.map_account(cr, uid, fpos, a)
+ inv_id = invoice_line_obj.create(cr, uid, {
+ 'name': line.name,
+ 'origin': line.order_id.name,
+ 'account_id': a,
+ 'price_unit': line.price_unit,
+ 'quantity': line.product_qty,
+ 'uos_id': line.product_uom.id,
+ 'product_id': line.product_id.id or False,
+ 'invoice_line_tax_id': [(6, 0, [x.id for x in line.taxes_id])],
+ 'note': line.notes,
+ 'account_analytic_id': line.account_analytic_id and line.account_analytic_id.id or False,
+ })
+ cr.execute('insert into purchase_order_line_invoice_rel (order_line_id,invoice_id) values (%s,%s)', (line.id, inv_id))
+ purchase_line_obj.write(cr, uid, [line.id], {'invoiced': True})
+ invoices[line.order_id.id].append((line,inv_id))
+
+ res = []
+ for result in invoices.values():
+ order = result[0][0].order_id
+ il = map(lambda x: x[1], result)
+ res.append(make_invoice(order, il))
+
+ return {
+ 'domain': "[('id','in', ["+','.join(map(str,res))+"])]",
+ 'name': _('Supplier Invoices'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.invoice',
+ 'view_id': False,
+ 'context': "{'type':'in_invoice'}",
+ 'type': 'ir.actions.act_window'
+ }
+purchase_line_invoice()
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/purchase/wizard/purchase_line_invoice_view.xml b/addons/purchase/wizard/purchase_line_invoice_view.xml
new file mode 100644
index 00000000000..c5855e5d448
--- /dev/null
+++ b/addons/purchase/wizard/purchase_line_invoice_view.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+ Control invoices
+ purchase.order.line_invoice
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/purchase_manual/__openerp__.py b/addons/purchase_manual/__openerp__.py
deleted file mode 100644
index 7634af9ca7a..00000000000
--- a/addons/purchase_manual/__openerp__.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-
-{
- 'name': 'Purchase Management - Manual Control of Invoice',
- 'version': '1.1',
- 'category': 'Generic Modules/Sales & Purchases',
- 'description': """Module for purchase management, manual control of invoice""",
- 'author': 'Tiny',
- 'website': 'http://www.openerp.com',
- 'depends': ['purchase'],
- 'init_xml': [],
- 'update_xml': [
- 'purchase_manual_view.xml',
- 'purchase_manual_wizard.xml',
- ],
- 'demo_xml': [],
- 'installable': True,
- 'active': False,
-# 'certificate': False,
-}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase_manual/purchase_manual.py b/addons/purchase_manual/purchase_manual.py
deleted file mode 100644
index f31b96f4c8a..00000000000
--- a/addons/purchase_manual/purchase_manual.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields
-from osv import osv
-import netsvc
-
-class purchase_order_line(osv.osv):
- _inherit='purchase.order.line'
- _columns = {
- 'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', required=True, readonly=True,
- help=' * The \'Draft\' state is set automatically when purchase order in draft state. \
- \n* The \'Confirmed\' state is set automatically as confirm when purchase order in confirm state. \
- \n* The \'Done\' state is set automatically when purchase order is set as done. \
- \n* The \'Cancelled\' state is set automatically when user cancel purchase order.'),
- 'invoice_lines': fields.many2many('account.invoice.line', 'purchase_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True),
- 'invoiced': fields.boolean('Invoiced', readonly=True),
- 'partner_id': fields.related('order_id','partner_id',string='Partner',readonly=True,type="many2one", relation="res.partner"),
- 'date_order': fields.related('order_id','date_order',string='Order Date',readonly=True,type="date")
- }
- _defaults = {
- 'state': lambda *args: 'draft',
- 'invoiced': lambda *a: 0,
-
- }
- def copy_data(self, cr, uid, id, default=None, context={}):
- print 'copy called'
- if not default:
- default = {}
- default.update({
- 'state':'draft',
- 'invoiced':0,
- 'invoice_lines':[],
- })
- return super(purchase_order_line, self).copy_data(cr, uid, id, default, context)
-
- def action_confirm(self, cr, uid, ids, context={}):
- self.write(cr, uid, ids, {'state': 'confirmed'}, context)
- return True
-purchase_order_line()
-
-class purchase_order(osv.osv):
- _inherit='purchase.order'
- def action_invoice_create(self, cr, uid, ids, context={}):
- print 'Invoice Create'
- res = super(purchase_order, self).action_invoice_create(cr, uid, ids, context)
- for po in self.browse(cr, uid, ids, context):
- todo = []
- for line in po.order_line:
- todo.append(line.id)
- self.pool.get('purchase.order.line').write(cr, uid, todo, {'invoiced':True}, context)
- return res
-
- def wkf_confirm_order(self, cr, uid, ids, context={}):
- res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context)
- todo = []
- for po in self.browse(cr, uid, ids, context):
- for line in po.order_line:
- if line.state=='draft':
- todo.append(line.id)
- self.pool.get('purchase.order.line').action_confirm(cr, uid, todo, context)
- return res
-purchase_order()
diff --git a/addons/purchase_manual/purchase_manual_view.xml b/addons/purchase_manual/purchase_manual_view.xml
deleted file mode 100644
index 114ae173e1b..00000000000
--- a/addons/purchase_manual/purchase_manual_view.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
- #
- # Define PO Line Views
- #
-
-
- purchase.order.form
- purchase.order
- form
-
-
-
-
-
-
-
-
-
-
- purchase.order.line.form
- purchase.order.line
- form
-
- 17
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- purchase.order.line.tree
- purchase.order.line
- tree
-
-
-
-
-
-
-
-
-
- #
- # Inherit PO view to get buttons
- #
-
-
- Purchase Order Lines
- ir.actions.act_window
- purchase.order.line
- tree,form
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- Uninvoiced Purchase Order Lines
- ir.actions.act_window
- purchase.order.line
- [('state','in',('confirmed','done')), ('invoiced','=',False)]
- form
- tree,form
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
diff --git a/addons/purchase_manual/purchase_manual_wizard.xml b/addons/purchase_manual/purchase_manual_wizard.xml
deleted file mode 100644
index 62771cf9fbb..00000000000
--- a/addons/purchase_manual/purchase_manual_wizard.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py b/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py
deleted file mode 100644
index 0e30368d41b..00000000000
--- a/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import netsvc
-import ir
-import pooler
-from osv import osv
-from tools.translate import _
-
-invoice_form = """
-