bzr revid: fp@tinyerp.com-20081007123509-2sz5ip3yxrzazegm
This commit is contained in:
Fabien Pinckaers
2008-10-07 14:35:09 +02:00
16 changed files with 507 additions and 212 deletions
+4 -4
View File
@@ -1121,8 +1121,8 @@ class account_tax(osv.osv):
# Same fields for refund invoices
'ref_base_code_id': fields.many2one('account.tax.code', 'Base Code', help="Use this code for the VAT declaration."),
'ref_tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="Use this code for the VAT declaration."),
'ref_base_code_id': fields.many2one('account.tax.code', 'Refund Base Code', help="Use this code for the VAT declaration."),
'ref_tax_code_id': fields.many2one('account.tax.code', 'Refund Tax Code', help="Use this code for the VAT declaration."),
'ref_base_sign': fields.float('Base Code Sign', help="Usualy 1 or -1."),
'ref_tax_sign': fields.float('Tax Code Sign', help="Usualy 1 or -1."),
'include_base_amount': fields.boolean('Include in base amount', help="Indicate if the amount of tax must be included in the base amount for the computation of the next taxes"),
@@ -1781,8 +1781,8 @@ class account_tax_template(osv.osv):
# Same fields for refund invoices
'ref_base_code_id': fields.many2one('account.tax.code.template', 'Base Code', help="Use this code for the VAT declaration."),
'ref_tax_code_id': fields.many2one('account.tax.code.template', 'Tax Code', help="Use this code for the VAT declaration."),
'ref_base_code_id': fields.many2one('account.tax.code.template', 'Refund Base Code', help="Use this code for the VAT declaration."),
'ref_tax_code_id': fields.many2one('account.tax.code.template', 'Refund Tax Code', help="Use this code for the VAT declaration."),
'ref_base_sign': fields.float('Base Code Sign', help="Usually 1 or -1."),
'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."),
'include_base_amount': fields.boolean('Include in base amount', help="Indicate if the amount of tax must be included in the base amount for the computation of the next taxes."),
+6 -6
View File
@@ -184,8 +184,8 @@
<field name="state" select="2"/>
<field name="residual"/>
<group col="3" colspan="4">
<button name="invoice_open" states="draft,proforma" string="Validate"/>
<button name="invoice_cancel" states="draft,proforma,sale,open" string="Cancel"/>
<button name="invoice_open" states="draft,proforma2" string="Validate"/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
<button name='%(wizard_paid_open)d' type='action' string='Re-Open' states='paid'/>
</group>
@@ -266,9 +266,9 @@
<field name="state" select="2"/>
<field name="residual"/>
<group col="3" colspan="4">
<button name="invoice_proforma" states="draft" string="PRO-FORMA"/>
<button name="invoice_open" states="draft,proforma" string="Create"/>
<button name="invoice_cancel" states="draft,proforma,sale,open" string="Cancel"/>
<button name="invoice_proforma2" states="draft" string="PRO-FORMA"/>
<button name="invoice_open" states="draft,proforma2" string="Create"/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
<button name='%(wizard_paid_open)d' type='action' string='Re-Open' states='paid'/>
</group>
@@ -452,7 +452,7 @@
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="domain">[('state','=','proforma'),('type','=','out_invoice')]</field>
<field name="domain">[('state','=','proforma2'),('type','=','out_invoice')]</field>
<field name="context">{'type':'out_invoice'}</field>
</record>
<record id="action_invoice_tree6_view1" model="ir.actions.act_window.view">
@@ -23,6 +23,14 @@
write({'state':'proforma'})</field>
<field name="kind">function</field>
</record>
<record id="act_proforma2" model="workflow.activity">
<field name="wkf_id" ref="account.wkf"/>
<field name="name">proforma2</field>
<field name="action">write({'state':'proforma2'})</field>
<field name="kind">function</field>
</record>
<record id="act_open" model="workflow.activity">
<field name="wkf_id" ref="wkf"/>
<field name="name">open</field>
@@ -114,5 +122,31 @@ write({'state':'cancel'})</field>
<field name="act_to" ref="act_cancel"/>
<field name="signal">invoice_cancel</field>
</record>
<record id="draft_to_pro2" model="workflow.transition">
<field name="act_from" ref="account.act_draft"/>
<field name="act_to" ref="act_proforma2"/>
<field name="signal">invoice_proforma2</field>
</record>
<record id="pro2_to_open" model="workflow.transition">
<field name="act_from" ref="act_proforma2"/>
<field name="act_to" ref="account.act_open"/>
<field name="signal">invoice_open</field>
</record>
<record id="pro2_to_paid" model="workflow.transition">
<field name="act_from" ref="act_proforma2"/>
<field name="act_to" ref="account.act_paid"/>
<field name="trigger_model">account.move.line</field>
<field name="trigger_expr_id">move_line_id_payment_get()</field>
<field name="condition">test_paid()</field>
</record>
<record id="pro2_to_cancel" model="workflow.transition">
<field name="act_from" ref="act_proforma2"/>
<field name="act_to" ref="account.act_cancel"/>
<field name="signal">invoice_cancel</field>
</record>
</data>
</openerp>
+1
View File
@@ -9,6 +9,7 @@
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration"/>
<menuitem id="menu_finance_reporting" name="Reporting" parent="account.menu_finance" sequence="8"/>
<menuitem id="menu_finance_legal_statement" name="Legal Statements" parent="account.menu_finance" sequence="8"/>
<menuitem id="menu_finance_entries" name="Entries Encoding" parent="account.menu_finance" sequence="2"/>
<menuitem id="account.menu_finance_recurrent_entries" name="Recurrent Entries" parent="account.menu_finance_entries" sequence="15"/>
+1
View File
@@ -165,6 +165,7 @@ class account_invoice(osv.osv):
'state': fields.selection([
('draft','Draft'),
('proforma','Pro-forma'),
('proforma2','Pro-forma'),
('open','Open'),
('paid','Done'),
('cancel','Canceled')
+1 -1
View File
@@ -224,5 +224,5 @@ class account_balance(report_sxw.rml_parse):
def _sum_debit(self):
return self.sum_debit
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=2)
report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False)
+145 -50
View File
@@ -19,6 +19,7 @@
<lineMode width="0.7"/>
<lines>1cm 27.7cm 20cm 27.7cm</lines>
<setFont name="Helvetica" size="8"/>
</pageGraphics>
</pageTemplate>
</template>
@@ -40,7 +41,7 @@
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P2" fontName="Helvetica" fontSize="2.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Helvetica" fontSize="2.0" leading="0" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3a" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10" fontName="Helvetica" fontSize="9.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>
@@ -51,12 +52,15 @@
<paraStyle name="P12a" fontName="Helvetica" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P14" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
<blockTableStyle id="TrLevel8">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel7">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
<blockTableStyle id="TrLevel6">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
</blockTableStyle>
<blockTableStyle id="TrLevel5">
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
</blockTableStyle>
@@ -75,25 +79,30 @@
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
</blockTableStyle>
<paraStyle
name="Level8"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level7"
fontName="Helvetica"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level6"
fontName="Helvetica"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level5"
fontName="Helvetica"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level4"
fontName="Helvetica"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle
name="Level3"
fontName="Helvetica"
fontName="Helvetica-Bold"
fontSize="8.0" />
<paraStyle name="Level2"
fontSize="8.0"
@@ -101,15 +110,111 @@
/>
<paraStyle name="Level1"
fontSize="8.0"
fontName="Helvetica-Bold"
/>
<paraStyle
name="Amt_Level8"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level7"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level6"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level5"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level4"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Amt_Level3"
fontName="Helvetica-Bold"
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Amt_Level2"
fontSize="8.0"
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle name="Amt_Level1"
fontSize="8.0"
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle
name="Det_Level8"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level7"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level6"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level5"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level4"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle
name="Det_Level3"
fontName="Times-Italic"
fontSize="8.0" leading="5"/>
<paraStyle name="Det_Level2"
fontSize="8.0" leading="5"
fontName="Times-Italic"
/>
<paraStyle name="Det_Level1"
fontSize="8.0" leading="5"
fontName="Times-Italic"
/>
<paraStyle
name="Det_Amt_Level8"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level7"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level6"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level5"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level4"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle
name="Det_Amt_Level3"
fontName="Times-Italic"
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Det_Amt_Level2"
fontSize="8.0"
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
<paraStyle name="Det_Amt_Level1"
fontSize="8.0"
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
/>
</stylesheet>
<images/>
<story>
<para style="P2">
<font color="white"> </font>
</para>
<blockTable colWidths="527.00" style="Table4" repeatRows="1">
<tr>
<td>
@@ -139,46 +244,36 @@
<para style="P10">Balance</para>
</td>
</tr>
<tr>
<td>
<blockTable colWidths="50.0,248.0,73.0,72.0,82.0" style="Table3">
<para style="P2">[[ repeatIn(lines(data['form']), 'a') ]]</para>
<tr>
<td><para style="P14">[[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]]<i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td>
<para style="P14">[[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]]<font color="white">[[ (a['level']&lt;6 and removeParentNode('font') or '... '*(a['level']-4)) ]]</font>[[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]]</para>
</td>
<td>
<para style="P3">[[ (a['level']&lt;4) and setTag('para','para',{'style':'P3'}) ]]<u>[[ (a['leef'] and removeParentNode('para')) or formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]]</u></para>
<para style="P3">[[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]]</para>
</td>
<td>
<para style="P3">[[ (a['level']&lt;4) and setTag('para','para',{'style':'P3'}) ]]<u>[[ (a['leef'] and removeParentNode('para')) or formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]]</u></para>
<para style="P3">[[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]]</para>
</td>
<td>
<para style="P3">[[ (a['level']&lt;4) and setTag('para','para',{'style':'P3a'}) ]]<u>[[ (a['leef'] and removeParentNode('para')) or formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]]</u></para>
<para style="P3">[[ ((not a['leef']) and removeParentNode('para')) or formatLang(a['balance']) and formatLang(a['balance']) or '0.00' ]]</para>
</td>
</tr>
<tr>
<td><para style="P14">[[ a['jname'] or removeParentNode('tr') ]]</para></td>
<td>
<para style="P14"><font color="white">[[ '... '*(a['level']-3) ]]</font>[[ a['lname'] ]]</para>
</td>
<td>
<para style="P3">[[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']]</para>
</td>
<td>
<para style="P3">[[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']]</para>
</td>
<td>
<para style="P3">[[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]]</para>
</td>
</tr>
</blockTable>
</td>
</tr>
<tr>
<td>
<blockTable colWidths="50.0,248.0,73.0,72.0,82.0" style="Table3">
<para style="P2">[[ repeatIn(lines(data['form']), 'a') ]]</para>
<tr>
<td><para style="P14">[[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]]<i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
<td><para style="P14">[[ setTag('para','para',{'style':('Level'+str(a['level']))}) ]][[ setTag('blockTable','blockTable',{'style':'TrLevel'+str(a['level'])}) ]][[ a['name'] ]]</para></td>
<td>
<para style="P3"><font><u>[[ a['level']&gt;3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]]</u></font>
<font>[[ a['level']&lt;4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit']) and '%.2f'%a['debit'] or '0.00' ]]</font></para>
</td>
<td>
<para style="P3"><font><u>[[ a['level']&gt;3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]]</u></font>
<font>[[ a['level']&lt;4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit']) and '%.2f'%a['credit'] or '0.00' ]]</font></para>
</td>
<td>
<para style="P3"><font><u>[[ a['level']&gt;3 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]]</u></font>
<font>[[ a['level']&lt;4 and removeParentNode('font') ]][[ setTag('para','para',{'style':('Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance']) and '%.2f'%a['balance'] or '0.00' ]]</font></para>
</td>
</tr>
<tr>
<td><para style="P14">[[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]][[ a['jname'] or removeParentNode('tr') ]]</para></td>
<td><para style="P14"><font color="white">[[ a['level']&lt;4 and removeParentNode('font') or '...'*(2) ]]</font>[[ setTag('para','para',{'style':('Det_Level'+str(a['level']))}) ]]<font>[ref: [[ a['ref'] or removeParentNode('font') ]] ]</font> [[ a['lname'] ]]</para></td>
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['debit1']) and '%.2f'%a['debit1'] or '0.00']]</para></td>
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['credit1']) and '%.2f'%a['credit1'] or '0.00']]</para></td>
<td><para style="P3">[[ setTag('para','para',{'style':('Det_Amt_Level'+str(a['level']))}) ]][[ formatLang(a['balance1']) and '%.2f'%a['balance1'] or '0.00' ]]</para></td>
</tr>
</blockTable>
</td>
</tr>
</blockTable>
</story>
</document>
@@ -277,11 +277,7 @@
<field name="view_id" ref="view_crossovered_budget_line_tree"/>
</record>
<menuitem name="Budgets" parent="menu_action_account_budget_post_tree"
id="menu_financial_reporting_budget_budget"/>
<menuitem name="Entries" parent="menu_financial_reporting_budget_budget"
id="menu_financial_reporting_budget_budget_entries"/>
<menuitem parent="menu_financial_reporting_budget_budget_entries"
<menuitem parent="menu_action_account_budget_post_tree"
id="menu_act_crossovered_budget_lines_view"
action="act_crossovered_budget_lines_view" />
+1
View File
@@ -92,6 +92,7 @@ class res_partner_address(osv.osv):
_description ='Partner Address'
_columns = {
'job_ids':fields.one2many('res.partner.job', 'address_id', 'Contacts'),
'email': fields.related('job_ids', 'email', type='char', string='Default Email'),
}
res_partner_address()
+100 -8
View File
@@ -232,20 +232,20 @@ class document_directory(osv.osv):
path=[]
def _parent(dir_id,path):
parent=self.browse(cr,uid,dir_id)
if parent.parent_id and not parent.ressource_parent_type_id:
if parent.parent_id and not parent.ressource_parent_type_id:
_parent(parent.parent_id.id,path)
path.append(parent.name)
else:
path.append(parent.name)
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)])
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)
_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))
#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):
@@ -595,4 +595,96 @@ class document_file(osv.osv):
except:
pass
return super(document_file, self).unlink(cr, uid, ids, context)
document_file()
document_file()
class auto_configuration(osv.osv_memory):
_name='auto.configuration'
_rec_name = 'Auto Directory configuration'
_columns = {
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_config(self, cr, uid, ids, context=None):
obj=self.pool.get('document.directory')
search_ids=obj.search(cr,uid,[])
browse_lst=obj.browse(cr,uid,search_ids)
model_obj=self.pool.get('ir.model')
for doc_obj in browse_lst:
if doc_obj.name in ('Partner','Contacts','Personnal Folders','Partner Category','Sales Order','All Sales Order','Sales by Salesman','Projects'):
res={}
id=[]
if doc_obj.name=='Partner':
id=model_obj.search(cr,uid,[('model','=','res.partner')])
if doc_obj.name=='Contacts':
id=model_obj.search(cr,uid,[('model','=','res.partner.address')])
if doc_obj.name=='Partner Category':
id=model_obj.search(cr,uid,[('model','=','res.partner.category')])
if doc_obj.name=='All Sales Order':
val={}
id=model_obj.search(cr,uid,[('model','=','sale.order')])
if not len(doc_obj.content_ids):
val['name']='Sale Report'
val['suffix']='_report'
val['report_id']=self.pool.get('ir.actions.report.xml').search(cr,uid,[('report_name','=','sale.order')])[0]
val['extension']='.pdf'
val['directory_id']=doc_obj.id
self.pool.get('document.directory.content').create(cr,uid,val)
if doc_obj.name=='Sales by Salesman':
id=model_obj.search(cr,uid,[('model','=','res.users')])
if doc_obj.name=='Personnal Folders':
id=model_obj.search(cr,uid,[('model','=','res.users')])
if doc_obj.name=='Projects':
id=model_obj.search(cr,uid,[('model','=','account.analytic.account')])
res['ressource_tree']=True
if id:
res['ressource_type_id']=id[0]
res['type']='ressource'
obj.write(cr,uid,doc_obj.id,res)
self.create_folder(cr, uid, ids, context=None)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def create_folder(self, cr, uid, ids, context=None):
doc_obj=self.pool.get('document.directory')
model_obj=self.pool.get('ir.model')
for name in ('Sales','Quotation','Meetings','Analysis Reports'):
res={}
if name=='Sales':
child_model=model_obj.search(cr,uid,[('model','=','sale.order')])
link_model=model_obj.search(cr,uid,[('model','=','res.users')])
if child_model:
res['type']='ressource'
res['ressource_type_id']=child_model[0]
res['ressource_parent_type_id']=link_model[0]
res['domain']="[('user_id','=',active_id)]"
else:
link_model=model_obj.search(cr,uid,[('model','=','account.analytic.account')])
if link_model:
res['ressource_parent_type_id']=link_model[0]
res['ressource_id']=0
if res:
res['name']=name
doc_obj.create(cr,uid,res)
return True
auto_configuration()
+38
View File
@@ -198,6 +198,44 @@
</field>
</record>
<record id="view_auto_config_form" model="ir.ui.view">
<field name="name">Auto Configure Directory</field>
<field name="model">auto.configuration</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Auto Configure">
<label string="" colspan="2"/>
<newline/>
<label string="Do you want to configure Directory Automatically ?" colspan="2"/>
<newline/>
<newline/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_config" string="Configure" icon='gtk-ok' type="object"/>
</group>
<newline/>
<label string="You Can use ftp://admin:admin@localhost:8021 " colspan="2"/>
</form>
</field>
</record>
<record id="action_config_auto_directory" model="ir.actions.act_window">
<field name="name">Auto Configure Directory</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">auto.configuration</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.actions.todo"
id="config_auto_directory">
<field name="name">Auto Configure Directory</field>
<field name="action_id" ref="action_config_auto_directory"/>
<field name="state">open</field>
</record>
</data>
</terp>
+91 -43
View File
@@ -78,15 +78,24 @@ class event(osv.osv):
_order = 'date_begin'
def copy(self, cr, uid, id, default=None, context=None):
return super(event, self).copy(cr, uid,id, default={'code': self.pool.get('ir.sequence').get(cr, uid, 'event.event'),})
return super(event, self).copy(cr, uid,id, default={'code': self.pool.get('ir.sequence').get(cr, uid, 'event.event'),'state':'draft'})
def button_draft(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'draft'})
def button_cancel(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'cancel'})
def button_done(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'done'})
def button_confirm(self, cr, uid, ids, context={}):
for eve in self.browse(cr, uid, ids):
if eve.mail_auto_confirm:
#send reminder that will confirm the event for all the people that were already confirmed
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id','=',eve.id),('state','not in',['draft','cancel'])])
if reg_ids:
self.pool.get('event.registration').mail_user_confirm(cr, uid, reg_ids)
return self.write(cr, uid, ids, {'state':'confirm'})
def _get_register(self, cr, uid, ids, name, args, context=None):
@@ -116,10 +125,28 @@ class event(osv.osv):
def write(self, cr, uid, ids,vals, *args, **kwargs):
res = super(event,self).write(cr, uid, ids,vals, *args, **kwargs)
if 'date_begin' in vals and vals['date_begin']:
data_event = self.browse(cr, uid, ids)
for eve in data_event:
for eve in self.browse(cr, uid, ids):
#change the deadlines of the registration linked to this event
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id','=',eve.id)])
if reg_ids:
self.pool.get('event.registration').write(cr, uid, reg_ids, {'date_deadline':vals['date_begin']})
#change the date of the project
if eve.project_id:
self.pool.get('project.project').write(cr, uid, [eve.project_id.id], {'date_end':eve.date_begin})
#change the description of the registration linked to this event
if 'mail_auto_confirm' in vals:
if vals['mail_auto_confirm']:
if 'mail_confirm' not in vals:
for eve in self.browse(cr, uid, ids):
vals['mail_confirm'] = eve.mail_confirm
else:
vals['mail_confirm']=False
if 'mail_confirm' in vals:
for eve in self.browse(cr, uid, ids):
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id','=',eve.id)])
if reg_ids:
self.pool.get('event.registration').write(cr, uid, reg_ids, {'description':vals['mail_confirm']})
return res
_columns = {
@@ -134,12 +161,12 @@ 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 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'),
'mail_auto_registr':fields.boolean('Mail Auto Register',help='Check this box if you want to use the automatic mailing for new registration'),
'mail_auto_confirm':fields.boolean('Mail Auto Confirm',help='Check this box if you want ot use the automatic confirmation emailing or the reminder'),
'mail_registr':fields.text('Registration Email',help='This email will be sent when someone subscribes to the event.'),
'mail_confirm': fields.text('Confirmation Email', help="This email will be sent when the event gets confimed or when someone subscribes to a confirmed event. This is also the email sent to remind someone about the event."),
'budget_id':fields.many2one('account.budget.post','Budget'),
'product_id':fields.many2one('product.product','Product'),
'product_id':fields.many2one('product.product','Product', required=True),
}
_defaults = {
'state': lambda *args: 'draft',
@@ -177,6 +204,8 @@ class event_registration(osv.osv):
def create(self, cr, uid, *args, **argv):
args[0]['section_id']= self.pool.get('event.event').browse(cr, uid, args[0]['event_id'], None).section_id.id
args[0]['date_deadline']= self.pool.get('event.event').browse(cr, uid, args[0]['event_id'], None).date_begin
args[0]['description']= self.pool.get('event.event').browse(cr, uid, args[0]['event_id'], None).mail_confirm
res = super(event_registration, self).create(cr, uid, *args, **argv)
self._history(cr, uid,self.browse(cr, uid, [res]), 'Created', history=True)
return res
@@ -184,22 +213,38 @@ class event_registration(osv.osv):
def write(self, cr, uid, *args, **argv):
if 'event_id' in args[1]:
args[1]['section_id']= self.pool.get('event.event').browse(cr, uid, args[1]['event_id'], None).section_id.id
args[1]['date_deadline']= self.pool.get('event.event').browse(cr, uid, args[1]['event_id'], None).date_begin
args[1]['description']= self.pool.get('event.event').browse(cr, uid, args[1]['event_id'], None).mail_confirm
return super(event_registration, self).write(cr, uid, *args, **argv)
def mail_user(self,cr,uid,ids):
src=tools.config.options['smtp_user']
def mail_user_confirm(self,cr,uid,ids):
reg_ids=self.browse(cr,uid,ids)
for reg_id in reg_ids:
dest=reg_id.email_from
if (reg_id.event_id.state in ['confirm','running']) and reg_id.event_id.mail_auto_confirm:
if dest:
tools.email_send(src,[dest],'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name,reg_id.event_id.mail_confirm)
return True
# Sending another mail
if reg_id.event_id.state in ['draft', 'fixed', 'open','confirm','running'] and reg_id.event_id.mail_auto_registr:
if dest:
tools.email_send(src,[dest],'Auto Registration: '+'['+str(reg_id.id)+']'+' '+reg_id.name,reg_id.event_id.mail_registr)
return True
src = reg_id.event_id.reply_to or False
dest = [reg_id.email_from]
if reg_id.email_cc:
dest += [reg_id.email_cc]
if dest and src:
tools.email_send(src, dest,'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_confirm, tinycrm = str(reg_id.case_id.id))
if not src:
raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering'))
return False
def mail_user(self,cr,uid,ids):
reg_ids=self.browse(cr,uid,ids)
for reg_id in reg_ids:
src = reg_id.event_id.reply_to or False
dest = [reg_id.email_from]
if reg_id.email_cc:
dest += [reg_id.email_cc]
if reg_id.event_id.mail_auto_confirm or reg_id.event_id.mail_auto_registr:
if dest and src:
if reg_id.event_id.state in ['draft', 'fixed', 'open','confirm','running'] and reg_id.event_id.mail_auto_registr:
tools.email_send(src, dest,'Auto Registration: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_registr, tinycrm = str(reg_id.case_id.id))
if (reg_id.event_id.state in ['confirm','running']) and reg_id.event_id.mail_auto_confirm:
tools.email_send(src, dest,'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.description, tinycrm = str(reg_id.case_id.id))
if not src:
raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering'))
return False
_name= 'event.registration'
@@ -208,9 +253,9 @@ class event_registration(osv.osv):
_columns = {
'case_id':fields.many2one('crm.case','Case'),
'nb_register': fields.integer('Number of Registration', readonly=True, states={'draft':[('readonly',False)]}),
"partner_order_id":fields.many2one('res.partner','Partner Order'),
'event_id':fields.many2one('event.event', 'Event Related', required=True),
"partner_invoice_id":fields.many2one('res.partner', 'Partner Invoice'),
"partner_invoice_id":fields.many2one('res.partner', 'Partner Invoiced'),
"contact_id":fields.many2one('res.partner.contact', 'Partner Contact'), #TODO: filter only the contacts that have a function into the selected partner_id
"unit_price": fields.float('Unit Price'),
"badge_title":fields.char('Badge Title',size=128),
"badge_name":fields.char('Badge Name',size=128),
@@ -232,18 +277,19 @@ class event_registration(osv.osv):
data['name'] = 'Registration: ' + badge_name
return {'value':data}
def onchange_contact_id(self, cr, uid, ids, contact_id):
def onchange_contact_id(self, cr, uid, ids, contact, partner):
data ={}
if not contact_id:
if not contact:
return data
obj_addr=self.pool.get('res.partner.address').browse(cr, uid, contact_id)
data['email_from'] = obj_addr.email
if obj_addr.contact_id:
data['badge_name']=obj_addr.contact_id.name
data['badge_title']=obj_addr.contact_id.title
d=self.onchange_badge_name(cr, uid, ids,data['badge_name'])
data.update(d['value'])
contact_id = self.pool.get('res.partner.contact').browse(cr, uid, contact)
data['badge_name'] = contact_id.name
data['badge_title'] = contact_id.title
if partner:
partner_addresses = self.pool.get('res.partner.address').search(cr, uid, [('partner_id','=',partner)])
job_id = self.pool.get('res.partner.job').search(cr, uid, [('contact_id','=',contact),('address_id','in',partner_addresses)])[0]
data['email_from'] = self.pool.get('res.partner.job').browse(cr, uid, job_id).email
d = self.onchange_badge_name(cr, uid, ids,data['badge_name'])
data.update(d['value'])
return {'value':data}
@@ -263,24 +309,26 @@ class event_registration(osv.osv):
return {'value':{'unit_price' : False,'invoice_label' : False}}
def onchange_partner_id(self, cr, uid, ids, part, event_id, email=False):#override function for partner name.
def onchange_partner_id(self, cr, uid, ids, part, event_id):
data={}
data['badge_partner']=data['partner_address_id']=data['partner_invoice_id']=data['email_from']=data['badge_title']=data['badge_name']=False
data['badge_partner'] = data['contact_id'] = data['partner_invoice_id'] = data['email_from'] = data['badge_title'] = data['badge_name'] = False
if not part:
return {'value':data}
data['partner_invoice_id']=part
# this calls onchange_partner_invoice_id
d=self.onchange_partner_invoice_id(cr, uid, ids, event_id,part)
d = self.onchange_partner_invoice_id(cr, uid, ids, event_id,part)
# this updates the dictionary
data.update(d['value'])
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['contact'])
data['partner_address_id']=addr['contact']
if addr['contact']:
d=self.onchange_contact_id(cr, uid, ids,addr['contact'])
data.update(d['value'])
partner_data=self.pool.get('res.partner').browse(cr, uid, part)
data['badge_partner']=partner_data.name
addr = self.pool.get('res.partner').address_get(cr, uid, [part])
if addr:
if addr.has_key('default'):
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('address_id','=',addr['default'])])
if job_ids:
data['contact_id'] = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0]).contact_id.id
d = self.onchange_contact_id(cr, uid, ids, data['contact_id'],part)
data.update(d['value'])
partner_data = self.pool.get('res.partner').browse(cr, uid, part)
data['badge_partner'] = partner_data.name
return {'value':data}
def onchange_partner_invoice_id(self, cr, uid, ids, event_id, partner_invoice_id):
+27 -23
View File
@@ -55,20 +55,22 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Events">
<notebook>
<page string="Information">
<separator string="Event description" colspan="4"/>
<field name="name" string="Event" select="1" colspan="4"/>
<field name="parent_id" domain="[('parent_id','child_of','Event')]" string="Category"/>
<field name="type"/>
<group col="6" colspan="4">
<field name="name" string="Event" select="1"/>
<field name="type" select="2"/>
<field name="user_id" select="1"/>
<field name="active"/>
<field name="date_begin" select="1"/>
<field name="date_end" select="2"/>
<field name="product_id"/>
</group>
<notebook colspan="4">
<page string="General">
<separator string="Event description" colspan="4"/>
<field name="parent_id" domain="[('parent_id','child_of','Event')]" string="Parent Category"/>
<field name="active"/>
<field name="register_min" select="2"/>
<field name="register_max" select="2"/>
<field name="budget_id"/>
<field name="product_id" required="1"/>
<separator string="Tasks management" colspan="4"/>
<field name="project_id"/>
<button string="Create Retro-Planning" name="%(event.event_wiz)d" type="action"/>
@@ -82,13 +84,15 @@
</group>
</page>
<page string="Mailing">
<field name="reply_to"/>
<separator string="Auto Registration Email" colspan="4"/>
<field name="mail_auto_registr"/>
<newline/><newline/>
<field name="mail_registr"/>
<newline/>
<field name="mail_registr" colspan="4"/>
<separator string="Auto Confirmation Email" colspan="4"/>
<field name="mail_auto_confirm"/>
<newline/><newline/>
<field name="mail_confirm"/>
<newline/>
<field name="mail_confirm" colspan="4"/>
<newline/>
</page>
<page string="Statistics">
@@ -138,7 +142,7 @@
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
</record>
<menuitem parent="menu_event_config" id="menu_event_new_event" action="action_new_event_form" />
<menuitem parent="menu_event_main" id="menu_event_new_event" action="action_new_event_form" />
<record model="ir.actions.act_window" id="action_event_view">
@@ -196,27 +200,27 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Registration">
<notebook>
<page string="General">
<field name="event_id" select="1" on_change="onchange_event(event_id, partner_invoice_id)" colspan="1" domain="[('state','in',('draft','confirm'))]"/>
<group col="6" colspan="4">
<field name="event_id" select="1" on_change="onchange_event(event_id, partner_invoice_id)" 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)" />
<field name="user_id" select="1"/>
<field name="partner_id" required="1" select="1" on_change="onchange_partner_id(partner_id,event_id)" />
<field name="partner_invoice_id" on_change="onchange_partner_invoice_id(event_id, partner_invoice_id)"/>
<field name="partner_address_id" select="2" on_change="onchange_contact_id(partner_address_id)" colspan="3"/>
<field name="unit_price" select="2"/>
</group>
<notebook colspan="4">
<page string="General">
<field name="contact_id" select="2" on_change="onchange_contact_id(contact_id, partner_id)" /><newline/>
<field name="email_from" select="2"/>
<button name="remind_partner" string="Send Reminder" states="open,pending" type="object" colspan="2"/>
<field name="user_id" select="1"/>
<button name="remind_user" string="Send Reminder" states="open,pending" type="object" colspan="2"/>
<newline/>
<separator colspan="4"/>
<field name="unit_price" select="2"/>
<separator string="Badge" colspan="4"/>
<field name="badge_title" select="2"/>
<field name="badge_name" select="2" on_change="onchange_badge_name(badge_name)"/>
<field name="badge_partner" select="2"/>
<newline/>
<separator colspan="4"/>
<separator string="Status" colspan="4"/>
<group col="8" colspan="4">
<field name="state" select="1" colspan="2"/>
<button name="button_reg_close" string="Registration Invoiced" states="open" type="object"/>
+30 -28
View File
@@ -1,36 +1,38 @@
<?xml version="1.0"?>
<openerp>
<data>
<wizard
string="Enlist Vat Details"
model="res.partner"
name="list.vat.detail"
menu="False"
id="partner_wizard_vat"/>
<menuitem
name="Financial Management/Reporting/Listing of VAT Customers"
action="partner_wizard_vat"
type="wizard"
id="partner_wizard_vat_menu"/>
<wizard
string="VAT Declaration"
name="wizard.account.xml.vat.declaration"
menu="False"
id="wizard_xml_vat_declaration"/>
<data>
<wizard
string="Enlist Vat Details"
model="res.partner"
name="list.vat.detail"
menu="False"
id="partner_wizard_vat"/>
<menuitem
name="Listing of VAT Customers"
parent="account.menu_finance_legal_statement"
action="partner_wizard_vat"
type="wizard"
id="partner_wizard_vat_menu"/>
<menuitem
name="Financial Management/Periodical Processing/Taxes/VAT Declaration"
action="wizard_xml_vat_declaration"
type="wizard"
id="account_wizard_vat_declaration"/>
<wizard
string="VAT Declaration"
name="wizard.account.xml.vat.declaration"
menu="False"
id="wizard_xml_vat_declaration"/>
<menuitem
name="VAT Declaration"
parent="account.menu_finance_legal_statement"
action="wizard_xml_vat_declaration"
type="wizard"
id="account_wizard_vat_declaration"/>
<record id="config_call_account_template" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
<record id="config_call_account_template" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
<field name="state">open</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
<field name="state">open</field>
</record>
</data>
</data>
</openerp>
+23 -30
View File
@@ -32,53 +32,46 @@
from osv import fields, osv
from tools import config
class product_pricelist(osv.osv):
_inherit = "product.pricelist"
def _compute_price(self, cr, uid, ids, field_name, arg, context):
res = {}
for id in ids:
res[id]=0.0
return res
_columns = {
'price': fields.function(_compute_price, type='float', method=True, string='Price', digits=(16, int(config['price_accuracy']))),
}
product_pricelist()
class product_product(osv.osv):
_name = 'product.product'
_inherit = 'product.product'
def _pricelist_sale_ids(self, cr, uid, ids, name, arg, context=None):
def _pricelist_calculate(self, cr, uid, ids, name, arg, context=None):
result = {}
if not context:
context={}
format=""
pricelist_obj=self.pool.get('product.pricelist')
for product in self.browse(cr, uid, ids, context):
pricelist_ids=pricelist_obj.search(cr,uid,[('type','=','sale')], context=context)
result[product.id]=pricelist_ids
return result
def _pricelist_purchase_ids(self, cr, uid, ids, name, arg, context=None):
result = {}
pricelist_obj=self.pool.get('product.pricelist')
for product in self.browse(cr, uid, ids, context):
if name=='pricelist_purchase':
pricelist_ids=pricelist_obj.search(cr,uid,[('type','=','purchase')])
result[product.id]=pricelist_ids
else:
pricelist_ids=pricelist_obj.search(cr,uid,[('type','=','sale')])
pricelist_browse=pricelist_obj.browse(cr,uid,pricelist_ids)
for product in self.browse(cr, uid, ids, context):
for pricelist in pricelist_browse:
for version in pricelist.version_id:
for items in version.items_id:
qty=items.min_quantity
price=pricelist_obj.price_get(cr, uid,[pricelist.id],product.id,qty,partner=None, context=None)
if name=='pricelist_purchase':
format+=pricelist.name + "\t" +str(qty) +" \t\t" + str(price[pricelist.id]) + "\n"
else:
format+=pricelist.name + "\t\t\t" +str(qty) +" \t\t\t" + str(price[pricelist.id]) + "\n"
result[product.id]=format
format=""
return result
_columns = {
'pricelist_sale':fields.function(
_pricelist_sale_ids,
_pricelist_calculate,
method=True,
relation='product.pricelist',
string='Sale Pricelists',
type="many2many"),
type="text"),
'pricelist_purchase':fields.function(
_pricelist_purchase_ids,
_pricelist_calculate,
method=True,
relation='product.pricelist',
string='Purchase Pricelists',
type="many2many"),
type="text"),
}
product_product()
+4 -14
View File
@@ -10,20 +10,10 @@
<field name="arch" type="xml">
<field colspan="4" name="seller_ids" nolabel="1" position="after">
<group colspan="4" groups="base.group_extended">
<separator string="Sale Pricelists" colspan="2"/>
<separator string="Purchase Pricelists" colspan="2"/>
<field nolabel="1" name="pricelist_sale" colspan="2">
<tree string="Sale Price List">
<field name="name"/>
<field name="price" context="{'product_id':parent.id}"/>
</tree>
</field>
<field nolabel="1" name="pricelist_purchase" colspan="2" context="product_id=parent.id">
<tree string="Purchase Price List" context="product_id=parent.id">
<field name="name"/>
<field name="price" context="product_id=parent.id"/>
</tree>
</field>
<separator string="Sale Pricelists Min.Qty Price" colspan="2"/>
<separator string="Purchase Pricelists Min.Qty Price" colspan="2"/>
<field nolabel="1" name="pricelist_sale" colspan="2"/>
<field nolabel="1" name="pricelist_purchase" colspan="2"/>
</group>
</field>
</field>