@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>pso-newaddons</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.python.pydev.PyDevBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.python.pydev.pythonNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -67,7 +67,7 @@
|
||||
"product_view.xml",
|
||||
"account_assert_test.xml",
|
||||
"process/invoice_process.xml",
|
||||
"process/statement_process.xml"
|
||||
"process/statement_process.xml",
|
||||
],
|
||||
"translations" : {
|
||||
"fr": "i18n/french_fr.csv"
|
||||
|
||||
@@ -1032,6 +1032,7 @@ class account_tax_code(osv.osv):
|
||||
|
||||
_name = 'account.tax.code'
|
||||
_description = 'Tax Code'
|
||||
_rec_name = 'code'
|
||||
_columns = {
|
||||
'name': fields.char('Tax Case Name', size=64, required=True),
|
||||
'code': fields.char('Case Code', size=16),
|
||||
@@ -1681,6 +1682,7 @@ class account_tax_code_template(osv.osv):
|
||||
_name = 'account.tax.code.template'
|
||||
_description = 'Tax Code Template'
|
||||
_order = 'code'
|
||||
_rec_name = 'code'
|
||||
_columns = {
|
||||
'name': fields.char('Tax Case Name', size=64, required=True),
|
||||
'code': fields.char('Case Code', size=16),
|
||||
|
||||
@@ -86,6 +86,12 @@
|
||||
<wizard id="wizard_general_ledger" menu="False" model="account.account" name="account.general.ledger.report" string="General ledger"/>
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_general_ledger" id="menu_general_ledger" parent="account.menu_generic_report" type="wizard"/>
|
||||
|
||||
<wizard id="wizard_print_journal" menu="False" model="account.journal.period" name="account.print.journal.report" string="Print journal" />
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_print_journal" id="menu_print_journal" parent="account.menu_generic_report" type="wizard" />
|
||||
|
||||
<wizard id="wizard_central_journal" menu="False" model="account.journal.period" name="account.central.journal.report" string="Central journal" />
|
||||
<menuitem icon="STOCK_PRINT" action="wizard_central_journal" id="menu_cetral_journal" parent="account.menu_generic_report" type="wizard" />
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -287,7 +287,7 @@ class account_invoice(osv.osv):
|
||||
pt_obj= self.pool.get('account.payment.term')
|
||||
|
||||
if not date_invoice :
|
||||
date_invoice = self._defaults["date_invoice"](cr,uid,{})
|
||||
date_invoice = time.strftime('%Y-%m-%d')
|
||||
|
||||
pterm_list= pt_obj.compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
|
||||
|
||||
@@ -857,26 +857,11 @@ class account_invoice_line(osv.osv):
|
||||
taxep=None
|
||||
lang=self.pool.get('res.partner').read(cr, uid, [partner_id])[0]['lang']
|
||||
tax_obj = self.pool.get('account.tax')
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
if type in ('out_invoice', 'out_refund'):
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
taxep = part.property_account_position and part.property_account_position.account_tax
|
||||
if not taxep or not taxep.id:
|
||||
tax_id = map(lambda x: x.id, res.taxes_id)
|
||||
else:
|
||||
tax_id = [taxep.id]
|
||||
for t in res.taxes_id:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
tax_id.append(t.id)
|
||||
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, res.taxes_id)
|
||||
else:
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
taxep = part.property_account_position and part.property_account_position.account_supplier_tax
|
||||
if not taxep or not taxep.id:
|
||||
tax_id = map(lambda x: x.id, res.supplier_taxes_id)
|
||||
else:
|
||||
tax_id = [taxep.id]
|
||||
for t in res.supplier_taxes_id:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
tax_id.append(t.id)
|
||||
tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, res.supplier_taxes_id)
|
||||
if type in ('in_invoice', 'in_refund'):
|
||||
result = self.product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
|
||||
else:
|
||||
@@ -968,13 +953,8 @@ class account_invoice_line(osv.osv):
|
||||
return {}
|
||||
taxes = self.pool.get('account.account').browse(cr, uid, account_id).tax_ids
|
||||
part = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
taxep = partner.property_account_position and partner.property_account_position.account_tax
|
||||
if not taxep.id:
|
||||
return {'value': {'invoice_line_tax_id': map(lambda x: x.id, taxes or []) }}
|
||||
res = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
res.append(t.id)
|
||||
|
||||
res = self.pool.get('account.fiscal.position').map_tax(cr, uid, part, taxes)
|
||||
r = {'value':{'invoice_line_tax_id': res}}
|
||||
return r
|
||||
account_invoice_line()
|
||||
|
||||
@@ -37,16 +37,24 @@ class account_fiscal_position(osv.osv):
|
||||
_columns = {
|
||||
'name': fields.char('Fiscal Position', size=64, translate=True, required=True),
|
||||
'company_id': fields.many2one('res.company', 'Company'),
|
||||
'account_tax': fields.many2one(
|
||||
'account.tax', 'Customer Tax',
|
||||
help="This account will be used as the receivable account for partners in this position",
|
||||
),
|
||||
'account_supplier_tax': fields.many2one(
|
||||
'account.tax', 'Supplier Tax',
|
||||
help="This account will be used as the payable account for partners in this position",
|
||||
),
|
||||
'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Accounts Mapping')
|
||||
'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Accounts Mapping'),
|
||||
'tax_ids': fields.one2many('account.fiscal.position.tax', 'position_id', 'Taxes Mapping')
|
||||
}
|
||||
def map_tax(self, cr, uid, partner, taxes, context={}):
|
||||
if (not partner) or (not partner.property_account_position) :
|
||||
return map(lambda x: x.id, taxes)
|
||||
result = []
|
||||
for t in taxes:
|
||||
ok = False
|
||||
for tax in partner.property_account_position.tax_ids:
|
||||
if tax.tax_src_id.id==t.id:
|
||||
if tax.tax_dest_id:
|
||||
result.append(tax.tax_dest_id.id)
|
||||
ok=True
|
||||
if not ok:
|
||||
result.append(t.id)
|
||||
return result
|
||||
|
||||
def map_account(self, cr, uid, partner, account_id, context={}):
|
||||
if (not partner) or (not partner.property_account_position) :
|
||||
return account_id
|
||||
@@ -58,6 +66,18 @@ class account_fiscal_position(osv.osv):
|
||||
account_fiscal_position()
|
||||
|
||||
|
||||
class account_fiscal_position_tax(osv.osv):
|
||||
_name = 'account.fiscal.position.tax'
|
||||
_description = 'Fiscal Position Taxes Mapping'
|
||||
_rec_name = 'position_id'
|
||||
_columns = {
|
||||
'position_id': fields.many2one('account.fiscal.position', 'Fiscal Position', required=True, ondelete='cascade'),
|
||||
'tax_src_id': fields.many2one('account.tax', 'Tax Source', required=True),
|
||||
'tax_dest_id': fields.many2one('account.tax', 'Replacement Tax')
|
||||
}
|
||||
account_fiscal_position_tax()
|
||||
|
||||
|
||||
class account_fiscal_position_account(osv.osv):
|
||||
_name = 'account.fiscal.position.account'
|
||||
_description = 'Fiscal Position Accounts Mapping'
|
||||
|
||||
@@ -11,8 +11,16 @@
|
||||
<field name="name" select="1"/>
|
||||
<field name="company_id"/>
|
||||
<newline/>
|
||||
<field name="account_tax" select="2"/>
|
||||
<field name="account_supplier_tax" select="2"/>
|
||||
<field name="tax_ids" colspan="4">
|
||||
<tree string="Taxes Mapping" editable="bottom">
|
||||
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
</tree>
|
||||
<form string="Taxes Mapping">
|
||||
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
</form>
|
||||
</field>
|
||||
<field name="account_ids" colspan="4">
|
||||
<tree string="Accounts Mapping" editable="bottom">
|
||||
<field name="account_src_id"/>
|
||||
@@ -34,8 +42,6 @@
|
||||
<tree string="Fiscal Position">
|
||||
<field name="name"/>
|
||||
<field name="company_id"/>
|
||||
<field name="account_tax"/>
|
||||
<field name="account_supplier_tax"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Node
|
||||
Process Node
|
||||
-->
|
||||
|
||||
<record id="process_node_analytic0" model="process.node">
|
||||
@@ -23,6 +23,7 @@
|
||||
<field eval=""""Analytic"""" name="name"/>
|
||||
<field eval=""""From analytic accounts, It creates invoice."""" name="note"/>
|
||||
<field name="process_id" ref="process_process_invoiceworkflow0"/>
|
||||
<field name="subflow_id" ref="process_process_invoiceworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'open', 'pending', 'close')"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
@@ -62,10 +63,11 @@
|
||||
<record id="process_node_bankstatement0" model="process.node">
|
||||
<field name="menu_id" ref="account.menu_bank_statement_tree2"/>
|
||||
<field name="model_id" ref="account.model_account_bank_statement"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Bank Statement"""" name="name"/>
|
||||
<field eval=""""Statement encoding produces payment entries"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_invoiceworkflow0"/>
|
||||
<!-- <field name="subflow_id" ref="process_process_statementworkflow0"/>-->
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
@@ -102,10 +104,18 @@
|
||||
<field eval=""""object.state=='paid'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--
|
||||
Process Transition
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="res_roles_invoice0" model="res.roles">
|
||||
<field eval=""""Invoice"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="account.t5" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_invoice0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_analyticinvoice0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
@@ -123,6 +133,7 @@
|
||||
<field eval=""""Number of entries are generated"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_invoiceinvoice0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_draftinvoices0"/>
|
||||
<field eval="[(6,0,[ref('account.t5')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_validentries0" model="process.transition">
|
||||
@@ -169,6 +180,17 @@
|
||||
<field model="process.node" name="target_node_id" ref="process_node_paidinvoice0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_reconciliation0"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_createentries0" model="process.transition.action">
|
||||
<field eval=""""action_move_create"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Create entry"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_customerinvoice0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -78,15 +78,16 @@
|
||||
<field eval=""""Reconciliation of Entries"""" name="name"/>
|
||||
<field eval=""""Reconcilation of the entries with invoice."""" name="note"/>
|
||||
<field name="process_id" ref="process_process_statementworkflow0"/>
|
||||
<field name="subflow_id" ref="account.process_process_invoiceworkflow0"/>
|
||||
<field eval=""""object.state=='valid'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="process_transition_filestatement0" model="process.transition">
|
||||
|
||||
<record id="process_transition_filestatement0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""File statement"""" name="name"/>
|
||||
@@ -130,6 +131,26 @@
|
||||
<field model="process.node" name="target_node_id" ref="process_node_reconciliationofentries0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_accountingstatemententries0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_statemententries0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Statement Entries"""" name="name"/>
|
||||
<field eval=""""From statement, create entries"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_paymententries0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_bankstatement0"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_draftconfirmstatement0" model="process.transition.action">
|
||||
<field eval=""""button_confirm"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmstatementfromdraft0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -45,12 +45,28 @@ class journal_print(report_sxw.rml_parse):
|
||||
'sum_credit': self._sum_credit
|
||||
})
|
||||
|
||||
def lines(self, period_id, journal_id, *args):
|
||||
def lines(self, period_id, journal_id, sort_selection='date', *args):
|
||||
if type(period_id)==type([]):
|
||||
ids_final = []
|
||||
for journal in journal_id:
|
||||
for period in period_id:
|
||||
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
|
||||
if ids_journal_period:
|
||||
self.cr.execute('update account_journal_period set state=%s where journal_id=%d and period_id=%d and state=%s', ('printed',journal,period,'draft'))
|
||||
self.cr.commit()
|
||||
self.cr.execute('select id from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\' order by ('+ sort_selection +'),id', (period, journal))
|
||||
ids = map(lambda x: x[0], self.cr.fetchall())
|
||||
ids_final.append(ids)
|
||||
line_ids = []
|
||||
for line_id in ids_final:
|
||||
a = self.pool.get('account.move.line').browse(self.cr, self.uid, line_id )
|
||||
line_ids.append(a)
|
||||
return line_ids
|
||||
self.cr.execute('update account_journal_period set state=%s where journal_id=%d and period_id=%d and state=%s', ('printed',journal_id,period_id,'draft'))
|
||||
self.cr.commit()
|
||||
self.cr.execute('select id from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\' order by date,id', (period_id, journal_id))
|
||||
ids = map(lambda x: x[0], self.cr.fetchall())
|
||||
return self.pool.get('account.move.line').browse(self.cr, self.uid, ids)
|
||||
return self.pool.get('account.move.line').browse(self.cr, self.uid, ids )
|
||||
|
||||
def _sum_debit(self, period_id, journal_id):
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
|
||||
@@ -60,7 +76,7 @@ class journal_print(report_sxw.rml_parse):
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print,header=False)
|
||||
|
||||
report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print,header=False)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -31,13 +31,13 @@ import rml_parse
|
||||
from report import report_sxw
|
||||
|
||||
class aged_trial_report(rml_parse.rml_parse):
|
||||
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(aged_trial_report, self).__init__(cr, uid, name, context)
|
||||
self.line_query = ''
|
||||
self.total_account = []
|
||||
|
||||
|
||||
|
||||
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_lines': self._get_lines,
|
||||
@@ -46,19 +46,19 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
'get_for_period': self._get_for_period,
|
||||
'get_company': self._get_company,
|
||||
'get_currency': self._get_currency,
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
def _get_lines(self, form):
|
||||
|
||||
|
||||
if (form['result_selection'] == 'customer' ):
|
||||
self.ACCOUNT_TYPE = "('receivable')"
|
||||
elif (form['result_selection'] == 'supplier'):
|
||||
self.ACCOUNT_TYPE = "('payable')"
|
||||
else:
|
||||
self.ACCOUNT_TYPE = "('payable','receivable')"
|
||||
|
||||
|
||||
|
||||
res = []
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
@@ -78,7 +78,7 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
for i in range(7):
|
||||
self.total_account.append(0)
|
||||
#
|
||||
|
||||
|
||||
for partner in partners:
|
||||
values = {}
|
||||
## If choise selection is in the future
|
||||
@@ -94,7 +94,7 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
"AND account_account.active",
|
||||
(form['date1'], partner['id'],form['date1'], form['company_id']))
|
||||
before = self.cr.fetchone()
|
||||
|
||||
|
||||
self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0)
|
||||
|
||||
values['direction'] = before and before[0] or 0.0
|
||||
@@ -112,7 +112,6 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
after = self.cr.fetchone()
|
||||
self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0)
|
||||
values['direction'] = after and after[0] or ""
|
||||
#print str(values['direction'])
|
||||
for i in range(5):
|
||||
self.cr.execute("SELECT SUM(debit-credit) " \
|
||||
"FROM account_move_line AS line, account_account " \
|
||||
@@ -128,8 +127,6 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
during = self.cr.fetchone()
|
||||
# Ajout du compteur
|
||||
self.total_account[(i)] = self.total_account[(i)] + (during and during[0] or 0)
|
||||
|
||||
#print str(during)
|
||||
values[str(i)] = during and during[0] or ""
|
||||
self.cr.execute("SELECT SUM(debit-credit) " \
|
||||
"FROM account_move_line AS line, account_account " \
|
||||
@@ -145,19 +142,16 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
values['total'] = total and total[0] or 0.0
|
||||
## Add for total
|
||||
self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0)
|
||||
print self.total_account,">>>>>>>>>>>>>Total>>>>>>>>>>>>>>>>"
|
||||
values['name'] = partner['name']
|
||||
#t = 0.0
|
||||
#for i in range(5)+['direction']:
|
||||
# t+= float(values.get(str(i), 0.0) or 0.0)
|
||||
#values['total'] = t
|
||||
|
||||
|
||||
if values['total']:
|
||||
|
||||
res.append(values)
|
||||
|
||||
|
||||
total = 0.0
|
||||
|
||||
totals = {}
|
||||
for r in res:
|
||||
total += float(r['total'] or 0.0)
|
||||
@@ -166,24 +160,17 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
totals[str(i)] += float(r[str(i)] or 0.0)
|
||||
return res
|
||||
|
||||
|
||||
|
||||
|
||||
def _get_total(self,pos):
|
||||
print self.total_account,"========_get_total========"
|
||||
period = self.total_account[int(pos)]
|
||||
return period
|
||||
return period
|
||||
|
||||
|
||||
def _get_direction(self,pos):
|
||||
|
||||
period = self.total_account[int(pos)]
|
||||
return period
|
||||
return period
|
||||
|
||||
def _get_for_period(self,pos):
|
||||
|
||||
period = self.total_account[int(pos)]
|
||||
return period
|
||||
return period
|
||||
|
||||
def _get_company(self, form):
|
||||
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).name
|
||||
@@ -194,5 +181,5 @@ class aged_trial_report(rml_parse.rml_parse):
|
||||
|
||||
report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
|
||||
'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,20 +43,33 @@ class journal_print(report_sxw.rml_parse):
|
||||
'sum_debit': self._sum_debit,
|
||||
'sum_credit': self._sum_credit
|
||||
})
|
||||
|
||||
|
||||
def lines(self, period_id, journal_id, *args):
|
||||
if type(period_id)==type([]):
|
||||
ids_final = []
|
||||
for journal in journal_id:
|
||||
for period in period_id:
|
||||
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
|
||||
if ids_journal_period:
|
||||
self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name, l.journal_id, l.period_id', (period, journal))
|
||||
res = self.cr.dictfetchall()
|
||||
a = {'journal':self.pool.get('account.journal').browse(self.cr, self.uid, journal),'period':self.pool.get('account.period').browse(self.cr, self.uid, period)}
|
||||
res[0].update(a)
|
||||
ids_final.append(res)
|
||||
return ids_final
|
||||
self.cr.execute('select a.code, a.name, sum(debit) as debit, sum(credit) as credit from account_move_line l left join account_account a on (l.account_id=a.id) where l.period_id=%d and l.journal_id=%d and l.state<>\'draft\' group by a.id, a.code, a.name', (period_id, journal_id))
|
||||
return self.cr.dictfetchall()
|
||||
|
||||
res = self.cr.dictfetchall()
|
||||
return res
|
||||
|
||||
def _sum_debit(self, period_id, journal_id):
|
||||
self.cr.execute('select sum(debit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
|
||||
|
||||
def _sum_credit(self, period_id, journal_id):
|
||||
self.cr.execute('select sum(credit) from account_move_line where period_id=%d and journal_id=%d and state<>\'draft\'', (period_id, journal_id))
|
||||
return self.cr.fetchone()[0] or 0.0
|
||||
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print, header=False)
|
||||
|
||||
report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml',parser=journal_print, header=False)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -40,7 +40,11 @@ class general_ledger(rml_parse.rml_parse):
|
||||
|
||||
def preprocess(self, objects, data, ids):
|
||||
##
|
||||
|
||||
|
||||
self.borne_date = self.get_min_date(data['form'])
|
||||
|
||||
|
||||
##
|
||||
new_ids = []
|
||||
if (data['model'] == 'account.account'):
|
||||
@@ -54,6 +58,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(general_ledger, self).__init__(cr, uid, name, context)
|
||||
self.date_borne = {}
|
||||
self.query = ""
|
||||
self.child_ids = ""
|
||||
self.tot_currency = 0.0
|
||||
@@ -109,6 +114,7 @@ class general_ledger(rml_parse.rml_parse):
|
||||
return result
|
||||
|
||||
def get_children_accounts(self, account, form):
|
||||
|
||||
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', self.ids)])
|
||||
res = []
|
||||
@@ -116,16 +122,17 @@ class general_ledger(rml_parse.rml_parse):
|
||||
## We will make the test for period or date
|
||||
## We will now make the test
|
||||
#
|
||||
if form.has_key('fiscalyear'):
|
||||
if form.has_key('fiscalyear'):
|
||||
ctx['fiscalyear'] = form['fiscalyear']
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
else:
|
||||
ctx['date_from'] = form['date_from']
|
||||
ctx['date_to'] = form['date_to']
|
||||
##
|
||||
#
|
||||
|
||||
#
|
||||
self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx)
|
||||
|
||||
for child_id in self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', [account.id])]):
|
||||
child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id)
|
||||
@@ -153,69 +160,111 @@ class general_ledger(rml_parse.rml_parse):
|
||||
res.append(child_account)
|
||||
|
||||
##
|
||||
if form['soldeinit']:
|
||||
## We will now compute solde initiaux
|
||||
for move in res:
|
||||
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date < '" + self.borne_date['max_date'] + "'" + " AND l.date > '" + self.borne_date['min_date'] + "'"
|
||||
self.cr.execute(SOLDEINIT)
|
||||
resultat = self.cr.dictfetchall()
|
||||
if resultat[0] :
|
||||
if resultat[0]['sum_debit'] == None:
|
||||
sum_debit = 0
|
||||
else:
|
||||
sum_debit = resultat[0]['sum_debit']
|
||||
if resultat[0]['sum_credit'] == None:
|
||||
sum_credit = 0
|
||||
else:
|
||||
sum_credit = resultat[0]['sum_credit']
|
||||
|
||||
move.init_credit = sum_credit
|
||||
move.init_debit = sum_debit
|
||||
|
||||
else:
|
||||
move.init_credit = 0
|
||||
move.init_debit = 0
|
||||
|
||||
|
||||
## We will now compute solde initiaux
|
||||
|
||||
for move in res:
|
||||
|
||||
SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date <= '" + self.borne_date['max_date'] + "'" + " AND l.date >= '" + self.borne_date['min_date'] + "'"
|
||||
self.cr.execute(SOLDEINIT)
|
||||
resultat = self.cr.dictfetchall()
|
||||
|
||||
if resultat[0] :
|
||||
|
||||
if resultat[0]['sum_debit'] == None:
|
||||
sum_debit = 0
|
||||
else:
|
||||
|
||||
sum_debit = resultat[0]['sum_debit']
|
||||
if resultat[0]['sum_credit'] == None:
|
||||
sum_credit = 0
|
||||
else:
|
||||
sum_credit = resultat[0]['sum_credit']
|
||||
|
||||
move.init_credit = sum_credit
|
||||
move.init_debit = sum_debit
|
||||
|
||||
else:
|
||||
move.init_credit = 0
|
||||
move.init_debit = 0
|
||||
|
||||
##
|
||||
|
||||
return res
|
||||
|
||||
def get_min_date(self,form):
|
||||
|
||||
## Get max born from account_fiscal year
|
||||
#
|
||||
sql = """ select min(fy.date_start) from account_fiscalyear
|
||||
sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear
|
||||
As fy where fy.state <> 'close'
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['min']
|
||||
#
|
||||
##
|
||||
if form.has_key('fiscalyear'):
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
if form['state'] == 'byperiod':
|
||||
## This function will return the most aged date
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) from account_period as p where p.id in ( """ + periods_id + """)
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_max = res[0]['min']
|
||||
else:
|
||||
borne_max = form['date_from']
|
||||
date_borne = {
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
elif form['state'] == 'bydate':
|
||||
borne_min = form['date_from']
|
||||
borne_max = form['date_to']
|
||||
elif form['state'] == 'all':
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
period_min = res[0]['start_date']
|
||||
period_max = res[0]['stop_date']
|
||||
date_min = form['date_from']
|
||||
date_max = form['date_to']
|
||||
if period_min<date_min:
|
||||
borne_min = period_min
|
||||
else :
|
||||
borne_min = date_min
|
||||
if date_max<period_max:
|
||||
borne_max = period_max
|
||||
else :
|
||||
borne_max = date_max
|
||||
elif form['state'] == 'none':
|
||||
sql = """
|
||||
SELECT min(date) as start_date,max(date) as stop_date FROM account_move_line """
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
self.date_borne = {
|
||||
'min_date': borne_min,
|
||||
'max_date': borne_max,
|
||||
}
|
||||
return date_borne
|
||||
return self.date_borne
|
||||
|
||||
|
||||
|
||||
def lines(self, account, form):
|
||||
|
||||
inv_types = {
|
||||
'out_invoice': 'CI: ',
|
||||
'in_invoice': 'SI: ',
|
||||
@@ -223,18 +272,27 @@ class general_ledger(rml_parse.rml_parse):
|
||||
'in_refund': 'SR: ',
|
||||
}
|
||||
### We will now compute solde initaux
|
||||
|
||||
|
||||
if form['sortbydate'] == 'sort_date':
|
||||
sorttag = 'l.date'
|
||||
else:
|
||||
sorttag = 'j.code'
|
||||
|
||||
sql = """
|
||||
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
|
||||
FROM account_move_line l LEFT JOIN res_currency c on (l.currency_id=c.id) JOIN account_journal j on (l.journal_id=j.id)
|
||||
AND account_id = %d AND %s
|
||||
ORDER by %s"""%(account.id,self.query,sorttag)
|
||||
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
|
||||
FROM account_move_line as l
|
||||
LEFT JOIN res_currency c on (l.currency_id=c.id)
|
||||
JOIN account_journal j on (l.journal_id=j.id)
|
||||
AND account_id = %d
|
||||
AND %s
|
||||
WHERE l.date<='%s'
|
||||
AND l.date>='%s'
|
||||
ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag)
|
||||
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
sum = 0.0
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
for l in res:
|
||||
|
||||
@@ -35,16 +35,15 @@
|
||||
|
||||
<blockTableStyle id="tbl_header">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="tbl_content">
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,1" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
|
||||
</blockTableStyle>
|
||||
|
||||
|
||||
@@ -91,244 +90,86 @@
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
|
||||
<blockTable colWidths="54.0,135.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3_centre">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Partner</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Mvt</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Crebit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">Balance</para>
|
||||
</td>
|
||||
<td><para style="P3">Date</para></td>
|
||||
<td><para style="P3">Partner</para></td>
|
||||
<td><para style="P3">Ref</para></td>
|
||||
<td><para style="P3">Mvt</para></td>
|
||||
<td><para style="P3">Entry Label</para></td>
|
||||
<td><para style="P4">Debit</para></td>
|
||||
<td><para style="P4">Crebit</para></td>
|
||||
<td><para style="P9">Balance</para></td>
|
||||
</tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<td>
|
||||
<blockTable colWidths="48.0,135.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="273.00,100.0,52.5,52.5,52.5" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="P16"></para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3">Balance Initial</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ o.init_debit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td>
|
||||
<para style="P3">[[ line['date'] ]]</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3">[[ line['partner'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
<blockTable colWidths="280.0,100.0,52.5,52.5,52.5" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code or '']] [[ o.name or '']]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td><para style="P3">[[ line['date'] or '' ]]</para></td>
|
||||
<td><para style="P3">[[ line['partner'] or '']]</para></td>
|
||||
<td><para style="P3">[[ line['ref'] or '']]</para></td>
|
||||
<td><para style="P3">[[ line['move'] or '']]</para></td>
|
||||
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
|
||||
<td><para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable colWidths="59.0,105.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P3_centre">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Partner</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Mvt</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Crebit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Currency</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<blockTable colWidths="59.0,105.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="P3">Date</para></td>
|
||||
<td><para style="P3">Partner</para></td>
|
||||
<td><para style="P3">Ref</para></td>
|
||||
<td><para style="P3">Mvt</para></td>
|
||||
<td><para style="P3">Entry Label</para></td>
|
||||
<td><para style="P4">Debit</para></td>
|
||||
<td><para style="P4">Crebit</para></td>
|
||||
<td><para style="P4">Balance</para></td>
|
||||
<td><para style="P4">Currency</para></td>
|
||||
</tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<td>
|
||||
<blockTable colWidths="54.0,105.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_content" >
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="259.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<para style="P9b"><u> [[ sum_currency_amount_account(a, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="P16"></para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3">Balance Initial</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ o.init_debit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4"> </para>
|
||||
</td>
|
||||
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="264.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u> [[ sum_currency_amount_account(a, data['form']) or '0.0' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td>
|
||||
<para style="P3">[[ line['date'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['partner'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para>
|
||||
</td>
|
||||
|
||||
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td><para style="P3">[[ line['date'] or '' ]]</para></td>
|
||||
<td><para style="P3">[[ line['partner'] or '' ]]</para></td>
|
||||
<td><para style="P3">[[ line['ref'] or '']]</para></td>
|
||||
<td><para style="P3">[[ line['move'] or '' ]]</para></td>
|
||||
<td><para style="P3">[[ line['name'] or '' ]]</para></td>
|
||||
<td><para style="P4">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] or '']]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</blockTable>
|
||||
|
||||
</story>
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ import pooler
|
||||
|
||||
class general_ledger_landscape(rml_parse.rml_parse):
|
||||
_name = 'report.account.general.ledger_landscape'
|
||||
|
||||
|
||||
|
||||
|
||||
def preprocess(self, objects, data, ids):
|
||||
##
|
||||
self.borne_date = self.get_min_date(data['form'])
|
||||
@@ -46,18 +46,19 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
new_ids = ids
|
||||
else:
|
||||
new_ids.append(data['form']['Account_list'])
|
||||
|
||||
|
||||
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
|
||||
|
||||
super(general_ledger_landscape, self).preprocess(objects, data, new_ids)
|
||||
|
||||
|
||||
super(general_ledger_landscape, self).preprocess(objects, data, new_ids)
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(general_ledger_landscape, self).__init__(cr, uid, name, context)
|
||||
self.date_borne = {}
|
||||
self.query = ""
|
||||
self.child_ids = ""
|
||||
self.tot_currency = 0.0
|
||||
self.period_sql = ""
|
||||
self.sold_accounts = {}
|
||||
self.sold_accounts = {}
|
||||
self.localcontext.update( {
|
||||
'time': time,
|
||||
'lines': self.lines,
|
||||
@@ -66,7 +67,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
'sum_solde_account': self._sum_solde_account,
|
||||
'sum_debit': self._sum_debit,
|
||||
'sum_credit': self._sum_credit,
|
||||
'sum_solde': self._sum_solde,
|
||||
'sum_solde': self._sum_solde,
|
||||
'get_children_accounts': self.get_children_accounts,
|
||||
'sum_currency_amount_account': self._sum_currency_amount_account
|
||||
})
|
||||
@@ -75,7 +76,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
result = {}
|
||||
#for id in ids:
|
||||
# result.setdefault(id, False)
|
||||
|
||||
|
||||
for account_line in self.pool.get('account.move.line').browse(cr, uid, ids, context):
|
||||
# For avoid long text in the field we will limit it to 5 lines
|
||||
#
|
||||
@@ -85,7 +86,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
num_id_move = str(account_line.move_id.id)
|
||||
num_id_line = str(account_line.id)
|
||||
account_id = str(account_line.account_id.id)
|
||||
# search the basic account
|
||||
# search the basic account
|
||||
# We have the account ID we will search all account move line from now until this time
|
||||
# We are in the case of we are on the top of the account move Line
|
||||
cr.execute('SELECT distinct(ac.code) as code_rest,ac.name as name_rest from account_account AS ac, account_move_line mv\
|
||||
@@ -103,68 +104,101 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
result[account_line.id] = concat + '...'
|
||||
break
|
||||
rup_id+=1
|
||||
|
||||
#print str(result)
|
||||
return result
|
||||
|
||||
|
||||
def get_min_date(self,form):
|
||||
|
||||
## Get max born from account_fiscal year
|
||||
#
|
||||
sql = """ select min(fy.date_start) from account_fiscalyear
|
||||
sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear
|
||||
As fy where fy.state <> 'close'
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['min']
|
||||
#
|
||||
##
|
||||
if form.has_key('fiscalyear'):
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
if form['state'] == 'byperiod':
|
||||
## This function will return the most aged date
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) from account_period as p where p.id in ( """ + periods_id + """)
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_max = res[0]['min']
|
||||
else:
|
||||
borne_max = form['date_from']
|
||||
date_borne = {
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
elif form['state'] == 'bydate':
|
||||
borne_min = form['date_from']
|
||||
borne_max = form['date_to']
|
||||
elif form['state'] == 'all':
|
||||
periods = form['periods'][0][2]
|
||||
if not periods:
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """
|
||||
"""
|
||||
else:
|
||||
periods_id = ','.join(map(str, periods))
|
||||
sql = """
|
||||
Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """)
|
||||
"""
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
period_min = res[0]['start_date']
|
||||
period_max = res[0]['stop_date']
|
||||
date_min = form['date_from']
|
||||
date_max = form['date_to']
|
||||
if period_min<date_min:
|
||||
borne_min = period_min
|
||||
else :
|
||||
borne_min = date_min
|
||||
if date_max<period_max:
|
||||
borne_max = period_max
|
||||
else :
|
||||
borne_max = date_max
|
||||
elif form['state'] == 'none':
|
||||
sql = """
|
||||
SELECT min(date) as start_date,max(date) as stop_date FROM account_move_line """
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
borne_min = res[0]['start_date']
|
||||
borne_max = res[0]['stop_date']
|
||||
self.date_borne = {
|
||||
'min_date': borne_min,
|
||||
'max_date': borne_max,
|
||||
}
|
||||
return date_borne
|
||||
return self.date_borne
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def get_children_accounts(self, account, form):
|
||||
|
||||
|
||||
|
||||
|
||||
self.child_ids = self.pool.get('account.account').search(self.cr, self.uid,
|
||||
[('parent_id', 'child_of', self.ids)])
|
||||
#
|
||||
#
|
||||
res = []
|
||||
ctx = self.context.copy()
|
||||
## We will make the test for period or date
|
||||
## We will now make the test
|
||||
#
|
||||
if form.has_key('fiscalyear'):
|
||||
if form.has_key('fiscalyear'):
|
||||
ctx['fiscalyear'] = form['fiscalyear']
|
||||
ctx['periods'] = form['periods'][0][2]
|
||||
else:
|
||||
ctx['date_from'] = form['date_from']
|
||||
ctx['date_to'] = form['date_to']
|
||||
##
|
||||
|
||||
|
||||
#
|
||||
self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx)
|
||||
|
||||
|
||||
for child_id in self.pool.get('account.account').search(self.cr, self.uid,[('parent_id', 'child_of', [account.id])]):
|
||||
child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id)
|
||||
sold_account = self._sum_solde_account(child_account,form)
|
||||
@@ -175,7 +209,6 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
[('account_id','=',child_account.id)],
|
||||
context=ctx)) <> 0 :
|
||||
res.append(child_account)
|
||||
#print "Type de vue :" + form['display_account']
|
||||
elif form['display_account'] == 'bal_solde':
|
||||
if child_account.type != 'view' \
|
||||
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
|
||||
@@ -183,7 +216,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
context=ctx)) <> 0 :
|
||||
if ( sold_account <> 0.0):
|
||||
res.append(child_account)
|
||||
else:
|
||||
else:
|
||||
if child_account.type != 'view' \
|
||||
and len(self.pool.get('account.move.line').search(self.cr, self.uid,
|
||||
[('account_id','=',child_account.id)],
|
||||
@@ -205,17 +238,17 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
sum_credit = 0
|
||||
else:
|
||||
sum_credit = resultat[0]['sum_credit']
|
||||
|
||||
|
||||
move.init_credit = sum_credit
|
||||
move.init_debit = sum_debit
|
||||
|
||||
|
||||
else:
|
||||
move.init_credit = 0
|
||||
move.init_debit = 0
|
||||
|
||||
|
||||
##
|
||||
return res
|
||||
|
||||
|
||||
def lines(self, account, form):
|
||||
inv_types = {
|
||||
'out_invoice': 'CI: ',
|
||||
@@ -229,12 +262,19 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
else:
|
||||
sorttag = 'j.code'
|
||||
sql = """
|
||||
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name, l.debit, l.credit, l.period_id
|
||||
FROM account_move_line l LEFT JOIN res_currency c on (l.currency_id=c.id) JOIN account_journal j on (l.journal_id=j.id)
|
||||
AND account_id = %d AND %s
|
||||
ORDER by %s"""%(account.id,self.query,sorttag)
|
||||
SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id
|
||||
FROM account_move_line as l
|
||||
LEFT JOIN res_currency c on (l.currency_id=c.id)
|
||||
JOIN account_journal j on (l.journal_id=j.id)
|
||||
AND account_id = %d
|
||||
AND %s
|
||||
WHERE l.date<='%s'
|
||||
AND l.date>='%s'
|
||||
ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag)
|
||||
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
res = self.cr.dictfetchall()
|
||||
sum = 0.0
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
for l in res:
|
||||
@@ -258,11 +298,11 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
if (l['credit'] > 0):
|
||||
if l['amount_currency'] != None:
|
||||
l['amount_currency'] = abs(l['amount_currency']) * -1
|
||||
|
||||
|
||||
#
|
||||
if l['amount_currency'] != None:
|
||||
self.tot_currency = self.tot_currency + l['amount_currency']
|
||||
|
||||
self.tot_currency = self.tot_currency + l['amount_currency']
|
||||
|
||||
return res
|
||||
|
||||
def _sum_debit_account(self, account, form):
|
||||
@@ -291,7 +331,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
sum_credit += account.init_credit
|
||||
#
|
||||
##
|
||||
|
||||
|
||||
return sum_credit
|
||||
|
||||
def _sum_solde_account(self, account, form):
|
||||
@@ -301,7 +341,7 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
sum_solde = self.cr.fetchone()[0] or 0.0
|
||||
if form['soldeinit']:
|
||||
sum_solde += account.init_debit - account.init_credit
|
||||
|
||||
|
||||
return sum_solde
|
||||
|
||||
def _sum_debit(self, form):
|
||||
@@ -330,31 +370,24 @@ class general_ledger_landscape(rml_parse.rml_parse):
|
||||
self.cr.execute("SELECT (sum(debit) - sum(credit)) as tot_solde "\
|
||||
"FROM account_move_line l "\
|
||||
"WHERE l.account_id in ("+','.join(map(str, self.child_ids))+") AND "+self.query)
|
||||
# print ("SELECT (sum(debit) - sum(credit)) as Test "\
|
||||
# "FROM account_move_line l "\
|
||||
# "WHERE l.account_id in ("+','.join(map(str, child_ids))+") AND "+query+period_sql)
|
||||
sum_solde = self.cr.fetchone()[0] or 0.0
|
||||
return sum_solde
|
||||
|
||||
|
||||
def _set_get_account_currency_code(self, account_id):
|
||||
print"====account_id=====",account_id
|
||||
self.cr.execute("SELECT c.code as code "\
|
||||
"FROM res_currency c,account_account as ac "\
|
||||
"WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id))
|
||||
result = self.cr.fetchone()
|
||||
print"====result====",result
|
||||
if result:
|
||||
self.account_currency = result[0]
|
||||
else:
|
||||
self.account_currency = False
|
||||
|
||||
|
||||
|
||||
def _sum_currency_amount_account(self, account, form):
|
||||
|
||||
self._set_get_account_currency_code(account.id)
|
||||
self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %d "%account.id)
|
||||
total = self.cr.fetchone()
|
||||
|
||||
|
||||
if self.account_currency:
|
||||
return_field = str(total[0]) + self.account_currency
|
||||
return return_field
|
||||
|
||||
@@ -37,9 +37,8 @@
|
||||
|
||||
<blockTableStyle id="tbl_header">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<blockValign value="TOP"/>
|
||||
<blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="tbl_content">
|
||||
@@ -92,335 +91,93 @@
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
|
||||
|
||||
<blockTable colWidths="55.0,35.0,150.0, 90.0,60.0,345.0,50.0,69.0,72.0,64.0,58.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
|
||||
<blockTable colWidths="55.0,35.0,150.0, 90.0,60.0,345.0,50.0,69.0,72.0,64.0,58.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Date</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Ref</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Mvt</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P3">Entry Label</para></td>
|
||||
<td><para style="P12"><font color="white"> </font> </para><para style="P3">Counterpart</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Currency</para></td>
|
||||
</tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="404.0,375.0,69.0,72.0,64.0,59.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_credit_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[ sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
<td><para style="P9b"><u> [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td><para style="P2_content">[[ line['date'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['code'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['move'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ line['name'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable colWidths="55.0,35.0,166.0,90.0,60.0,390.0,50.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Date</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">JNRL</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Partner</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Ref</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P2">Mvt</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P3">Entry Label</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P3">Counterpart</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Debit</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Credit</para></td>
|
||||
<td><para style="P12"><font color="white"> </font></para><para style="P4">Balance</para></td>
|
||||
</tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="date">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="date">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P2">Partner</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P2">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P2">Mvt</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P3">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font> </para>
|
||||
<para style="P3">Counterpart</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P4">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P4">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P4">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><font color="white"> </font></para>
|
||||
<para style="P4">Currency</para>
|
||||
</td>
|
||||
<blockTable colWidths="405.0,435.0,69.0,72.0,64.0" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0']]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0']]</u></para></td>
|
||||
<td><para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
|
||||
<td>
|
||||
|
||||
<blockTable colWidths="50.0,35.0,150.0, 90.0,60.0,345.0,50.0,69.0,72.0,64.0,58.0" style="tbl_content" >
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="400.0,374.0,69.0,72.0,64.0,59.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_credit_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9b"><u>[[ sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<para style="P9b"><u> [[ sum_currency_amount_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="P3_content">Balance Initial</para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_debit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ (o.init_debit - o.init_credit) or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content"> </para>
|
||||
</td>
|
||||
|
||||
<tr>
|
||||
[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td><para style="P2_content">[[ line['date'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['code'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['partner'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['ref'] ]]</para></td>
|
||||
<td><para style="P2_content">[[ line['move'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ line['name'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para></td>
|
||||
<td><para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td>
|
||||
|
||||
<para style="P2_content">[[ line['date'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['partner'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['amount_currency'] or '0.0' ]] [[ line['currency_code'] ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</blockTable>
|
||||
|
||||
|
||||
<blockTable colWidths="55.0,35.0,166.0,90.0,60.0,390.0,50.0,69.0,72.0,64.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="date">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="date">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P2">Partner</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P2">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P2">Mvt</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3">Counterpart</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P4">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P4">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P4">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<para>[[ repeatIn(objects, 'a') ]]</para>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<blockTable colWidths="50.0,35.0,196.0, 90.0,30.0,390.0,50.0,69.0,72.0,64.0" style="tbl_content" >[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="400.0,435.0,69.0,72.0,64.0" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[ sum_debit_account(o, data['form']) or '0.0']]</u></para>
|
||||
</td>
|
||||
<td alignment="right">
|
||||
<para style="P9b"><u>[[sum_credit_account(o, data['form']) or '0.0']]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9b"><u>[[sum_solde_account(o, data['form']) or '0.0' ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ data['form']['soldeinit'] == True or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P3_content">Solde Initial</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content"></para>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_debit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ o.init_debit - o.init_credit or '0.0' ]]</para>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>[[ repeatIn(lines(o, data['form']), 'line') ]]
|
||||
<td>
|
||||
<para style="P2_content">[[ line['date'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['partner'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['ref'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2_content">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content">[[ line['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P3_content">[[ strip_name(line['line_corresp'],55) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['debit'] and line['debit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['credit'] and line['credit'] or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4_content">[[ line['progress'] and line['progress'] or '0.0' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
|
||||
|
||||
</story>
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
||||
@@ -73,7 +73,8 @@ class partner_balance(report_sxw.rml_parse):
|
||||
## Get All Period Date
|
||||
#
|
||||
# If we have no period we will take all perdio in the FiscalYear.
|
||||
print"data['form']['periods'][0][2]",data['form']['periods'][0][2]
|
||||
|
||||
|
||||
if not data['form']['periods'][0][2] :
|
||||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
else:
|
||||
@@ -116,15 +117,14 @@ class partner_balance(report_sxw.rml_parse):
|
||||
else :
|
||||
stop_date = date_stop_date
|
||||
|
||||
print"===start_date===",start_date
|
||||
print"===stop_date===",stop_date
|
||||
|
||||
final_date_array = []
|
||||
final_date_array = final_date_array + self.date_range(start_date,stop_date)
|
||||
self.date_lst = final_date_array
|
||||
self.date_lst.sort()
|
||||
|
||||
def transform_none_into_date_array(self,data):
|
||||
print"======transform_none_into_date_array====="
|
||||
|
||||
sql = "SELECT min(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
start_date = self.cr.fetchone()[0]
|
||||
@@ -132,7 +132,7 @@ class partner_balance(report_sxw.rml_parse):
|
||||
sql = "SELECT max(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
stop_date = self.cr.fetchone()[0]
|
||||
print"stop_date",stop_date
|
||||
|
||||
|
||||
array = []
|
||||
array = array + self.date_range(start_date,stop_date)
|
||||
@@ -159,16 +159,16 @@ class partner_balance(report_sxw.rml_parse):
|
||||
#
|
||||
#
|
||||
if data['form']['state'] == 'none':
|
||||
print"========none=========="
|
||||
|
||||
self.transform_none_into_date_array(data)
|
||||
elif data['form']['state'] == 'bydate':
|
||||
print"========bydate=========="
|
||||
|
||||
self.transform_date_into_date_array(data)
|
||||
elif data['form']['state'] == 'byperiod':
|
||||
print"========byperiod=========="
|
||||
|
||||
self.transform_period_into_date_array(data)
|
||||
elif data['form']['state'] == 'all':
|
||||
print"========both=========="
|
||||
|
||||
self.transform_both_into_date_array(data)
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ class partner_balance(report_sxw.rml_parse):
|
||||
#
|
||||
#
|
||||
if data['form']['soldeinit'] :
|
||||
print"=====self.date_lst[0]=====",self.date_lst[0]
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT p.ref, p.name,l.account_id,ac.name as account_name,ac.code as code , sum(debit) as debit, sum(credit) as credit, " \
|
||||
"CASE WHEN sum(debit) > sum(credit) " \
|
||||
@@ -525,7 +525,7 @@ class partner_balance(report_sxw.rml_parse):
|
||||
'l.date IN (' + self.date_lst_string + ') ' \
|
||||
'GROUP BY partner_id')
|
||||
a = self.cr.fetchone()[0]
|
||||
print"====self.cr.fetchone()====",a
|
||||
|
||||
if self.cr.fetchone() != None:
|
||||
result_tmp = result_tmp + (a or 0.0)
|
||||
else:
|
||||
@@ -555,7 +555,7 @@ class partner_balance(report_sxw.rml_parse):
|
||||
'AND l.reconcile_id IS NULL ' \
|
||||
'GROUP BY partner_id',
|
||||
(self.date_lst[0],))
|
||||
print"self.cr.fetchone()[0]",self.cr.fetchone()
|
||||
|
||||
if self.cr.fetchone() != None:
|
||||
result_tmp = float(self.cr.fetchone()[0]) or 0.0
|
||||
else:
|
||||
|
||||
@@ -59,7 +59,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
for date in date_array:
|
||||
full_str_date.append(str(date))
|
||||
return full_str_date
|
||||
|
||||
|
||||
#
|
||||
def transform_period_into_date_array(self,data):
|
||||
## Get All Period Date
|
||||
@@ -67,66 +67,61 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
else:
|
||||
periods_id = data['form']['periods'][0][2]
|
||||
date_array = []
|
||||
date_array = []
|
||||
for period_id in periods_id:
|
||||
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
|
||||
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
|
||||
self.date_lst = date_array
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
def transform_date_into_date_array(self,data):
|
||||
return_array = self.date_range(data['form']['date1'],data['form']['date2'])
|
||||
self.date_lst = return_array
|
||||
self.date_lst.sort()
|
||||
|
||||
def transform_both_into_date_array(self,data):
|
||||
|
||||
|
||||
if not data['form']['periods'][0][2] :
|
||||
periods_id = self.pool.get('account.period').search(self.cr, self.uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
else:
|
||||
periods_id = data['form']['periods'][0][2]
|
||||
date_array = []
|
||||
date_array = []
|
||||
for period_id in periods_id:
|
||||
period_obj = self.pool.get('account.period').browse(self.cr, self.uid, period_id)
|
||||
date_array = date_array + self.date_range(period_obj.date_start,period_obj.date_stop)
|
||||
|
||||
|
||||
period_start_date = date_array[0]
|
||||
date_start_date = data['form']['date1']
|
||||
period_stop_date = date_array[-1]
|
||||
date_stop_date = data['form']['date2']
|
||||
|
||||
|
||||
if period_start_date<date_start_date:
|
||||
start_date = period_start_date
|
||||
else :
|
||||
start_date = date_start_date
|
||||
|
||||
|
||||
if date_stop_date<period_stop_date:
|
||||
stop_date = period_stop_date
|
||||
else :
|
||||
stop_date = date_stop_date
|
||||
|
||||
print"start_date",start_date
|
||||
print"stop_date",stop_date
|
||||
final_date_array = []
|
||||
final_date_array = final_date_array + self.date_range(start_date, stop_date)
|
||||
self.date_lst = final_date_array
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
def transform_none_into_date_array(self,data):
|
||||
sql = "SELECT min(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
start_date = self.cr.fetchone()[0]
|
||||
print"start_date",start_date
|
||||
sql = "SELECT max(date) as start_date from account_move_line"
|
||||
self.cr.execute(sql)
|
||||
stop_date = self.cr.fetchone()[0]
|
||||
print"stop_date",stop_date
|
||||
array= []
|
||||
array = array + self.date_range(start_date, stop_date)
|
||||
self.date_lst = array
|
||||
self.date_lst.sort()
|
||||
|
||||
|
||||
|
||||
|
||||
def comma_me(self,amount):
|
||||
if type(amount) is float :
|
||||
amount = str('%.2f'%amount)
|
||||
@@ -145,36 +140,31 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
for date_string in self.date_lst:
|
||||
string_map = date_string + ','
|
||||
return string_map
|
||||
|
||||
|
||||
def preprocess(self, objects, data, ids):
|
||||
PARTNER_REQUEST = ''
|
||||
if (data['model'] == 'res.partner'):
|
||||
print"data['model']",data['model']
|
||||
## Si on imprime depuis les partenaires
|
||||
if ids:
|
||||
PARTNER_REQUEST = "AND line.partner_id IN (" + ','.join(map(str, ids)) + ")"
|
||||
# Transformation des date
|
||||
#
|
||||
#
|
||||
# if data['form']['fiscalyear']:
|
||||
# if data['form']['fiscalyear']:
|
||||
# self.transform_period_into_date_array(data)
|
||||
# else:
|
||||
# self.transform_date_into_date_array(data)
|
||||
##
|
||||
if data['form']['state'] == 'none':
|
||||
print"-----none-----"
|
||||
self.transform_none_into_date_array(data)
|
||||
elif data['form']['state'] == 'bydate':
|
||||
print"-----bydate-------"
|
||||
self.transform_date_into_date_array(data)
|
||||
elif data['form']['state'] == 'byperiod':
|
||||
print"-----byperiod-------"
|
||||
self.transform_period_into_date_array(data)
|
||||
elif data['form']['state'] == 'all':
|
||||
print"-----all-------"
|
||||
self.transform_both_into_date_array(data)
|
||||
|
||||
|
||||
|
||||
|
||||
self.date_lst_string = '\'' + '\',\''.join(map(str,self.date_lst)) + '\''
|
||||
#
|
||||
#new_ids = [id for (id,) in self.cr.fetchall()]
|
||||
@@ -197,7 +187,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
self.account_ids = ','.join([str(a) for (a,) in self.cr.fetchall()])
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
partner_to_use = []
|
||||
|
||||
|
||||
if data['form']['soldeinit'] :
|
||||
self.cr.execute(
|
||||
"SELECT DISTINCT line.partner_id " \
|
||||
@@ -227,7 +217,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
for res_line in res:
|
||||
partner_to_use.append(res_line['partner_id'])
|
||||
res = self.cr.dictfetchall()
|
||||
|
||||
|
||||
for res_line in res:
|
||||
partner_to_use.append(res_line['partner_id'])
|
||||
new_ids = partner_to_use
|
||||
@@ -260,7 +250,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
sum = r['debit'] - r['credit']
|
||||
r['progress'] = sum
|
||||
full_account.append(r)
|
||||
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit " \
|
||||
"FROM account_move_line l " \
|
||||
@@ -278,11 +268,11 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
sum = r['debit'] - r['credit']
|
||||
r['progress'] = sum
|
||||
full_account.append(r)
|
||||
|
||||
|
||||
return full_account
|
||||
|
||||
def _sum_debit_partner(self, partner,data):
|
||||
|
||||
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
result_tmp = 0.0
|
||||
if data['form']['reconcil'] :
|
||||
@@ -303,7 +293,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
|
||||
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT sum(debit) " \
|
||||
@@ -313,14 +303,14 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") " ,
|
||||
(partner.id,))
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
return result_tmp
|
||||
|
||||
|
||||
def _sum_credit_partner(self, partner,data):
|
||||
account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
|
||||
result_tmp = 0.0
|
||||
@@ -342,7 +332,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
|
||||
|
||||
self.cr.execute(
|
||||
"SELECT sum(credit) " \
|
||||
"FROM account_move_line " \
|
||||
@@ -352,13 +342,13 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"AND date IN (" + self.date_lst_string + ") " ,
|
||||
(partner.id,))
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
return result_tmp
|
||||
|
||||
|
||||
def _sum_debit(self,data):
|
||||
if not self.ids:
|
||||
return 0.0
|
||||
@@ -389,18 +379,18 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
)
|
||||
|
||||
contemp = self.cr.fetchone()
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
|
||||
|
||||
return result_tmp
|
||||
|
||||
|
||||
|
||||
|
||||
def _sum_credit(self,data):
|
||||
if not self.ids:
|
||||
return 0.0
|
||||
@@ -430,14 +420,14 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
"WHERE partner_id IN (" + self.partner_ids + ") " \
|
||||
# "AND account_id IN (" + self.account_ids + ") " \
|
||||
" " + RECONCILE_TAG + " " \
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
"AND date IN (" + self.date_lst_string + ") "
|
||||
)
|
||||
contemp = self.cr.fetchone()
|
||||
contemp = self.cr.fetchone()
|
||||
if contemp != None:
|
||||
result_tmp = contemp[0] or 0.0
|
||||
else:
|
||||
result_tmp = result_tmp + 0.0
|
||||
|
||||
|
||||
return result_tmp
|
||||
|
||||
def _get_company(self, form):
|
||||
@@ -445,7 +435,7 @@ class third_party_ledger(rml_parse.rml_parse):
|
||||
|
||||
def _get_currency(self, form):
|
||||
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name
|
||||
|
||||
|
||||
report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner',
|
||||
'addons/account/report/third_party_ledger.rml',parser=third_party_ledger,
|
||||
header=False)
|
||||
|
||||
@@ -217,13 +217,13 @@
|
||||
<para style="P4"></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ (line['debit']) or '' ]]</para>
|
||||
<para style="P5">[[ (line['debit']) or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ (line['credit']) or '' ]]</para>
|
||||
<para style="P5">[[ (line['credit']) or '0.0' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5">[[ (line['progress']) or '' ]]</para>
|
||||
<para style="P5">[[ (line['progress']) or '0.0' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<header>
|
||||
<pageGraphics>
|
||||
<!--logo-->
|
||||
<!--<fill color="darkblue"/>-->
|
||||
<!--<stroke color="darkblue"/>-->
|
||||
|
||||
<!--TITLE COMPANY-->
|
||||
<!-- <drawString x="4.6cm" y="28.7cm">[[ company.partner_id.name ]]</drawString> -->
|
||||
|
||||
<setFont name="Helvetica-Bold" size="9"/>
|
||||
|
||||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Print Journal - [[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
</pageGraphics>
|
||||
</header>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<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"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
|
||||
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P2" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P3" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P5" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P6" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P7" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" 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="P10a" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10b" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11a" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER"/>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<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="Heading" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.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_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" 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_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.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_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.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_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_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"/>
|
||||
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<para style="Table Contents">[[ repeatIn(objects, 'o') ]]</para>
|
||||
<blockTable colWidths="65.0,62.0,58.0,62.0,174.0,57.0,61.0" style="Table1" repeatRows="1">
|
||||
<para style="terp_default_8">[[repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2],data['form']['sort_selection']), 'line') ]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P10a">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">Voucher No</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">A/c No.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10a">Third party</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10a">Entry label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10b">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10b">Credit</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11">[[line[0].period_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11a">[[line[0].journal_id.code ]]</para></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<para style="P12"><u>[[ '%.2f' % sum_debit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12"><u>[[ '%.2f' % sum_credit(line[0].period_id.id, line[0].journal_id.id) or '0.00' ]]</u></para>
|
||||
</td>
|
||||
</tr >
|
||||
<tr>
|
||||
<para style="terp_default_8">[[repeatIn(line,'l')]]</para>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ l.date ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ l.ref ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ l.account_id.code ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ l.partner_id and l.partner_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">[[ l.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ l.debit and '%.2f' % l.debit or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[ l.credit and '%.2f' % l.credit or '0.00' ]]</para>
|
||||
</td>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</story>
|
||||
</document>
|
||||
@@ -0,0 +1,247 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
|
||||
<header>
|
||||
<pageGraphics>
|
||||
<setFont name="Helvetica-Bold" size="9"/>
|
||||
|
||||
|
||||
<!--COL 1-->
|
||||
<drawString x="1.0cm" y="28.1cm">[[ company.name ]]</drawString>
|
||||
<drawRightString x="20cm" y="28.1cm">Central Journal-[[ company.currency_id.name ]]</drawRightString>
|
||||
|
||||
<!-- Header -->
|
||||
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
<drawString x="1.0cm" y="1cm"> [[ time.strftime("%Y-%m-%d %H:%M", time.localtime()) ]]</drawString>
|
||||
<drawString x="19.0cm" y="1cm">Page <pageNumber/></drawString>
|
||||
<!--<drawRightString x="19.8cm" y="28cm">[[ company.rml_header1 ]]</drawRightString>-->
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
|
||||
</pageGraphics>
|
||||
</header>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_header_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Sub_Header_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-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="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Subheader_Content_detail">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#cccccc" start="1,0" stop="1,-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="LINEBEFORE" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#cccccc" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#cccccc" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#cccccc" start="2,-1" stop="2,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Account_detail_Title">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Final_Total">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<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"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_Journal_Line_Content">
|
||||
<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"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="Standard" fontName="Times-Roman"/>
|
||||
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<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="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Footer" 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="12.0" leading="15" alignment="LEFT" 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="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="12.0" leading="15" 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"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<!--blockTable colWidths="180.0,180.0,180.0" style="Table_header_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_header">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_header">Central Journal-[[ company.currency_id.name ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable-->
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">[[ repeatIn(objects, 'o') ]]</para>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(data['form']['period_id'][0][2],data['form']['journal_id'][0][2]), 'line') ]]</para>
|
||||
<blockTable colWidths="180.0,180.0,180.0" style="Table_Sub_Header_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Journal Code</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Journal Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Printing Date</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="180.0,180.0,180.0" style="Table_Subheader_Content_detail">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ line[0]['journal'].code or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ line[0]['journal'].name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">[[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="83.0,272.0,95.0,89.0" style="Table_Account_detail_Title" repeatRows="1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account Num.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Account Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="80.0,272.0,94.0,87.0" style="Table_Final_Total">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right">[[ '%.2f' % sum_debit(line[0]['period'].id, line[0]['journal'].id) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right">[[ '%.2f' % sum_credit(line[0]['period'].id, line[0]['journal'].id) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="80.0,272.0,94.0,87.0" style="Table_Journal_Line_Content">
|
||||
<para style="terp_default_8">[[repeatIn(line,'l')]]</para>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ l['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ l['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(l['debit']) and '%.2f' % l['debit'] or '0.00' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(l['credit']) and '%.2f' % l['credit'] or '0.00' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
@@ -4,7 +4,8 @@
|
||||
"access_account_account_type","account.account.type","model_account_account_type","account.group_account_user",1,0,0,0
|
||||
"access_account_tax","account.tax","model_account_tax","account.group_account_user",1,0,0,0
|
||||
"access_account_account","account.account","model_account_account","account.group_account_user",1,0,0,0
|
||||
"access_account_account_partner_manager","account.account partner manager","model_account_account","base.group_user",1,0,0,0
|
||||
"access_account_account_user","account.account user","model_account_account","base.group_user",1,0,0,0
|
||||
"access_account_account_partner_manager","account.account partner manager","model_account_account","base.group_partner_manager",1,0,0,0
|
||||
"access_account_journal_view","account.journal.view","model_account_journal_view","account.group_account_user",1,0,0,0
|
||||
"access_account_journal_column","account.journal.column","model_account_journal_column","account.group_account_user",1,0,0,0
|
||||
"access_account_journal","account.journal","model_account_journal","account.group_account_user",1,0,0,0
|
||||
@@ -56,9 +57,6 @@
|
||||
"access_account_tax_code_manager","account.tax.code","model_account_tax_code","account.group_account_manager",1,1,1,1
|
||||
"access_account_tax_manager","account.tax","model_account_tax","account.group_account_manager",1,1,1,1
|
||||
"access_account_invoice_group_invoice","account.invoice group invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
|
||||
"access_account_invoice_manager","account.invoice","model_account_invoice","account.group_account_manager",1,1,1,1
|
||||
"access_account_invoice_line_manager","account.invoice.line","model_account_invoice_line","account.group_account_manager",1,1,1,1
|
||||
"access_account_invoice_tax_manager","account.invoice.tax","model_account_invoice_tax","account.group_account_manager",1,1,1,1
|
||||
"access_account_analytic_account_manager","account.analytic.account","model_account_analytic_account","account.group_account_manager",1,1,1,1
|
||||
"access_account_analytic_journal_manager","account.analytic.journal","model_account_analytic_journal","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscalyear","account.fiscalyear","model_account_fiscalyear","account.group_account_manager",1,1,1,1
|
||||
@@ -76,6 +74,8 @@
|
||||
"access_account_account_product_manager","account.account product manager","model_account_account","product.group_product_manager",1,0,0,0
|
||||
"access_account_journal_product_manager","account.journal product manager","model_account_journal","product.group_product_manager",1,0,0,0
|
||||
"access_account_fiscal_position_product_manager","account.fiscal.position account.manager","model_account_fiscal_position","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
|
||||
"access_account_fiscal_position_tax_product_manager","account.fiscal.position.tax account.manager","model_account_fiscal_position_tax","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
|
||||
"access_account_fiscal_position_account_product_manager","account.fiscal.position account.manager","model_account_fiscal_position_account","account.group_account_manager",1,1,1,1
|
||||
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
|
||||
|
||||
|
@@ -64,6 +64,8 @@ import wizard_use_model
|
||||
import wizard_state_open
|
||||
|
||||
import wizard_statement_from_invoice
|
||||
import wizard_print_journal
|
||||
import wizard_central_journal
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
# -*- 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
|
||||
|
||||
form = '''<?xml version="1.0"?>
|
||||
<form string="Print Journal">
|
||||
<field name="journal_id"/>
|
||||
<field name="period_id"/>
|
||||
</form>'''
|
||||
|
||||
fields = {
|
||||
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
|
||||
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
|
||||
}
|
||||
|
||||
|
||||
class wizard_print_journal(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
|
||||
},
|
||||
'print': {
|
||||
'actions': [],
|
||||
'result': {'type':'print', 'report':'account.central.journal.wiz', 'state':'end'},
|
||||
},
|
||||
}
|
||||
wizard_print_journal('account.central.journal.report')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -29,31 +29,31 @@ import pooler
|
||||
import locale
|
||||
import time
|
||||
|
||||
report_type = '''<?xml version="1.0"?>
|
||||
<form string="Select Report Type">
|
||||
</form>'''
|
||||
|
||||
dates_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period ">
|
||||
<field name="date_from" colspan="4"/>
|
||||
<field name="date_to" colspan="4"/>
|
||||
<field name="sortbydate" colspan="4"/>
|
||||
<field name="display_account" colspan="4"/>
|
||||
<field name="landscape" colspan="4"/>
|
||||
<field name="soldeinit"/>
|
||||
<field name="amount_currency" colspan="4"/>
|
||||
</form>'''
|
||||
|
||||
dates_fields = {
|
||||
'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
|
||||
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
|
||||
'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
|
||||
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
'amount_currency':{'string':"with amount in currency",'type':'boolean'}
|
||||
|
||||
}
|
||||
#report_type = '''<?xml version="1.0"?>
|
||||
#<form string="Select Report Type">
|
||||
#</form>'''
|
||||
#
|
||||
#dates_form = '''<?xml version="1.0"?>
|
||||
#<form string="Select period ">
|
||||
# <field name="date_from" colspan="4"/>
|
||||
# <field name="date_to" colspan="4"/>
|
||||
# <field name="sortbydate" colspan="4"/>
|
||||
# <field name="display_account" colspan="4"/>
|
||||
# <field name="landscape" colspan="4"/>
|
||||
# <field name="soldeinit"/>
|
||||
# <field name="amount_currency" colspan="4"/>
|
||||
#</form>'''
|
||||
#
|
||||
#dates_fields = {
|
||||
# 'date_from': {'string':"Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
# 'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
# 'sortbydate':{'string':"Sort by",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
|
||||
# 'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
|
||||
# 'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
|
||||
# 'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
# 'amount_currency':{'string':"with amount in currency",'type':'boolean'}
|
||||
#
|
||||
#}
|
||||
|
||||
account_form = '''<?xml version="1.0"?>
|
||||
<form string="Select parent account">
|
||||
@@ -68,25 +68,59 @@ account_fields = {
|
||||
|
||||
|
||||
period_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period ">
|
||||
<field name="fiscalyear" colspan="4"/>
|
||||
<field name="periods" colspan="4"/>
|
||||
<field name="sortbydate" colspan="4"/>
|
||||
<field name="display_account" colspan="4"/>
|
||||
<field name="landscape" colspan="4"/>
|
||||
<field name="soldeinit"/>
|
||||
<field name="amount_currency" colspan="4"/>
|
||||
<form string="Select Date-Period">
|
||||
|
||||
<field name="company_id" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="fiscalyear"/>
|
||||
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
|
||||
<newline/>
|
||||
<field name="display_account"/>
|
||||
<field name="sortbydate"/>
|
||||
|
||||
<field name="landscape"/>
|
||||
<field name="amount_currency"/>
|
||||
|
||||
<newline/>
|
||||
<separator string="Filters" colspan="4"/>
|
||||
<field name="state" required="True"/>
|
||||
<newline/>
|
||||
|
||||
<group attrs="{'invisible':[('state','=','byperiod'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Date Filter" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('state','=','bydate'),('state','=','none')]}" colspan="4">
|
||||
<separator string="Filter on Periods" colspan="4"/>
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>'''
|
||||
|
||||
period_fields = {
|
||||
'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
|
||||
'state':{
|
||||
'string':"Date/Period Filter",
|
||||
'type':'selection',
|
||||
'selection':[('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],
|
||||
'default': lambda *a:'bydate'
|
||||
},
|
||||
'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear',
|
||||
'help': 'Keep empty for all open fiscal year'},
|
||||
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'},
|
||||
'sortbydate':{'string':"Sort by:",'type':'selection','selection':[('sort_date','Date'),('sort_mvt','Mouvement')]},
|
||||
'display_account':{'string':"Display accounts ",'type':'selection','selection':[('bal_mouvement','With movements'),('bal_all','All'),('bal_solde','With balance is not equal to 0')]},
|
||||
'landscape':{'string':"Print in Landscape Mode",'type':'boolean'},
|
||||
'landscape':{'string':"Landscape Mode",'type':'boolean'},
|
||||
'soldeinit':{'string':"Inclure les soldes initiaux",'type':'boolean'},
|
||||
'amount_currency':{'string':"with amount in currency",'type':'boolean'}
|
||||
'amount_currency':{'string':"With Currency",'type':'boolean'},
|
||||
'date_from': {'string':" Start date",'type':'date','required':True ,'default': lambda *a: time.strftime('%Y-01-01')},
|
||||
'date_to': {'string':"End date",'type':'date','required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')},
|
||||
|
||||
}
|
||||
def _check_path(self, cr, uid, data, context):
|
||||
if data['model'] == 'account.account':
|
||||
@@ -117,20 +151,22 @@ def _check_date(self, cr, uid, data, context):
|
||||
|
||||
class wizard_report(wizard.interface):
|
||||
def _get_defaults(self, cr, uid, data, context):
|
||||
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid, context=context)
|
||||
if user.company_id:
|
||||
company_id = user.company_id.id
|
||||
else:
|
||||
company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0]
|
||||
data['form']['company_id'] = company_id
|
||||
fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear')
|
||||
|
||||
data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid)
|
||||
periods_obj=pooler.get_pool(cr.dbname).get('account.period')
|
||||
data['form']['periods'] =periods_obj.search(cr, uid, [('fiscalyear_id','=',data['form']['fiscalyear'])])
|
||||
data['form']['sortbydate'] = 'sort_date'
|
||||
data['form']['display_account']='bal_all'
|
||||
data['form']['landscape']=True
|
||||
data['form']['amount_currency'] = True
|
||||
return data['form']
|
||||
def _get_defaults_fordate(self, cr, uid, data, context):
|
||||
data['form']['sortbydate'] = 'sort_date'
|
||||
data['form']['display_account']='bal_all'
|
||||
data['form']['landscape']=True
|
||||
data['form']['amount_currency'] = True
|
||||
return data['form']
|
||||
|
||||
|
||||
states = {
|
||||
'init': {
|
||||
@@ -142,21 +178,9 @@ class wizard_report(wizard.interface):
|
||||
'result': {'type':'form', 'arch':account_form,'fields':account_fields, 'state':[('end','Cancel'),('checktype','Print')]}
|
||||
},
|
||||
'checktype': {
|
||||
'actions': [],
|
||||
'result': {'type':'form', 'arch':report_type,'fields':{}, 'state':[('with_period','Use with Period'),('with_date','Use with Date')]}
|
||||
},
|
||||
'with_period': {
|
||||
'actions': [_get_defaults],
|
||||
'result': {'type':'form', 'arch':period_form, 'fields':period_fields, 'state':[('end','Cancel'),('checkreport','Print')]}
|
||||
},
|
||||
'with_date': {
|
||||
'actions': [_get_defaults_fordate],
|
||||
'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('checkdate','Print')]}
|
||||
},
|
||||
'checkdate': {
|
||||
'actions': [],
|
||||
'result': {'type':'choice','next_state':_check_date}
|
||||
},
|
||||
'checkreport': {
|
||||
'actions': [],
|
||||
'result': {'type':'choice','next_state':_check}
|
||||
|
||||
@@ -30,7 +30,7 @@ import wizard
|
||||
import pooler
|
||||
|
||||
period_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period" colspan="4">
|
||||
<form string="Select Date-Period">
|
||||
<field name="company_id"/>
|
||||
<field name="result_selection"/>
|
||||
<newline/>
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
# -*- 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
|
||||
|
||||
form = '''<?xml version="1.0"?>
|
||||
<form string="Print Journal">
|
||||
<field name="journal_id"/>
|
||||
<field name="period_id"/>
|
||||
<field name="sort_selection"/>
|
||||
</form>'''
|
||||
|
||||
fields = {
|
||||
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
|
||||
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
|
||||
'sort_selection':{
|
||||
'string':"Entries Sorted By",
|
||||
'type':'selection',
|
||||
'selection':[('date','By date'),('ref','Reference Number')],
|
||||
'required':True,
|
||||
'default': lambda *a: 'date',
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
class wizard_print_journal(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel'), ('print', 'Print'))},
|
||||
},
|
||||
'print': {
|
||||
'actions': [],
|
||||
'result': {'type':'print', 'report':'account.journal.period.print.wiz', 'state':'end'},
|
||||
},
|
||||
}
|
||||
wizard_print_journal('account.print.journal.report')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -31,7 +31,7 @@ import pooler
|
||||
|
||||
|
||||
period_form = '''<?xml version="1.0"?>
|
||||
<form string="Select period">
|
||||
<form string="Select Date-Period">
|
||||
|
||||
<field name="company_id"/>
|
||||
<field name="result_selection"/>
|
||||
|
||||
@@ -164,7 +164,6 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
||||
|
||||
|
||||
def test1(self,data,object,intercall=False):
|
||||
|
||||
obj_history=self.pool.get('account.report.history')
|
||||
|
||||
if data['select_base']=='year':
|
||||
@@ -233,13 +232,13 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
||||
# drawing.save(formats=['png'],fnRoot=path+str(self.count),title="helo")
|
||||
# renderPM.drawToFile(drawing1, 'example1.jpg','jpg')
|
||||
import os
|
||||
dirname ='Temp_images'
|
||||
path=os.path.join(tools.config['root_path'],dirname,"Image")
|
||||
path=tools.config['addons_path']+"/account_report/tmp_images/image"
|
||||
|
||||
if not os.path.isdir(tools.config['root_path']+ "/"+dirname + '/'):
|
||||
os.mkdir(tools.config['root_path'] +"/"+ dirname + '/')
|
||||
os.path.join(tools.config['root_path'],dirname,"/")
|
||||
can = canvas.init('Image'+str(self.count)+".png")
|
||||
dirname =tools.config['addons_path']+'/account_report/tmp_images/'
|
||||
if not os.path.isdir(dirname):
|
||||
os.mkdir(dirname)
|
||||
|
||||
can = canvas.init('image'+str(self.count)+".png")
|
||||
# can.clip(0,0,600,400)
|
||||
|
||||
data=zip(self.header_name,self.header_val)
|
||||
@@ -252,8 +251,8 @@ class accounting_report_indicator(report_sxw.rml_parse):
|
||||
ar.draw()
|
||||
|
||||
can.close()
|
||||
os.system('cp '+'Image'+str(self.count)+'.png ' +path+str(self.count)+'.png')
|
||||
os.system('rm '+'Image'+str(self.count)+'.png')
|
||||
os.system('cp '+'image'+str(self.count)+'.png ' +path+str(self.count)+'.png')
|
||||
os.system('rm '+'image'+str(self.count)+'.png')
|
||||
# can.endclip()
|
||||
return path+str(self.count)+'.png'
|
||||
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
|
||||
<pageGraphics>
|
||||
<setFont name="Helvetica" size="8.5"/>
|
||||
<drawString x="10.5cm" y="1cm"><pageNumber/></drawString>
|
||||
|
||||
<setFont name="Helvetica" size="9"/>
|
||||
</pageGraphics>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
@@ -17,90 +23,75 @@
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#b3b3b3" start="0,0" stop="-1,-1"/>
|
||||
<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"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table4">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<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"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Times-Roman" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P1" alignment="CENTER" fontName="Helvetica" fontSize="8.5" leading="10" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P2" fontName="Helvetica" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P3" fontName="Times-BoldItalic" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P4" fontName="Times-Bold" fontSize="18.0" leading="22" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Times-Roman" fontSize="13.0" leading="16" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Times-Roman" fontSize="8.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Times-Roman" fontSize="16.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Times-Roman" fontSize="10.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P14" fontName="Times-Roman" fontSize="11.0" leading="14" 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="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="P4" fontName="Helvetica" fontSize="10.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P5" fontName="Helvetica" fontSize="8.5" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P6" fontName="Helvetica" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P7" fontName="Helvetica" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P8" fontName="Helvetica-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P9" fontName="Helvetica" fontSize="8.0" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P10" fontName="Helvetica" fontSize="16.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P11" fontName="Helvetica" fontSize="9.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P12" fontName="Helvetica" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P13" fontName="Helvetica" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="P14" fontName="Helvetica" fontSize="10.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica" 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="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
</stylesheet>
|
||||
<images/>
|
||||
<story>
|
||||
<blockTable colWidths="146.0,223.0,158.0" repeatRows="1" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P10">Indicators</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P5">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P2">Currency: <font face="Times-Roman" size="11.0">[[ company.currency_id.name]]</font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
<blockTable colWidths="520.0" style="Standard_Outline">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_header_Centre">Indicators</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="264.0,264.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P14">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Currency: <font face="Times-Roman" size="11.0">[[ company.currency_id.name]]</font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P4">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<blockTable colWidths="362.0,166.0" repeatRows="1" style="Table4">
|
||||
<para style="P1">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
|
||||
<blockTable colWidths="362.0,166.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P6">Name</para>
|
||||
@@ -119,10 +110,10 @@
|
||||
<blockTable colWidths="362.0,166.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11"><b>(<seq/>)</b> [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]]<u>[[ o['name'] ]]</u></para>
|
||||
<para style="P11"><b>(<seq/>)</b> [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]<u>[[ o['name'] ]]</u></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold'}) ]]<u>[[ o['code'] ]]</u></para>
|
||||
<para style="P11">[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]<u>[[ o['code'] ]]</u></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -140,37 +131,50 @@
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</blockTable>
|
||||
</section>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="528.0" repeatRows="1" style="Table3">
|
||||
<blockTable colWidths="14.0,500.0,14.0" repeatRows="1" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11"><b>Expression :</b> [[ o['expression'] ]]</para>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5"><b>Expression :</b> [[ o['expression'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="528.0" repeatRows="1" style="Table3">
|
||||
<blockTable colWidths="14.0,500.0,14.0" repeatRows="1" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P11"><b>Notes :</b> [[ o['note'] ]]</para>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P5"><b>Notes :</b> [[ o['note'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<hr color="black" thickness="1.5"/>
|
||||
</section>
|
||||
</story>
|
||||
</document>
|
||||
|
||||
@@ -8,17 +8,17 @@
|
||||
"access_auction_bid","auction.bid","model_auction_bid","base.group_user",1,1,1,1
|
||||
"access_auction_bid_line","auction.bid.line","model_auction_bid_line","base.group_user",1,1,1,1
|
||||
"access_auction_lot_history","auction.lot.history","model_auction_lot_history","base.group_user",1,1,1,1
|
||||
"access_report_buyer_auction","report.buyer.auction","model_report_buyer_auction","base.group_user",1,1,1,1
|
||||
"access_report_buyer_auction2","report.buyer.auction2","model_report_buyer_auction2","base.group_user",1,1,1,1
|
||||
"access_report_seller_auction","report.seller.auction","model_report_seller_auction","base.group_user",1,1,1,1
|
||||
"access_report_seller_auction2","report.seller.auction2","model_report_seller_auction2","base.group_user",1,1,1,1
|
||||
"access_report_auction_view","report.auction.view","model_report_auction_view","base.group_user",1,1,1,1
|
||||
"access_report_auction_view2","report.auction.view2","model_report_auction_view2","base.group_user",1,1,1,1
|
||||
"access_report_auction_object_date","report.auction.object.date","model_report_auction_object_date","base.group_user",1,1,1,1
|
||||
"access_report_auction_estimation_adj_category","report.auction.estimation.adj.category","model_report_auction_estimation_adj_category","base.group_user",1,1,1,1
|
||||
"access_report_auction_adjudication","report.auction.adjudication","model_report_auction_adjudication","base.group_user",1,1,1,1
|
||||
"access_report_attendance","report.attendance","model_report_attendance","base.group_user",1,1,1,1
|
||||
"access_report_deposit_border","report.deposit.border","model_report_deposit_border","base.group_user",1,1,1,1
|
||||
"access_report_object_encoded","report.object.encoded","model_report_object_encoded","base.group_user",1,1,1,1
|
||||
"access_report_object_encoded_manager","report.object.encoded.manager","model_report_object_encoded_manager","base.group_user",1,1,1,1
|
||||
"access_report_unclassified_objects","report.unclassified.objects","model_report_unclassified_objects","base.group_user",1,1,1,1
|
||||
"access_report_buyer_auction","report.buyer.auction","model_report_buyer_auction","base.group_user",1,0,0,0
|
||||
"access_report_buyer_auction2","report.buyer.auction2","model_report_buyer_auction2","base.group_user",1,0,0,0
|
||||
"access_report_seller_auction","report.seller.auction","model_report_seller_auction","base.group_user",1,0,0,0
|
||||
"access_report_seller_auction2","report.seller.auction2","model_report_seller_auction2","base.group_user",1,0,0,0
|
||||
"access_report_auction_view","report.auction.view","model_report_auction_view","base.group_user",1,0,0,0
|
||||
"access_report_auction_view2","report.auction.view2","model_report_auction_view2","base.group_user",1,0,0,0
|
||||
"access_report_auction_object_date","report.auction.object.date","model_report_auction_object_date","base.group_user",1,0,0,0
|
||||
"access_report_auction_estimation_adj_category","report.auction.estimation.adj.category","model_report_auction_estimation_adj_category","base.group_user",1,0,0,0
|
||||
"access_report_auction_adjudication","report.auction.adjudication","model_report_auction_adjudication","base.group_user",1,0,0,0
|
||||
"access_report_attendance","report.attendance","model_report_attendance","base.group_user",1,0,0,0
|
||||
"access_report_deposit_border","report.deposit.border","model_report_deposit_border","base.group_user",1,0,0,0
|
||||
"access_report_object_encoded","report.object.encoded","model_report_object_encoded","base.group_user",1,0,0,0
|
||||
"access_report_object_encoded_manager","report.object.encoded.manager","model_report_object_encoded_manager","base.group_user",1,0,0,0
|
||||
"access_report_unclassified_objects","report.unclassified.objects","model_report_unclassified_objects","base.group_user",1,0,0,0
|
||||
|
||||
|
@@ -1,12 +1,15 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_crm_segmentation,crm.segmentation,model_crm_segmentation,crm.group_crm_manager,1,1,1,1
|
||||
access_crm_segmentation_line,crm.segmentation.line,model_crm_segmentation_line,crm.group_crm_manager,1,1,1,1
|
||||
access_crm_case_section,crm.case.section,model_crm_case_section,crm.group_crm_user,1,0,0,0
|
||||
access_crm_case_categ,crm.case.categ,model_crm_case_categ,crm.group_crm_user,1,0,0,0
|
||||
access_crm_case_rule,crm.case.rule,model_crm_case_rule,crm.group_crm_user,1,0,0,0
|
||||
access_crm_case,crm.case,model_crm_case,crm.group_crm_user,1,1,1,1
|
||||
access_crm_case_log,crm.case.log,model_crm_case_log,crm.group_crm_user,1,1,1,1
|
||||
access_crm_case_history,crm.case.history,model_crm_case_history,crm.group_crm_user,1,1,1,1
|
||||
access_crm_case_section_manager,crm.case.section.manager,model_crm_case_section,crm.group_crm_manager,1,1,1,1
|
||||
access_crm_case_categ_manager,crm.case.categ.manager,model_crm_case_categ,crm.group_crm_manager,1,1,1,1
|
||||
access_crm_case_rule_manager,crm.case.rule.manager,model_crm_case_rule,crm.group_crm_manager,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_crm_segmentation","crm.segmentation","model_crm_segmentation","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_segmentation_line","crm.segmentation.line","model_crm_segmentation_line","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_section","crm.case.section","model_crm_case_section","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_categ","crm.case.categ","model_crm_case_categ","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_rule","crm.case.rule","model_crm_case_rule","crm.group_crm_user",1,0,0,0
|
||||
"access_crm_case_manger","crm.case manager","model_crm_case","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case","crm.case","model_crm_case","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_log","crm.case.log","model_crm_case_log","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case_history","crm.case.history","model_crm_case_history","crm.group_crm_user",1,1,1,1
|
||||
"access_crm_case_section_manager","crm.case.section.manager","model_crm_case_section","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_categ_manager","crm.case.categ.manager","model_crm_case_categ","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_rule_manager","crm.case.rule.manager","model_crm_case_rule","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_log_manager","crm.case.log manager","model_crm_case_log","crm.group_crm_manager",1,1,1,1
|
||||
"access_crm_case_history_manager","crm.case.history manager","model_crm_case_history","crm.group_crm_manager",1,1,1,1
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
people to intelligently and efficiently manage tasks, issues,
|
||||
and requests. It manages key tasks such as communication,
|
||||
identification, prioritization, assignment, resolution and notification.""",
|
||||
"depends" : ["crm","report_crm", "process"],
|
||||
"depends" : ["crm","report_crm", "process", "account"],
|
||||
"init_xml" : [
|
||||
"crm_config_view.xml",
|
||||
"crm_bugs_view.xml",
|
||||
@@ -40,7 +40,7 @@
|
||||
"crm_helpdesk_menu.xml", "crm_lead_menu.xml",
|
||||
"crm_meeting_menu.xml",
|
||||
"security/ir.model.access.csv",
|
||||
# "process/crm_configuration_process.xml",
|
||||
"process/crm_configuration_process.xml",
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!--
|
||||
Process
|
||||
-->
|
||||
|
||||
<record id="process_process_contractworkflow0" model="process.process">
|
||||
<field eval=""""Contracts flow for services companies."""" name="note"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field eval=""""Contract Workflow"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Node
|
||||
-->
|
||||
|
||||
<record id="process_node_leads0" model="process.node">
|
||||
<field name="menu_id" ref="crm_configuration.menu_crm_case_categ0_act_leads_all"/>
|
||||
<field name="model_id" ref="crm.model_crm_case"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Leads"""" name="name"/>
|
||||
<field eval=""""Premier Contact Leads"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'open', 'pending', 'done', 'cancel')"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_opportunities0" model="process.node">
|
||||
<field name="menu_id" ref="crm_configuration.menu_crm_case_categ0_act_oppor11"/>
|
||||
<field name="model_id" ref="crm.model_crm_case"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Opportunities"""" name="name"/>
|
||||
<field eval=""""Business Opportunities"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'open', 'pending', 'done', 'cancel')"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_accord0" model="process.node">
|
||||
<field name="menu_id" ref="crm_configuration.menu_crm_case_categ0_act_leads_all"/>
|
||||
<field name="model_id" ref="crm.model_crm_case"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Accord"""" name="name"/>
|
||||
<field eval=""""Accord Client Contract"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval=""""object.state=='done'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_contractanalytic0" model="process.node">
|
||||
<field name="menu_id" ref="account.account_analytic_def_account"/>
|
||||
<field name="model_id" ref="account.model_account_analytic_account"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Contract Analytic"""" name="name"/>
|
||||
<field eval=""""Analytic accounts"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_contractpricelist0" model="process.node">
|
||||
<field name="menu_id" ref="product.menu_product_pricelist_action2"/>
|
||||
<field name="model_id" ref="product.model_product_pricelist"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Contract Pricelist"""" name="name"/>
|
||||
<field eval=""""Contract Volume (pricelist)"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_contractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="process_transition_leadopportunity0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Lead Opportunity"""" name="name"/>
|
||||
<field eval=""""Creating business opportunities from leads"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_opportunities0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_leads0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_opportunitiesaccord0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Opportunities Accord"""" name="name"/>
|
||||
<field eval=""""When leads are confirmed"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_accord0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_opportunities0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_accordanalytic0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Accord Analytic"""" name="name"/>
|
||||
<field eval=""""Goes into the Analytic"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_contractanalytic0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_accord0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_accordpricelist0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Accord Pricelist"""" name="name"/>
|
||||
<field eval=""""Goes into the Pricelist"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_contractpricelist0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_accord0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -83,27 +83,14 @@ class stock_picking(osv.osv):
|
||||
account_id = picking.carrier_id.product_id.categ_id\
|
||||
.property_account_income_categ.id
|
||||
|
||||
taxes = self.pool.get('account.tax').browse(cursor, user,
|
||||
[x.id for x in picking.carrier_id.product_id.taxes_id])
|
||||
taxep = None
|
||||
taxes = picking.carrier_id.product_id.taxes_id
|
||||
|
||||
partner_id=picking.address_id.partner_id and picking.address_id.partner_id.id or False
|
||||
taxes_ids = [x.id for x in picking.carrier_id.product_id.taxes_id]
|
||||
if partner_id:
|
||||
print 'Found Partner'
|
||||
partner = picking.address_id.partner_id
|
||||
taxep = partner.property_account_position and partner.property_account_position.account_tax
|
||||
print account_id
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, partner, account_id)
|
||||
print account_id
|
||||
|
||||
if not taxep or not taxep.id:
|
||||
taxes_ids = [x.id for x in picking.carrier_id.product_id.taxes_id]
|
||||
else:
|
||||
res5 = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
res5.append(t.id)
|
||||
taxes_ids = res5
|
||||
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner, account_id)
|
||||
taxes_ids = self.pool.get('account.fiscal.position').map_tax(cursor, user, partner, taxes)
|
||||
|
||||
invoice_line_obj.create(cursor, user, {
|
||||
'name': picking.carrier_id.name,
|
||||
|
||||
@@ -68,22 +68,9 @@ def _delivery_set(self, cr, uid, data, context):
|
||||
grid_obj=pooler.get_pool(cr.dbname).get('delivery.grid')
|
||||
grid = grid_obj.browse(cr, uid, [grid_id])[0]
|
||||
|
||||
taxes = pooler.get_pool(cr.dbname).get('account.tax').browse(cr, uid,
|
||||
[x.id for x in grid.carrier_id.product_id.taxes_id])
|
||||
taxep = None
|
||||
partner_id=order.partner_id and order.partner_id.id or False
|
||||
if partner_id:
|
||||
partner = order.partner_id
|
||||
taxep = partner.property_account_position and partner.property_account_position.account_tax
|
||||
if not taxep or not taxep.id:
|
||||
taxes_ids = [x.id for x in grid.carrier_id.product_id.taxes_id]
|
||||
else:
|
||||
res5 = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
res5.append(t.id)
|
||||
taxes_ids = res5
|
||||
|
||||
taxes = grid.carrier_id.product_id.taxes_id
|
||||
taxes_ids = pooler.get_pool(cr.dbname).get('account.fiscal.position').map_tax(cr, uid, order.partner_id, taxes)
|
||||
|
||||
line_obj.create(cr, uid, {
|
||||
'order_id': order.id,
|
||||
'name': grid.carrier_id.name,
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
* User Authentification
|
||||
* Document Indexation
|
||||
""",
|
||||
"depends" : ["base", "process"],
|
||||
"depends" : ["base", "process", "hr"],
|
||||
"init_xml" : ["document_data.xml"],
|
||||
"update_xml" : [
|
||||
"document_view.xml",
|
||||
"security/document_security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"process/document_process.xml"
|
||||
],
|
||||
"demo_xml" : ["document_demo.xml"],
|
||||
"active": False,
|
||||
|
||||
@@ -67,11 +67,13 @@
|
||||
<field name="res_model">document.directory</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</record>
|
||||
<menuitem name="Configuration" id="menu_document_configuration" parent="menu_document"/>
|
||||
<menuitem
|
||||
name="Document Management/Configuration/Directories"
|
||||
name="Directories"
|
||||
action="action_document_directory_form"
|
||||
id="menu_document_directories"/>
|
||||
id="menu_document_directories"
|
||||
parent="menu_document_configuration"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_directory_tree">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
@@ -80,9 +82,10 @@
|
||||
<field name="domain">[('ressource_parent_type_id','=',False),('parent_id','=',False)]</field>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Document Management/Directorie's Structure"
|
||||
name="Directorie's Structure"
|
||||
action="action_document_directory_tree"
|
||||
id="menu_document_directories_tree"/>
|
||||
id="menu_document_directories_tree"
|
||||
parent="menu_document"/>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_document_file_form">
|
||||
@@ -141,9 +144,10 @@
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Document Management/Search a File"
|
||||
name="Search a File"
|
||||
action="action_document_file_form"
|
||||
id="menu_document_files"/>
|
||||
id="menu_document_files"
|
||||
parent="menu_document"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_document_file_directory_form">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="process_node_papers0" model="process.node">
|
||||
<field name="menu_id" ref="document.menu_document_directories"/>
|
||||
<field name="model_id" ref="document.model_document_directory"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Papers"""" name="name"/>
|
||||
<field eval=""""Employee get papers and matrieal"""" name="note"/>
|
||||
<field name="process_id" ref="hr.process_process_employeecontractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_papersandmaterials0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Papers and materials"""" name="name"/>
|
||||
<field eval=""""Employee get papers and necessary materials"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_papers0"/>
|
||||
<field model="process.node" name="source_node_id" ref="hr.process_node_employee0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -6,5 +6,9 @@
|
||||
<field name="name">Document / Manager</field>
|
||||
</record>
|
||||
|
||||
<record id="menu_document_configuration" model="ir.ui.menu">
|
||||
<field name="groups_id" eval="[(6,0,[ref('group_document_manager')])]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_event_type,event.type,model_event_type,crm.group_crm_user,1,1,1,1
|
||||
access_event_event,event.event,model_event_event,crm.group_crm_user,1,1,1,1
|
||||
access_event_registration,event.registration,model_event_registration,crm.group_crm_user,1,1,1,1
|
||||
access_report_event_registration,report.event.registration,model_report_event_registration,crm.group_crm_user,1,1,1,1
|
||||
access_report_event_type_registration,report.event.type.registration,model_report_event_type_registration,crm.group_crm_user,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_event_type","event.type","model_event_type","crm.group_crm_user",1,1,1,1
|
||||
"access_event_event","event.event","model_event_event","crm.group_crm_user",1,1,1,1
|
||||
"access_event_registration","event.registration","model_event_registration","crm.group_crm_user",1,1,1,1
|
||||
"access_report_event_registration","report.event.registration","model_report_event_registration","crm.group_crm_user",1,0,0,0
|
||||
"access_report_event_type_registration","report.event.type.registration","model_report_event_type_registration","crm.group_crm_user",1,0,0,0
|
||||
"access_project_project_crm_user","project.project crm user","project.model_project_project","crm.group_crm_user",1,0,0,0
|
||||
|
||||
|
@@ -40,7 +40,7 @@
|
||||
|
||||
Different reports are also provided, mainly for attendance statistics.
|
||||
""",
|
||||
"depends" : ["base", "process"],
|
||||
"depends" : ["base", "crm_configuration", "process"],
|
||||
"init_xml" : [],
|
||||
"demo_xml" : [
|
||||
"hr_demo.xml",
|
||||
@@ -52,6 +52,7 @@
|
||||
"hr_view.xml",
|
||||
"hr_wizard.xml",
|
||||
"hr_department_view.xml",
|
||||
"process/hr_process.xml"
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!--
|
||||
Process
|
||||
-->
|
||||
|
||||
<record id="process_process_employeecontractworkflow0" model="process.process">
|
||||
<field eval=""""Employee Contract flow for services companies."""" name="note"/>
|
||||
<field eval="1" name="active"/>
|
||||
<field eval=""""Employee Contract Workflow"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Node
|
||||
-->
|
||||
|
||||
<record id="process_node_jobshiring0" model="process.node">
|
||||
<field name="menu_id" ref="crm_configuration.menu_crm_case_categ0_act11"/>
|
||||
<field name="model_id" ref="crm.model_crm_case"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Jobs hiring"""" name="name"/>
|
||||
<field eval=""""Jobs hiring to new employees"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_employeecontractworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'open', 'pending', 'done', 'cancel')"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_employee0" model="process.node">
|
||||
<field name="menu_id" ref="hr.menu_open_view_employee_list"/>
|
||||
<field name="model_id" ref="hr.model_hr_employee"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Employee"""" name="name"/>
|
||||
<field eval=""""Employee Complete Form"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_employeecontractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_employeecontact0" model="process.node">
|
||||
<field name="menu_id" ref="hr.menu_open_view_employee_list"/>
|
||||
<field name="model_id" ref="hr.model_hr_employee"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Employee Contact"""" name="name"/>
|
||||
<field eval=""""Fill up employee's contact information"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_employeecontractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_openerpuser0" model="process.node">
|
||||
<field name="menu_id" ref="base.menu_users"/>
|
||||
<field name="model_id" ref="base.model_res_users"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Openerp user"""" name="name"/>
|
||||
<field eval=""""Create OpenERP User"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_employeecontractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="process_transition_employeejob0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Employee Job"""" name="name"/>
|
||||
<field eval=""""After confirming job, he will be a employee"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_employee0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_jobshiring0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_contactofemployee0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Contact of employee"""" name="name"/>
|
||||
<field eval=""""Fill up contact information"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_employeecontact0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_employee0"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,3 +1,3 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","base.group_user",1,1,1,1
|
||||
"access_hr_attendance_employee","hr attendance employee","model_hr_attendance","base.group_user",1,1,1,1
|
||||
"access_hr_action_reason_employee","hr action reason employee","model_hr_action_reason","hr.group_hr_user",1,1,1,1
|
||||
"access_hr_attendance_employee","hr attendance employee","model_hr_attendance","hr.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
"access_hr_contract_wage_type_user","hr.contract.wage.type user","model_hr_contract_wage_type","hr.group_hr_user",1,0,0,0
|
||||
"access_hr_contract_wage_type","hr.contract.wage.type","model_hr_contract_wage_type","hr.group_hr_manager",1,1,1,1
|
||||
"access_hr_contract_wage_type_contract","hr.contract.wage.type contract","model_hr_contract_wage_type","group_hr_contract",1,1,1,1
|
||||
"access_hr_contract_wage_type_period_contract","hr.contract.wage.type.period contract","model_hr_contract_wage_type_period","group_hr_contract",1,1,1,1
|
||||
"access_hr_contract_user","hr.contract user","model_hr_contract","hr.group_hr_user",1,0,0,0
|
||||
"access_hr_contract","hr.contract","model_hr_contract","group_hr_contract",1,1,1,1
|
||||
"access_hr_employee_contract","hr.employee contract","hr.model_hr_employee","group_hr_contract",1,0,0,0
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_hr_expense_expense,hr.expense.expense,model_hr_expense_expense,base.group_user,1,1,1,1
|
||||
access_hr_expense_line,hr.expense.line,model_hr_expense_line,base.group_user,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_expense_expense","hr.expense.expense","model_hr_expense_expense","hr.group_hr_user",1,1,1,1
|
||||
"access_hr_expense_line","hr.expense.line","model_hr_expense_line","hr.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
"hr_view.xml",
|
||||
"hr_holidays_report.xml",
|
||||
"hr_holidays_wizard.xml",
|
||||
# "process/hr_holidays_process.xml"
|
||||
"process/hr_holidays_process.xml"
|
||||
],
|
||||
# "demo_xml" : ["hr_bel_holidays_2008.xml",],
|
||||
"demo_xml" : [],
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="process_node_secretariatsocial0" model="process.node">
|
||||
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays"/>
|
||||
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Secretariat Social"""" name="name"/>
|
||||
<field eval=""""Secretariat social"""" name="note"/>
|
||||
<field name="process_id" ref="hr.process_process_employeecontractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_node_holidays0" model="process.node">
|
||||
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays"/>
|
||||
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Holidays"""" name="name"/>
|
||||
<field eval=""""Employee Get holidays"""" name="note"/>
|
||||
<field name="process_id" ref="hr.process_process_employeecontractworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'validate', 'confirm', 'refuse', 'cancel')"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_employeesocial0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Employee Social"""" name="name"/>
|
||||
<field eval=""""Social Activity"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_secretariatsocial0"/>
|
||||
<field model="process.node" name="source_node_id" ref="hr.process_node_employee0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_employeeholidays0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Employee Holidays"""" name="name"/>
|
||||
<field eval=""""Employee get holidays"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_holidays0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_secretariatsocial0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,4 +1,4 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_holidays_per_user","hr.holidays.per.user","model_hr_holidays_per_user","base.group_user",1,1,1,1
|
||||
"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","base.group_user",1,1,1,1
|
||||
"access_hr_holidays_user","hr holidays user","model_hr_holidays","base.group_user",1,1,1,1
|
||||
"access_hr_holidays_per_user","hr.holidays.per.user","model_hr_holidays_per_user","hr.group_hr_user",1,1,1,1
|
||||
"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","hr.group_hr_user",1,1,1,1
|
||||
"access_hr_holidays_user","hr holidays user","model_hr_holidays","hr.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_hr_timesheet_invoice_factor,hr_timesheet_invoice.factor,model_hr_timesheet_invoice_factor,base.group_user,1,0,0,0
|
||||
access_hr_timesheet_invoice_factor,hr_timesheet_invoice.factor,model_hr_timesheet_invoice_factor,account.group_account_invoice,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_timesheet_invoice_factor","hr_timesheet_invoice.factor","model_hr_timesheet_invoice_factor","hr.group_hr_user",1,0,0,0
|
||||
"access_hr_timesheet_invoice_factor","hr_timesheet_invoice.factor","model_hr_timesheet_invoice_factor","account.group_account_invoice",1,1,1,1
|
||||
|
||||
|
@@ -108,15 +108,7 @@ class final_invoice_create(wizard.interface):
|
||||
price = 0.0
|
||||
|
||||
taxes = product.taxes_id
|
||||
taxep = account.partner_id.property_account_position and account.partner_id.property_account_position.account_tax
|
||||
if not taxep.id:
|
||||
tax = [x.id for x in taxes or []]
|
||||
else:
|
||||
tax = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
tax.append(t.id)
|
||||
|
||||
tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
|
||||
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
|
||||
|
||||
curr_line = {
|
||||
@@ -165,15 +157,8 @@ class final_invoice_create(wizard.interface):
|
||||
taxes = product.taxes_id
|
||||
else:
|
||||
taxes = []
|
||||
taxep = account.partner_id.property_account_position and account.partner_id.property_account_position.account_tax
|
||||
if not taxep.id:
|
||||
tax = [x.id for x in taxes or []]
|
||||
else:
|
||||
tax = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
tax.append(t.id)
|
||||
|
||||
tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
|
||||
curr_line = {
|
||||
'price_unit': -amount,
|
||||
'quantity': 1.0,
|
||||
@@ -194,15 +179,7 @@ class final_invoice_create(wizard.interface):
|
||||
product = pool.get('product.product').browse(cr, uid, data['form']['balance_product'], context2)
|
||||
|
||||
taxes = product.taxes_id
|
||||
taxep = account.partner_id.property_account_position and account.partner_id.property_account_position.account_tax
|
||||
if not taxep.id:
|
||||
tax = [x.id for x in taxes or []]
|
||||
else:
|
||||
tax = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
tax.append(t.id)
|
||||
|
||||
tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
|
||||
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
|
||||
|
||||
curr_line = {
|
||||
|
||||
@@ -113,15 +113,7 @@ class invoice_create(wizard.interface):
|
||||
price = 0.0
|
||||
|
||||
taxes = product.taxes_id
|
||||
taxep = account.partner_id.property_account_position and account.partner_id.property_account_position.account_tax
|
||||
if not taxep.id:
|
||||
tax = [x.id for x in taxes or []]
|
||||
else:
|
||||
tax = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
tax.append(t.id)
|
||||
|
||||
tax = self.pool.get('account.fiscal.position').map_tax(cr, uid, account.partner_id, taxes)
|
||||
account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id
|
||||
|
||||
curr_line = {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"website" : "http://tinyerp.com/module_hr.html",
|
||||
"depends" : ["project", "hr_timesheet_sheet"],
|
||||
"update_xml" : ["hr_timesheet_project_view.xml",
|
||||
# "process/hr_timesheet_project_process.xml",
|
||||
"process/hr_timesheet_project_process.xml",
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<field eval=""""Task encoding"""" name="name"/>
|
||||
<field eval=""""Encode how much time u spent on your task"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="hr_timesheet_sheet.process_node_timesheetline0"/>
|
||||
<field model="process.node" name="source_node_id" ref="project.process_node_taskwork0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_taskwork0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_tasktimesheet0" model="process.transition">
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
<field eval=""""Timesheet"""" name="name"/>
|
||||
<field eval=""""Defines the task work entry into timesheet line"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_hrtimesheetworkflow0"/>
|
||||
<field name="subflow_id" ref="hr_timesheet.process_process_timesheetworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -140,6 +141,14 @@
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="res_roles_hr0" model="res.roles">
|
||||
<field eval=""""HR"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_timesheet_sheet.t1" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_hr0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_attendance0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
@@ -166,6 +175,7 @@
|
||||
<field eval=""""timesheet is confirmed at the end of the week / month"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_confirmedtimesheet0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_drafttimesheetsheet0"/>
|
||||
<field eval="[(6,0,[ref('hr_timesheet_sheet.t1')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_validatetimesheet0" model="process.transition">
|
||||
@@ -222,5 +232,38 @@
|
||||
<field model="process.node" name="source_node_id" ref="process_node_review0"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_draftconfirmtimesheet0" model="process.transition.action">
|
||||
<field eval=""""button_confirm"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmtimesheet0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_validatetimesheet0" model="process.transition.action">
|
||||
<field eval=""""write({'state':'done'})"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Validate"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_validatetimesheet0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_refusetimesheet0" model="process.transition.action">
|
||||
<field eval=""""write({'state':'draft'})"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Refuse"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_validatetimesheet0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_reviewtimesheet0" model="process.transition.action">
|
||||
<field eval=""""button_confirm"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Review"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmtimesheetsheet0"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,4 +1,4 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_hr_timesheet_sheet_sheet,hr_timesheet_sheet.sheet,model_hr_timesheet_sheet_sheet,base.group_user,1,1,1,1
|
||||
access_hr_timesheet_sheet_sheet_day,hr_timesheet_sheet.sheet.day,model_hr_timesheet_sheet_sheet_day,base.group_user,1,1,1,1
|
||||
access_hr_timesheet_sheet_sheet_account,hr_timesheet_sheet.sheet.account,model_hr_timesheet_sheet_sheet_account,base.group_user,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_timesheet_sheet_sheet","hr_timesheet_sheet.sheet","model_hr_timesheet_sheet_sheet","hr.group_hr_user",1,1,1,1
|
||||
"access_hr_timesheet_sheet_sheet_day","hr_timesheet_sheet.sheet.day","model_hr_timesheet_sheet_sheet_day","hr.group_hr_user",1,1,1,1
|
||||
"access_hr_timesheet_sheet_sheet_account","hr_timesheet_sheet.sheet.account","model_hr_timesheet_sheet_sheet_account","hr.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -59,7 +59,6 @@
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Chart template of l10n_be -->
|
||||
<!-- Account template definition -->
|
||||
<record id="a_root" model="account.account.template">
|
||||
@@ -6434,7 +6433,7 @@
|
||||
|
||||
<!-- Tax Code Configuration -->
|
||||
<record id="vat_code_chart_root" model="account.tax.code.template">
|
||||
<field name="name">Plan de Taxe Belge</field>
|
||||
<field name="name">Plan de Taxes Belge</field>
|
||||
</record>
|
||||
<record id="vat_code_op_base" model="account.tax.code.template">
|
||||
<field name="name">I. Valeur des operations</field>
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
|
||||
<menuitem action="wizard_chart_report" id="menu_fr_chart_report" parent="account.menu_finance_reporting" type="wizard"/>
|
||||
|
||||
<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>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,9 +12,11 @@ This module install:
|
||||
*the main taxes used in Luxembourg""",
|
||||
"depends" : ["account","account_report","base_vat","base_iban"],
|
||||
"init_xml" : [ ],
|
||||
"demo_xml" : [ "account.report.report.csv" ],
|
||||
"demo_xml" : ["account.report.report.csv"],
|
||||
"update_xml" : [
|
||||
"account.tax.code.template.csv",
|
||||
"l10n_lu_data.xml",
|
||||
"account.tax.template.csv",
|
||||
"l10n_lu_wizard.xml",
|
||||
"l10n_lu_report.xml",
|
||||
],
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
"parent_id:id","code","sign","id","name"
|
||||
,,1,"account_tax_code_template_1","Plan de Taxes Luxembourgeois"
|
||||
"account_tax_code_template_1",76,1,"account_tax_code_template_73","Solde à verser"
|
||||
"account_tax_code_template_1",10,-1,"account_tax_code_template_8","Prestations de services (art 26)"
|
||||
"account_tax_code_template_1",46,1,"account_tax_code_template_37","Total Base intracommunautaire"
|
||||
"account_tax_code_template_1",52,1,"account_tax_code_template_50","Acquisition triangulaire"
|
||||
"account_tax_code_template_1",61,1,"account_tax_code_template_63","Total Base Importation"
|
||||
"account_tax_code_template_1",74,1,"account_tax_code_template_71","Excédent de taxe"
|
||||
"account_tax_code_template_1",9,1,"account_tax_code_template_2","Total du chiffre d'affaires"
|
||||
"account_tax_code_template_2",5,1,"account_tax_code_template_5","Prélèvements privés de services (art 16)"
|
||||
"account_tax_code_template_2",4,1,"account_tax_code_template_4","Prélèvements privés de biens (art 13 a)"
|
||||
"account_tax_code_template_2",8,1,"account_tax_code_template_7","Point 5"
|
||||
"account_tax_code_template_2",3,1,"account_tax_code_template_3","1. Ventes ou recettes"
|
||||
"account_tax_code_template_2",6,1,"account_tax_code_template_6","Affectation de biens (art 13 b)"
|
||||
"account_tax_code_template_3","Exo",1,"account_tax_code_template_90","Total Exoneration"
|
||||
"account_tax_code_template_3",22,1,"account_tax_code_template_17","Chiffre d'affaires imposable (sans TVA)"
|
||||
"account_tax_code_template_8",422,1,"account_tax_code_template_87","Base des prestations de services (art.26/1/c et d)"
|
||||
"account_tax_code_template_8",92,1,"account_tax_code_template_78","Livraisons de biens (art. 26) 6%"
|
||||
"account_tax_code_template_17",33,1,"account_tax_code_template_28","Base CA 6%"
|
||||
"account_tax_code_template_17",32,1,"account_tax_code_template_27","Base CA 15%"
|
||||
"account_tax_code_template_17",82,1,"account_tax_code_template_31","Base CA au taux indéfini"
|
||||
"account_tax_code_template_17",35,1,"account_tax_code_template_30","Base CA 12%"
|
||||
"account_tax_code_template_17",34,1,"account_tax_code_template_29","Base CA 3%"
|
||||
"account_tax_code_template_37",44,1,"account_tax_code_template_40","Base intracom. 3%"
|
||||
"account_tax_code_template_37",85,1,"account_tax_code_template_42","Base intracom. exonérée"
|
||||
"account_tax_code_template_37",43,1,"account_tax_code_template_39","Base intracom. 6%"
|
||||
"account_tax_code_template_37",42,1,"account_tax_code_template_38","Base intracom. 15%"
|
||||
"account_tax_code_template_37",45,1,"account_tax_code_template_41","Base intracom. 12%"
|
||||
"account_tax_code_template_73",97,1,"account_tax_code_template_82","Taxe livraisons de biens (art. 26) 6%"
|
||||
"account_tax_code_template_90",19,1,"account_tax_code_template_16","Point 7"
|
||||
"account_tax_code_template_90",17,1,"account_tax_code_template_15","Autres opérations réalisées à l'étranger"
|
||||
"account_tax_code_template_90",13,1,"account_tax_code_template_11","Autres exonérations (art 43)"
|
||||
"account_tax_code_template_90",14,1,"account_tax_code_template_12","Autres exonérations (art 44)"
|
||||
"account_tax_code_template_90",11,1,"account_tax_code_template_9","Livraisons intracommunautaires de biens"
|
||||
"account_tax_code_template_90",12,1,"account_tax_code_template_10","Exportations (art 43)"
|
||||
"account_tax_code_template_90",15,1,"account_tax_code_template_13","Tabacs fabriqués"
|
||||
"account_tax_code_template_90",16,1,"account_tax_code_template_14","Livraisons / aquisitions intracom."
|
||||
"account_tax_code_template_71",73,-1,"account_tax_code_template_70","Taxe en amont déductible"
|
||||
"account_tax_code_template_71",98,1,"account_tax_code_template_83","Total de la taxe à payer"
|
||||
"account_tax_code_template_83",72,1,"account_tax_code_template_69","Total de la taxe"
|
||||
"account_tax_code_template_70",31,1,"account_tax_code_template_26","Taxe en amont déductible"
|
||||
"account_tax_code_template_26",27,1,"account_tax_code_template_22","Taxe déclarée comme débiteur"
|
||||
"account_tax_code_template_26",28,1,"account_tax_code_template_23","Taxe acquittée comme caution solidaire"
|
||||
"account_tax_code_template_26",29,-1,"account_tax_code_template_24","Taxe non déductible / op. exonérée"
|
||||
"account_tax_code_template_26",30,-1,"account_tax_code_template_25","Taxe non déductible (art 50)"
|
||||
"account_tax_code_template_26",23,1,"account_tax_code_template_18","Achat de B. et S. à l'intérieur du pays"
|
||||
"account_tax_code_template_26",24,1,"account_tax_code_template_19","Acquisitions intracom. de biens"
|
||||
"account_tax_code_template_26",26,1,"account_tax_code_template_21","Affectations de biens"
|
||||
"account_tax_code_template_26",25,1,"account_tax_code_template_20","Importations de biens"
|
||||
"account_tax_code_template_69",70,1,"account_tax_code_template_59","Total Taxe Importation (entr.)"
|
||||
"account_tax_code_template_69",219,1,"account_tax_code_template_88","Taxe des prestations de services (art.26/1/c et d)"
|
||||
"account_tax_code_template_69",87,1,"account_tax_code_template_44","Report"
|
||||
"account_tax_code_template_44",86,1,"account_tax_code_template_43","A reporter"
|
||||
"account_tax_code_template_43",51,1,"account_tax_code_template_49","Total Taxe intracom."
|
||||
"account_tax_code_template_49",47,1,"account_tax_code_template_45","Taxe intracom. 15%"
|
||||
"account_tax_code_template_49",81,1,"account_tax_code_template_53","Base à un taux exonéré"
|
||||
"account_tax_code_template_49",59,1,"account_tax_code_template_62","Base Importation (privées) 3%"
|
||||
"account_tax_code_template_49",50,1,"account_tax_code_template_48","Taxe intracom. 12%"
|
||||
"account_tax_code_template_49",48,1,"account_tax_code_template_46","taxe intracom. 6%"
|
||||
"account_tax_code_template_49",49,1,"account_tax_code_template_47","Taxe intracom. 3%"
|
||||
"account_tax_code_template_49",65,1,"account_tax_code_template_58","Taxe Importation (entr.) 12%"
|
||||
"account_tax_code_template_69",71,1,"account_tax_code_template_68","Total Taxe Importation (privées)"
|
||||
"account_tax_code_template_58",63,1,"account_tax_code_template_84","Taxe importation (entr.) 6%"
|
||||
"account_tax_code_template_58",64,1,"account_tax_code_template_57","Taxe Importation (entr.) 3%"
|
||||
"account_tax_code_template_58",62,1,"account_tax_code_template_56","Taxe Importation (entr.) 15%"
|
||||
"account_tax_code_template_63",58,1,"account_tax_code_template_61","Base Importation (privées) 6%"
|
||||
"account_tax_code_template_63",54,1,"account_tax_code_template_52","Base Importation (entr.) 6%"
|
||||
"account_tax_code_template_63",57,1,"account_tax_code_template_60","Base Importation (privées) 15%"
|
||||
"account_tax_code_template_63",56,1,"account_tax_code_template_55","Base Importation (entr.) 12%"
|
||||
"account_tax_code_template_63",55,1,"account_tax_code_template_54","Base Importation (entr.) 3%"
|
||||
"account_tax_code_template_63",53,1,"account_tax_code_template_51","Base importation (entr.) 15%"
|
||||
"account_tax_code_template_63",60,1,"account_tax_code_template_85","Base importation (privées.) 12%"
|
||||
"account_tax_code_template_68",68,1,"account_tax_code_template_66","Taxe Importation (privées) 3%"
|
||||
"account_tax_code_template_68",69,1,"account_tax_code_template_67","Taxe Importation (privées) 12%"
|
||||
"account_tax_code_template_68",67,1,"account_tax_code_template_65","Taxe Importation (privées) 6%"
|
||||
"account_tax_code_template_68",66,1,"account_tax_code_template_64","Taxe Importation (privées) 15%"
|
||||
"account_tax_code_template_87",89,1,"account_tax_code_template_75","Prestations de services (art. 26) 6%"
|
||||
"account_tax_code_template_87",88,1,"account_tax_code_template_74","Prestations de services (art. 26) 15%"
|
||||
"account_tax_code_template_87",91,1,"account_tax_code_template_77","Prestations de services (art. 26) 12%"
|
||||
"account_tax_code_template_87",90,1,"account_tax_code_template_76","Prestations de services (art. 26) 3%"
|
||||
"account_tax_code_template_88",94,1,"account_tax_code_template_79","Taxe prestations de services (art. 26) 6%"
|
||||
"account_tax_code_template_88",93,1,"account_tax_code_template_86","Taxe prestation de services (Art.26) 15%"
|
||||
"account_tax_code_template_88",96,1,"account_tax_code_template_81","Taxe prestations de services (art. 26) 12%"
|
||||
"account_tax_code_template_88",95,1,"account_tax_code_template_80","Taxe prestations de services (art. 26) 3%"
|
||||
"account_tax_code_template_43",41,1,"account_tax_code_template_89",41
|
||||
"account_tax_code_template_89",40,1,"account_tax_code_template_35","Taxes CA 12%"
|
||||
"account_tax_code_template_89",83,1,"account_tax_code_template_36","Taxe au taux indéfini"
|
||||
"account_tax_code_template_89",39,1,"account_tax_code_template_34","Taxe CA 3%"
|
||||
"account_tax_code_template_89",37,1,"account_tax_code_template_32","Taxe CA 15%"
|
||||
"account_tax_code_template_89",38,1,"account_tax_code_template_33","Taxe CA 6%"
|
||||
|
@@ -0,0 +1,35 @@
|
||||
"ref_base_code_id:id","ref_base_sign","name","ref_tax_code_id:id","account_collected_id:id","amount","chart_template_id:id","tax_code_id:id","child_depend","include_base_amount","parent_id:id","tax_sign","account_paid_id:id","base_code_id:id","id","ref_tax_sign"
|
||||
"account_tax_code_template_9",-1,"Intra Travail à façon 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_1",1
|
||||
"account_tax_code_template_9",-1,"Intra Livraison avec installation 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_2",1
|
||||
"account_tax_code_template_9",-1,"Intra transfert de biens 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_3",1
|
||||
"account_tax_code_template_13",-1,"Vente de tabacs 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_13","account_tax_template_9",1
|
||||
"account_tax_code_template_10",-1,"Exportations 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_10","account_tax_template_10",1
|
||||
,1,"Achats frais généraux 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,,"account_tax_template_11",1
|
||||
"account_tax_code_template_29",-1,"Ventes 3%","account_tax_code_template_34","account_451000","0.0300","l10nlu_chart_template","account_tax_code_template_34",0,0,,1,"account_451000","account_tax_code_template_29","account_tax_template_5",-1
|
||||
"account_tax_code_template_28",-1,"Ventes 6%","account_tax_code_template_33","account_451000","0.0600","l10nlu_chart_template","account_tax_code_template_33",0,0,,1,"account_451000","account_tax_code_template_28","account_tax_template_6",-1
|
||||
"account_tax_code_template_30",-1,"Ventes 12%","account_tax_code_template_35","account_451000","0.1200","l10nlu_chart_template","account_tax_code_template_35",0,0,,1,"account_451000","account_tax_code_template_30","account_tax_template_7",-1
|
||||
"account_tax_code_template_27",-1,"Ventes 15%","account_tax_code_template_32","account_451000","0.1500","l10nlu_chart_template","account_tax_code_template_32",0,0,,1,"account_451000","account_tax_code_template_27","account_tax_template_8",-1
|
||||
,1,"Achats frais généraux 15%","account_tax_code_template_18","account_411000","0.1500","l10nlu_chart_template","account_tax_code_template_18",0,0,,1,"account_411000",,"account_tax_template_12",-1
|
||||
,1,"Achats Intra-Co",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_13",1
|
||||
,1,"Achats de Services Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_18",1
|
||||
,1,"Ventes de Services Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_21",1
|
||||
,1,"Livraison de Biens Triangulaire 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,,1,"account_411000","account_tax_code_template_38","account_tax_template_26",1
|
||||
,1,"Livraisons de biens triangulaire 2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,,-1,"account_451000",,"account_tax_template_25",1
|
||||
,1,"Importations a des fins de l'entreprise",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_30",1
|
||||
,1,"Importations a des fins privées",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_33",1
|
||||
,1,"Livraisons de Biens Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_36",1
|
||||
,1,"Livraison de Biens triangulaire",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_24",1
|
||||
,1,"Livraisons de biens triangulaire 2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_24",-1,"account_451000",,"account_tax_template_22",1
|
||||
,1,"Livraison de Biens Triangulaire 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_24",1,"account_411000","account_tax_code_template_38","account_tax_template_23",1
|
||||
,1,"Importations Intra-Co2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_56",0,0,"account_tax_template_30",-1,"account_411000","account_tax_code_template_51","account_tax_template_28",1
|
||||
,1,"Importations Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_30",1,"account_411000",,"account_tax_template_29",1
|
||||
,1,"Importations Fins Privées",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_64",0,0,"account_tax_template_33",-1,"account_411000","account_tax_code_template_60","account_tax_template_31",1
|
||||
,1,"Importations Fins Privées",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_33",1,"account_411000",,"account_tax_template_32",1
|
||||
,1,"Livraison de Biens Art26",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_36",-1,"account_451000",,"account_tax_template_34",1
|
||||
,1,"Livraisons de Biens Art26",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_82",0,0,"account_tax_template_36",1,"account_411000","account_tax_code_template_78","account_tax_template_35",1
|
||||
,1,"Achats Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_19",0,0,"account_tax_template_13",1,"account_411000","account_tax_code_template_38","account_tax_template_14",1
|
||||
,1,"Achats Intra-CO2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_13",-1,"account_411000",,"account_tax_template_15",1
|
||||
,1,"Services Intra-Co2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_18",-1,"account_411000",,"account_tax_template_17",1
|
||||
,1,"Services Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_18",1,"account_411000","account_tax_code_template_38","account_tax_template_16",1
|
||||
,1,"Services Intra-Co2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_21",-1,"account_451000",,"account_tax_template_19",1
|
||||
,1,"Services Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_86",0,0,"account_tax_template_21",1,"account_411000","account_tax_code_template_74","account_tax_template_20",1
|
||||
|
+32
-1021
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,6 @@
|
||||
menu="False"
|
||||
model="account.tax.code"
|
||||
name="l10n_lu.tax.report.print"
|
||||
string="Luxemburg VAT Declaration"/>
|
||||
string="Luxembourg VAT Declaration"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -13,7 +13,7 @@ This is the same wizard that runs from Financial Managament/Configuration/Financ
|
||||
<menuitem
|
||||
id="legal_lu"
|
||||
parent="account.menu_finance_legal_statement"
|
||||
name="Luxemburg"/>
|
||||
name="Luxembourg"/>
|
||||
|
||||
<wizard
|
||||
id="wizard_print_vat"
|
||||
@@ -21,7 +21,7 @@ This is the same wizard that runs from Financial Managament/Configuration/Financ
|
||||
model="account.tax.code"
|
||||
name="l10n_lu.tax.report.wizard" string="VAT Declaration"/>
|
||||
|
||||
<menuitem
|
||||
<menuitem
|
||||
id="legal_lu_vat"
|
||||
parent="legal_lu"
|
||||
type="wizard"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import lunch
|
||||
import wizard
|
||||
import report
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
{
|
||||
"name": "Lunch Module",
|
||||
"author": "Tiny",
|
||||
"version": "0.1",
|
||||
"depends": ["base", "process", "hr"],
|
||||
"init_xml": [],
|
||||
"update_xml": ['lunch_wizard.xml', 'lunch_view.xml', 'lunch_report.xml',
|
||||
'process/lunch_process.xml'
|
||||
],
|
||||
"demo_xml": ['lunch_demo.xml'],
|
||||
"installable": True,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
from osv import osv, fields
|
||||
import time
|
||||
|
||||
class lunch_category(osv.osv):
|
||||
_name = 'lunch.category'
|
||||
_description = "Category"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', required=True, size=50),
|
||||
}
|
||||
|
||||
_order = 'name'
|
||||
|
||||
lunch_category()
|
||||
|
||||
class lunch_product(osv.osv):
|
||||
_name = 'lunch.product'
|
||||
|
||||
def _category_name_get(self, cr, uid, context={}):
|
||||
obj = self.pool.get('lunch.category')
|
||||
cat_ids= obj.search(cr,uid,[])
|
||||
res = obj.read(cr,uid,cat_ids,['name', 'category'])
|
||||
return [(str(r['id']), r['name']) for r in res]+ [('0','')]
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=50, required=True),
|
||||
'category_id': fields.selection(_category_name_get, 'Category', size=32),
|
||||
'description': fields.char('Description', size=128, required=False),
|
||||
'price': fields.float('Price', digits=(16,2)),
|
||||
'active': fields.boolean('Active'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'active': lambda *a : True,
|
||||
}
|
||||
|
||||
lunch_product()
|
||||
|
||||
class lunch_cashbox(osv.osv):
|
||||
_name='lunch.cashbox'
|
||||
|
||||
def amount_available(self, cr, uid, ids, field_name, arg, context):
|
||||
cr.execute("SELECT box,sum(amount) from lunch_cashmove where active = 't' group by box")
|
||||
r = dict(cr.fetchall())
|
||||
for i in ids :
|
||||
r.setdefault(i,0)
|
||||
return r
|
||||
|
||||
_columns={
|
||||
'manager':fields.many2one('res.users','Manager'),
|
||||
'name':fields.char('Name',size=30,required=True, unique = True),
|
||||
'sum_remain': fields.function(amount_available, method=True, string='Remained Total'),
|
||||
}
|
||||
|
||||
lunch_cashbox()
|
||||
|
||||
|
||||
|
||||
|
||||
class lunch_cashmove(osv.osv):
|
||||
_name= 'lunch.cashmove'
|
||||
|
||||
_columns={
|
||||
'name': fields.char('Name',size=128),
|
||||
'user_cashmove': fields.many2one('res.users','User Name', required=True),
|
||||
'amount': fields.float('Amount', digits=(16,2)),
|
||||
'box':fields.many2one('lunch.cashbox','Box Name',size=30,required=True),
|
||||
'active':fields.boolean('Active'),
|
||||
'create_date': fields.datetime('Created date', readonly=True),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
'active': lambda *a: True,
|
||||
}
|
||||
|
||||
lunch_cashmove()
|
||||
|
||||
|
||||
|
||||
class lunch_order(osv.osv):
|
||||
_name='lunch.order'
|
||||
_rec_name= "user_id"
|
||||
|
||||
def _price_get(self, cr, uid, ids, name, args, context=None):
|
||||
res = {}
|
||||
for o in self.browse(cr, uid, ids):
|
||||
res[o.id] = o.product.price
|
||||
return res
|
||||
|
||||
_columns={
|
||||
'user_id': fields.many2one('res.users','User Name', required=True,
|
||||
readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'product':fields.many2one('lunch.product','Product', required=True,
|
||||
readonly=True, states={'draft':[('readonly',False)]}, change_default=True),
|
||||
'date': fields.date('Date',readonly=True,states={'draft':[('readonly',False)]}),
|
||||
'cashmove':fields.many2one('lunch.cashmove', 'CashMove' , readonly=True ),
|
||||
'descript':fields.char('Description Order', readonly=True, size=50,
|
||||
states={'draft':[('readonly',False)]}),
|
||||
'state': fields.selection([('draft','Draft'), ('confirmed','Confirmed'),],
|
||||
'State', readonly=True, select=True),
|
||||
'price': fields.function(_price_get, method=True, string="Price"),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
'user_id': lambda self,cr,uid,context: uid,
|
||||
'date': lambda self,cr,uid,context: time.strftime('%Y-%m-%d'),
|
||||
'state': lambda self,cr,uid,context: 'draft',
|
||||
}
|
||||
|
||||
def confirm(self,cr,uid,ids,box,context):
|
||||
cashmove_ref= self.pool.get('lunch.cashmove')
|
||||
for order in self.browse(cr,uid,ids):
|
||||
if order.state == 'confirmed':
|
||||
continue
|
||||
new_id= cashmove_ref.create(cr,uid,{'name': order.product.name+' order',
|
||||
'amount':-order.product.price,
|
||||
'user_cashmove':order.user_id.id,
|
||||
'box':box,
|
||||
'active':True,
|
||||
})
|
||||
self.write(cr,uid,[order.id],{'cashmove':new_id, 'state':'confirmed'})
|
||||
return {}
|
||||
|
||||
def lunch_order_cancel(self,cr,uid,ids,context):
|
||||
orders= self.browse(cr,uid,ids)
|
||||
for order in orders:
|
||||
if not order.cashmove:
|
||||
continue
|
||||
self.pool.get('lunch.cashmove').unlink(cr, uid, [order.cashmove.id])
|
||||
self.write(cr,uid,ids,{'state':'draft'})
|
||||
return {}
|
||||
|
||||
def onchange_product(self, cr, uid, ids, product):
|
||||
if not product:
|
||||
return {'value': {'price': 0.0}}
|
||||
price = self.pool.get('lunch.product').read(cr, uid, product, ['price'])['price']
|
||||
return {'value': {'price': price}}
|
||||
|
||||
lunch_order()
|
||||
|
||||
class report_lunch_amount(osv.osv):
|
||||
_name='report.lunch.amount'
|
||||
_description = "Amount available by user and box"
|
||||
_auto = False
|
||||
_rec_name= "user"
|
||||
|
||||
_columns = {
|
||||
'user_id': fields.many2one('res.users','User Name',readonly=True),
|
||||
'amount': fields.float('Amount', readonly=True, digits=(16,2)),
|
||||
'box':fields.many2one('lunch.cashbox','Box Name',size=30,readonly=True),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
cr.execute("""
|
||||
create or replace view report_lunch_amount as (
|
||||
select
|
||||
min(lc.id) as id,
|
||||
lc.user_cashmove as user_id,
|
||||
sum(amount) as amount,
|
||||
lc.box as box
|
||||
from
|
||||
lunch_cashmove lc
|
||||
where
|
||||
active = 't'
|
||||
group by lc.user_cashmove, lc.box
|
||||
)""")
|
||||
|
||||
report_lunch_amount()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0"?>
|
||||
<terp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record model="lunch.category" id="categ_sandwich">
|
||||
<field name="name">Sandwich</field>
|
||||
</record>
|
||||
|
||||
<record model="lunch.product" id="product_club">
|
||||
<field name="name">Club</field>
|
||||
<field name="category_id" eval="str(ref('categ_sandwich'))"/>
|
||||
<field name="price">2.75</field>
|
||||
</record>
|
||||
|
||||
<record model="lunch.cashbox" id="cashbox_cashbox">
|
||||
<field name="name">Cashbox</field>
|
||||
<field name="manager" ref="base.user_admin"/>
|
||||
</record>
|
||||
</data>
|
||||
</terp>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<terp>
|
||||
<data>
|
||||
<report
|
||||
id="report_lunch_order"
|
||||
string="Print Order"
|
||||
model="lunch.order"
|
||||
name="lunch.order"
|
||||
rml="lunch/report/order.rml"
|
||||
auto="False"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</terp>
|
||||
@@ -0,0 +1,232 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem name="Tools" id="menu_tools" icon="STOCK_PREFERENCES"/>
|
||||
<menuitem name="Lunch" parent="menu_tools" id="menu_lunch" />
|
||||
<menuitem name="Configuration" parent="menu_lunch" id="menu_lunch_category_root" sequence="1"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_order_form">
|
||||
<field name="name">Order</field>
|
||||
<field name="model">lunch.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Order">
|
||||
<group colspan="2" col="4">
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="product" select="1" on_change="onchange_product(product)"/>
|
||||
<field name="price"/>
|
||||
<field name="descript"/>
|
||||
<field name="cashmove"/>
|
||||
<field name="state" select="2"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_order_tree">
|
||||
<field name="name">Order</field>
|
||||
<field name="model">lunch.order</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Order">
|
||||
<field name="user_id"/>
|
||||
<field name="product"/>
|
||||
<field name="date"/>
|
||||
<field name="cashmove"/>
|
||||
<field name="state"/>
|
||||
<field name="descript"/>
|
||||
<field name="price" sum="Total price"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_order_form">
|
||||
<field name="name">Make order</field>
|
||||
<field name="res_model">lunch.order</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
</record>
|
||||
<menuitem name="Make order" parent="menu_lunch" id="menu_lunch_order_form" action="action_lunch_order_form"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_order_day_form">
|
||||
<field name="name"> Order of the day</field>
|
||||
<field name="res_model">lunch.order</field>
|
||||
<field name="domain">[('date','=',time.strftime('%Y-%m-%d'))]</field>
|
||||
|
||||
</record>
|
||||
<menuitem name="Order of the day" parent="menu_lunch_order_form" id="menu_lunch_order_day_form" action="action_lunch_order_day_form"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_cashbox_form">
|
||||
<field name="name">CashBox</field>
|
||||
<field name="model">lunch.cashbox</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="CashBox">
|
||||
<field name="name" select="1"/>
|
||||
<field name="manager" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_cashbox_tree">
|
||||
<field name="name">CashBox</field>
|
||||
<field name="model">lunch.cashbox</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="CashBox" colors="red:sum_remain<=0">
|
||||
<field name="name" select="1"/>
|
||||
<field name="manager" select="1"/>
|
||||
<field name="sum_remain" select="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_cashbox_form">
|
||||
<field name="name"> CashBox </field>
|
||||
<field name="res_model">lunch.cashbox</field>
|
||||
</record>
|
||||
<menuitem name="CashBox" parent="menu_lunch_category_root" id="menu_lunch_cashbox_form" action="action_lunch_cashbox_form"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_cashmove_form">
|
||||
<field name="name">CashMove</field>
|
||||
<field name="model">lunch.cashmove</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="CashMove">
|
||||
<field name="name" select="1"/>
|
||||
<field name="user_cashmove" select="1"/>
|
||||
<field name="amount" select="2"/>
|
||||
<field name="box" select="1"/>
|
||||
<field name="create_date" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_cashmove_tree">
|
||||
<field name="name">CashMove</field>
|
||||
<field name="model">lunch.cashmove</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="CashMove" editable="top">
|
||||
<field name="name" select="1" required="1"/>
|
||||
<field name="user_cashmove" select="1"/>
|
||||
<field name="amount" select="1" sum="Total amount"/>
|
||||
<field name="box" select="1"/>
|
||||
<field name="create_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_cashmove_form">
|
||||
<field name="name">CashMove</field>
|
||||
<field name="res_model">lunch.cashmove</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Cash Moves" parent="menu_lunch" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_category_form">
|
||||
<field name="name"> Category of product </field>
|
||||
<field name="model">lunch.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Category">
|
||||
<separator string="Category related to Products" colspan="4"/>
|
||||
<field name="name" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_category_tree">
|
||||
<field name="name">Category</field>
|
||||
<field name="model">lunch.category</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Order">
|
||||
<field name="name" select="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_category_form">
|
||||
<field name="name"> Category of product </field>
|
||||
<field name="res_model">lunch.category</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_product_form">
|
||||
<field name="name">Products</field>
|
||||
<field name="type">form</field>
|
||||
<field name="model">lunch.product</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Products">
|
||||
<field name="name" select="1"/>
|
||||
<field name="category_id" select="1"/>
|
||||
<field name="description" select="1"/>
|
||||
<field name="price" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_lunch_product_tree">
|
||||
<field name="name">Products</field>
|
||||
<field name="model">lunch.product</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Products">
|
||||
<field name="name" select="1"/>
|
||||
<field name="category_id" select="1"/>
|
||||
<field name="description" select="1"/>
|
||||
<field name="price" select="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_product_form">
|
||||
<field name="name">Product</field>
|
||||
<field name="res_model">lunch.product</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Tools/Lunch/Configuration/Products" id="menu_lunch_product_form" action="action_lunch_product_form" sequence="1"/>
|
||||
<menuitem name="Products" parent="menu_lunch_category_root" id="menu_lunch_product_form" action="action_lunch_product_form" sequence="1"/>
|
||||
<menuitem name="Category of product" parent="menu_lunch_product_form" id="menu_lunch_category_form" action="action_lunch_category_form" />
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_report_lunch_amount_tree">
|
||||
<field name="name">Lunch amount</field>
|
||||
<field name="model">report.lunch.amount</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Box Amount by User">
|
||||
<field name="box" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="amount" select="1" sum="Total box" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_report_lunch_amount_form">
|
||||
<field name="name">Lunch amount</field>
|
||||
<field name="model">report.lunch.amount</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Box Amount by User">
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="box" select="1"/>
|
||||
<field name="amount" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_report_lunch_amount_tree">
|
||||
<field name="name">Lunch amount</field>
|
||||
<field name="res_model">report.lunch.amount</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem name="Box Amount by User" parent="menu_lunch" action="action_report_lunch_amount_tree" id="menu_lunch_report_amount_tree"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" ?>
|
||||
<terp>
|
||||
<data>
|
||||
<wizard
|
||||
string="Confirm Order"
|
||||
model="lunch.order"
|
||||
name="lunch.order.confirm"
|
||||
keyword="client_action_multi"
|
||||
id="lunch_order_confirm"/>
|
||||
|
||||
<wizard
|
||||
string="Cancel Order"
|
||||
model="lunch.order"
|
||||
name="lunch.order.cancel"
|
||||
keyword="client_action_multi"
|
||||
id="wizard_id_cancel"/>
|
||||
|
||||
<wizard
|
||||
string="Set CashBox to Zero"
|
||||
model="lunch.cashbox"
|
||||
name="lunch.cashbox.clean"
|
||||
keyword="client_action_multi"
|
||||
id="wizard_clean_cashbox"/>
|
||||
</data>
|
||||
|
||||
|
||||
</terp>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="process_node_lunchbox0" model="process.node">
|
||||
<field name="menu_id" ref="lunch.menu_lunch_product_form"/>
|
||||
<field name="model_id" ref="lunch.model_lunch_product"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Lunchbox"""" name="name"/>
|
||||
<field eval=""""Employee get lunchbox if he wants lunch"""" name="note"/>
|
||||
<field name="process_id" ref="hr.process_process_employeecontractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_employeelunch0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Employee lunch"""" name="name"/>
|
||||
<field eval=""""Employee get lunch"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_lunchbox0"/>
|
||||
<field model="process.node" name="source_node_id" ref="hr.process_node_employee0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,4 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import order
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 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
|
||||
from report import report_sxw
|
||||
from osv import osv
|
||||
|
||||
|
||||
class order(report_sxw.rml_parse):
|
||||
|
||||
def sum_price(self, orders):
|
||||
res = 0.0
|
||||
for o in orders:
|
||||
res += o.price
|
||||
return res
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(order, self).__init__(cr, uid, name, context)
|
||||
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'sum_price': self.sum_price,
|
||||
})
|
||||
|
||||
report_sxw.report_sxw('report.lunch.order', 'lunch.order',
|
||||
'addons/lunch/report/order.rml',parser=order, header=False)
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0"?>
|
||||
<document filename="test.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="34.0" y1="42.0" width="527" height="758"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
<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="3,0" stop="3,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="GRID" colorName="black"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="P1" fontName="Times-Roman" fontSize="15.0" leading="19"/>
|
||||
<paraStyle name="P2" fontName="Times-Roman" fontSize="16.0" leading="20"/>
|
||||
<paraStyle name="P3" fontName="Times-Roman"/>
|
||||
<paraStyle name="P4" fontName="Times-Bold" fontSize="8.0" leading="10" alignment="CENTER"/>
|
||||
<paraStyle name="P5" fontName="Times-BoldItalic" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P6" fontName="Times-BoldItalic" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P7" fontName="Times-Italic" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P8" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P9" fontName="Times-Roman" fontSize="9.0" leading="11"/>
|
||||
<paraStyle name="P10" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P11" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<paraStyle name="P12" fontName="Times-BoldItalic" fontSize="6.0" leading="8"/>
|
||||
<paraStyle name="P13" fontName="Times-Italic" fontSize="9.0" leading="11" alignment="LEFT"/>
|
||||
<paraStyle name="P14" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT"/>
|
||||
<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="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Header" fontName="Times-Roman"/>
|
||||
<paraStyle name="Footer" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Contents" fontName="Times-Roman"/>
|
||||
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
|
||||
<paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Footnote" rightIndent="0.0" leftIndent="14.0" fontName="Times-Roman" fontSize="10.0" leading="13"/>
|
||||
<paraStyle name="Index" fontName="Times-Roman"/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P1">
|
||||
<font face="Times-Roman">Printed at : [[time.strftime("%Hh%M")]]</font>
|
||||
</para>
|
||||
<para style="P2">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="P3">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="149.0,135.0,103.0,140.0" repeatRows="1" style="Tableau2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P4">Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Order</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P4">Unit Price</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="P5">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</section>
|
||||
<blockTable colWidths="148.0,135.0,103.0,140.0" style="Tableau1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P7">[[repeatIn(objects, 'o') ]]</para>
|
||||
<para style="P7">[[ o.user_id.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P8">[[o.product.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">[[ o.descript ]]</para>
|
||||
<para style="P10">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P14">[['%.2f' % o.price ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P12">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="P11">[[ '%.2f' % sum_price(objects) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="P6">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import confirm
|
||||
import cancel
|
||||
import reset_box
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
import wizard
|
||||
import netsvc
|
||||
import ir
|
||||
import pooler
|
||||
|
||||
cancel_form = """<?xml version="1.0"?>
|
||||
<form string="Cancel Order">
|
||||
<label string="Are you sure you want to cancel this order ?"/>
|
||||
</form>"""
|
||||
|
||||
|
||||
cancel_fields = {
|
||||
}
|
||||
|
||||
def _cancel(self,cr,uid,data,context):
|
||||
return pooler.get_pool(cr.dbname).get('lunch.order').lunch_order_cancel(cr,uid,data['ids'],context)
|
||||
|
||||
class order_cancel(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type':'form', 'arch':cancel_form, 'fields':cancel_fields, 'state':[('end','No'),('cancel','Yes')]}
|
||||
},
|
||||
'cancel': {
|
||||
'actions': [_cancel],
|
||||
'result': {'type':'state', 'state':'end'}
|
||||
}
|
||||
}
|
||||
order_cancel('lunch.order.cancel')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# 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 wizard
|
||||
import netsvc
|
||||
import ir
|
||||
import pooler
|
||||
|
||||
confirm_order_form = """<?xml version="1.0"?>
|
||||
<form title="Confirm">
|
||||
<separator string="Orders Confirmation" colspan="4"/>
|
||||
<field name="confirm_cashbox"/>
|
||||
<newline/>
|
||||
</form>
|
||||
"""
|
||||
|
||||
confirm_order_fields = {
|
||||
'confirm_cashbox': {'string':'Name of box', 'type':'many2one', 'required':True, 'relation':'lunch.cashbox' },
|
||||
}
|
||||
|
||||
def _confirm(self,cr,uid,data,context):
|
||||
pool= pooler.get_pool(cr.dbname)
|
||||
order_ref = pool.get('lunch.order')
|
||||
order_ref.confirm(cr,uid,data['ids'],data['form']['confirm_cashbox'],context)
|
||||
return {}
|
||||
|
||||
class order_confirm(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'action':[],
|
||||
'result':{'type' : 'form', 'arch' : confirm_order_form, 'fields' : confirm_order_fields, 'state' : [('end', 'Cancel'),('go', 'Confirm Order') ]},
|
||||
},
|
||||
'go' : {
|
||||
'actions' : [_confirm],
|
||||
'result' : {'type' : 'state', 'state' : 'end'}
|
||||
},
|
||||
}
|
||||
order_confirm('lunch.order.confirm')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import wizard
|
||||
import netsvc
|
||||
import ir
|
||||
import pooler
|
||||
|
||||
set_to_zero_form = """<?xml version="1.0"?>
|
||||
<form string="Reset cashbox">
|
||||
<label string="Are you sure you want to reset this cashbox ?"/>
|
||||
</form>"""
|
||||
|
||||
|
||||
|
||||
confirm_setting_zero_fields = {}
|
||||
|
||||
def _set_to_zero(self,cr,uid,data,context):
|
||||
pool= pooler.get_pool(cr.dbname)
|
||||
cashmove_ref = pool.get('lunch.cashmove')
|
||||
cr.execute("select user_cashmove, box,sum(amount) from lunch_cashmove where active= 't' and box in (%s) group by user_cashmove, box"%','.join(map(str,data['ids'])))
|
||||
res= cr.fetchall()
|
||||
cr.execute("update lunch_cashmove set active = 'f' where active= 't' and box in (%s)"%','.join(map(str,data['ids'])))
|
||||
## to_unactive= {}.fromkeys([r[0] for r in cr.fetchall]).keys()
|
||||
## print to_unactive
|
||||
## cashmove_ref.write(cr,uid,to_unactive,{'active':False})
|
||||
##
|
||||
for (user_id,box_id,amount) in res:
|
||||
cashmove_ref.create(cr,uid,{'name': 'Summary for user'+ str(user_id),
|
||||
'amount': amount,
|
||||
'user_cashmove': user_id,
|
||||
'box': box_id,
|
||||
'active': True,
|
||||
})
|
||||
return {}
|
||||
|
||||
|
||||
class cashbox_set_to_zero(wizard.interface):
|
||||
|
||||
states = {
|
||||
|
||||
'init': {
|
||||
'action':[],
|
||||
'result':{'type' : 'form',
|
||||
'arch' : set_to_zero_form,
|
||||
'fields' : confirm_setting_zero_fields,
|
||||
'state' : [('end', 'Cancel'),('zero', 'Set to Zero') ]},
|
||||
|
||||
},
|
||||
'zero' : {
|
||||
'actions' : [_set_to_zero],
|
||||
'result' : {'type' : 'state', 'state' : 'end'}
|
||||
},
|
||||
}
|
||||
|
||||
cashbox_set_to_zero('lunch.cashbox.clean')
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_membership_membership_line_partner_manager","membership.membership_line partner_manager","model_membership_membership_line","base.group_partner_manager",1,1,1,1
|
||||
"access_membership_membership_line","membership.membership_line","model_membership_membership_line","base.group_user",1,0,0,0
|
||||
"access_membership_membership_line","membership.membership_line","model_membership_membership_line",,1,0,0,0
|
||||
"access_report_partner_member_year","report.partner_member.year","model_report_partner_member_year","base.group_partner_manager",1,0,0,0
|
||||
"access_report_partner_member_year_new","report.partner_member.year_new","model_report_partner_member_year_new","base.group_partner_manager",1,0,0,0
|
||||
|
||||
|
+3
-17
@@ -890,7 +890,7 @@ class mrp_procurement(osv.osv):
|
||||
return True
|
||||
return False
|
||||
|
||||
def action_confirm(self, cr, uid, ids):
|
||||
def action_confirm(self, cr, uid, ids, context={}):
|
||||
for procurement in self.browse(cr, uid, ids):
|
||||
if procurement.product_id.type in ('product', 'consu'):
|
||||
if not procurement.move_id:
|
||||
@@ -1000,25 +1000,11 @@ class mrp_procurement(osv.osv):
|
||||
'notes':product.description_purchase,
|
||||
}
|
||||
|
||||
taxes = self.pool.get('account.tax').browse(cr, uid,
|
||||
[x.id for x in procurement.product_id.product_tmpl_id.supplier_taxes_id])
|
||||
taxep = None
|
||||
if partner_id:
|
||||
taxep = partner.property_account_position and partner.property_account_position.account_supplier_tax
|
||||
if not taxep or not taxep.id:
|
||||
taxes_ids = [x.id for x in procurement.product_id.product_tmpl_id.supplier_taxes_id]
|
||||
else:
|
||||
res5 = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
res5.append(t.id)
|
||||
taxes_ids = res5
|
||||
|
||||
taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
|
||||
self.pool.get('account.fiscal.position').map_tax(cr, uid, partner, taxes)
|
||||
line.update({
|
||||
'taxes_id':[(6,0,taxes_ids)]
|
||||
})
|
||||
|
||||
|
||||
purchase_id = self.pool.get('purchase.order').create(cr, uid, {
|
||||
'origin': procurement.origin,
|
||||
'partner_id': partner_id,
|
||||
|
||||
+27
-14
@@ -27,9 +27,19 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem id="menu_mrp_configuration" name="Configuration" parent="menu_mrp_root"/>
|
||||
<menuitem id="menu_mrp_property_group_action_prop" name="Properties" parent="menu_mrp_configuration"/>
|
||||
<menuitem action="mrp_property_group_action" id="menu_mrp_property_group_action" parent="menu_mrp_property_group_action_prop"/>
|
||||
<menuitem
|
||||
id="menu_mrp_configuration"
|
||||
name="Configuration"
|
||||
parent="menu_mrp_root"/>
|
||||
<menuitem
|
||||
id="menu_mrp_property_group_action_prop"
|
||||
name="Properties"
|
||||
parent="menu_mrp_configuration"
|
||||
groups="base.group_extended"/>
|
||||
<menuitem
|
||||
action="mrp_property_group_action"
|
||||
id="menu_mrp_property_group_action"
|
||||
parent="menu_mrp_property_group_action_prop"/>
|
||||
|
||||
<record id="mrp_property_tree_view" model="ir.ui.view">
|
||||
<field name="name">mrp.property.tree</field>
|
||||
@@ -65,7 +75,10 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="mrp_property_action" id="menu_mrp_property_action" parent="menu_mrp_property_group_action_prop"/>
|
||||
<menuitem
|
||||
action="mrp_property_action"
|
||||
id="menu_mrp_property_action"
|
||||
parent="menu_mrp_property_group_action_prop"/>
|
||||
|
||||
<!--
|
||||
Workcenters
|
||||
@@ -216,20 +229,20 @@
|
||||
<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"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<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"/>
|
||||
<field name="routing_id" select="2" groups="base.group_extended"/>
|
||||
<field name="type" groups="base.group_extended"/>
|
||||
<notebook colspan="4">
|
||||
<page string="General Information">
|
||||
<field colspan="4" name="bom_lines" nolabel="1" widget="one2many_list"/>
|
||||
</page>
|
||||
<page string="Revisions">
|
||||
<page string="Revisions" groups="base.group_extended">
|
||||
<field colspan="4" name="revision_ids" nolabel="1" widget="one2many_list"/>
|
||||
</page>
|
||||
<page string="Properties">
|
||||
@@ -242,7 +255,7 @@
|
||||
<field name="date_stop" select="2"/>
|
||||
<field name="product_rounding"/>
|
||||
<field name="product_efficiency"/>
|
||||
<field colspan="4" name="property_ids" nolabel="2"/>
|
||||
<field colspan="4" name="property_ids" nolabel="2" groups="base.group_extended"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
@@ -404,7 +417,7 @@
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="date_planned" select="1"/>
|
||||
<field name="priority"/>
|
||||
<field name="priority" groups="base.group_extended"/>
|
||||
<field name="product_id" on_change="product_id_change(product_id)" select="1"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="product_uom"/>
|
||||
@@ -656,12 +669,12 @@
|
||||
<page string="Extra Information">
|
||||
<separator colspan="4" string="Details"/>
|
||||
<field name="bom_id" select="2"/>
|
||||
<field name="move_id"/>
|
||||
<field name="move_id" groups="base.group_extended"/>
|
||||
<field name="date_close" select="2"/>
|
||||
<field name="close_move"/>
|
||||
<field name="close_move" groups="base.group_extended"/>
|
||||
<field name="purchase_id"/>
|
||||
<separator colspan="4" string="Properties"/>
|
||||
<field colspan="4" name="property_ids" nolabel="1"/>
|
||||
<field colspan="4" name="property_ids" nolabel="1" groups="base.group_extended"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
@@ -13,7 +12,7 @@
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Node
|
||||
Process Node
|
||||
-->
|
||||
|
||||
<record id="process_node_minimumstockrule0" model="process.node">
|
||||
@@ -43,6 +42,7 @@
|
||||
<field eval=""""Procurements"""" name="name"/>
|
||||
<field eval=""""Procurement Orders"""" name="note"/>
|
||||
<field name="process_id" ref="purchase.process_process_purchaseworkflow0"/>
|
||||
<field name="subflow_id" ref="process_process_procurementworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting') """" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
@@ -54,6 +54,7 @@
|
||||
<field eval=""""Production order"""" name="name"/>
|
||||
<field eval=""""Procurement for raw materials"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_procurementworkflow0"/>
|
||||
<field name="subflow_id" ref="process_process_procurementworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'picking_except', 'confirmed', 'ready', 'in_production', 'cancel', 'done')"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
@@ -109,6 +110,7 @@
|
||||
<field eval=""""Subcontracting"""" name="name"/>
|
||||
<field eval=""""Procure method is purchase"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_procurementworkflow0"/>
|
||||
<field name="subflow_id" ref="purchase.process_process_purchaseworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -128,7 +130,7 @@
|
||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Stockable make to stock"""" name="name"/>
|
||||
<field eval=""""Stockable stock"""" name="name"/>
|
||||
<field eval=""""Wait for available products for reservation"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_procurementworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting') """" name="model_states"/>
|
||||
@@ -139,7 +141,7 @@
|
||||
<field name="menu_id" ref="mrp.menu_mrp_procurement_action"/>
|
||||
<field name="model_id" ref="mrp.model_mrp_procurement"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Stockable make to order"""" name="name"/>
|
||||
<field eval=""""Stockable order"""" name="name"/>
|
||||
<field eval=""""If Procurement is make to order"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_procurementworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting') """" name="model_states"/>
|
||||
@@ -153,6 +155,7 @@
|
||||
<field eval=""""Stockable request"""" name="name"/>
|
||||
<field eval=""""If procure method is purchase"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_procurementworkflow0"/>
|
||||
<field name="subflow_id" ref="purchase.process_process_purchaseworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -161,16 +164,25 @@
|
||||
<field name="menu_id" ref="mrp.menu_mrp_production_action"/>
|
||||
<field name="model_id" ref="mrp.model_mrp_production"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Stockable production"""" name="name"/>
|
||||
<field eval=""""Stock produce"""" name="name"/>
|
||||
<field eval=""""If procure method is produce"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_procurementworkflow0"/>
|
||||
<field name="subflow_id" ref="process_process_procurementworkflow0"/>
|
||||
<field eval=""""object.state=='confirmed'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="res_roles_mrp0" model="res.roles">
|
||||
<field eval=""""Mrp"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp.trans_draft_confirm" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_mrp0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_productionprocurement0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
@@ -215,6 +227,7 @@
|
||||
<field eval=""""If procure method is Make to order and supply method is buy"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_subcontracting0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_maketoorder0"/>
|
||||
<field eval="[(6,0,[ref('mrp.trans_draft_confirm')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_procurementstockable0" model="process.transition">
|
||||
@@ -251,6 +264,7 @@
|
||||
<field eval=""""If Procure method is Make to order and supply method is buy"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_stockablerequest0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_stockablemaketoorder0"/>
|
||||
<field eval="[(6,0,[ref('mrp.trans_draft_confirm')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_stockableorderproduction0" model="process.transition">
|
||||
@@ -260,6 +274,7 @@
|
||||
<field eval=""""If Procure method is Make to order and supply method is produce"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_stockableproduction0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_stockablemaketoorder0"/>
|
||||
<field eval="[(6,0,[ref('mrp.trans_draft_confirm')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_procurementtopurchase0" model="process.transition">
|
||||
@@ -298,5 +313,97 @@
|
||||
<field model="process.node" name="source_node_id" ref="process_node_billofmaterial0"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Condition
|
||||
-->
|
||||
|
||||
<record id="process_condition_serviceprocure0" model="process.condition">
|
||||
<field name="model_id" ref="model_mrp_procurement"/>
|
||||
<field name="node_id" ref="process_node_serviceproduct0"/>
|
||||
<field eval=""""object.product_id.type=='service'"""" name="model_states"/>
|
||||
<field eval=""""Condition_service_procure"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="process_condition_stockableprocure0" model="process.condition">
|
||||
<field name="model_id" ref="model_mrp_procurement"/>
|
||||
<field name="node_id" ref="process_node_stockableproduct0"/>
|
||||
<field eval=""""object.product_id.type=='product'"""" name="model_states"/>
|
||||
<field eval=""""Condition_stockable_procure"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_procurementpurchaseorder0" model="process.transition.action">
|
||||
<field eval=""""action_po_assign"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Purchase"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_procurementtopurchase0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_orderconfirmsubcontracting0" model="process.transition.action">
|
||||
<field eval=""""action_confirm"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_ordersubcontracting0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_ordercancelsubcontracting0" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_ordersubcontracting0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_runprocurement0" model="process.transition.action">
|
||||
<field eval=""""write({'state':'exception'})"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Run Procurement"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_ordersubcontracting0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_stockableconfirmrequest0" model="process.transition.action">
|
||||
<field eval=""""action_confirm"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_stockableorderrequest0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_stockablecancelrequest0" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_stockableorderrequest0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_requestrunprocurement0" model="process.transition.action">
|
||||
<field eval=""""write({'state':'exception'})"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Run Procurement"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_stockableorderrequest0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_stockableconfirmproduction0" model="process.transition.action">
|
||||
<field eval=""""action_confirm"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_stockableorderproduction0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_stockablecancelproduction0" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_stockableorderproduction0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_productionrunprocurement0" model="process.transition.action">
|
||||
<field eval=""""write({'state':'exception'})"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Run Procurement"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_stockableorderproduction0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import partner
|
||||
import wizard
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
{
|
||||
"name" : "Partner extension to synchronize TinyERP with ldap",
|
||||
"version" : "1.0",
|
||||
"author" : "Tiny",
|
||||
"depends" : ["base", "hr", "process"],
|
||||
"category" : "Generic Modules/Inventory Control",
|
||||
"description": "Synchronise partners through a LDAP module. Has been used to synchronise partners in Outlook and Tiny ERP.",
|
||||
"init_xml" : [],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : ["wizard.xml",
|
||||
"process/partner_ldap_process.xml"
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2006 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.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
|
||||
class address_ldap(osv.osv):
|
||||
_inherit = 'res.partner.address'
|
||||
|
||||
_columns = {
|
||||
'dn' : fields.char('Distinguished name', size=128),
|
||||
}
|
||||
|
||||
address_ldap()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="process_node_ldap0" model="process.node">
|
||||
<field name="model_id" ref="base.model_res_partner_address"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""LDAP"""" name="name"/>
|
||||
<field eval=""""LDAP (all services)"""" name="note"/>
|
||||
<field name="process_id" ref="hr.process_process_employeecontractworkflow0"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_employeeldap0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Employee LDAP"""" name="name"/>
|
||||
<field eval=""""Employee get all services of that company"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_ldap0"/>
|
||||
<field model="process.node" name="source_node_id" ref="hr.process_node_employee0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_ldapuser0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""LDAP User"""" name="name"/>
|
||||
<field eval=""""Create your own openerp user"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="hr.process_node_openerpuser0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_ldap0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" ?>
|
||||
<terp>
|
||||
<data>
|
||||
<wizard string="Synchronize with ldap" model="res.partner.address" name="partners.sync_ldap" id="wizard_ldap_sync" />
|
||||
<menuitem name="Partners/Synchronize With Ldap" action="wizard_ldap_sync" type="wizard" />
|
||||
</data>
|
||||
</terp>
|
||||
@@ -0,0 +1,4 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import synchronize
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2005-2006 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 sys
|
||||
if sys.version_info[:2] < (2, 4):
|
||||
from sets import Set as set
|
||||
|
||||
import time
|
||||
import ldap
|
||||
import ldap.modlist
|
||||
|
||||
import wizard
|
||||
import pooler
|
||||
|
||||
BASE_DN = 'ou=addressbook,dc=localdomain'
|
||||
|
||||
def terp2ldap(data):
|
||||
res = {}
|
||||
for ldap_name, terp in LDAP_TERP_MAPPER.items():
|
||||
if callable(terp) and terp(data):
|
||||
res[ldap_name] = [terp(data)]
|
||||
elif isinstance(terp, basestring) and data[terp]:
|
||||
res[ldap_name] = ['%s' % data[terp]]
|
||||
return res
|
||||
|
||||
def get_lastname(dico):
|
||||
lnames = dico['name'].split(' ', 1)[1:]
|
||||
if lnames:
|
||||
return ' '.join(lnames)
|
||||
else:
|
||||
return dico['name']
|
||||
|
||||
def get_street(dico):
|
||||
return ' '.join([dico[x] for x in ('street', 'street2') if dico[x]])
|
||||
|
||||
def get_name(attribute):
|
||||
def func(dico):
|
||||
return dico[attribute][1]
|
||||
return func
|
||||
|
||||
|
||||
LDAP_TERP_MAPPER = {
|
||||
'displayname': 'name',
|
||||
'mail': 'email',
|
||||
'o': get_name('partner_id'),
|
||||
'telephoneNumber': 'phone',
|
||||
'street': get_street,
|
||||
'postalcode': 'zip',
|
||||
'l': 'city',
|
||||
'cn': 'name',
|
||||
'sn': get_lastname,
|
||||
'uid': 'id',
|
||||
}
|
||||
|
||||
|
||||
class sync_ldap(wizard.interface):
|
||||
|
||||
_login_arch = '''<?xml version="1.0" ?>
|
||||
<form string="LDAP Credentials">
|
||||
<field name="ldap_host" colspan="4" />
|
||||
<field name="dn" colspan="4" />
|
||||
<field name="password" colspan="4" />
|
||||
</form>
|
||||
'''
|
||||
|
||||
_login_fields = {
|
||||
'ldap_host': {'string': 'LDAP Host', 'type': 'char', 'size': 128},
|
||||
'dn': {'string': 'Distinguished name', 'type': 'char', 'size': 128},
|
||||
'password': {'string': 'Password', 'type': 'char', 'size': 128},
|
||||
}
|
||||
|
||||
def _do_sync(self, cr, uid, data, context):
|
||||
l = ldap.open(data['form']['ldap_host'])
|
||||
l.simple_bind_s(data['form']['dn'], data['form']['password'])
|
||||
ldap_objs = dict(l.search_s(BASE_DN, ldap.SCOPE_ONELEVEL, 'objectclass=*',
|
||||
LDAP_TERP_MAPPER.keys()))
|
||||
address = pooler.get_pool(cr.dbname).get('res.partner.address')
|
||||
terp_objs = dict([(x['id'], x) for x in address.read(cr, uid, address.search(cr, uid, []))])
|
||||
ldap_set = [int(x['uid'][0]) for x in ldap_objs.values()]
|
||||
terp_set = terp_objs.keys()
|
||||
for to_delete in ldap_set:
|
||||
if to_delete in terp_set:
|
||||
continue
|
||||
l.delete_s('uid=%s,%s' % (to_delete, BASE_DN))
|
||||
for to_add in terp_set:
|
||||
if to_add in ldap_set:
|
||||
continue
|
||||
new_dn = 'uid=%s,%s' % (to_add, BASE_DN)
|
||||
ldap_data = {'objectclass' : ['organizationalPerson', 'inetOrgPerson']}
|
||||
ldap_data.update(terp2ldap(terp_objs[to_add]))
|
||||
l.add_s(new_dn, ldap.modlist.addModlist(ldap_data))
|
||||
address.write(cr, uid, [to_add], {'dn' : new_dn})
|
||||
for to_update in terp_set:
|
||||
if to_update not in ldap_set:
|
||||
continue
|
||||
current_dn = 'uid=%s,%s' % (to_update, BASE_DN)
|
||||
modlist = ldap.modlist.modifyModlist(ldap_objs[current_dn], terp2ldap(terp_objs[to_update]))
|
||||
if modlist:
|
||||
l.modify_s(current_dn, modlist)
|
||||
return {}
|
||||
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [],
|
||||
'result' : {
|
||||
'type' : 'form',
|
||||
'arch' : _login_arch,
|
||||
'fields' : _login_fields,
|
||||
'state' : (('end', 'Cancel'),('sync', 'Synchronize'))
|
||||
},
|
||||
},
|
||||
'sync' : {
|
||||
'actions' : [ _do_sync ],
|
||||
'result' : { 'type' : 'state', 'state' : 'end' },
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
sync_ldap('partners.sync_ldap')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Node
|
||||
Process Node
|
||||
-->
|
||||
|
||||
<record id="process_node_product0" model="process.node">
|
||||
|
||||
@@ -112,5 +112,44 @@
|
||||
<field model="process.node" name="source_node_id" ref="process_node_donetask0"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_draftopentask0" model="process.transition.action">
|
||||
<field eval=""""do_open"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Open"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_draftopentask0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_draftcanceltask0" model="process.transition.action">
|
||||
<field eval=""""do_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_draftopentask0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_openpendingtask0" model="process.transition.action">
|
||||
<field eval=""""do_pending"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Set pending"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_opendonetask0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_opendrafttask0" model="process.transition.action">
|
||||
<field eval=""""do_draft"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Draft"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_opendonetask0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_opencanceltask0" model="process.transition.action">
|
||||
<field eval=""""do_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_opendonetask0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -9,10 +9,11 @@
|
||||
<record id="process_node_tasks0" model="process.node">
|
||||
<field name="menu_id" ref="project.menu_action_view_task"/>
|
||||
<field name="model_id" ref="project.model_project_task"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Tasks"""" name="name"/>
|
||||
<field eval=""""In case you sell services on sale order (task subflow)"""" name="note"/>
|
||||
<field name="process_id" ref="sale.process_process_salesworkflow0"/>
|
||||
<field name="subflow_id" ref="project.process_process_tasksworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -35,6 +36,7 @@
|
||||
<field eval=""""Procure task"""" name="name"/>
|
||||
<field eval=""""If Procure method is produce"""" name="note"/>
|
||||
<field name="process_id" ref="mrp.process_process_procurementworkflow0"/>
|
||||
<field name="subflow_id" ref="project.process_process_tasksworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -78,6 +80,32 @@
|
||||
<field eval=""""If procure method is Make to order and supply method is produce"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_procuretask0"/>
|
||||
<field model="process.node" name="source_node_id" ref="mrp.process_node_maketoorder0"/>
|
||||
<field eval="[(6,0,[ref('mrp.trans_draft_confirm')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_orderconfirmtask0" model="process.transition.action">
|
||||
<field eval=""""action_confirm"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_ordertask0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_ordercanceltask0" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_ordertask0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_taskrunprocurement0" model="process.transition.action">
|
||||
<field eval=""""write({'state':'exception'})"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Run Procurement"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_ordertask0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<field eval=""""Purchase Order"""" name="name"/>
|
||||
<field eval=""""After confirming purchase order, it is approved by supplier."""" name="note"/>
|
||||
<field name="process_id" ref="account.process_process_invoiceworkflow0"/>
|
||||
<field name="subflow_id" ref="process_process_purchaseworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
@@ -67,6 +68,7 @@
|
||||
<field eval=""""Invoice Control"""" name="name"/>
|
||||
<field eval=""""Draft invoices are pre-generated for control."""" name="note"/>
|
||||
<field name="process_id" ref="process_process_purchaseworkflow0"/>
|
||||
<field name="subflow_id" ref="account.process_process_invoiceworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -89,6 +91,7 @@
|
||||
<field eval=""""Invoice after packing"""" name="name"/>
|
||||
<field eval=""""In case you control based on delivery"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_purchaseworkflow0"/>
|
||||
<field name="subflow_id" ref="account.process_process_invoiceworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -96,7 +99,19 @@
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
|
||||
<record id="res_roles_purchase0" model="res.roles">
|
||||
<field eval=""""Purchase"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="purchase.trans_draft_confirmed" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_purchase0"/>
|
||||
</record>
|
||||
|
||||
<record id="purchase.trans_router_invoice" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_purchase0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_confirmingpurchaseorder0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
@@ -104,8 +119,9 @@
|
||||
<field eval=""""Confirm Purchase order from Request for quotation"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_confirmpurchaseorder0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_draftpurchaseorder0"/>
|
||||
<field eval="[(6,0,[ref('purchase.trans_draft_confirmed')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="process_transition_approvingpurchaseorder0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
@@ -122,6 +138,7 @@
|
||||
<field eval=""""After approved purchase order , it comes into the supplier invoice"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_invoicecontrol0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_approvepurchaseorder0"/>
|
||||
<field eval="[(6,0,[ref('purchase.trans_router_invoice')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_createpackinglist0" model="process.transition">
|
||||
@@ -150,6 +167,45 @@
|
||||
<field model="process.node" name="target_node_id" ref="account.process_node_draftinvoices0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_purchaseorder0"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_confirmpurchaseorder0" model="process.transition.action">
|
||||
<field eval=""""wkf_confirm_order"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmingpurchaseorder0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancelpurchaseorder0" model="process.transition.action">
|
||||
<field eval=""""write({'state':'cancel'})"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmingpurchaseorder0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_approvingpurchaseorder0" model="process.transition.action">
|
||||
<field eval=""""wkf_approve_order"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Approve"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_approvingpurchaseorder0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_approvingcancelpurchaseorder0" model="process.transition.action">
|
||||
<field eval=""""write({'state':'cancel'})"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_approvingpurchaseorder0"/>
|
||||
</record>.
|
||||
|
||||
<record id="process_transition_action_invoicefrompurchaseorder0" model="process.transition.action">
|
||||
<field eval=""""action_invoice_create"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Create invoice"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_invoicefrompurchase0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -231,7 +231,7 @@ class purchase_order(osv.osv):
|
||||
pricelist = part.property_product_pricelist_purchase.id
|
||||
return {'value':{'partner_address_id': addr['default'], 'pricelist_id': pricelist}}
|
||||
|
||||
def wkf_approve_order(self, cr, uid, ids):
|
||||
def wkf_approve_order(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state': 'approved', 'date_approve': time.strftime('%Y-%m-%d')})
|
||||
return True
|
||||
|
||||
@@ -471,20 +471,9 @@ class purchase_order_line(osv.osv):
|
||||
res = {'value': {'price_unit': price, 'name':prod_name, 'taxes_id':prod['supplier_taxes_id'], 'date_planned': dt,'notes':prod['description_purchase'], 'product_uom': uom}}
|
||||
domain = {}
|
||||
|
||||
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
taxes = self.pool.get('account.tax').browse(cr, uid,prod['supplier_taxes_id'])
|
||||
taxep = None
|
||||
if partner_id:
|
||||
partner = self.pool.get('res.partner').browse(cr, uid, partner_id)
|
||||
taxep = partner.property_account_position and partner.property_account_position.account_supplier_tax
|
||||
if not taxep or not taxep.id:
|
||||
res['value']['taxes_id'] = prod['supplier_taxes_id']
|
||||
else:
|
||||
res5 = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
res5.append(t.id)
|
||||
res['value']['taxes_id'] = res5
|
||||
res['value']['taxes_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner, taxes)
|
||||
|
||||
res2 = self.pool.get('product.uom').read(cr, uid, [uom], ['category_id'])
|
||||
res3 = self.pool.get('product.uom').read(cr, uid, [prod_uom_po], ['category_id'])
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<field eval=""""Order"""" name="name"/>
|
||||
<field eval=""""After confirming order, Create the invoice."""" name="note"/>
|
||||
<field name="process_id" ref="account.process_process_invoiceworkflow0"/>
|
||||
<field name="subflow_id" ref="process_process_salesworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
@@ -34,6 +35,7 @@
|
||||
<field eval=""""Sale Order Procurement"""" name="name"/>
|
||||
<field eval=""""Procurement for each line"""" name="note"/>
|
||||
<field name="process_id" ref="mrp.process_process_procurementworkflow0"/>
|
||||
<field name="subflow_id" ref="process_process_salesworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'waiting_date', 'manual', 'progress', 'shipping_except', 'invoice_except', 'done', 'cancel')"""" name="model_states"/>
|
||||
<field eval="1" name="flow_start"/>
|
||||
</record>
|
||||
@@ -85,10 +87,11 @@
|
||||
<record id="process_node_invoice0" model="process.node">
|
||||
<field name="menu_id" ref="account.menu_invoice_draft"/>
|
||||
<field name="model_id" ref="account.model_account_invoice"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Invoice"""" name="name"/>
|
||||
<field eval=""""In case you invoice based on sale order."""" name="note"/>
|
||||
<field name="process_id" ref="process_process_salesworkflow0"/>
|
||||
<field name="subflow_id" ref="account.process_process_invoiceworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -96,10 +99,11 @@
|
||||
<record id="process_node_invoiceafterdelivery0" model="process.node">
|
||||
<field name="menu_id" ref="account.menu_invoice_draft"/>
|
||||
<field name="model_id" ref="account.model_account_invoice"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Invoice after delivery"""" name="name"/>
|
||||
<field eval=""""In case you invoice based on deliveries (subflow)"""" name="note"/>
|
||||
<field name="process_id" ref="process_process_salesworkflow0"/>
|
||||
<field name="subflow_id" ref="account.process_process_invoiceworkflow0"/>
|
||||
<field eval=""""object.state=='draft'"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
@@ -118,6 +122,18 @@
|
||||
<!--
|
||||
Process Transition
|
||||
-->
|
||||
|
||||
<record id="res_roles_salesman0" model="res.roles">
|
||||
<field eval=""""Salesman"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="sale.trans_draft_router" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_salesman0"/>
|
||||
</record>
|
||||
|
||||
<record id="sale.trans_wait_invoice_invoice_manual" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_salesman0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_confirmquotation0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
@@ -125,22 +141,9 @@
|
||||
<field eval=""""Whenever confirm button is clicked, the draft state is moved to manual. that is, quotation is moved to sale order."""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_saleorder0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_quotation0"/>
|
||||
<field eval="[(6,0,[ref('sale.trans_draft_router')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_confirm0" model="process.transition.action">
|
||||
<field eval=""""action_wait"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmquotation0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancel0" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmquotation0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_packing0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Packing"""" name="name"/>
|
||||
@@ -148,28 +151,7 @@
|
||||
<field model="process.node" name="target_node_id" ref="process_node_packinglist0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_saleorder0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_assign0" model="process.transition.action">
|
||||
<field eval=""""action_assign"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Assign"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_packing0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_forceassignation0" model="process.transition.action">
|
||||
<field eval=""""force_assign"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Force Assignation"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_packing0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancel1" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_packing0"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="process_transition_deliver0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Deliver"""" name="name"/>
|
||||
@@ -178,52 +160,15 @@
|
||||
<field model="process.node" name="source_node_id" ref="process_node_packinglist0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancelassignation0" model="process.transition.action">
|
||||
<field eval=""""cancel_assign"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel Assignation"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_deliver0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_validate0" model="process.transition.action">
|
||||
<field eval=""""test_finnished"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Validate"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_deliver0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancel2" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_deliver0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_invoice0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Invoice"""" name="name"/>
|
||||
<field eval=""""Invoice is created when 'Create Invoice' is being clicked after confirming the sale order. This transaction moves the sale order to invoices."""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_invoice0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_saleorder0"/>
|
||||
<field eval="[(6,0,[ref('sale.trans_wait_invoice_invoice_manual')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_createinvoice0" model="process.transition.action">
|
||||
<field eval=""""action_invoice_create"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Create Invoice"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_invoice0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancelorder0" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel Order"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_invoice0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_invoice0" model="process.transition">
|
||||
<field eval=""""Invoice is created when 'Create Invoice' is being clicked after confirming the sale order. This transaction moves the sale order to invoices."""" name="note"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_invoiceafterdelivery0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Invoice after delivery"""" name="name"/>
|
||||
@@ -249,25 +194,79 @@
|
||||
<field model="process.node" name="target_node_id" ref="account.process_node_draftinvoices0"/>
|
||||
<field model="process.node" name="source_node_id" ref="process_node_order0"/>
|
||||
</record>
|
||||
|
||||
<record id="res_roles_salesman0" model="res.roles">
|
||||
<field eval=""""Salesman"""" name="name"/>
|
||||
|
||||
<!--
|
||||
Process Action
|
||||
-->
|
||||
|
||||
<record id="process_transition_action_confirm0" model="process.transition.action">
|
||||
<field eval=""""action_wait"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Confirm"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmquotation0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancel0" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_confirmquotation0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_assign0" model="process.transition.action">
|
||||
<field eval=""""action_assign"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Assign"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_packing0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_forceassignation0" model="process.transition.action">
|
||||
<field eval=""""force_assign"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Force Assignation"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_packing0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancel1" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_packing0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancelassignation0" model="process.transition.action">
|
||||
<field eval=""""cancel_assign"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel Assignation"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_deliver0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_validate0" model="process.transition.action">
|
||||
<field eval=""""test_finnished"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Validate"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_deliver0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_cancel2" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_deliver0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_action_createinvoice0" model="process.transition.action">
|
||||
<field eval=""""action_invoice_create"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Create Invoice"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_invoice0"/>
|
||||
</record>
|
||||
|
||||
<record id="sale.trans_draft_router" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_salesman0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_confirmquotation0" model="process.transition">
|
||||
<field eval="[(6,0,[ref('sale.trans_draft_router')])]" name="transition_ids"/>
|
||||
</record>
|
||||
|
||||
<record id="sale.trans_wait_invoice_invoice_manual" model="workflow.transition">
|
||||
<field name="role_id" ref="res_roles_salesman0"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_invoice0" model="process.transition">
|
||||
<field eval="[(6,0,[ref('sale.trans_wait_invoice_invoice_manual')])]" name="transition_ids"/>
|
||||
<record id="process_transition_action_cancelorder0" model="process.transition.action">
|
||||
<field eval=""""action_cancel"""" name="action"/>
|
||||
<field eval=""""object"""" name="state"/>
|
||||
<field eval=""""Cancel Order"""" name="name"/>
|
||||
<field name="transition_id" ref="process_transition_invoice0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
+2
-15
@@ -837,23 +837,10 @@ class sale_order_line(osv.osv):
|
||||
|
||||
if update_tax: #The quantity only have changed
|
||||
result['delay'] = (product_obj.sale_delay or 0.0)
|
||||
taxes = self.pool.get('account.tax').browse(cr, uid,
|
||||
[x.id for x in product_obj.taxes_id])
|
||||
taxep = None
|
||||
if partner_id:
|
||||
partner = partner_obj.browse(cr, uid, partner_id)
|
||||
taxep = partner.property_account_position and partner.property_account_position.account_tax
|
||||
if not taxep or not taxep.id:
|
||||
result['tax_id'] = [x.id for x in product_obj.taxes_id]
|
||||
else:
|
||||
res5 = [taxep.id]
|
||||
for t in taxes:
|
||||
if not t.tax_group==taxep.tax_group:
|
||||
res5.append(t.id)
|
||||
result['tax_id'] = res5
|
||||
partner = partner_obj.browse(cr, uid, partner_id)
|
||||
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner, product_obj.taxes_id)
|
||||
|
||||
result['name'] = product_obj.partner_ref
|
||||
|
||||
domain = {}
|
||||
if not uom and not uos:
|
||||
result['product_uom'] = product_obj.uom_id.id
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"version" : "1.0",
|
||||
"author" : "Tiny",
|
||||
"website" : "http://tinyerp.com/module_sale.html",
|
||||
"depends" : ["sale", "crm", "product", "account"],
|
||||
"depends" : ["sale", "crm_configuration", "product", "account"],
|
||||
"category" : "Generic Modules/Sales & Purchases",
|
||||
"description": """
|
||||
This module adds a shortcut on one or several cases in the CRM.
|
||||
@@ -18,7 +18,9 @@
|
||||
""",
|
||||
"init_xml" : [],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : ["sale_crm_wizard.xml"],
|
||||
"update_xml" : ["sale_crm_wizard.xml",
|
||||
"process/sale_crm_process.xml"
|
||||
],
|
||||
"active": False,
|
||||
"installable": True
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="process_node_contractsale0" model="process.node">
|
||||
<field name="menu_id" ref="sale.menu_sale_order"/>
|
||||
<field name="model_id" ref="sale.model_sale_order"/>
|
||||
<field eval=""""subflow"""" name="kind"/>
|
||||
<field eval=""""Contract Sale"""" name="name"/>
|
||||
<field eval=""""Contract Command (sale)"""" name="note"/>
|
||||
<field name="process_id" ref="crm_configuration.process_process_contractworkflow0"/>
|
||||
<field eval=""""object.state in ('draft', 'manual', 'waiting_date', 'progress', 'shipping_except', 'invoice_except', 'done', 'cancel')"""" name="model_states"/>
|
||||
<field eval="0" name="flow_start"/>
|
||||
</record>
|
||||
|
||||
<record id="process_transition_accordsale0" model="process.transition">
|
||||
<field eval="[(6,0,[])]" name="role_ids"/>
|
||||
<field eval="[(6,0,[])]" name="transition_ids"/>
|
||||
<field eval=""""Accord Sale"""" name="name"/>
|
||||
<field eval=""""Goes into the Sale"""" name="note"/>
|
||||
<field model="process.node" name="target_node_id" ref="process_node_contractsale0"/>
|
||||
<field model="process.node" name="source_node_id" ref="crm_configuration.process_node_accord0"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user