From 02f2aee066d77a7bf89d48f1d53f15abadec5036 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 29 May 2012 14:00:29 +0200 Subject: [PATCH 1/2] [IMP] account: account.journal, add default coins for a cash journal bzr revid: stw@openerp.com-20120529120029-ttzrsum3ilhyvb1n --- addons/account/account_cash_statement.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index d0474887594..bea48528f63 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -306,10 +306,21 @@ account_cash_statement() class account_journal(osv.osv): _inherit = 'account.journal' + def _default_cashbox_line_ids(self, cr, uid, context=None): + # Return a list of coins in Euros. + result = [ + dict(pieces=value) for value in [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500] + ] + return result + _columns = { 'cashbox_line_ids' : fields.one2many('account.journal.cashbox.line', 'journal_id', 'CashBox'), } + _defaults = { + 'cashbox_line_ids' : _default_cashbox_line_ids, + } + account_journal() class account_journal_cashbox_line(osv.osv): From e83f930dcb3c0529f6b91f468bac5c92665b4299 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 29 May 2012 14:15:56 +0200 Subject: [PATCH 2/2] [IMP] point_of_sale: move the 'to_weight' field from the pos.category to the product object bzr revid: stw@openerp.com-20120529121556-q91gf18qf5a3uf1q --- addons/point_of_sale/point_of_sale.py | 11 ++++++----- addons/point_of_sale/point_of_sale_view.xml | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 637f6bd5a2f..75eba71b18b 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1140,10 +1140,6 @@ class pos_category(osv.osv): 'parent_id': fields.many2one('pos.category','Parent Category', select=True), 'child_id': fields.one2many('pos.category', 'parent_id', string='Children Categories'), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."), - 'to_weight' : fields.boolean('To Weight', help="This category contains products that should be weighted, mainly used for the self-checkout interface"), - } - _defaults = { - 'to_weight' : False, } pos_category() @@ -1174,8 +1170,13 @@ class product_product(osv.osv): 'product_image_small': fields.function(_get_small_image, string='Small Image', type="binary", store = { 'product.product': (lambda self, cr, uid, ids, c={}: ids, ['product_image'], 10), - }) + }), + 'to_weight' : fields.boolean('To Weight', help="This category contains products that should be weighted, mainly used for the self-checkout interface"), } + _defaults = { + 'to_weight' : False, + } + product_product() diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index b65a662196c..cc718aea45d 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -613,6 +613,7 @@ + @@ -646,7 +647,6 @@ -