[REF, REM] Membership: Cleaning remove demo file

bzr revid: mra@mra-laptop-20101026130337-n0wnsw4pz76dvhir
This commit is contained in:
Mustufa Rangwala 2010-10-26 18:33:37 +05:30
parent 09badf3375
commit 481c50471e
4 changed files with 21 additions and 190 deletions

View File

@ -1,166 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data noupdate="1">
<record id="account_tax_testingtax0" model="account.tax">
<field eval="1" name="sequence"/>
<field eval="1.0" name="base_sign"/>
<field eval="&quot;true&quot;" name="applicable_type"/>
<field name="company_id" ref="base.main_company"/>
<field eval="&quot;# price_unit
# address : res.partner.address object or False
# product : product.product object or False
result = price_unit * 0.10&quot;" name="python_compute_inv"/>
<field eval="1.0" name="ref_tax_sign"/>
<field eval="&quot;percent&quot;" name="type"/>
<field eval="1.0" name="ref_base_sign"/>
<field eval="&quot;1&quot;" name="active"/>
<field eval="&quot;testing tax&quot;" name="name"/>
<field eval="0.069" name="amount"/>
<field eval="&quot;# price_unit
# address : res.partner.address object or False
# product : product.product object or None
# partner : res.partner object or None
result = price_unit * 0.10&quot;" name="python_compute"/>
<field eval="1.0" name="tax_sign"/>
</record>
</data>
<data noupdate="1">
<record id="base.EUR" model="res.currency"/>
</data>
<data>
<record id="product_template_0" model="product.template">
<field name="list_price" eval="150.0"/>
<field name="name" eval="&quot;Membership 2006&quot;"/>
<field name="categ_id" eval="7"/>
<field name="type" eval="&quot;service&quot;"/>
</record>
</data>
<data>
<record id="product_product_0" model="product.product">
<field eval="&quot;2007-03-31&quot;" name="membership_date_to"/>
<field eval="&quot;1&quot;" name="membership"/>
<field eval="&quot;m2006&quot;" name="default_code"/>
<field eval="&quot;2006-01-01&quot;" name="membership_date_from"/>
<field eval="&quot;1&quot;" name="active"/>
<field eval="150.0" name="price_margin"/>
<field name="product_tmpl_id" ref="product_template_0"/>
</record>
</data>
<data>
<record id="product_template_1" model="product.template">
<field name="list_price" eval="160.0"/>
<field name="name" eval="&quot;Membership 2007&quot;"/>
<field name="categ_id" eval="7"/>
<field name="type" eval="&quot;service&quot;"/>
</record>
</data>
<data>
<record id="product_product_1" model="product.product">
<field eval="&quot;2008-03-31&quot;" name="membership_date_to"/>
<field eval="&quot;1&quot;" name="membership"/>
<field eval="&quot;m2007&quot;" name="default_code"/>
<field eval="&quot;2007-01-01&quot;" name="membership_date_from"/>
<field eval="&quot;1&quot;" name="active"/>
<field eval="160.0" name="price_margin"/>
<field name="product_tmpl_id" ref="product_template_1"/>
</record>
</data>
<data>
<record id="product_template_2" model="product.template">
<field name="list_price" eval="165.0"/>
<field name="name" eval="&quot;Membership 2008&quot;"/>
<field name="categ_id" eval="7"/>
<field name="type" eval="&quot;service&quot;"/>
</record>
</data>
<data>
<record id="product_product_2" model="product.product">
<field eval="&quot;2009-03-31&quot;" name="membership_date_to"/>
<field eval="&quot;1&quot;" name="membership"/>
<field eval="&quot;m2008&quot;" name="default_code"/>
<field eval="&quot;2008-01-01&quot;" name="membership_date_from"/>
<field eval="&quot;1&quot;" name="active"/>
<field eval="165.0" name="price_margin"/>
<field name="product_tmpl_id" ref="product_template_2"/>
</record>
</data>
<data noupdate="1">
<record id="account_invoice_0" model="account.invoice">
<field name="partner_id" ref="base.res_partner_agrolait"/>
<field name="account_id" ref="account.a_recv"/>
<field name="address_contact_id" ref="base.res_partner_address_8"/>
<field eval="&quot;none&quot;" name="reference_type"/>
<field name="journal_id" ref="account.sales_journal"/>
<field name="company_id" ref="base.main_company"/>
<field name="currency_id" ref="base.EUR"/>
<field name="address_invoice_id" ref="base.res_partner_address_8"/>
<field eval="&quot;paid&quot;" name="state"/>
<field eval="&quot;out_invoice&quot;" name="type"/>
<field eval="&quot;2006-02-10&quot;" name="date_invoice"/>
</record>
<record id="account_invoice_line_membership0" model="account.invoice.line">
<field name="uos_id" ref="product.product_uom_unit"/>
<field eval="&quot;Membership 2006&quot;" name="name"/>
<field name="invoice_id" ref="account_invoice_0"/>
<field eval="150.0" name="price_unit"/>
<field eval="[(6,0,[ref('account_tax_testingtax0')])]" name="invoice_line_tax_id"/>
<field name="product_id" ref="product_product_0"/>
<field eval="1.0" name="quantity"/>
<field name="account_id" ref="account.a_sale"/>
</record>
</data>
<data noupdate="1">
<record id="account_invoice_1" model="account.invoice">
<field name="partner_id" ref="base.res_partner_agrolait"/>
<field name="account_id" ref="account.a_recv"/>
<field name="address_contact_id" ref="base.res_partner_address_8"/>
<field eval="&quot;none&quot;" name="reference_type"/>
<field name="journal_id" ref="account.sales_journal"/>
<field name="company_id" ref="base.main_company"/>
<field name="currency_id" ref="base.EUR"/>
<field name="address_invoice_id" ref="base.res_partner_address_8"/>
<field eval="&quot;paid&quot;" name="state"/>
<field eval="&quot;out_invoice&quot;" name="type"/>
<field eval="&quot;2007-01-30&quot;" name="date_invoice"/>
</record>
<record id="account_invoice_line_membership1" model="account.invoice.line">
<field name="uos_id" ref="product.product_uom_unit"/>
<field eval="&quot;Membership 2007&quot;" name="name"/>
<field name="invoice_id" ref="account_invoice_1"/>
<field eval="160.0" name="price_unit"/>
<field eval="[(6,0,[ref('account_tax_testingtax0')])]" name="invoice_line_tax_id"/>
<field name="product_id" ref="product_product_1"/>
<field eval="1.0" name="quantity"/>
<field name="account_id" ref="account.a_sale"/>
</record>
</data>
<data noupdate="1">
<record id="account_invoice_2" model="account.invoice">
<field name="partner_id" ref="base.res_partner_agrolait"/>
<field name="account_id" ref="account.a_recv"/>
<field name="address_contact_id" ref="base.res_partner_address_8"/>
<field eval="&quot;none&quot;" name="reference_type"/>
<field name="journal_id" ref="account.sales_journal"/>
<field name="company_id" ref="base.main_company"/>
<field name="currency_id" ref="base.EUR"/>
<field name="address_invoice_id" ref="base.res_partner_address_8"/>
<field eval="&quot;paid&quot;" name="state"/>
<field eval="&quot;out_invoice&quot;" name="type"/>
<field eval="&quot;2007-11-30&quot;" name="date_invoice"/>
</record>
<record id="account_invoice_line_membership1" model="account.invoice.line">
<field name="uos_id" ref="product.product_uom_unit"/>
<field eval="&quot;Membership 2007&quot;" name="name"/>
<field name="invoice_id" ref="account_invoice_2"/>
<field eval="160.0" name="price_unit"/>
<field eval="[(6,0,[ref('account_tax_testingtax0')])]" name="invoice_line_tax_id"/>
<field name="product_id" ref="product_product_2"/>
<field eval="1.0" name="quantity"/>
<field name="account_id" ref="account.a_sale"/>
</record>
</data>
</openerp>

