commit
9e6f14b852
|
@ -583,7 +583,7 @@
|
|||
<field name="tax_code_id"/>
|
||||
<field name="tax_sign"/>
|
||||
|
||||
<separator colspan="4" string="Refund Invoices"/>
|
||||
<separator colspan="4" string="Credit Notes"/>
|
||||
<field name="ref_base_code_id"/>
|
||||
<field name="ref_base_sign"/>
|
||||
<field name="ref_tax_code_id"/>
|
||||
|
@ -1508,7 +1508,7 @@
|
|||
<field name="tax_code_id"/>
|
||||
<field name="tax_sign"/>
|
||||
|
||||
<separator colspan="4" string="Refund Invoices"/>
|
||||
<separator colspan="4" string="Credit Notes"/>
|
||||
<field name="ref_base_code_id"/>
|
||||
<field name="ref_base_sign"/>
|
||||
<field name="ref_tax_code_id"/>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<wizard id="wizard_invoice_refund" model="account.invoice" name="account.invoice.refund" string="Refund invoice"/>
|
||||
<wizard id="wizard_invoice_refund" model="account.invoice" name="account.invoice.refund" string="Credit Note"/>
|
||||
|
||||
<wizard id="wizard_invoice_pay" model="account.invoice" name="account.invoice.pay" string="Pay invoice"/>
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class res_partner(osv.osv):
|
|||
def _credit_debit_get(self, cr, uid, ids, field_names, arg, context):
|
||||
query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
|
||||
cr.execute(("""select
|
||||
l.partner_id, a.type, sum(l.debit-l.credit)
|
||||
l.partner_id, a.type, sum(l.debit-l.credit)
|
||||
from
|
||||
account_move_line l
|
||||
left join
|
||||
|
@ -116,6 +116,7 @@ class res_partner(osv.osv):
|
|||
string="Default Supplier Tax",
|
||||
method=True,
|
||||
view_load=True,
|
||||
domain=[('parent_id','=',False)],
|
||||
help="This tax will be used, instead of the default one for supplier invoices."),
|
||||
'property_account_tax': fields.property(
|
||||
'account.tax',
|
||||
|
@ -124,6 +125,7 @@ class res_partner(osv.osv):
|
|||
string="Default Tax",
|
||||
method=True,
|
||||
view_load=True,
|
||||
domain=[('parent_id','=',False)],
|
||||
help="This tax will be used, instead of the default one for customers."),
|
||||
'property_payment_term': fields.property(
|
||||
'account.payment.term',
|
||||
|
|
|
@ -32,7 +32,7 @@ import wizard
|
|||
import pooler
|
||||
|
||||
sur_form = '''<?xml version="1.0"?>
|
||||
<form string="Refund Invoice">
|
||||
<form string="Credit Note">
|
||||
<label string="Are you sure you want to refund this invoice ?"/>
|
||||
</form>'''
|
||||
|
||||
|
@ -56,7 +56,7 @@ class wiz_refund(wizard.interface):
|
|||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type':'form', 'arch':sur_form, 'fields':sur_fields, 'state':[('end','Cancel'),('refund','Refund Invoice')]}
|
||||
'result': {'type':'form', 'arch':sur_form, 'fields':sur_fields, 'state':[('end','Cancel'),('refund','Credit Note')]}
|
||||
},
|
||||
'refund': {
|
||||
'actions': [],
|
||||
|
|
|
@ -59,22 +59,21 @@ class budget_report(report_sxw.rml_parse):
|
|||
prev_1=prev * period_days / total_days
|
||||
return [{'prev': prev, 'prev_period': prev_1, 'achievements': achievements}]
|
||||
|
||||
def budget_total(self, post_objs, date1, date2):
|
||||
def budget_total(self, post_obj, date1, date2):
|
||||
res = {'prev': 0.0, 'prev_period': 0.0, 'achievements': 0.0}
|
||||
for post_obj in post_objs:
|
||||
r = self.post_total(post_obj, date1, date2)[0]
|
||||
for k in r:
|
||||
res[k] += r[k]
|
||||
r = self.post_total(post_obj, date1, date2)[0]
|
||||
for k in r:
|
||||
res[k] += r[k]
|
||||
return [res]
|
||||
|
||||
def lines(self, post_obj, date1, date2):
|
||||
res = []
|
||||
for a in post_obj.account_ids:
|
||||
self.cr.execute("SELECT COALESCE(SUM(debit-credit), 0) FROM account_move_line WHERE account_id=%d AND date>=%s AND date<=%s and state<>'draft'", (a.id, date1, date2))
|
||||
achievements = float(self.cr.fetchone()[0]) * (post_obj.sens=='produit' and -1 or 1)
|
||||
achievements = float(self.cr.fetchone()[0])
|
||||
res.append({'name': a.name, 'code': a.code, 'achievements': achievements})
|
||||
return res
|
||||
report_sxw.report_sxw('report.account.budget', 'account.budget.post', 'addons/account_budget/report/budget_report.rml',parser=budget_report)
|
||||
report_sxw.report_sxw('report.account.budget', 'account.budget.post', 'addons/account_budget/report/budget_report.rml',parser=budget_report,header=False)
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -10,233 +10,293 @@
|
|||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<blockBackground colorName="#e6e6e6" start="0,1" stop="0,1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
|
||||
<blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<blockBackground colorName="#ffffff" start="0,0" stop="0,-1"/>
|
||||
<blockBackground colorName="#ffffff" start="1,0" stop="1,-1"/>
|
||||
<blockBackground colorName="#ffffff" start="2,0" stop="2,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table8">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table9">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table10">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="4,0" stop="4,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="4,-1" stop="4,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#c0c0c0" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#c0c0c0" start="5,0" stop="5,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#c0c0c0" start="5,0" stop="5,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#c0c0c0" start="5,-1" stop="5,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Times-Bold" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Times-Bold" fontSize="18.0" leading="22" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="P7" fontName="Times-BoldItalic" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Times-Roman"/>
|
||||
<paraStyle name="P9" fontName="Times-Bold"/>
|
||||
<paraStyle name="P10" fontName="Times-Bold" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P11" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P12" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P13" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P14" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P15" fontName="Times-Bold" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P16" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P17" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P18" fontName="Times-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P1" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" rightIndent="-0.0" leftIndent="-3.0" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P15" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="15.0" leading="19" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<blockTable colWidths="145.0,189.0,164.0" repeatRows="1" style="Table2">
|
||||
<blockTable colWidths="499.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P1">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">Budget Analysis</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">From [[ data['form']['date1'] ]]</para>
|
||||
<para style="P3">to [[ data['form']['date2'] ]]</para>
|
||||
<para style="P14">Budget Analysis</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Text body">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="137.0,237.0,125.0" repeatRows="1" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">[[ company.name ]]</para>
|
||||
<para style="P15">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P8">From [[ data['form']['date1'] ]] to [[ data['form']['date2'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Currency: <font face="Times-Roman" size="11.0">[[ company.currency_id.name ]]</font></para>
|
||||
<para style="P9">Currency: [[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P6">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<para style="P6">
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="104.0,53.0,60.0,72.0,73.0,63.0,73.0" repeatRows="1" style="Table5">
|
||||
<para style="P10">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<para style="P1">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P1">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="104.0,55.0,58.0,72.0,77.0,59.0,73.0" repeatRows="1" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P7">Budget item detail</para>
|
||||
<para style="P13">Budget Item Detail</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">Account Number</para>
|
||||
<para style="P13">A/c No.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">Budget</para>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P13">Budget</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">Period Budget</para>
|
||||
<para style="P7">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P13">Period Budget</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">Performance</para>
|
||||
<para style="P13">Performance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">Spread</para>
|
||||
<para style="P13">Spread</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P7">% performance</para>
|
||||
<para style="P13">% performance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P8">
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="Standard">[[ repeatIn(objects,'o') ]]</para>
|
||||
<section>
|
||||
<para style="P8">[[ repeatIn(objects, 'o') ]]</para>
|
||||
<blockTable colWidths="75.0,424.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">[[ o.code ]]</para>
|
||||
<para style="P6">[[ o.code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">[[ o.name ]]</para>
|
||||
<para style="P5">[[ o.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="103.0,53.0,61.0,72.0,72.0,66.0,71.0" style="Table9">
|
||||
<blockTable colWidths="103.0,53.0,62.0,72.0,77.0,62.0,71.0" style="Table9">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">
|
||||
<font face="Times-Roman">[[ repeatIn(lines(o, data['form']['date1'], data['form']['date2']), 'a') ]] </font>
|
||||
<font face="Times-Roman">[[ a['name'] ]]</font>
|
||||
</para>
|
||||
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(lines(o, data['form']['date1'], data['form']['date2']), 'a') ]]</font>[[ a['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">[[ a['code'] ]]</para>
|
||||
<para style="P2">[[ a['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14">[[ '%.2f' % a['achievements'] ]]</para>
|
||||
<para style="P3">[[ '%.2f' % a['achievements'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P13">
|
||||
<para style="terp_default_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="156.0,61.0,72.0,72.0,66.0,70.0" style="Table10">
|
||||
<para style="Text body">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="156.0,61.0,72.0,76.0,62.0,71.0" style="Table10">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P15">Total [[ o.code ]]</para>
|
||||
<para style="P5">Total : [[ o.code ]]</para>
|
||||
<para style="Table Contents">[[ repeatIn( post_total(o, data['form']['date1'], data['form']['date2']), 'total') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ '%.2f' % total['prev'] ]]</para>
|
||||
<para style="P4">[[ '%.2f' % total['prev'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ '%.2f' % total['prev_period'] ]]</para>
|
||||
<para style="P4">[[ '%.2f' % total['prev_period'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ '%.2f' % total['achievements'] ]]</para>
|
||||
<para style="P4">[[ '%.2f' % total['achievements'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ '%.2f' % (total['prev_period'] - total['achievements']) ]]</para>
|
||||
<para style="P4">[[ '%.2f' % (total['prev_period'] - total['achievements']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P16">[[ total['prev_period'] and ('%.2f' % (total['achievements'] / total['prev_period'] * 100.0)) or 0.0]] %</para>
|
||||
<para style="P4">[[ total['prev_period'] and ('%.2f' % (total['achievements'] / total['prev_period'] * 100.0)) or 0.0]] %</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</section>
|
||||
<blockTable colWidths="156.0,61.0,72.0,72.0,67.0,68.0" style="Table7">
|
||||
<blockTable colWidths="156.0,61.0,72.0,76.0,64.0,68.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P17">Results</para>
|
||||
<para style="Table Contents">[[ repeatIn( budget_total(objects, data['form']['date1'], data['form']['date2']), 'total') ]]</para>
|
||||
<para style="P5">Results</para>
|
||||
<para style="Table Contents">[[ repeatIn( budget_total(o, data['form']['date1'], data['form']['date2']), 'total') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P18">[[ '%.2f' % total['prev'] ]]</para>
|
||||
<para style="P4">[[ '%.2f' % total['prev'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P18">[[ '%.2f' % total['prev_period'] ]]</para>
|
||||
<para style="P4">[[ '%.2f' % total['prev_period'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P18">[[ '%.2f' % total['achievements'] ]]</para>
|
||||
<para style="P4">[[ '%.2f' % total['achievements'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P18">[[ '%.2f' % (total['prev_period'] - total['achievements']) ]]</para>
|
||||
<para style="P4">[[ '%.2f' % (total['prev_period'] - total['achievements']) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P18">[[ '%.2f' % (total['achievements'] / total['prev_period'] * 100.0) ]] %</para>
|
||||
<para style="P4">[[ '%.2f' % (total['achievements'] / total['prev_period'] * 100.0) ]] %</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
@ -244,5 +304,4 @@
|
|||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
|
||||
</document>
|
|
@ -82,7 +82,7 @@ payment_mode()
|
|||
class payment_order(osv.osv):
|
||||
_name = 'payment.order'
|
||||
_description = 'Payment Order'
|
||||
_rec_name = 'date'
|
||||
_rec_name = 'reference'
|
||||
|
||||
def get_wizard(self,type):
|
||||
logger = netsvc.Logger()
|
||||
|
|
|
@ -103,8 +103,8 @@ Auction Management/Auction Dates/New Auction Dates
|
|||
<field name="auction1" select="1"/>
|
||||
<field name="auction2" select="1"/>
|
||||
<separator string="Commissions" colspan="4"/>
|
||||
<field name="seller_costs" domain="[('domain','=','auction')]"/>
|
||||
<field name="buyer_costs" domain="[('domain','=','auction')]"/>
|
||||
<field name="seller_costs" domain="[('parent_id','=',False),('domain','=','auction')]"/>
|
||||
<field name="buyer_costs" domain="[('parent_id','=',False),('domain','=','auction')]"/>
|
||||
<separator string="Accounting" colspan="4"/>
|
||||
<field name="acc_expense"/>
|
||||
<field name="acc_income"/>
|
||||
|
@ -126,7 +126,7 @@ Auction Management/Auction Dates/New Auction Dates
|
|||
<field name="domain">[('state','=','draft')]</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Auction Dates" parent="auction_menu_root" id="auction_date_menu"/>
|
||||
<menuitem name="Next Auction Dates" parent="auction_date_menu" id="menu_auction_dates_next1" action="action_auction_dates_next"/>
|
||||
=======================================================
|
||||
|
@ -208,7 +208,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="vnd_lim"/>
|
||||
<field name="vnd_lim_net"/>
|
||||
<field name="lot_est1"/>
|
||||
<field name="author_right" domain="[('domain','=','sabam')]"/>
|
||||
<field name="author_right" domain="[('domain','=','sabam'),('parent_id','=',False)]"/>
|
||||
<field name="lot_est2"/>
|
||||
<field name="product_id"/>
|
||||
<field name="state" readonly="1"/>
|
||||
|
@ -319,7 +319,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="obj_comm" select="2"/>
|
||||
<field name="obj_ret"/>
|
||||
<field name="ach_emp"/>
|
||||
<field name="author_right" domain="[('domain','=','sabam')]"/>
|
||||
<field name="author_right" domain="[('domain','=','sabam'),('parent_id','=',False)]"/>
|
||||
<field name="buyer_price"/>
|
||||
<field name="seller_price"/>
|
||||
<field name="gross_revenue"/>
|
||||
|
@ -370,10 +370,10 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_type">form</field>
|
||||
<field name="domain">[('state','=','sold')]</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Objects" parent="auction_menu_root" id="auction_objects_menu"/>
|
||||
<menuitem name="All objects" action="action_all_objects" parent="auction_objects_menu" id="auction_all_objects_menu"/>
|
||||
|
||||
|
||||
<menuitem name="Sold Objects" parent="auction_all_objects_menu" action="action_all_objects_sold" id="menu_all_objects_sold1"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_all_objects_to_sell">
|
||||
|
@ -430,7 +430,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="name" readonly="1" select="1"/>
|
||||
<field name="name2" readonly="2" select="1"/>
|
||||
<field name="artist_id" readonly="1"/>
|
||||
<field name="author_right" domain="[('domain','=','sabam')]"/>
|
||||
<field name="author_right" domain="[('domain','=','sabam'),('parent_id','=',False)]"/>
|
||||
<newline/>
|
||||
<field name="buyer_price"/>
|
||||
<field name="is_ok" select="1"/>
|
||||
|
@ -510,7 +510,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="partner_id" select="1" on_change="partner_id_change(partner_id)"/>
|
||||
<field name="method"/>
|
||||
<newline/>
|
||||
<field name="tax_id" domain="[('domain','=','auction')]"/>
|
||||
<field name="tax_id" domain="[('domain','=','auction'),('parent_id','=',False)]"/>
|
||||
<field name="transfer"/>
|
||||
<newline/>
|
||||
<field name="lot_id" colspan="4" mode="tree,graph" nolabel="1">
|
||||
|
@ -545,7 +545,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="lot_est1"/>
|
||||
<field name="lot_est2"/>
|
||||
|
||||
<field name="author_right" domain="[('domain','=','sabam')]"/>
|
||||
<field name="author_right" domain="[('domain','=','sabam'),('parent_id','=',False)]"/>
|
||||
<field name="product_id" domain="[('sale_ok','=',True)]"/>
|
||||
<field name="state" readonly="1"/>
|
||||
</page><page string="Photos">
|
||||
|
@ -598,7 +598,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_deposit_border_tree2"/>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Sellers" id="auction_seller_menu" parent="auction_menu_root"/>
|
||||
<menuitem name="Deposit border" parent="auction_seller_menu" action="action_deposit_border" id="menu_auction_deposit_border"/>
|
||||
|
||||
|
@ -694,7 +694,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="res_model">auction.bid</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Buyers" id="auction_buyers_menu" parent="auction_menu_root"/>
|
||||
<menuitem name="Bids" parent="auction_buyers_menu" action="action_bid_open" id="menu_action_bid_open"/>
|
||||
|
||||
|
@ -743,7 +743,7 @@ Auction Management/Auction Dates/Reporting
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Reporting" id="auction_report_menu" parent="auction_menu_root"/>
|
||||
|
||||
|
||||
|
@ -877,7 +877,7 @@ Auction Management/Auction Dates/Reporting
|
|||
</record>
|
||||
<menuitem name="Sellers" id="auction_report_seller_menu" parent="auction_report_menu"/>
|
||||
<menuitem name="Seller's Summary" action="action_auction_reporting_all1" id="menu_seller_allmonth_view1" parent="auction_report_seller_menu"/>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_auction_form2">
|
||||
<field name="name">Seller's auction</field>
|
||||
<field name="model">report.seller.auction2</field>
|
||||
|
@ -969,7 +969,7 @@ Auction Management/Auction Dates/Reporting
|
|||
<field name="view_mode">tree</field>
|
||||
<field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_auction_buyer_form2">
|
||||
<field name="name">Buyer's auction</field>
|
||||
<field name="model">report.buyer.auction2</field>
|
||||
|
@ -1017,16 +1017,16 @@ Auction Management/Auction Dates/Reporting
|
|||
</record>
|
||||
<menuitem name="Buyer" id="auction_report_buyer_menu" parent="auction_report_menu"/>
|
||||
<menuitem name="Buyer's Summary" action="action_auction_buyer_reporting_all1" id="menu_buyer_allmonth_view1" parent="auction_report_buyer_menu"/>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_auction_buyer_reporting_all2">
|
||||
<field name="name">Buyer's auction for all months</field>
|
||||
<field name="res_model">report.buyer.auction2</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<menuitem name="Buyer's Revenues" action="action_auction_buyer_reporting_all2" id="menu_buyer_allmonth_view2" parent="auction_report_buyer_menu"/>
|
||||
|
||||
<!--end : creating buyer Reporting menu for the buyer by pmo-->
|
||||
|
@ -1141,7 +1141,7 @@ estimation.adj.category
|
|||
|
||||
<!--=============================
|
||||
sign in sign out report by user
|
||||
==============================
|
||||
==============================
|
||||
|
||||
<record model="ir.ui.view" id="view_report_auction_sign_in_out_tree">
|
||||
<field name="name">report.auction.user.pointing.tree</field>
|
||||
|
@ -1240,7 +1240,7 @@ My Latest Objects
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('create_uid','=',uid)]</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_report_latest_objects_manager_tree">
|
||||
<field name="res_model">auction.lots</field>
|
||||
<field name="view_type">form</field>
|
||||
|
@ -1385,7 +1385,7 @@ Objects per Day
|
|||
<field name="view_type">tree</field>
|
||||
<field name="domain">[('state','=', 'draft')]</field>
|
||||
</record>
|
||||
<menuitem name="Objects by Auction"
|
||||
<menuitem name="Objects by Auction"
|
||||
parent="auction_objects_menu"
|
||||
id="menu_auction_dates_next_by_auction"
|
||||
action="action_report_object_by_auction" sequence="11"/>
|
||||
|
|
|
@ -13,15 +13,16 @@
|
|||
*contacts working at several adresses (possibly for different partners),
|
||||
*contacts with possibly different functions for each of its job's addresses
|
||||
|
||||
It also add a new menuitem located in
|
||||
It also add new menuitems located in
|
||||
Partners \ Contacts
|
||||
Partners \ Functions
|
||||
|
||||
|
||||
Pay attention that this module converts the existing addresses into "addresses + contacts". It means that some fields of the addresses will be missing (like the contact name), since these are supposed to be defined in an other object.
|
||||
""",
|
||||
"depends" : ["base"],
|
||||
"init_xml" : [],
|
||||
"demo_xml" : [],
|
||||
"demo_xml" : ["base_contact_demo.xml"],
|
||||
"update_xml" : [
|
||||
"security/ir.model.access.csv",
|
||||
'base_contact_view.xml'
|
||||
|
|
|
@ -0,0 +1,326 @@
|
|||
<?xml version="1.0" ?>
|
||||
<terp>
|
||||
<data>
|
||||
<!-- Create the functions -->
|
||||
<record id="res_partner_function_privateaddress0" model="res.partner.function">
|
||||
<field eval=""""Private Address"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<!-- Create the contacts -->
|
||||
<record id="res_partner_contact_mortier0" model="res.partner.contact">
|
||||
<field eval=""""Benoit"""" name="first_name"/>
|
||||
<field eval=""""Mortier"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_jacot0" model="res.partner.contact">
|
||||
<field eval=""""Laurent"""" name="first_name"/>
|
||||
<field eval=""""Jacot"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_passot0" model="res.partner.contact">
|
||||
<field eval=""""Thomas"""" name="first_name"/>
|
||||
<field eval=""""Passot"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_lacarte0" model="res.partner.contact">
|
||||
<field eval=""""Etienne"""" name="first_name"/>
|
||||
<field eval=""""Lacarte"""" name="name"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_tang0" model="res.partner.contact">
|
||||
<field eval=""""Tang"""" name="name"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_wong0" model="res.partner.contact">
|
||||
<field eval=""""Wong"""" name="name"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_lavente0" model="res.partner.contact">
|
||||
<field eval=""""Jean-Guy"""" name="first_name"/>
|
||||
<field eval=""""Lavente"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_lelitre0" model="res.partner.contact">
|
||||
<field eval=""""Sylvie"""" name="first_name"/>
|
||||
<field eval=""""Lelitre"""" name="name"/>
|
||||
<field eval=""""Mss"""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_grosbonnet0" model="res.partner.contact">
|
||||
<field eval=""""Arthur"""" name="first_name"/>
|
||||
<field eval=""""Grosbonnet"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_lesbrouffe0" model="res.partner.contact">
|
||||
<field eval=""""Karine"""" name="first_name"/>
|
||||
<field eval=""""Lesbrouffe"""" name="name"/>
|
||||
<field eval=""""Ms."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_zen0" model="res.partner.contact">
|
||||
<field eval=""""Zen"""" name="name"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_pinckears0" model="res.partner.contact">
|
||||
<field eval=""""http://fptiny.blogspot.com/"""" name="website"/>
|
||||
<field eval=""""Fabien"""" name="first_name"/>
|
||||
<field eval=""""Pinckears"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_debois0" model="res.partner.contact">
|
||||
<field eval=""""Cécile"""" name="first_name"/>
|
||||
<field eval=""""Debois"""" name="name"/>
|
||||
<field eval=""""Mss"""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_luu0" model="res.partner.contact">
|
||||
<field eval=""""Phuong"""" name="first_name"/>
|
||||
<field eval=""""Luu"""" name="name"/>
|
||||
<field eval=""""Ms."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_elkhayat0" model="res.partner.contact">
|
||||
<field eval=""""Najlaâ"""" name="first_name"/>
|
||||
<field eval=""""El Khayat"""" name="name"/>
|
||||
<field eval=""""Ms."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_depaoli0" model="res.partner.contact">
|
||||
<field eval=""""Quentin"""" name="first_name"/>
|
||||
<field eval=""""De Paoli"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_semal0" model="res.partner.contact">
|
||||
<field eval=""""Fabian"""" name="first_name"/>
|
||||
<field eval=""""Semal"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_vandewerve0" model="res.partner.contact">
|
||||
<field eval=""""Alain"""" name="first_name"/>
|
||||
<field eval=""""van de Werve"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_lambotte0" model="res.partner.contact">
|
||||
<field eval=""""Frédéric"""" name="first_name"/>
|
||||
<field eval=""""Lambotte"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_laurent0" model="res.partner.contact">
|
||||
<field eval=""""Olivier"""" name="first_name"/>
|
||||
<field eval=""""Laurent"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_simonis0" model="res.partner.contact">
|
||||
<field eval=""""Christophe"""" name="first_name"/>
|
||||
<field eval=""""Simonis"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_wirtel0" model="res.partner.contact">
|
||||
<field eval=""""Stéphane"""" name="first_name"/>
|
||||
<field eval=""""Wirtel"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_contact_mignon0" model="res.partner.contact">
|
||||
<field eval=""""Philippe"""" name="first_name"/>
|
||||
<field eval=""""Mignon"""" name="name"/>
|
||||
<field eval=""""M."""" name="title"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Create the addresses -->
|
||||
<record id="base.main_address" model="res.partner.address">
|
||||
<field eval=""""Grand-Rosière"""" name="city"/>
|
||||
<field eval=""""+32.81.73.35.01"""" name="fax"/>
|
||||
<field eval=""""1367"""" name="zip"/>
|
||||
<field name="country_id" ref="base.be"/>
|
||||
<field eval=""""+32.81.81.37.00"""" name="phone"/>
|
||||
<field eval=""""Chaussée de Namur, 40"""" name="street"/>
|
||||
</record>
|
||||
<record id="res_partner_address_0" model="res.partner.address">
|
||||
<field eval=""""Louvain-La-Neuve"""" name="city"/>
|
||||
<field eval=""""1348"""" name="zip"/>
|
||||
<field eval=""""contact"""" name="type"/>
|
||||
<field name="country_id" ref="base.be"/>
|
||||
<field eval=""""rue du pré, 115"""" name="street"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
<record id="res_partner_address_1" model="res.partner.address">
|
||||
<field eval=""""Charleroi"""" name="city"/>
|
||||
<field eval=""""6000"""" name="zip"/>
|
||||
<field eval=""""contact"""" name="type"/>
|
||||
<field name="country_id" ref="base.be"/>
|
||||
<field eval=""""Boulevars Tirou, 32"""" name="street"/>
|
||||
<field eval="1" name="active"/>
|
||||
</record>
|
||||
|
||||
<!-- Create the jobs -->
|
||||
<record id="res_partner_job_0" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_1"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field name="contact_id" ref="res_partner_contact_mortier0"/>
|
||||
<field name="sequence_partner">2</field>
|
||||
</record>
|
||||
<record id="res_partner_job_1" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_2"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field eval=""""contact@tecsas.fr"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_jacot0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_2" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_3"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""info@mediapole.net"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_passot0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_3" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_tang"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field name="contact_id" ref="res_partner_contact_tang0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_4" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_wong"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field name="contact_id" ref="res_partner_contact_wong0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_5" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_6"/>
|
||||
<field name="function_id" ref="base.function_director"/>
|
||||
<field name="contact_id" ref="res_partner_contact_lacarte0"/>
|
||||
<field name="sequence_contact">1</field>
|
||||
<field name="sequence_partner">0</field>
|
||||
|
||||
</record>
|
||||
<record id="res_partner_job_6" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_7"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field name="contact_id" ref="res_partner_contact_lavente0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_7" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_8"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field name="contact_id" ref="res_partner_contact_lelitre0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_8" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_9"/>
|
||||
<field name="function_id" ref="base.function_director"/>
|
||||
<field name="contact_id" ref="res_partner_contact_grosbonnet0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_9" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_10"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field name="contact_id" ref="res_partner_contact_lesbrouffe0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_10" model="res.partner.job">
|
||||
<field name="address_id" ref="base.res_partner_address_zen"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field name="contact_id" ref="res_partner_contact_zen0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_11" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field eval=""""pmi@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_mignon0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_12" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""stw@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_wirtel0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_13" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""chs@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_simonis0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_14" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""olt@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_laurent0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_15" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""fla@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_lambotte0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_16" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field eval=""""avw@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_vandewerve0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_17" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""fbs@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_semal0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_18" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""qdp@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_depaoli0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_19" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""nel@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_elkhayat0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_20" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_it"/>
|
||||
<field eval=""""phu@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_luu0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_21" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_director"/>
|
||||
<field eval=""""fp@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_pinckears0"/>
|
||||
<field name="sequence_partner">-1</field>
|
||||
</record>
|
||||
<record id="res_partner_job_22" model="res.partner.job">
|
||||
<field name="address_id" ref="base.main_address"/>
|
||||
<field name="function_id" ref="base.function_sale"/>
|
||||
<field eval=""""cde@tinyerp.com"""" name="email"/>
|
||||
<field name="contact_id" ref="res_partner_contact_debois0"/>
|
||||
</record>
|
||||
<record id="res_partner_job_23" model="res.partner.job">
|
||||
<field name="address_id" ref="res_partner_address_0"/>
|
||||
<field name="contact_id" ref="res_partner_contact_mortier0"/>
|
||||
<field name="function_id" ref="res_partner_function_privateaddress0"/>
|
||||
<field name="sequence_contact">5</field>
|
||||
</record>
|
||||
<record id="res_partner_job_24" model="res.partner.job">
|
||||
<field eval="1" name="sequence_contact"/>
|
||||
<field name="address_id" ref="res_partner_address_1"/>
|
||||
<field name="contact_id" ref="res_partner_contact_lacarte0"/>
|
||||
<field name="function_id" ref="res_partner_function_privateaddress0"/>
|
||||
<field name="sequence_contact">5</field>
|
||||
</record>
|
||||
<record id="res_partner_job_25" model="res.partner.job">
|
||||
<field eval="2" name="sequence_contact"/>
|
||||
<field name="address_id" ref="base.res_partner_address_1"/>
|
||||
<field name="contact_id" ref="res_partner_contact_lacarte0"/>
|
||||
<field name="function_id" ref="base.function_director"/>
|
||||
<field name="sequence_contact">1</field>
|
||||
</record>
|
||||
</data>
|
||||
</terp>
|
|
@ -31,11 +31,52 @@
|
|||
import netsvc
|
||||
from osv import fields, osv
|
||||
|
||||
def _format_iban(string):
|
||||
'''
|
||||
This function removes all characters from given 'string' that isn't a alpha numeric and converts it to lower case.
|
||||
'''
|
||||
res = ""
|
||||
for char in string:
|
||||
if char.isalnum():
|
||||
res += char.lower()
|
||||
return res
|
||||
|
||||
class res_partner_bank(osv.osv):
|
||||
_inherit = "res.partner.bank"
|
||||
_columns = {
|
||||
'iban': fields.char('IBAN', size=34, readonly=True, help="International Bank Account Number"),
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
#overwrite to format the iban number correctly
|
||||
if vals.has_key('iban'):
|
||||
vals['iban'] = _format_iban(vals['iban'])
|
||||
return super(res_partner_bank, self).create(cr, uid, vals, context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context={}):
|
||||
#overwrite to format the iban number correctly
|
||||
if vals.has_key('iban'):
|
||||
vals['iban'] = _format_iban(vals['iban'])
|
||||
return super(res_partner_bank, self).write(cr, uid, ids, vals, context)
|
||||
|
||||
def check_iban(self, cr, uid, ids):
|
||||
'''
|
||||
Check the IBAN number
|
||||
'''
|
||||
for bank_acc in self.browse(cr, uid, ids):
|
||||
if not bank_acc.iban:
|
||||
continue
|
||||
iban =_format_iban(bank_acc.iban)
|
||||
#the four first digits have to be shifted to the end
|
||||
iban = iban[4:] + iban[:4]
|
||||
#letters have to be transformed into numbers (a = 10, b = 11, ...)
|
||||
iban2 = ""
|
||||
for char in iban:
|
||||
if char.isalpha():
|
||||
iban2 += str(ord(char)-87)
|
||||
else:
|
||||
iban2 += char
|
||||
#iban is correct if modulo 97 == 1
|
||||
if not int(iban2) % 97 == 1:
|
||||
return False
|
||||
return True
|
||||
|
||||
def name_get(self, cr, uid, ids, context=None):
|
||||
res = []
|
||||
|
@ -48,18 +89,50 @@ class res_partner_bank(osv.osv):
|
|||
res += super(res_partner_bank, self).name_get(cr, uid, to_check_ids, context)
|
||||
return res
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None,
|
||||
context=None, count=False):
|
||||
res = super(res_partner_bank,self).search(cr, uid, args, offset, limit,
|
||||
order, context=context, count=count)
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
#overwrite the search method in order to search not only on bank type == basic account number but also on type == iban
|
||||
res = super(res_partner_bank,self).search(cr, uid, args, offset, limit, order, context=context, count=count)
|
||||
if filter(lambda x:x[0]=='acc_number' ,args):
|
||||
#get the value of the search
|
||||
iban_value = filter(lambda x:x[0]=='acc_number' ,args)[0][2]
|
||||
#get the other arguments of the search
|
||||
args1 = filter(lambda x:x[0]!='acc_number' ,args)
|
||||
#add the new criterion
|
||||
args1 += [('iban','ilike',iban_value)]
|
||||
#append the results to the older search
|
||||
res += super(res_partner_bank,self).search(cr, uid, args1, offset, limit,
|
||||
order, context=context, count=count)
|
||||
return res
|
||||
|
||||
def get_bban_from_iban(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function returns the bank account number computed from the iban account number, thanks to the mapping_list dictionary that contains the rules associated to its country.
|
||||
'''
|
||||
res = {}
|
||||
mapping_list = {
|
||||
#TODO add rules for others countries
|
||||
'be': lambda x: x[4:],
|
||||
'fr': lambda x: x[14:],
|
||||
'ch': lambda x: x[9:],
|
||||
'gb': lambda x: x[14:],
|
||||
}
|
||||
for record in self.browse(cr, uid, ids, context):
|
||||
if not record.iban:
|
||||
res[record.id] = False
|
||||
continue
|
||||
res[record.id] = False
|
||||
for code, function in mapping_list.items():
|
||||
if record.iban.lower().startswith(code):
|
||||
res[record.id] = function(record.iban)
|
||||
break
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'iban': fields.char('IBAN', size=34, readonly=True, help="International Bank Account Number"),
|
||||
}
|
||||
|
||||
_constraints = [(check_iban, "The IBAN number doesn't seem to be correct.", ["iban"])]
|
||||
|
||||
res_partner_bank()
|
||||
|
||||
|
||||
|
|
|
@ -226,24 +226,27 @@ class document_directory(osv.osv):
|
|||
('dirname_uniq', 'unique (name,parent_id,ressource_id,ressource_parent_type_id)', 'The directory name must be unique !')
|
||||
]
|
||||
|
||||
def get_resource_path(self,cr,uid,res_model,res_id):
|
||||
# to be need test
|
||||
def get_resource_path(self,cr,uid,dir_id,res_model,res_id):
|
||||
# this method will be used in process module
|
||||
# to be need test and Improvement if resource dir has parent resource (link resource)
|
||||
path=[]
|
||||
def _parent(dir_id):
|
||||
def _parent(dir_id,path):
|
||||
parent=self.browse(cr,uid,dir_id)
|
||||
if parent.parent_id:
|
||||
_parent(parent.parent_id.id)
|
||||
else:
|
||||
if parent.parent_id and not parent.ressource_parent_type_id:
|
||||
_parent(parent.parent_id.id,path)
|
||||
path.append(parent.name)
|
||||
return path
|
||||
model_ids=self.pool.get('ir.model').search(cr,uid,[('model','=',res_model)])
|
||||
directory_ids=self.search(cr,uid,[('ressource_type_id','=',model_ids[0]),('ressource_id','=',res_id)])
|
||||
if len(directory_ids):
|
||||
path=parent(directory_ids[0])
|
||||
direc=self.browse(cr,uid,directory_ids)[0]
|
||||
path.append(direc.name)
|
||||
path.append(self.pool.get(direc.ressource_type_id.model).browse(cr,uid,res_id).name)
|
||||
return "ftp://localhost:8021/"+cr.dbname+'/'.join(path)
|
||||
else:
|
||||
path.append(parent.name)
|
||||
return path
|
||||
|
||||
directory=self.browse(cr,uid,dir_id)
|
||||
model_ids=self.pool.get('ir.model').search(cr,uid,[('model','=',res_model)])
|
||||
if directory:
|
||||
_parent(dir_id,path)
|
||||
path.append(self.pool.get(directory.ressource_type_id.model).browse(cr,uid,res_id).name)
|
||||
user=self.pool.get('res.users').browse(cr,uid,uid)
|
||||
#print "ftp://%s:%s@localhost:8021/%s/%s"%(user.login,user.password,cr.dbname,'/'.join(path))
|
||||
return "ftp://%s:%s@localhost:8021/%s/%s"%(user.login,user.password,cr.dbname,'/'.join(path))
|
||||
return False
|
||||
def _check_duplication(self, cr, uid,vals):
|
||||
if 'name' in vals:
|
||||
|
@ -343,8 +346,9 @@ class document_directory(osv.osv):
|
|||
return result
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if not self._check_duplication(cr,uid,vals):
|
||||
raise except_orm('ValidateError', 'Directory name must be unique!')
|
||||
# need to make constraints to checking duplicate
|
||||
#if not self._check_duplication(cr,uid,vals):
|
||||
# raise except_orm('ValidateError', 'Directory name must be unique!')
|
||||
return super(document_directory,self).write(cr,uid,ids,vals,context=context)
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
<field name="priority" eval="1"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="subflow_id" position="after">
|
||||
<field name="directory_id"/>
|
||||
<field name="directory_id" domain="[('ressource_type_id','=',model_id),('ressource_parent_type_id','=',False)]"/>
|
||||
<newline/>
|
||||
</field>
|
||||
</field>
|
||||
|
@ -192,7 +192,7 @@
|
|||
<field name="priority" eval="1"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="subflow_id" position="after">
|
||||
<field name="directory_id"/>
|
||||
<field name="directory_id" domain="[('ressource_type_id','=',model_id),('ressource_parent_type_id','=',False)]"/>
|
||||
<newline/>
|
||||
</field>
|
||||
</field>
|
||||
|
|
|
@ -134,8 +134,8 @@ class event(osv.osv):
|
|||
'date_begin': fields.datetime('Beginning date', required=True),
|
||||
'date_end': fields.datetime('Ending date', required=True),
|
||||
'state': fields.selection([('draft','Draft'),('confirm','Confirmed'),('done','Done'),('cancel','Canceled')], 'Status', readonly=True, required=True),
|
||||
'mail_auto_registr':fields.boolean('Mail Auto Register',help='A mail is send when the registration is confirmed'),
|
||||
'mail_auto_confirm':fields.boolean('Mail Auto Confirm',help='A mail is send when the event is confimed'),
|
||||
'mail_auto_registr':fields.boolean('Mail Auto Register',help='A mail is sent when the registration is confirmed'),
|
||||
'mail_auto_confirm':fields.boolean('Mail Auto Confirm',help='A mail is sent when the event is confimed'),
|
||||
'mail_registr':fields.text('Mail Register',help='Template for the mail'),
|
||||
'mail_confirm':fields.text('Mail Confirm',help='Template for the mail'),
|
||||
'budget_id':fields.many2one('account.budget.post','Budget'),
|
||||
|
@ -163,13 +163,6 @@ class event_registration(osv.osv):
|
|||
obj.create(cr, uid, data, context)
|
||||
return True
|
||||
|
||||
def button_reg_open(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'open',})
|
||||
cases = self.browse(cr, uid, ids)
|
||||
self._history(cr, uid, cases, 'Open', history=True)
|
||||
self.mail_user(cr,uid,ids)
|
||||
return True
|
||||
|
||||
def button_reg_close(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'done',})
|
||||
cases = self.browse(cr, uid, ids)
|
||||
|
@ -223,7 +216,7 @@ class event_registration(osv.osv):
|
|||
"badge_name":fields.char('Badge Name',size=128),
|
||||
"badge_partner":fields.char('Badge Partner',size=128),
|
||||
"invoice_label":fields.char("Label Invoice",size=128,required=True),
|
||||
"tobe_invoiced":fields.boolean("To be Invoice"),
|
||||
"tobe_invoiced":fields.boolean("To be Invoiced"),
|
||||
"invoice_id":fields.many2one("account.invoice","Invoice"),
|
||||
}
|
||||
_defaults = {
|
||||
|
|
|
@ -198,7 +198,7 @@
|
|||
<form string="Registration">
|
||||
<notebook>
|
||||
<page string="General">
|
||||
<field name="event_id" select="1" on_change="onchange_event(event_id, partner_invoice_id)" colspan="1"/>
|
||||
<field name="event_id" select="1" on_change="onchange_event(event_id, partner_invoice_id)" colspan="1" domain="[('state','in',('draft','confirm'))]"/>
|
||||
<field name="nb_register"/>
|
||||
<newline/>
|
||||
<field name="partner_id" required="1" select="1" on_change="onchange_partner_id(partner_id,event_id, email_from)" />
|
||||
|
@ -220,7 +220,7 @@
|
|||
<group col="8" colspan="4">
|
||||
<field name="state" select="1" colspan="2"/>
|
||||
<button name="button_reg_close" string="Registration Invoiced" states="open" type="object"/>
|
||||
<button name="button_reg_open" string="Confirm Registration" states="draft" type="object"/>
|
||||
<button name="%(event_confirm_registration)d" string="Confirm Registration" states="draft" type="action"/>
|
||||
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object"/>
|
||||
</group>
|
||||
</page>
|
||||
|
|
|
@ -1,52 +1,43 @@
|
|||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<wizard string="Project"
|
||||
model="event.event"
|
||||
name="event.project"
|
||||
id="event_wiz"
|
||||
menu="False"/>
|
||||
<data>
|
||||
<wizard string="Project"
|
||||
model="event.event"
|
||||
name="event.project"
|
||||
id="event_wiz"
|
||||
menu="False"/>
|
||||
|
||||
<wizard
|
||||
string="Tasks"
|
||||
model="event.event"
|
||||
name="wizard_event_tasks"
|
||||
id="wizard_event_task"/>
|
||||
<wizard
|
||||
string="Tasks"
|
||||
model="event.event"
|
||||
name="wizard_event_tasks"
|
||||
id="wizard_event_task"/>
|
||||
|
||||
<wizard
|
||||
string="Registrations"
|
||||
model="event.event"
|
||||
name="wizard_event_registration"
|
||||
id="wizard_event_registration"/>
|
||||
<wizard
|
||||
string="Registrations"
|
||||
model="event.event"
|
||||
name="wizard_event_registration"
|
||||
id="wizard_event_registration"/>
|
||||
|
||||
<!--<wizard
|
||||
string="New child event"
|
||||
model="event.event"
|
||||
name="wizard_event_new"
|
||||
keyword="client_action_multi"
|
||||
menu="False"
|
||||
id="wizard_event_new"/>-->
|
||||
<wizard
|
||||
string="List Register Partners"
|
||||
model="event.event"
|
||||
name="event.event_reg_partners"
|
||||
id="wizard_event_reg_partners"/>
|
||||
|
||||
<wizard
|
||||
string="List Register Partners"
|
||||
model="event.event"
|
||||
name="event.event_reg_partners"
|
||||
id="wizard_event_reg_partners"/>
|
||||
<wizard string="Make Invoice"
|
||||
model="event.registration"
|
||||
name="event.reg_make_invoice"
|
||||
id="event_reg_invoice"
|
||||
menu="True"
|
||||
/>
|
||||
|
||||
<wizard string="Make Invoice"
|
||||
model="event.registration"
|
||||
name="event.reg_make_invoice"
|
||||
id="event_reg_invoice"
|
||||
menu="True"
|
||||
/>
|
||||
<!--
|
||||
<record model="ir.values" id="ir_open_new_event">
|
||||
<field name="key2">tree_but_open</field>
|
||||
<field name="model">event.event</field>
|
||||
<field name="name">New child event</field>
|
||||
<field name="value" eval="'ir.actions.wizard,%d'%wizard_event_new"/>
|
||||
<field name="object" eval="True"/>
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
<wizard string="Confirm Registration"
|
||||
model="event.registration"
|
||||
name="event.confirm_registration"
|
||||
id="event_confirm_registration"
|
||||
menu="False"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -3,6 +3,7 @@ import event_registration
|
|||
import project_wizard
|
||||
import make_invoice
|
||||
import event_registrations_partner
|
||||
import confirm_registration
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import wizard
|
||||
import ir
|
||||
import pooler
|
||||
from osv.osv import except_osv
|
||||
from osv import fields,osv
|
||||
import netsvc
|
||||
|
||||
ARCH = '''<?xml version="1.0"?>
|
||||
<form string="Registration Confirmation">
|
||||
<label string="The event limit is reached. What do you want to do?" colspan="4"/>
|
||||
</form>'''
|
||||
|
||||
ARCH_fields={}
|
||||
|
||||
def _confirm(self, cr, uid, data, context):
|
||||
registration_obj = pooler.get_pool(cr.dbname).get('event.registration')
|
||||
current_registration = registration_obj.browse(cr, uid, [data['id']])[0]
|
||||
|
||||
total_confirmed = current_registration.event_id.register_current + current_registration.nb_register
|
||||
if total_confirmed <= current_registration.event_id.register_max:
|
||||
return 'confirm'
|
||||
return 'split'
|
||||
|
||||
|
||||
def _check_confirm(self, cr, uid, data, context):
|
||||
registration_obj = pooler.get_pool(cr.dbname).get('event.registration')
|
||||
registration_obj.write(cr, uid, [data['id']], {'state':'open',})
|
||||
reg = registration_obj.browse(cr, uid, [data['id']])
|
||||
registration_obj._history(cr, uid, reg, 'Open', history=True)
|
||||
registration_obj.mail_user(cr,uid,[data['id']])
|
||||
return {}
|
||||
|
||||
|
||||
class confirm_registration(wizard.interface):
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [],
|
||||
'result' : {'type' : 'choice', 'next_state' : _confirm}
|
||||
},
|
||||
|
||||
'split' : {
|
||||
'actions' : [],
|
||||
'result' : {'type' : 'form',
|
||||
'arch' : ARCH,'fields':ARCH_fields,
|
||||
'state' : [('end', 'Cancel'),('confirm', 'Confirm Anyway') ]}
|
||||
},
|
||||
|
||||
'confirm' : {
|
||||
'actions' : [],
|
||||
'result' : {'type' : 'action', 'action': _check_confirm, 'state' : 'end'}
|
||||
},
|
||||
'end' : {
|
||||
'actions' : [],
|
||||
'result': {'type': 'state', 'state': 'end'},
|
||||
},
|
||||
}
|
||||
|
||||
confirm_registration('event.confirm_registration')
|
|
@ -6,21 +6,21 @@
|
|||
model="res.partner"
|
||||
name="list.vat.detail"
|
||||
menu="False"
|
||||
id="base.partner_wizard_vat"/>
|
||||
id="partner_wizard_vat"/>
|
||||
<menuitem
|
||||
name="Financial Management/Reporting/Listing of VAT Customers"
|
||||
action="base.partner_wizard_vat"
|
||||
action="partner_wizard_vat"
|
||||
type="wizard"
|
||||
id="base.partner_wizard_vat_menu"/>
|
||||
id="partner_wizard_vat_menu"/>
|
||||
<wizard
|
||||
string="VAT Declaration"
|
||||
name="wizard.account.vat.declaration"
|
||||
name="wizard.account.xml.vat.declaration"
|
||||
menu="False"
|
||||
id="account.wizard_vat_declaration"/>
|
||||
id="wizard_xml_vat_declaration"/>
|
||||
|
||||
<menuitem
|
||||
name="Financial Management/Periodical Processing/Taxes/VAT Declaration"
|
||||
action="account.wizard_vat_declaration"
|
||||
action="wizard_xml_vat_declaration"
|
||||
type="wizard"
|
||||
id="account_wizard_vat_declaration"/>
|
||||
|
||||
|
|
|
@ -98,4 +98,4 @@ class wizard_vat_declaration(wizard.interface):
|
|||
}
|
||||
}
|
||||
|
||||
wizard_vat_declaration('wizard.account.vat.declaration')
|
||||
wizard_vat_declaration('wizard.account.xml.vat.declaration')
|
||||
|
|
|
@ -1205,7 +1205,7 @@ msgstr "Index numériques"
|
|||
#. module: mrp
|
||||
#: field:mrp.routing,location_id:0
|
||||
msgid "Production Location"
|
||||
msgstr "Emplacement de production\\""
|
||||
msgstr "Emplacement de production"
|
||||
|
||||
#. module: mrp
|
||||
#: selection:stock.warehouse.orderpoint,logic:0
|
||||
|
|
|
@ -214,20 +214,19 @@
|
|||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Bill of Material">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
|
||||
<newline/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="product_uom"/>
|
||||
<field name="product_qty"/>
|
||||
<newline/>
|
||||
<field name="product_uos" groups="product.group_uos"/>
|
||||
<field name="product_uos_qty" groups="product.group_uos"/>
|
||||
<field name="routing_id" select="2"/>
|
||||
<field name="type"/>
|
||||
<notebook>
|
||||
<page string="General Information">
|
||||
<field name="product_id" on_change="onchange_product_id(product_id, name)" select="1"/>
|
||||
<newline/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="product_uom"/>
|
||||
<field name="product_qty"/>
|
||||
<newline/>
|
||||
<field name="product_uos"/>
|
||||
<field name="product_uos_qty"/>
|
||||
<field name="routing_id" select="2"/>
|
||||
<field name="type"/>
|
||||
|
||||
<field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list"/>
|
||||
</page>
|
||||
<page string="Revisions">
|
||||
|
|
|
@ -122,6 +122,9 @@ class process_process(osv.osv):
|
|||
wkf_ids = self.pool.get('workflow').search(cr, uid, [('osv', '=', data['model'])])
|
||||
data['workflow'] = (wkf_ids or False) and wkf_ids[0]
|
||||
|
||||
if 'directory_id' in node and node.directory_id:
|
||||
data['directory_id'] = node.directory_id.id
|
||||
|
||||
if node.menu_id:
|
||||
data['menu'] = {'name': node.menu_id.complete_name, 'id': node.menu_id.id}
|
||||
|
||||
|
@ -190,9 +193,9 @@ class process_process(osv.osv):
|
|||
refobj = pool.get(ref_model).browse(cr, uid, [ref_id], context)[0]
|
||||
fields = pool.get(ref_model).fields_get(cr, uid, context=context)
|
||||
|
||||
# chech whether directory_id from inherited from document module
|
||||
if 'directory_id' in refobj and refobj.directory_id:
|
||||
res['directory'] = self.pool.get('document.directory').get_resource_path(cr, uid, node.directory_id.id, ref_model, ref_id)
|
||||
# chech for directory_id from inherited from document module
|
||||
if nodes[nid].get('directory_id', False):
|
||||
resource['directory'] = self.pool.get('document.directory').get_resource_path(cr, uid, nodes[nid]['directory_id'], ref_model, ref_id)
|
||||
|
||||
resource['name'] = refobj.name_get(context)[0][1]
|
||||
resource['perm'] = pool.get(ref_model).perm_read(cr, uid, [ref_id], context)[0]
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
# Fabien Pinckaers <fp@tiny.Be>
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import product_margin
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
{
|
||||
"name":"Margins in Product",
|
||||
"version":"1.0",
|
||||
"author":"Tiny",
|
||||
"category":"Custom",
|
||||
"depends":["product"],
|
||||
"demo_xml":[],
|
||||
"update_xml":["product_margin_view.xml"],
|
||||
"active": False,
|
||||
"installable": True,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id: partner.py 1007 2005-07-25 13:18:09Z kayhman $
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields,osv
|
||||
import pooler
|
||||
from tools import config
|
||||
import time
|
||||
|
||||
class product_product(osv.osv):
|
||||
_inherit = "product.product"
|
||||
|
||||
|
||||
def _product_margin(self, cr, uid, ids, field_names, arg, context):
|
||||
res = {}
|
||||
for val in self.browse(cr, uid, ids,context=context):
|
||||
res[val.id] = {}
|
||||
date_from=context.get('date_from', time.strftime('%Y-01-01'))
|
||||
date_to=context.get('date_to', time.strftime('%Y-12-31'))
|
||||
invoice_state=context.get('invoice_state', 'open')
|
||||
if 'date_from' in field_names:
|
||||
res[val.id]['date_from']=date_from
|
||||
if 'date_to' in field_names:
|
||||
res[val.id]['date_to']=date_to
|
||||
if 'invoice_state' in field_names:
|
||||
res[val.id]['invoice_state']=invoice_state
|
||||
|
||||
|
||||
invoice_types=[]
|
||||
states=[]
|
||||
if invoice_state=='draft_open':
|
||||
states=['draft','open']
|
||||
elif invoice_state=='paid':
|
||||
states=['paid']
|
||||
elif invoice_state=='open':
|
||||
states=['open']
|
||||
|
||||
if 'sale_avg_price' in field_names or 'sale_num_invoiced' in field_names or 'turnover' in field_names or 'sale_expected' in field_names:
|
||||
invoice_types=['out_invoice','in_refund']
|
||||
if 'purchase_avg_price' in field_names or 'purchase_num_invoiced' in field_names or 'total_cost' in field_names or 'normal_cost' in field_names:
|
||||
invoice_types=['in_invoice','out_refund']
|
||||
if len(invoice_types):
|
||||
sql="""
|
||||
select
|
||||
avg(l.price_unit) as avg_unit_price,
|
||||
sum(l.quantity) as num_qty,
|
||||
sum(l.quantity * l.price_unit) as total,
|
||||
sum(sale_line.product_uom_qty * sale_line.price_unit) as sale_expected,
|
||||
sum(purchase_line.product_qty * purchase_line.price_unit) as normal_cost
|
||||
from account_invoice_line l
|
||||
left join account_invoice i on (l.invoice_id = i.id)
|
||||
left join sale_order_invoice_rel sale_invoice on (i.id=sale_invoice.invoice_id)
|
||||
left join sale_order sale on sale.id=sale_invoice.order_id
|
||||
left join sale_order_line sale_line on sale.id=sale_line.order_id
|
||||
left join purchase_order purchase on purchase.invoice_id=i.id
|
||||
left join purchase_order_line purchase_line on purchase_line.order_id=purchase.id
|
||||
where l.product_id = %s and i.state in ('%s') and i.type in ('%s')
|
||||
"""%(val.id,"','".join(states),"','".join(invoice_types))
|
||||
cr.execute(sql)
|
||||
result=cr.fetchall()[0]
|
||||
if 'sale_avg_price' in field_names or 'sale_num_invoiced' in field_names or 'turnover' in field_names or 'sale_expected' in field_names:
|
||||
res[val.id]['sale_avg_price']=result[0] and result[0] or 0.0
|
||||
res[val.id]['sale_num_invoiced']=result[1] and result[1] or 0.0
|
||||
res[val.id]['turnover']=result[2] and result[2] or 0.0
|
||||
res[val.id]['sale_expected']=result[3] and result[3] or 0.0
|
||||
res[val.id]['sales_gap']=res[val.id]['sale_expected']-res[val.id]['turnover']
|
||||
if 'purchase_avg_price' in field_names or 'purchase_num_invoiced' in field_names or 'total_cost' in field_names or 'normal_cost' in field_names:
|
||||
res[val.id]['purchase_avg_price']=result[0] and result[0] or 0.0
|
||||
res[val.id]['purchase_num_invoiced']=result[1] and result[1] or 0.0
|
||||
res[val.id]['total_cost']=result[2] and result[2] or 0.0
|
||||
res[val.id]['normal_cost']=result[4] and result[4] or 0.0
|
||||
res[val.id]['purchase_gap']=res[val.id]['normal_cost']-res[val.id]['total_cost']
|
||||
|
||||
if 'total_margin' in field_names:
|
||||
res[val.id]['total_margin']=val.turnover-val.total_cost
|
||||
if 'expected_margin' in field_names:
|
||||
res[val.id]['expected_margin']=val.sale_expected-val.normal_cost
|
||||
if 'total_margin_rate' in field_names:
|
||||
res[val.id]['total_margin_rate']=val.turnover and val.total_margin * 100 / val.turnover or 0.0
|
||||
if 'expected_margin_rate' in field_names:
|
||||
res[val.id]['expected_margin_rate']=val.sale_expected and val.expected_margin * 100 / val.sale_expected or 0.0
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'date_from': fields.function(_product_margin, method=True, type='date', string='From Date', multi=True),
|
||||
'date_to': fields.function(_product_margin, method=True, type='date', string='To Date', multi=True),
|
||||
'invoice_state': fields.function(_product_margin, method=True, type='selection', selection=[
|
||||
('paid','Paid'),
|
||||
('open','All Open'),
|
||||
('draft_open','Draft and Open')
|
||||
], string='Invoice State',multi=True, readonly=True),
|
||||
'sale_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='sale'),
|
||||
'purchase_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='purchase'),
|
||||
'sale_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='sale'),
|
||||
'purchase_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='purchase'),
|
||||
'sales_gap' : fields.function(_product_margin, method=True, type='float', string='Sales Gap', multi='sale'),
|
||||
'purchase_gap' : fields.function(_product_margin, method=True, type='float', string='Purchase Gap', multi='purchase'),
|
||||
'turnover' : fields.function(_product_margin, method=True, type='float', string='Turnover' ,multi='sale'),
|
||||
'total_cost' : fields.function(_product_margin, method=True, type='float', string='Total Cost', multi='purchase'),
|
||||
'sale_expected' : fields.function(_product_margin, method=True, type='float', string='Expected Sale', multi='sale'),
|
||||
'normal_cost' : fields.function(_product_margin, method=True, type='float', string='Normal Cost', multi='purchase'),
|
||||
'total_margin' : fields.function(_product_margin, method=True, type='float', string='Total Margin', multi='total'),
|
||||
'expected_margin' : fields.function(_product_margin, method=True, type='float', string='Expected Margin', multi='total'),
|
||||
'total_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Total Margin (%)', multi='margin'),
|
||||
'expected_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Expected Margin (%)', multi='margin'),
|
||||
}
|
||||
|
||||
|
||||
product_product()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<wizard id="action_open_margin" menu="False" model="product.product" name="product.margin" string="Product Margin"/>
|
||||
|
||||
<menuitem id="menu_product_reporting" name="Reporting" parent ="product.menu_main_product" />
|
||||
|
||||
<menuitem icon="STOCK_JUSTIFY_FILL" action="action_open_margin" id="menu_action_product_margin" type="wizard" sequence="5" parent="menu_product_reporting" />
|
||||
|
||||
<record id="view_product_margin_form" model="ir.ui.view">
|
||||
<field name="name">product.margin.form.inherit</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="priority">10</field>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Prices" position="after">
|
||||
<page string="Margin">
|
||||
<separator string="Analysis Criteria" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<newline/>
|
||||
<field name="invoice_state" />
|
||||
|
||||
<separator string="Sales" colspan="4"/>
|
||||
<field name="sale_avg_price"/>
|
||||
<field name="list_price" string="Catalog Price" readonly="1"/>
|
||||
<field name="sale_num_invoiced" />
|
||||
<field name="sales_gap" />
|
||||
<field name="turnover" />
|
||||
<field name="sale_expected" />
|
||||
|
||||
<separator string="Purchases" colspan="4"/>
|
||||
<field name="purchase_avg_price"/>
|
||||
<field name="standard_price" string="Standard Price" readonly="1"/>
|
||||
<field name="purchase_num_invoiced" />
|
||||
<field name="purchase_gap" />
|
||||
<field name="total_cost" />
|
||||
<field name="normal_cost" />
|
||||
|
||||
<separator string="Margins" colspan="4"/>
|
||||
<field name="total_margin"/>
|
||||
<field name="expected_margin"/>
|
||||
<field name="total_margin_rate" widget="progressbar"/>
|
||||
<field name="expected_margin_rate" widget="progressbar"/>
|
||||
|
||||
</page>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_product_margin_tree" model="ir.ui.view">
|
||||
<field name="name">product.margin.tree</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Product Margin">
|
||||
<field name="name" select="1"/>
|
||||
<field name="default_code" select="1"/>
|
||||
<field name="sale_avg_price"/>
|
||||
<field name="sale_num_invoiced"/>
|
||||
<field name="turnover"/>
|
||||
<field name="sales_gap"/>
|
||||
<field name="total_cost"/>
|
||||
<field name="purchase_num_invoiced" string="#Purchased"/>
|
||||
<field name="total_margin"/>
|
||||
<field name="expected_margin"/>
|
||||
<field name="total_margin_rate" widget="progressbar"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -0,0 +1,33 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
# Fabien Pinckaers <fp@tiny.Be>
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard_product_margin
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import wizard
|
||||
import pooler
|
||||
import time
|
||||
|
||||
def _action_open_window(self, cr, uid, data, context):
|
||||
cr.execute('select id,name from ir_ui_view where name=%s and type=%s', ('product.margin.tree', 'tree'))
|
||||
view_res = cr.fetchone()
|
||||
return {
|
||||
'name': 'Product Margin',
|
||||
'context':{'date_from':data['form']['from_date'],'date_to':data['form']['to_date'],'invoice_state' : data['form']['invoice_state']},
|
||||
'view_type': 'form',
|
||||
"view_mode": 'tree,form',
|
||||
'res_model':'product.product',
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_id': view_res,
|
||||
}
|
||||
|
||||
|
||||
class product_margin(wizard.interface):
|
||||
form1 = '''<?xml version="1.0"?>
|
||||
<form string="View Stock of Products">
|
||||
<separator string="Select " colspan="4"/>
|
||||
<field name="from_date"/>
|
||||
<field name="to_date"/>
|
||||
<field name="invoice_state"/>
|
||||
</form>'''
|
||||
form1_fields = {
|
||||
'from_date': {
|
||||
'string': 'From',
|
||||
'type': 'date',
|
||||
},
|
||||
'to_date': {
|
||||
'string': 'To',
|
||||
'type': 'date',
|
||||
},
|
||||
'invoice_state': {
|
||||
'string': 'Invoice State',
|
||||
'type': 'selection',
|
||||
'selection': [('paid','Paid'),('open','All Open'),('draft_open','Draft and Open')],
|
||||
'required': True,
|
||||
'default': lambda *a:"open",
|
||||
},
|
||||
}
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel','gtk-cancel'),('open', 'Open Margin','gtk-ok')]}
|
||||
},
|
||||
'open': {
|
||||
'actions': [],
|
||||
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
|
||||
}
|
||||
}
|
||||
product_margin('product.margin')
|
Loading…
Reference in New Issue