[REF, REM] Membership: Cleaning remove demo file
bzr revid: mra@mra-laptop-20101026130337-n0wnsw4pz76dvhir
This commit is contained in:
parent
09badf3375
commit
481c50471e
|
@ -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=""true"" name="applicable_type"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field eval=""# price_unit
|
||||
# address : res.partner.address object or False
|
||||
# product : product.product object or False
|
||||
|
||||
result = price_unit * 0.10"" name="python_compute_inv"/>
|
||||
<field eval="1.0" name="ref_tax_sign"/>
|
||||
<field eval=""percent"" name="type"/>
|
||||
<field eval="1.0" name="ref_base_sign"/>
|
||||
<field eval=""1"" name="active"/>
|
||||
<field eval=""testing tax"" name="name"/>
|
||||
<field eval="0.069" name="amount"/>
|
||||
<field eval=""# 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"" 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=""Membership 2006""/>
|
||||
<field name="categ_id" eval="7"/>
|
||||
<field name="type" eval=""service""/>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
<record id="product_product_0" model="product.product">
|
||||
<field eval=""2007-03-31"" name="membership_date_to"/>
|
||||
<field eval=""1"" name="membership"/>
|
||||
<field eval=""m2006"" name="default_code"/>
|
||||
<field eval=""2006-01-01"" name="membership_date_from"/>
|
||||
<field eval=""1"" 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=""Membership 2007""/>
|
||||
<field name="categ_id" eval="7"/>
|
||||
<field name="type" eval=""service""/>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
<record id="product_product_1" model="product.product">
|
||||
<field eval=""2008-03-31"" name="membership_date_to"/>
|
||||
<field eval=""1"" name="membership"/>
|
||||
<field eval=""m2007"" name="default_code"/>
|
||||
<field eval=""2007-01-01"" name="membership_date_from"/>
|
||||
<field eval=""1"" 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=""Membership 2008""/>
|
||||
<field name="categ_id" eval="7"/>
|
||||
<field name="type" eval=""service""/>
|
||||
</record>
|
||||
</data>
|
||||
<data>
|
||||
<record id="product_product_2" model="product.product">
|
||||
<field eval=""2009-03-31"" name="membership_date_to"/>
|
||||
<field eval=""1"" name="membership"/>
|
||||
<field eval=""m2008"" name="default_code"/>
|
||||
<field eval=""2008-01-01"" name="membership_date_from"/>
|
||||
<field eval=""1"" 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=""none"" 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=""paid"" name="state"/>
|
||||
<field eval=""out_invoice"" name="type"/>
|
||||
<field eval=""2006-02-10"" 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=""Membership 2006"" 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=""none"" 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=""paid"" name="state"/>
|
||||
<field eval=""out_invoice"" name="type"/>
|
||||
<field eval=""2007-01-30"" 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=""Membership 2007"" 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=""none"" 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=""paid"" name="state"/>
|
||||
<field eval=""out_invoice"" name="type"/>
|
||||
<field eval=""2007-11-30"" 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=""Membership 2007"" 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>
|
|
@ -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:
|
|
@ -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:
|
|
@ -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:
|
Loading…
Reference in New Issue