View File

@ -484,6 +484,7 @@ class Product(osv.osv):
_defaults = {
'membership': False,
}
Product()
@ -501,6 +502,7 @@ class Invoice(osv.osv):
[l.id for l in invoice.invoice_line])])
member_line_obj.write(cr, uid, mlines, {'date_cancel': today})
return super(Invoice, self).action_cancel(cr, uid, ids)
Invoice()
class account_invoice_line(osv.osv):
@ -573,4 +575,5 @@ class account_invoice_line(osv.osv):
return result
account_invoice_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -23,7 +23,6 @@ from osv import fields, osv
import tools
import decimal_precision as dp
STATE = [
('none', 'Non Member'),
('canceled', 'Cancelled Member'),
@ -63,7 +62,7 @@ class report_membership(osv.osv):
'membership_state': fields.selection(STATE, 'Current Membership State', readonly=True),
'user_id': fields.many2one('res.users', 'Salesman', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True)
}
}
def init(self, cr):
'''Create the view'''
@ -127,20 +126,20 @@ class report_membership(osv.osv):
ml.state,
ml.id
) AS foo
GROUP BY
year,
month,
date_from,
date_to,
partner_id,
user_id,
membership_id,
company_id,
membership_state,
associate_member_id,
GROUP BY
year,
month,
date_from,
date_to,
partner_id,
user_id,
membership_id,
company_id,
membership_state,
associate_member_id,
membership_amount
)""")
report_membership()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -19,11 +19,7 @@
#
##############################################################################
import time
from osv import fields, osv
from tools.translate import _
import tools
import decimal_precision as dp
class membership_invoice(osv.osv_memory):
@ -35,7 +31,7 @@ class membership_invoice(osv.osv_memory):
'product_id': fields.many2one('product.product','Membership', required=True),
'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True),
}
def onchange_product(self, cr, uid, ids, product_id):
def onchange_product(self, cr, uid, ids, product_id=False):
"""This function returns value of product's member price based on product id.
"""
if not product_id:
@ -49,15 +45,14 @@ class membership_invoice(osv.osv_memory):
datas = {}
if not context:
context = {}
data = self.browse(cr, uid, ids)
data = self.browse(cr, uid, ids, context=context)
if data:
data = data[0]
datas = {
'membership_product_id': data.product_id.id,
'amount': data.member_price
}
invoice_ids = context.get('active_ids', [])
invoice_list = partner_obj.create_membership_invoice(cr, uid, invoice_ids, datas=datas, context=context)
invoice_list = partner_obj.create_membership_invoice(cr, uid, context.get('active_ids', []), datas=datas, context=context)
return {
'domain': [('id', 'in', invoice_list)],
@ -70,4 +65,4 @@ class membership_invoice(osv.osv_memory):
membership_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: