From: Ludovic CHEVALIER Date: Sun, 28 Oct 2012 20:30:02 +0000 (+0100) Subject: [point of sale] partner required for order and auto invoice X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/%22%7B%24wgStylePath%7D/common/wikibits.js/%7B%24www_url%7Dadmin/compta/operations/%40%20%27info_date_publication_anterieure%27%20=%3E%20%27Previously%20published%20on:%27%2C%20%27info_date_referencement%27%20=%3E%20%27THIS%20SITE%20REFERENCED%20ON:%27%2C%20%27info_derniere_etape%27%20=%3E%20%27Done%21%27%2C-%27info_derniers_articles_publies%27%20=%3E%20%27Your%20most%20recently%20published%20articles%27%2C-%27info_desactiver_messagerie_personnelle%27%20=%3E%20%27You%20can%20enable%20or%20disable%20your%20personal%20messaging%20on%20this%20site.%27%2C%20%27info_descriptif%27%20=%3E%20%27Description:%27%2C%20%27info_desinstaller_plugin%27%20=%3E%20%27%20deactivates%20the%20plugin%20and%20deletes%20the%20data%27%2C%20%27info_discussion_cours%27%20=%3E%20%27Current%20discussions%27%2C%40%40%20-332%2C7%20%20284%2C6%20%40%40%20Do%20not%20submit%20this%20import%20request.%3Cp%3EFor%20more%20information%2C%20please%20see%20%3Ca%20href=?a=commitdiff_plain;h=a8b8dd5c849171c2a3583fa5d9069bb551cb4780;p=burette%2Fremembership.git [point of sale] partner required for order and auto invoice --- diff --git a/__openerp__.py b/__openerp__.py index eeb1df7..0adc843 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -30,11 +30,12 @@ """, 'author': 'L\'Heureux Cyclage - LHC', 'website': 'http://www.heureux-cyclage.org', - 'depends': ['membership'], + 'depends': ['membership', 'point_of_sale'], 'init_xml': [], 'data': [ 'data/membership_sequence.xml', 'view/partner.xml', + 'view/point_of_sale.xml', ], 'update_xml': [], 'demo_xml': [], diff --git a/remembership.py b/remembership.py index fa16f56..260e56e 100644 --- a/remembership.py +++ b/remembership.py @@ -38,15 +38,30 @@ class account_invoice_line(osv.osv): _inherit='account.invoice.line' def create(self, cr, uid, vals, context=None): - result = super(account_invoice_line, self).create(cr, uid, vals, context=context) - line = self.browse(cr, uid, result, context=context) + res = super(account_invoice_line, self).create(cr, uid, vals, context=context) + line = self.browse(cr, uid, res, context=context) if line.invoice_id.type == 'out_invoice': if line.product_id and line.product_id.membership and not line.invoice_id.partner_id.member_ident: mbr_id = self.pool.get('ir.sequence').get(cr, uid, 'member_ident') self.pool.get('res.partner').write(cr, uid, line.invoice_id.partner_id.id, {'member_ident': mbr_id}) - return result + return res account_invoice_line() +class pos_make_payment(osv.osv_memory): + _inherit = 'pos.make.payment' + + def check(self, cr, uid, ids, context=None): + """ + Auto invoice orders. Temporarly solution before make partner members just with orders, without invoice. + """ + res = super(pos_make_payment, self).check(cr, uid, ids, context=context) + + order_obj = self.pool.get('pos.order') + order_obj.action_invoice(cr, uid, ids, context=context) + + return res + +pos_make_payment() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/view/point_of_sale.xml b/view/point_of_sale.xml new file mode 100644 index 0000000..5f7dea2 --- /dev/null +++ b/view/point_of_sale.xml @@ -0,0 +1,17 @@ + + + + pos.order.form - Remembership + pos.order + form + + + + + + + + + + +