From 0c375a3d6f0bd5e8622b52e2f27fafb79afead30 Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Mon, 3 Dec 2012 17:49:00 +0530 Subject: [PATCH 1/6] [IMP] improve data(Immediate Payment,15days) and remove data from data(30 Days end of Month,30% Advance, End 30 Days) and keep in demo bzr revid: shp@tinyerp.com-20121203121900-fb52ryi5d2acolj8 --- addons/account/data/account_data.xml | 42 ++++++++-------------------- addons/account/demo/account_demo.xml | 31 ++++++++++++++++++++ 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/addons/account/data/account_data.xml b/addons/account/data/account_data.xml index 97bea14c1f2..c9b528e75f8 100644 --- a/addons/account/data/account_data.xml +++ b/addons/account/data/account_data.xml @@ -10,17 +10,19 @@ - - 30 Days End of Month - 30 Days End of Month + + Immediate Payment + Immediate Payment - - 30 Days End of Month + + + Immediate Payment balance - - - + + + + Payment Term 6 @@ -30,6 +32,7 @@ 30 Net Days 30 Net Days + 30 Net Days balance @@ -37,28 +40,7 @@ - - - 30% Advance End 30 Days - 30% Advance End 30 Days - - - 30% Advance - procent - - - - - - - - Remaining Balance - balance - - - - - + diff --git a/addons/account/demo/account_demo.xml b/addons/account/demo/account_demo.xml index 0dff40ca19f..e2fe480c0bc 100644 --- a/addons/account/demo/account_demo.xml +++ b/addons/account/demo/account_demo.xml @@ -127,6 +127,37 @@ + + 30 Days End of Month + 30 Days End of Month + + + 30 Days End of Month + balance + + + + + + 30% Advance End 30 Days + 30% Advance End 30 Days + + + 30% Advance + procent + + + + + + + + Remaining Balance + balance + + + + From 7b6d5f0e93b307f188021e957c3c43898967c671 Mon Sep 17 00:00:00 2001 From: "Jalpesh Patel (OpenERP)" Date: Tue, 4 Dec 2012 09:46:10 +0530 Subject: [PATCH 2/6] [IMP]remove sequece field and improve payment term form view bzr revid: pja@tinyerp.com-20121204041610-vpqx0zf3rneokugx --- addons/account/account.py | 6 ++---- addons/account/account_view.xml | 20 +------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 971bcec5bb0..c7c08df8c3b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -101,10 +101,9 @@ class account_payment_term_line(osv.osv): _description = "Payment Term Line" _columns = { 'name': fields.char('Line Name', size=32, required=True), - 'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the payment term lines from the lowest sequences to the higher ones"), 'value': fields.selection([('procent', 'Percent'), ('balance', 'Balance'), - ('fixed', 'Fixed Amount')], 'Valuation', + ('fixed', 'Fixed Amount')], 'Computation', required=True, help="""Select here the kind of valuation related to this payment term line. Note that you should have your last line with the type 'Balance' to ensure that the whole amount will be treated."""), 'value_amount': fields.float('Amount To Pay', digits_compute=dp.get_precision('Payment Term'), help="For percent enter a ratio between 0-1."), @@ -115,10 +114,9 @@ class account_payment_term_line(osv.osv): } _defaults = { 'value': 'balance', - 'sequence': 5, 'days2': 0, } - _order = "sequence" + _order = "days,value" def _check_percent(self, cr, uid, ids, context=None): obj = self.browse(cr, uid, ids[0], context=context) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index e2c45af8cba..86e6a618cde 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1554,7 +1554,6 @@ account.payment.term.line - @@ -1570,7 +1569,6 @@
- @@ -1583,22 +1581,6 @@ - -
@@ -1621,7 +1603,7 @@ - + From f95959593378288f669ae1ab12717e194df5b606 Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Tue, 4 Dec 2012 10:45:30 +0530 Subject: [PATCH 3/6] [IMP] balance computation line in payment term bzr revid: shp@tinyerp.com-20121204051530-4sx9r9m0uqmapous --- addons/account/account.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index 971bcec5bb0..0e333a7a579 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -94,6 +94,20 @@ class account_payment_term(osv.osv): amount -= amt return result + def _check_balance_line(self, cr, uid, ids, context=None): + line_list = [] + obj = self.browse(cr, uid, ids[0], context=context) + for ids in obj.line_ids: + if ids.value == 'balance': + line_list.append(ids.value) + if len(line_list) > 1: + return False + return True + + _constraints = [ + (_check_balance_line, 'A payment term should have one and only one "Balance" computation line.', ['value']), + ] + account_payment_term() class account_payment_term_line(osv.osv): From 62d0f3931d423d9841f0e6ec138544380993b760 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Tue, 4 Dec 2012 12:28:50 +0530 Subject: [PATCH 4/6] [IMP] Put a default value for payment term lines, make readonly amount to pay in list view, put % symbol when selection is percentage. bzr revid: nco@tinyerp.com-20121204065850-dw3f79n61hla9x3c --- addons/account/account.py | 4 ++-- addons/account/account_view.xml | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index aa5f90a081e..49be6d7503c 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -114,7 +114,6 @@ class account_payment_term_line(osv.osv): _name = "account.payment.term.line" _description = "Payment Term Line" _columns = { - 'name': fields.char('Line Name', size=32, required=True), 'value': fields.selection([('procent', 'Percent'), ('balance', 'Balance'), ('fixed', 'Fixed Amount')], 'Computation', @@ -128,7 +127,8 @@ class account_payment_term_line(osv.osv): } _defaults = { 'value': 'balance', - 'days2': 0, + 'days': 30, + 'days2': 1, } _order = "days,value" diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 86e6a618cde..20065edbc61 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1553,10 +1553,9 @@ account.payment.term.line.tree account.payment.term.line - - + - + @@ -1567,13 +1566,14 @@ account.payment.term.line
- - - - + From 8e974146ab8183c1a8d2627796a3b41844d73d84 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Tue, 4 Dec 2012 18:31:50 +0530 Subject: [PATCH 5/6] [FIX]: Remove editable tree view. bzr revid: atp@tinyerp.com-20121204130150-ng08xtg1mipt5590 --- addons/account/account_view.xml | 4 ++-- addons/account/data/account_data.xml | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index b87feb50a40..b82ab6cef06 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1553,7 +1553,7 @@ account.payment.term.line.tree account.payment.term.line - + @@ -1569,7 +1569,7 @@ -