From bb5d7cf5725bb6642838fc70717cbdc8b540588c Mon Sep 17 00:00:00 2001 From: Chris Halls Date: Fri, 16 Apr 2010 16:24:29 +0100 Subject: [PATCH 001/291] [FIX] When duplicating a production order, clear existing stock moves If a production order is duplicated, it will be because someone wants to build the same item(s) again. The copy function already puts the production order back into state draft but does not delete the related stock movements and consumed products. bzr revid: chris.halls@credativ.co.uk-20100416152429-2ygxfb32lvew3bgl --- addons/mrp/mrp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index eda4f076602..0e051e7ac2e 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -560,8 +560,12 @@ class mrp_production(osv.osv): default.update({ 'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.production'), 'move_lines' : [], - 'move_created_ids': [], - 'state': 'draft' + 'move_lines2' : [], + 'move_created_ids' : [], + 'move_created_ids2' : [], + 'product_lines' : [], + 'state': 'draft', + 'picking_id': False }) return super(mrp_production, self).copy(cr, uid, id, default, context) From c8a0a2a19165323500a15b4080512286174bf0d3 Mon Sep 17 00:00:00 2001 From: "pap (openerp)" Date: Thu, 17 Jun 2010 18:47:58 +0530 Subject: [PATCH 002/291] [IMP]: 1) added missing wizards under Financial Management/Periodical Processing 2) added entry_type on move line for different types of invoices bzr revid: pap@tinyerp.co.in-20100617131758-668hhpu1q1qkmt20 --- addons/account/account_view.xml | 22 +++++++++---------- addons/account/invoice.py | 21 +++++++++++++++--- .../account_subscription_generate_view.xml | 2 +- .../account/wizard/account_use_model_view.xml | 4 ++-- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index cf117613189..694a48177d9 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1022,7 +1022,7 @@ - Journal Entries + Journal Vouchers account.move form tree,form @@ -1033,7 +1033,7 @@ - Journal Items + Receivable Entries account.move form tree,form @@ -1045,7 +1045,7 @@ - Transaction Journals + Payable Entries account.move form tree,form @@ -1167,20 +1167,20 @@ form,tree - - - - - + - - - + company_currency # create one move line for the total and possibly adjust the other lines amount @@ -847,7 +854,7 @@ class account_invoice(osv.osv): line = self.finalize_invoice_move_lines(cr, uid, inv, line) - move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date} + move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date, 'type': entry_type} period_id=inv.period_id and inv.period_id.id or False if not period_id: period_ids= self.pool.get('account.period').search(cr,uid,[('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d'))]) @@ -1070,10 +1077,18 @@ class account_invoice(osv.osv): else: amount_currency = False currency_id = False + entry_type='' if invoice.type in ('in_invoice', 'in_refund'): ref = invoice.reference + entry_type = 'journal_pur_voucher' + if invoice.type in ('in_refund'): + entry_type = 'cont_voucher' else: ref = self._convert_ref(cr, uid, invoice.number) + entry_type = 'journal_sale_vou' + if invoice.type in ('out_refund'): + entry_type = 'cont_voucher' + # Pay attention to the sign for both debit/credit AND amount_currency l1 = { 'debit': direction * pay_amount>0 and direction * pay_amount, @@ -1104,7 +1119,7 @@ class account_invoice(osv.osv): l2['name'] = name lines = [(0, 0, l1), (0, 0, l2)] - move = {'ref': ref, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date} + move = {'ref': ref, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date, 'type': entry_type} move_id = self.pool.get('account.move').create(cr, uid, move, context=context) line_ids = [] diff --git a/addons/account/wizard/account_subscription_generate_view.xml b/addons/account/wizard/account_subscription_generate_view.xml index cfe91171621..ad0e4f958d1 100644 --- a/addons/account/wizard/account_subscription_generate_view.xml +++ b/addons/account/wizard/account_subscription_generate_view.xml @@ -32,7 +32,7 @@ new - + diff --git a/addons/account/wizard/account_use_model_view.xml b/addons/account/wizard/account_use_model_view.xml index 6ca3de7aa65..9ff781ea53c 100644 --- a/addons/account/wizard/account_use_model_view.xml +++ b/addons/account/wizard/account_use_model_view.xml @@ -41,8 +41,8 @@ account.move.line - - + account.use.model.open.entry.form From d07e43933180eddde1232c133425bb7c49a094de Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 18 Jun 2010 11:54:39 +0530 Subject: [PATCH 003/291] [Fix] Stock: Fix the problem of key error orgin for outgoing picking bzr revid: sbh@tinyerp.com-20100618062439-91tah2gr61jqgdvq --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 06f3fa44e55..ff9318739e3 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -559,7 +559,7 @@ class stock_picking(osv.osv): } new_id = super(stock_picking, self).create(cr, user, vals, context) if not vals.get('auto_picking', False): - message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals['origin'] or "n/a") + "' "+ _("is created.") + message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals.get('origin') or "n/a") + "' "+ _("is created.") self.log(cr, user, new_id, message) return new_id From 360afadc80f2ff97c1e41a21c402c99ba9205645 Mon Sep 17 00:00:00 2001 From: "psi (Open ERP)" Date: Fri, 18 Jun 2010 11:55:20 +0530 Subject: [PATCH 004/291] [IMP] account: Improve the wizard view, accunt_analytic_plan:Improve form view bzr revid: psi@tinyerp.co.in-20100618062520-b0ry32hrod0cmtsr --- addons/account/project/project_view.xml | 2 +- ...ic_cost_ledger_for_journal_report_view.xml | 26 ++++++++++--------- .../account_analytic_plans_view.xml | 6 ++--- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index 067fbd38ab1..6f2f6e39fe5 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -148,7 +148,7 @@ - + diff --git a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml index 1ad974e8650..204bb7c8de8 100644 --- a/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml +++ b/addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report_view.xml @@ -7,18 +7,20 @@ account.analytic.cost.ledger.journal.report form -
- - - - - - - - + +
diff --git a/addons/account_voucher_payment/account_voucher_payment_wizard.xml b/addons/account_voucher_payment/account_voucher_payment_wizard.xml index 0551b1bbcb5..2f961994fbd 100644 --- a/addons/account_voucher_payment/account_voucher_payment_wizard.xml +++ b/addons/account_voucher_payment/account_voucher_payment_wizard.xml @@ -4,7 +4,7 @@ From e69b3596d0caf4e5333ed37f0c60768409e87612 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 23 Jun 2010 16:27:04 +0530 Subject: [PATCH 096/291] [REF] purchase bzr revid: mra@mra-laptop-20100623105704-y2ad6iuqllbxuiu5 --- .../purchase/wizard/purchase_order_group.py | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/addons/purchase/wizard/purchase_order_group.py b/addons/purchase/wizard/purchase_order_group.py index 8c4e0784a7b..d9778dceb47 100644 --- a/addons/purchase/wizard/purchase_order_group.py +++ b/addons/purchase/wizard/purchase_order_group.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,46 +15,39 @@ # 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 time 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 = { - - } + _description = "Purchase Order Merge" 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 - + @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)) + "])]", @@ -66,5 +59,7 @@ class purchase_order_group(osv.osv_memory): 'type': 'ir.actions.act_window', 'search_view_id': id['res_id'] } + purchase_order_group() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From 1b8b85c9d51135cb8a1145227126076574db9bfb Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 23 Jun 2010 16:54:15 +0530 Subject: [PATCH 097/291] [REM] purchase wizard view and misc changes bzr revid: mra@mra-laptop-20100623112415-1y11p2k0j3ylm7o9 --- addons/purchase/company.py | 6 +++--- addons/purchase/partner.py | 15 ++++++--------- addons/purchase/purchase_wizard.xml | 13 ------------- addons/purchase/stock.py | 6 +++--- 4 files changed, 12 insertions(+), 28 deletions(-) delete mode 100644 addons/purchase/purchase_wizard.xml diff --git a/addons/purchase/company.py b/addons/purchase/company.py index 2a01605782c..012bb2142c0 100644 --- a/addons/purchase/company.py +++ b/addons/purchase/company.py @@ -28,9 +28,9 @@ class company(osv.osv): help="This is the leads/security time for each purchase order."), } _defaults = { - 'po_lead': lambda *a: 1.0, + 'po_lead': 1.0, } + 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/purchase/partner.py b/addons/purchase/partner.py index 48d006f2c15..afd13f6829e 100644 --- a/addons/purchase/partner.py +++ b/addons/purchase/partner.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 . # ############################################################################## @@ -27,17 +27,14 @@ class res_partner(osv.osv): _columns = { 'property_product_pricelist_purchase': fields.property( 'product.pricelist', - type='many2one', - relation='product.pricelist', + type='many2one', + relation='product.pricelist', domain=[('type','=','purchase')], - string="Purchase Pricelist", + string="Purchase Pricelist", method=True, view_load=True, help="This pricelist will be used, instead of the default one, for purchases from the current partner"), } res_partner() - - -# 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/purchase/purchase_wizard.xml b/addons/purchase/purchase_wizard.xml deleted file mode 100644 index d76ce1e3819..00000000000 --- a/addons/purchase/purchase_wizard.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index 087c9d6ddc8..245da72cad8 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.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 . # ############################################################################## @@ -29,7 +29,7 @@ class stock_move(osv.osv): readonly=True), } _defaults = { - 'purchase_line_id': lambda *a:False + 'purchase_line_id': False } stock_move() From 69525bf30269fb9e54198ffb2257740a0c33022e Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 23 Jun 2010 16:56:10 +0530 Subject: [PATCH 098/291] [REM] purchase analytic bzr revid: mra@mra-laptop-20100623112610-rhvatf7okayj0uwo --- .../purchase_analytic_plans.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/addons/purchase_analytic_plans/purchase_analytic_plans.py b/addons/purchase_analytic_plans/purchase_analytic_plans.py index 757868f13ed..0af2f90ba47 100644 --- a/addons/purchase_analytic_plans/purchase_analytic_plans.py +++ b/addons/purchase_analytic_plans/purchase_analytic_plans.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -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 . +# along with this program. If not, see . # ############################################################################## - -from osv import fields -from osv import osv import time -import netsvc - -import ir from mx import DateTime + +from osv import fields, osv +import netsvc +import ir import pooler from tools import config @@ -34,7 +32,7 @@ class purchase_order_line(osv.osv): _inherit='purchase.order.line' _columns = { 'analytics_id':fields.many2one('account.analytic.plan.instance','Analytic Distribution'), - } + } purchase_order_line() @@ -48,5 +46,5 @@ class purchase_order(osv.osv): return res purchase_order() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From dfcaa64718e093f7775f19e5657caead745b3e44 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Wed, 23 Jun 2010 17:20:24 +0530 Subject: [PATCH 099/291] [FIX]: override the correct view of voucher bzr revid: mga@tinyerp.com-20100623115024-vzl1bs20g0g2ic3c --- .../account_voucher_payment/account_voucher_payment_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher_payment/account_voucher_payment_view.xml b/addons/account_voucher_payment/account_voucher_payment_view.xml index adb4aebf44b..7969e9dbfca 100755 --- a/addons/account_voucher_payment/account_voucher_payment_view.xml +++ b/addons/account_voucher_payment/account_voucher_payment_view.xml @@ -63,11 +63,11 @@ - + account.voucher.form account.voucher form - +