From 3fefccfe51519d16c3ee460cbb75f356448e5687 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 8 Jul 2010 15:59:52 +0530 Subject: [PATCH 01/47] [FIX] pos: yml issue bzr revid: hmo@tinyerp.com-20100708102952-p891ytnsrukc24pa --- addons/point_of_sale/test/pos_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/test/pos_test.yml b/addons/point_of_sale/test/pos_test.yml index a96a792c711..360c25b53a5 100644 --- a/addons/point_of_sale/test/pos_test.yml +++ b/addons/point_of_sale/test/pos_test.yml @@ -250,7 +250,7 @@ country_id: base.in partner_id: res_partner_microlinktechnologies0 street: Ash House, Ash Road - title: Ms. + title: base.res_partner_title_miss - I create product category . - From 172cee237a705e8f1ad62d6961a157e25e6197a2 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Thu, 8 Jul 2010 16:00:27 +0530 Subject: [PATCH 02/47] [REF]: claim_from_delivery: Code improvements bzr revid: rpa@tinyerp.com-20100708103027-at59m943ytmnl5bq --- addons/claim_from_delivery/__init__.py | 1 + addons/claim_from_delivery/__openerp__.py | 3 ++- addons/claim_from_delivery/claim_delivery.py | 6 +++++- .../claim_delivery_view.xml | 18 +++++------------- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/addons/claim_from_delivery/__init__.py b/addons/claim_from_delivery/__init__.py index b10828031a8..801c814fdf9 100644 --- a/addons/claim_from_delivery/__init__.py +++ b/addons/claim_from_delivery/__init__.py @@ -18,5 +18,6 @@ # ############################################################################## import claim_delivery + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/claim_from_delivery/__openerp__.py b/addons/claim_from_delivery/__openerp__.py index 86d357834ff..c530a5605fb 100644 --- a/addons/claim_from_delivery/__openerp__.py +++ b/addons/claim_from_delivery/__openerp__.py @@ -21,7 +21,7 @@ "name" : "Claim from delivery", "version" : "1.0", "author" : "Tiny", - "category" : "Enterprise Specific Modules/Food Industries", + "category" : "Generic Modules/Inventory Control", "depends" : ["base", "crm_claim", "stock"], "init_xml" : [], "demo_xml" : [], @@ -31,5 +31,6 @@ "active": False, "installable": True } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/claim_from_delivery/claim_delivery.py b/addons/claim_from_delivery/claim_delivery.py index 4e81a0a3067..67e6f0baae2 100644 --- a/addons/claim_from_delivery/claim_delivery.py +++ b/addons/claim_from_delivery/claim_delivery.py @@ -24,6 +24,10 @@ from osv import fields, osv class stock_picking(osv.osv): _inherit = "stock.picking" _columns = { - 'partner_id': fields.related('address_id','partner_id',type='many2one', relation="res.partner", string="Partner"), + 'partner_id': fields.related('address_id', 'partner_id', type='many2one', relation="res.partner", string="Partner"), } + stock_picking() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/claim_from_delivery/claim_delivery_view.xml b/addons/claim_from_delivery/claim_delivery_view.xml index 7fb68cc6348..d2fe510460d 100644 --- a/addons/claim_from_delivery/claim_delivery_view.xml +++ b/addons/claim_from_delivery/claim_delivery_view.xml @@ -14,19 +14,11 @@ - - - - - {'default_partner_address_id': address_id, 'default_partner_id': partner_id} - + From c7e161dcc5db9dfe4029c3314ba7fab8c555e4fb Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Thu, 8 Jul 2010 16:17:49 +0530 Subject: [PATCH 03/47] [FIX] mrp: small yml issue bzr revid: hmo@tinyerp.com-20100708104749-qsqwr4ic10fjltwu --- addons/mrp/test/mrp_packs.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/mrp/test/mrp_packs.yml b/addons/mrp/test/mrp_packs.yml index 309e3d2b200..ca3453f94e6 100644 --- a/addons/mrp/test/mrp_packs.yml +++ b/addons/mrp/test/mrp_packs.yml @@ -69,7 +69,7 @@ location_dest_id: stock.stock_location_customers location_id: stock.stock_location_stock name: Pack of 24 Beers - product_id: mrp_bom_packofbeers0 + product_id: product_product_packofbeers0 product_qty: 2.0 product_uom: product.product_uom_unit move_type: direct @@ -83,12 +83,12 @@ "active_id": ref("stock.menu_action_picking_tree"), } ) - | - I check that my Picking of a "PAck of 24 beers" as been automatically + I check that my Picking of a "Pack of 24 beers" has been automatically converted to a picking of 24 beers and a pack of beer, so that my stock of beers remains exact. - !assert {model: stock.picking, id: picking_out}: - - len(move_ids) == 2 - - move_ids[0].product_id.id <> move_ids[1].product_id.id - - move_ids[0].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) - - move_ids[1].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) + - len(move_lines) == 2 + - move_lines[0].product_id.id <> move_lines[1].product_id.id + - move_lines[0].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) + - move_lines[1].product_id.id in (ref('product_product_beers0'), ref('product_product_beerspack0')) From 7c4179edd7b9c1ff47ddb6d1801941b5a296c8af Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Thu, 8 Jul 2010 16:18:52 +0530 Subject: [PATCH 04/47] [FIX]:account:Invoice Analysis:residual amount problem bzr revid: apa@tinyerp.com-20100708104852-hanh85h3znag8o01 --- .../account/report/account_invoice_report.py | 16 ++++++++----- .../report/account_invoice_report_view.xml | 24 +++++++++---------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index c15c2e670e3..b7fb9766bf1 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -122,17 +122,20 @@ class account_invoice_report(osv.osv): left join account_invoice as a ON (a.move_id=aml.move_id) left join account_invoice_line as l ON (a.id=l.invoice_id) where a.id=ai.id)) as delay_to_pay, - sum(case when ai.type in ('out_refund','in_invoice') then - ai.residual * -1 - else - ai.residual - end) as residual + (case when ai.type in ('out_refund','in_invoice') then + ai.residual * -1 + else + ai.residual + end)/(select count(l.*) from account_invoice_line as l + left join account_invoice as a ON (a.id=l.invoice_id) + where a.id=ai.id) as residual from account_invoice_line as ail left join account_invoice as ai ON (ai.id=ail.invoice_id) left join product_template pt on (pt.id=ail.product_id) left join product_uom u on (u.id=ail.uos_id) group by ail.product_id, ai.date_invoice, + ai.id, to_char(ai.date_invoice, 'YYYY'), to_char(ai.date_invoice, 'MM'), to_char(ai.date_invoice, 'YYYY-MM-DD'), @@ -153,7 +156,8 @@ class account_invoice_report(osv.osv): ai.address_contact_id, ai.address_invoice_id, ai.account_id, - ai.partner_bank + ai.partner_bank, + ai.residual ) """) account_invoice_report() diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index b947f9d5f6a..ee9ee498365 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -32,7 +32,7 @@ - + @@ -93,24 +93,24 @@ - - + + - - + + - - + + - + - + - - - + + + From 226922265836407792050b91ba196d41cb34a9a9 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Thu, 8 Jul 2010 16:49:21 +0530 Subject: [PATCH 05/47] [REM]: remove unused class bzr revid: mga@tinyerp.com-20100708111921-ljt97b156qyswfao --- .../account_voucher_payment.py | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/addons/account_voucher_payment/account_voucher_payment.py b/addons/account_voucher_payment/account_voucher_payment.py index a34a0859bfa..7bad021ba26 100755 --- a/addons/account_voucher_payment/account_voucher_payment.py +++ b/addons/account_voucher_payment/account_voucher_payment.py @@ -196,7 +196,8 @@ class account_voucher_line(osv.osv): residual = currency_pool.compute(cr, uid, invoice.currency_id.id, currency_id, invoice.residual) res.update({ - 'amount': residual + 'amount': residual, + 'account_id': invoice.account_id.id }) return { @@ -231,21 +232,4 @@ class account_voucher_line(osv.osv): } account_voucher_line() -class account_invoice(osv.osv): - _inherit = "account.invoice" - - def action_cancel(self, cr, uid, ids, *args): - res = super(account_invoice, self).action_cancel(cr, uid, ids, *args) - invoices = self.read(cr, uid, ids, ['move_id']) - voucher_db = self.pool.get('account.voucher') - voucher_ids = voucher_db.search(cr, uid, []) - voucher_obj = voucher_db.browse(cr, uid, voucher_ids) - move_db = self.pool.get('account.move') - move_ids = move_db.search(cr, uid, []) - move_obj = move_db.browse(cr, uid, move_ids) - return res - -account_invoice() - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 522877859d6207de4f2a5a5c5187803bd28ed5d5 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Thu, 8 Jul 2010 16:49:50 +0530 Subject: [PATCH 06/47] [IMP]: improve voucher unreconcile process bzr revid: mga@tinyerp.com-20100708111950-6xj9bjjfh5428rt1 --- .../wizard/account_voucher_unreconcile.py | 20 +++++++++++++++++-- .../account_voucher_unreconcile_view.xml | 2 ++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py b/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py index f91ee20925f..2bfffb372b7 100644 --- a/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py +++ b/addons/account_voucher_payment/wizard/account_voucher_unreconcile.py @@ -18,19 +18,31 @@ # along with this program. If not, see . # ############################################################################## -from osv import fields, osv + +import netsvc +from osv import osv +from osv import fields class account_voucher_unreconcile(osv.osv_memory): _name = "account.voucher.unreconcile" _description = "Account voucher unreconcile" + _columns = { + 'remove':fields.boolean('Want to remove accounting entries too ?', required=False), + } + + _defaults = { + 'remove': lambda *a: True, + } + def trans_unrec(self, cr, uid, ids, context=None): + res = self.browse(cr, uid, ids[0]) if context is None: context = {} voucher_pool = self.pool.get('account.voucher') reconcile_pool = self.pool.get('account.move.reconcile') if context.get('active_id'): - voucher = obj_voucher.browse(cr, uid, context.get('active_id'), context=context) + voucher = voucher_pool.browse(cr, uid, context.get('active_id'), context) recs = [] for line in voucher.move_ids: if line.reconcile_id: @@ -39,6 +51,10 @@ class account_voucher_unreconcile(osv.osv_memory): for rec in recs: obj_reconcile.unlink(cr, uid, rec) + if res.remove: + wf_service = netsvc.LocalService("workflow") + wf_service.trg_validate(uid, 'account.voucher', context.get('active_id'), 'cancel_voucher', cr) + return {} account_voucher_unreconcile() diff --git a/addons/account_voucher_payment/wizard/account_voucher_unreconcile_view.xml b/addons/account_voucher_payment/wizard/account_voucher_unreconcile_view.xml index 138aaec586f..3f8dd9c4e32 100644 --- a/addons/account_voucher_payment/wizard/account_voucher_unreconcile_view.xml +++ b/addons/account_voucher_payment/wizard/account_voucher_unreconcile_view.xml @@ -11,6 +11,8 @@