[MERGE] branch merged with lp:~openerp-dev/openobject-addons/trunk-dev-addons3
bzr revid: mtr@mtr-20100621140608-922odd1dew2vljwd
This commit is contained in:
@@ -34,14 +34,15 @@
|
||||
Budgets
|
||||
Customer and Supplier Invoices
|
||||
Bank statements
|
||||
Reconciliation process by partner
|
||||
Creates a dashboards for accountants that includes:
|
||||
* List of uninvoiced quotations
|
||||
* Graph of aged receivables
|
||||
* Graph of aged incomes
|
||||
* Graph of aged incomes
|
||||
|
||||
The processes like maintaining of general ledger is done through the defined financial Journals (entry move line or
|
||||
grouping is maintained through journal) for a particular financial year and for preparation of vouchers there is a
|
||||
module named account_voucherss
|
||||
module named account_vouchers
|
||||
""",
|
||||
'website': 'http://www.openerp.com',
|
||||
'init_xml': [],
|
||||
@@ -85,6 +86,7 @@ module named account_voucherss
|
||||
'wizard/account_compare_account_balance_report_view.xml',
|
||||
'wizard/account_third_party_ledger.xml',
|
||||
'wizard/account_reconcile_view.xml',
|
||||
'wizard/account_reconcile_partner_process_view.xml',
|
||||
'wizard/account_automatic_reconcile_view.xml',
|
||||
'project/wizard/project_account_analytic_line_view.xml',
|
||||
'account_end_fy.xml',
|
||||
|
||||
@@ -81,7 +81,7 @@ class account_payment_term(osv.osv):
|
||||
if amt:
|
||||
next_date = datetime.strptime(date_ref, '%Y-%m-%d') + relativedelta(days=line.days)
|
||||
if line.days2 < 0:
|
||||
next_date += relativedelta(day=line.days2)
|
||||
next_date += relativedelta(day=31)
|
||||
if line.days2 > 0:
|
||||
next_date += relativedelta(day=line.days2, months=1)
|
||||
result.append( (next_date.strftime('%Y-%m-%d'), amt) )
|
||||
@@ -616,17 +616,17 @@ class account_journal(osv.osv):
|
||||
'type_control_ids': fields.many2many('account.account.type', 'account_journal_type_rel', 'journal_id','type_id', 'Type Controls', domain=[('code','<>','view'), ('code', '<>', 'closed')]),
|
||||
'account_control_ids': fields.many2many('account.account', 'account_account_type_rel', 'journal_id','account_id', 'Account', domain=[('type','<>','view'), ('type', '<>', 'closed')]),
|
||||
'view_id': fields.many2one('account.journal.view', 'Display Mode', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tells Open ERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."),
|
||||
'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]",help="It acts as a default account for credit amount"),
|
||||
'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]",help="It acts as a default account for debit amount"),
|
||||
'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]", help="It acts as a default account for credit amount"),
|
||||
'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]", help="It acts as a default account for debit amount"),
|
||||
'centralisation': fields.boolean('Centralised counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."),
|
||||
'update_posted': fields.boolean('Allow Cancelling Entries',help="Check this box if you want to cancel the entries related to this journal or want to cancel the invoice related to this journal"),
|
||||
'update_posted': fields.boolean('Allow Cancelling Entries', help="Check this box if you want to allow the cancellation the entries related to this journal or of the invoice related to this journal"),
|
||||
'group_invoice_lines': fields.boolean('Group invoice lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."),
|
||||
'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="The sequence gives the display order for a list of journals", required=True),
|
||||
'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"),
|
||||
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
|
||||
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
|
||||
'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True,select=1,help="Company associated with a journal"),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, select=1, help="Company related to this journal"),
|
||||
'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
|
||||
help="The sequence used for invoice numbers in this journal."),
|
||||
'allow_date':fields.boolean('Check Date not in the Period', help= 'If set to True then do not accept the entry if the entry date is not into the period dates'),
|
||||
@@ -678,7 +678,6 @@ class account_journal(osv.osv):
|
||||
res= {'value':{'centralisation': False}}
|
||||
return res
|
||||
|
||||
|
||||
account_journal()
|
||||
|
||||
class account_fiscalyear(osv.osv):
|
||||
@@ -772,7 +771,7 @@ class account_period(osv.osv):
|
||||
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True),
|
||||
'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True,
|
||||
help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'),
|
||||
'company_id': fields.related('fiscalyear_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
|
||||
'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True)
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
@@ -878,7 +877,7 @@ class account_journal_period(osv.osv):
|
||||
'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'State', required=True, readonly=True,
|
||||
help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'),
|
||||
'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'),
|
||||
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company')
|
||||
'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company')
|
||||
}
|
||||
|
||||
def _check(self, cr, uid, ids, context={}):
|
||||
@@ -2122,7 +2121,7 @@ class account_tax_code_template(osv.osv):
|
||||
'info': fields.text('Description'),
|
||||
'parent_id': fields.many2one('account.tax.code.template', 'Parent Code', select=True),
|
||||
'child_ids': fields.one2many('account.tax.code.template', 'parent_id', 'Child Codes'),
|
||||
'sign': fields.float('Sign for parent', required=True),
|
||||
'sign': fields.float('Sign for parent', required=True, help="Choose 1.00 to add the total to the parent account or -1.00 to subtract it"),
|
||||
'notprintable':fields.boolean("Not Printable in Invoice", help="Check this box if you don't want any VAT related to this Tax Code to appear on invoices"),
|
||||
}
|
||||
|
||||
@@ -2154,7 +2153,7 @@ class account_chart_template(osv.osv):
|
||||
|
||||
_columns={
|
||||
'name': fields.char('Name', size=64, required=True),
|
||||
'account_root_id': fields.many2one('account.account.template','Root Account',required=True,domain=[('parent_id','=',False)]),
|
||||
'account_root_id': fields.many2one('account.account.template','Root Account',required=True,domain=[('parent_id','=',False)], help=""),
|
||||
'tax_code_root_id': fields.many2one('account.tax.code.template','Root Tax Code',required=True,domain=[('parent_id','=',False)]),
|
||||
'tax_template_ids': fields.one2many('account.tax.template', 'chart_template_id', 'Tax Template List', help='List of all the taxes that have to be installed by the wizard'),
|
||||
'bank_account_view_id': fields.many2one('account.account.template','Bank Account',required=True),
|
||||
|
||||
@@ -577,6 +577,39 @@ class account_move_line(osv.osv):
|
||||
# writeoff; entry generated for the difference between the lines
|
||||
#
|
||||
|
||||
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
if context is None:
|
||||
context = {}
|
||||
if context and context.get('next_partner_only', False):
|
||||
if not context.get('partner_id', False):
|
||||
partner = self.get_next_partner_only(cr, uid, offset, context)
|
||||
else:
|
||||
partner = context.get('partner_id', False)
|
||||
if not partner:
|
||||
return []
|
||||
args.append(('partner_id', '=', partner[0]))
|
||||
return super(account_move_line, self).search(cr, uid, args, offset, limit, order, context, count)
|
||||
|
||||
def get_next_partner_only(self, cr, uid, offset=0, context=None):
|
||||
cr.execute(
|
||||
"""
|
||||
SELECT p.id
|
||||
FROM res_partner p
|
||||
RIGHT JOIN (
|
||||
SELECT l.partner_id as partner_id, SUM(l.debit) as debit, SUM(l.credit) as credit
|
||||
FROM account_move_line l
|
||||
LEFT JOIN account_account a ON (a.id = l.account_id)
|
||||
LEFT JOIN res_partner p ON (l.partner_id = p.id)
|
||||
WHERE a.reconcile IS TRUE
|
||||
AND l.reconcile_id IS NULL
|
||||
AND (p.last_reconciliation_date IS NULL OR l.date > p.last_reconciliation_date)
|
||||
AND l.state <> 'draft'
|
||||
GROUP BY l.partner_id
|
||||
) AS s ON (p.id = s.partner_id)
|
||||
ORDER BY p.last_reconciliation_date LIMIT 1 OFFSET %s""", (offset,)
|
||||
)
|
||||
return cr.fetchone()
|
||||
|
||||
def reconcile_partial(self, cr, uid, ids, type='auto', context=None):
|
||||
merges = []
|
||||
unmerge = []
|
||||
@@ -730,6 +763,11 @@ class account_move_line(osv.osv):
|
||||
# because of the way the line_id are defined: (4, x, False)
|
||||
for id in ids:
|
||||
wf_service.trg_trigger(uid, 'account.move.line', id, cr)
|
||||
|
||||
if lines and lines[0]:
|
||||
partner_id = lines[0].partner_id.id
|
||||
if context and context.get('stop_reconcile', False):
|
||||
self.pool.get('res.partner').write(cr, uid, [partner_id], {'last_reconciliation_date': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
return r_id
|
||||
|
||||
def view_header_get(self, cr, user, view_id, view_type, context):
|
||||
@@ -838,13 +876,14 @@ class account_move_line(osv.osv):
|
||||
journal_id = m.journal_id.id
|
||||
period_id = m.period_id.id
|
||||
else:
|
||||
journal_id = context['journal_id']
|
||||
period_id = context['period_id']
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, [journal_id])[0]
|
||||
if journal.allow_date:
|
||||
period = self.pool.get('account.period').browse(cr, uid, [period_id])[0]
|
||||
if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') or not time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'):
|
||||
raise osv.except_osv(_('Error'),_('The date of your Ledger Posting is not in the defined period !'))
|
||||
journal_id = context.get('journal_id',False)
|
||||
period_id = context.get('period_id',False)
|
||||
if journal_id:
|
||||
journal = self.pool.get('account.journal').browse(cr, uid, [journal_id])[0]
|
||||
if journal.allow_date and period_id:
|
||||
period = self.pool.get('account.period').browse(cr, uid, [period_id])[0]
|
||||
if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') or not time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'):
|
||||
raise osv.except_osv(_('Error'),_('The date of your Ledger Posting is not in the defined period !'))
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
+306
-50
@@ -12,12 +12,14 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fiscalyear">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_stop"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="end_journal_period_id" groups="base.group_extended"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Periods"/>
|
||||
<field colspan="4" name="period_ids" nolabel="1" widget="one2many_list">
|
||||
<form string="Period">
|
||||
@@ -49,11 +51,32 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_fiscalyear_search" model="ir.ui.view">
|
||||
<field name="name">account.fiscalyear.search</field>
|
||||
<field name="model">account.fiscalyear</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Fiscalyear">
|
||||
<group>
|
||||
<filter string="Done" domain="[('state','=','done')]" icon="terp-dolar_ok!"/>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_account_fiscalyear_form" model="ir.actions.act_window">
|
||||
<field name="name">Fiscal Years</field>
|
||||
<field name="res_model">account.fiscalyear</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
<menuitem id="next_id_23" name="Periods" parent="account.menu_finance_accounting"/>
|
||||
<menuitem action="action_account_fiscalyear_form" id="menu_action_account_fiscalyear_form" parent="next_id_23"/>
|
||||
@@ -71,15 +94,15 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Period">
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_stop"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="fiscalyear_id"/>
|
||||
<field name="special"/>
|
||||
<separator colspan="4" string="States"/>
|
||||
<field name="state" select="1"/>
|
||||
<field name="state"/>
|
||||
<button name="action_draft" states="done" string="Set to Draft" type="object" icon="gtk-convert"/>
|
||||
</form>
|
||||
</field>
|
||||
@@ -99,11 +122,32 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_period_search" model="ir.ui.view">
|
||||
<field name="name">account.period.search</field>
|
||||
<field name="model">account.period</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Periods">
|
||||
<group>
|
||||
<filter string="Done" domain="[('state','=','done')]" icon="terp-dolar_ok!"/>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_account_period_form" model="ir.actions.act_window">
|
||||
<field name="name">Periods</field>
|
||||
<field name="res_model">account.period</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
<menuitem action="action_account_period_form" id="menu_action_account_period_form" parent="account.next_id_23"/>
|
||||
|
||||
@@ -154,10 +198,21 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Accounts">
|
||||
<field name="code" select="1"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="user_type" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-sale" string="Receivable Accounts" domain="[('type','=','receivable')]"/>
|
||||
<filter icon="terp-purchase" string="Purchase Accounts" domain="[('type','=','purchase')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="user_type" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Parent Account" icon="terp-folder-orange" domain="" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="User Type" icon="terp-folder-blue" domain="" context="{'group_by':'user_type'}"/>
|
||||
<filter string="Internal Type" icon="terp-folder-yellow" domain="" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -262,7 +317,28 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_journal_search" model="ir.ui.view">
|
||||
<field name="name">account.journal.search</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Search Account Journal">
|
||||
<group>
|
||||
<filter domain="[('type', '=', 'sale')]" string="Sale Journals" icon="terp-sale"/>
|
||||
<filter domain="[('type', '=', 'purchase')]" string="Purchase Journals" icon="terp-purchase"/>
|
||||
<filter domain="[('centralisation', '=', 'True')]" string="Centralized Journals" icon="terp-stock"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Type" context="{'group_by':'type'}" icon="terp-stock_effects-object-colorize"/>
|
||||
<filter string="User" context="{'group_by':'user_id'}" icon="terp-personal"/>
|
||||
</group>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_journal_form" model="ir.ui.view">
|
||||
<field name="name">account.journal.form</field>
|
||||
<field name="model">account.journal</field>
|
||||
@@ -351,16 +427,38 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_search" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.search</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Bank Statements">
|
||||
<group>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
|
||||
<filter string="Confirm" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
<field name="journal_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Journal" context="{'group_by': 'journal_id'}" icon="terp-folder-orange"/>
|
||||
<filter string="Period" context="{'group_by': 'period_id'}" icon="terp-go-month"/>
|
||||
<filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_bank_statement_form" model="ir.ui.view">
|
||||
<field name="name">account.bank.statement.form</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Statement">
|
||||
<field name="name" select="1"/>
|
||||
<field name="date" select="1"/>
|
||||
<field name="journal_id" on_change="onchange_journal_id(journal_id)" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="date"/>
|
||||
<field name="journal_id" on_change="onchange_journal_id(journal_id)"/>
|
||||
<field name="currency"/>
|
||||
<field name="period_id"/>
|
||||
<group colspan="2" col="3">
|
||||
@@ -427,7 +525,7 @@
|
||||
<field name="name">Draft statements</field>
|
||||
<field name="res_model">account.bank.statement</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="domain">[('state','=','draft')]</field>
|
||||
<field name="filter" eval="True"/>
|
||||
</record>
|
||||
@@ -629,6 +727,26 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_tax_search" model="ir.ui.view">
|
||||
<field name="name">account.tax.search</field>
|
||||
<field name="model">account.tax</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Taxes">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-folder-blue" string="Vat Taxes" domain="[('tax_group','=','vat')]" help="Vat Taxes"/>
|
||||
<filter icon="terp-folder-yellow" string="Other Taxes" domain="[('tax_group','=','other')]" help="Other Taxes"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Tax Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_tax_form" model="ir.ui.view">
|
||||
<field name="name">account.tax.form</field>
|
||||
<field name="model">account.tax</field>
|
||||
@@ -842,9 +960,18 @@
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date" select='1'/>
|
||||
<field name="account_id" select='1'/>
|
||||
<field name="partner_id" select='1'/>
|
||||
<field name="partner_id" select='1'>
|
||||
<filter help="Next Partner Entries to reconcile" name="next_partner" string="Next Partner to reconcile" context="{'next_partner_only': 1}" icon="terp-partner" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
|
||||
</field>
|
||||
<field name="balance" string="Debit/Credit" select='1'/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Account" context="{'group_by':'account_id'}" icon="terp-folder-blue"/>
|
||||
<filter string="Journal" context="{'group_by':'journal_id'}" icon="terp-folder-orange"/>
|
||||
<filter string="Partner" context="{'group_by':'partner_id'}" icon="terp-personal"/>
|
||||
<filter string="state" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1039,7 +1166,7 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_move_tree"/>
|
||||
<field name="search_view_id" ref="view_account_move_filter"/>
|
||||
<field name="domain">[('journal_id.type', '=', 'sale')]</field>
|
||||
<field name="domain">[('journal_id.type', 'in', ['sale', 'sale_refund'])]</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_moves_sale" id="menu_eaction_account_moves_sale" parent="menu_finance_receivables"/>
|
||||
@@ -1051,7 +1178,7 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_move_tree"/>
|
||||
<field name="search_view_id" ref="view_account_move_filter"/>
|
||||
<field name="domain">[('journal_id.type', '=', 'purchase')]</field>
|
||||
<field name="domain">[('journal_id.type', 'in', ['purchase', 'purchase_refund'])]</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_moves_purchase" id="menu_eaction_account_moves_purchase" parent="menu_finance_payables"/>
|
||||
@@ -1167,11 +1294,11 @@
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" ref="view_bank_statement_reconcile_form"/>
|
||||
</record>
|
||||
<menuitem
|
||||
<!-- <menuitem
|
||||
id="next_id_30"
|
||||
name="Bank Reconciliation"
|
||||
parent="menu_finance_periodical_processing"
|
||||
groups="group_account_user"/>
|
||||
groups="group_account_user"/> -->
|
||||
|
||||
<!-- <menuitem action="action_bank_statement_reconciliation_form" id="menu_action_account_bank_reconcile_tree" parent="next_id_30"/>-->
|
||||
<!-- <wizard id="action_account_bank_reconcile_tree" menu="False" model="account.move.line" name="account.move.bank.reconcile" string="Bank reconciliation"/> -->
|
||||
@@ -1180,7 +1307,19 @@
|
||||
<!-- bank reconsilation -->
|
||||
<menuitem action="action_account_bank_reconcile_tree"
|
||||
id="menu_action_account_bank_reconcile_check_tree"
|
||||
parent="account.next_id_30" />
|
||||
parent="periodical_processing_reconciliation" groups="group_account_user" />
|
||||
|
||||
<act_window
|
||||
context="{'search_default_next_partner':1}"
|
||||
id="action_account_manual_reconcile" name="Entry Lines"
|
||||
res_model="account.move.line"
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
name="Manual Reconcilication" icon="STOCK_EXECUTE"
|
||||
action="action_account_manual_reconcile"
|
||||
id="menu_manual_reconcile"
|
||||
parent="account.periodical_processing_reconciliation"/>
|
||||
|
||||
|
||||
<act_window
|
||||
@@ -1282,7 +1421,7 @@
|
||||
<field name="name" select="1"/>
|
||||
<field name="ref" select="1"/>
|
||||
<field name="journal_id" select="1"/>
|
||||
<field colspan="4" name="lines_id" widget="one2many_list"/>
|
||||
<field colspan="4" name="lines_id" widget="one2many_list" nolabel="1"/>
|
||||
<separator string="Legend" colspan="4"/>
|
||||
<field name="legend" colspan="4" nolabel="1"/>
|
||||
<group col="1" colspan="4">
|
||||
@@ -1359,12 +1498,32 @@
|
||||
<field name="name" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
<separator colspan="4" string="Description on invoices"/>
|
||||
<field colspan="4" name="note"/>
|
||||
<field colspan="4" name="note" nolabel="1"/>
|
||||
<separator colspan="4" string="Computation"/>
|
||||
<field colspan="4" name="line_ids"/>
|
||||
<field colspan="4" name="line_ids" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_account_move_line_filter" model="ir.ui.view">-->
|
||||
<!-- <field name="name">Payment Terms</field>-->
|
||||
<!-- <field name="model">account.payment.term</field>-->
|
||||
<!-- <field name="type">search</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <search string="Search Payment Terms">-->
|
||||
<!-- <group col='10' colspan='4'>-->
|
||||
<!-- <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Entry Lines"/>-->
|
||||
<!-- <filter icon="terp-camera_test" string="Posted" domain="[('state','=','valid')]" help="Posted Entry Lines"/>-->
|
||||
<!-- <separator orientation="vertical"/>-->
|
||||
<!-- <field name="date" select='1'/>-->
|
||||
<!-- <field name="account_id" select='1'/>-->
|
||||
<!-- <field name="partner_id" select='1'>-->
|
||||
<!-- <filter help="Next Partner Entries to reconcile" name="next_partner" string="Next Partner to reconcile" context="{'next_partner_only': 1}" icon="terp-partner" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>-->
|
||||
<!-- </field>-->
|
||||
<!-- <field name="balance" string="Debit/Credit" select='1'/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </search>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
<record id="action_payment_term_form" model="ir.actions.act_window">
|
||||
<field name="name">Payment Terms</field>
|
||||
<field name="res_model">account.payment.term</field>
|
||||
@@ -1558,13 +1717,14 @@
|
||||
<act_window domain="[('partner_id', '=', active_id)]" id="act_account_partner_account_move" name="All Account Entries" res_model="account.move.line" src_model="res.partner"/>
|
||||
|
||||
<record id="view_account_addtmpl_wizard_form" model="ir.ui.view">
|
||||
<field name="name">Account Add wizard</field>
|
||||
<field name="name">Create Account</field>
|
||||
<field name="model">account.addtmpl.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Add">
|
||||
<separator col="4" colspan="4" string="Select the common parent for the accounts"/>
|
||||
<form string="Create Account">
|
||||
<separator col="4" colspan="4" string="Create an Account based on this template"/>
|
||||
<field name="cparent_id"/>
|
||||
<newline/>
|
||||
<group col="2" colspan="2">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel" name="action_cancel" type="object"/>
|
||||
<button icon="gtk-ok" name="action_create" string="Add" type="object"/>
|
||||
@@ -1574,7 +1734,8 @@
|
||||
</record>
|
||||
|
||||
<act_window domain="[]" id="action_account_addtmpl_wizard_form"
|
||||
name="Add account Wizard"
|
||||
name="Create Account"
|
||||
target="new"
|
||||
res_model="account.addtmpl.wizard"
|
||||
context="{'tmpl_ids': active_id}"
|
||||
src_model="account.account.template"
|
||||
@@ -1607,16 +1768,17 @@
|
||||
<notebook>
|
||||
<page string="General Information">
|
||||
<field name="name"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="code"/>
|
||||
<newline/>
|
||||
<field name="parent_id" select="1"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="shortcut"/>
|
||||
<field name="type" select="1"/>
|
||||
<field name="user_type" select="1"/>
|
||||
<field name="type"/>
|
||||
<field name="user_type"/>
|
||||
|
||||
<field name="currency_id"/>
|
||||
<field name="reconcile"/>
|
||||
<field name="tax_ids" colspan="4"/>
|
||||
<separator string="Default taxes" colspan="4"/>
|
||||
<field name="tax_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field colspan="4" name="note" nolabel="1"/>
|
||||
@@ -1637,12 +1799,36 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_template_search" model="ir.ui.view">
|
||||
<field name="name">account.account.template.search</field>
|
||||
<field name="model">account.account.template</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Account Templates">
|
||||
<group>
|
||||
<filter icon="terp-sale" string="Receivale Accounts" domain="[('type','=','receivable')]"/>
|
||||
<filter icon="terp-purchase" string="Payable Accounts" domain="[('type','=','payable')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="code"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="type"/>
|
||||
<field name="user_type"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Internal Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
|
||||
<filter string="Account Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'user_type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_template_form" model="ir.actions.act_window">
|
||||
<field name="name">Account Templates</field>
|
||||
<field name="res_model">account.account.template</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -1656,21 +1842,50 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Chart of Accounts Template">
|
||||
<field name="name" select="1"/>
|
||||
<field name="account_root_id" select="1"/>
|
||||
<field name="bank_account_view_id" select="1"/>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="account_root_id"/>
|
||||
<field name="bank_account_view_id"/>
|
||||
<field name="tax_code_root_id"/>
|
||||
<field name="tax_template_ids" colspan="4" readonly="1" />
|
||||
</group>
|
||||
<field name="tax_template_ids" colspan="4" readonly="1" nolabel="1"/>
|
||||
<separator string="Properties" colspan="4"/>
|
||||
<group>
|
||||
<field name="property_account_receivable"/>
|
||||
<field name="property_account_payable"/>
|
||||
<field name="property_account_expense_categ" />
|
||||
<field name="property_account_income_categ"/>
|
||||
<field name="property_account_expense"/>
|
||||
<field name="property_account_income"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_chart_template_seacrh" model="ir.ui.view">
|
||||
<field name="name">account.chart.template.search</field>
|
||||
<field name="model">account.chart.template</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Chart of Account Templates">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="account_root_id"/>
|
||||
<field name="bank_account_view_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Root Account" icon="terp-folder-orange" domain="[]" context="{'group_by':'account_root_id'}"/>
|
||||
<filter string="Bank Account" icon="terp-folder-blue" domain="[]" context="{'group_by':'bank_account_view_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Receivable Account" icon="terp-sale" domain="[]" context="{'group_by':'property_account_receivable'}"/>
|
||||
<filter string="Payable Account" icon="terp-purchase" domain="[]" context="{'group_by':'property_account_payable'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Income Account" icon="terp-sale" domain="[]" context="{'group_by':'property_account_income_categ'}"/>
|
||||
<filter string="Expense Account" icon="terp-purchase" domain="[]" context="{'group_by':'property_account_expense_categ'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_chart_template_tree" model="ir.ui.view">
|
||||
<field name="name">account.chart.template.tree</field>
|
||||
<field name="model">account.chart.template</field>
|
||||
@@ -1688,7 +1903,7 @@
|
||||
<field name="name">Chart of Accounts Templates</field>
|
||||
<field name="res_model">account.chart.template</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_chart_template_form" id="menu_action_account_chart_template_form" parent="account_template_accounts"/>
|
||||
@@ -1702,11 +1917,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Tax Template">
|
||||
<group colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="description" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
<newline/>
|
||||
<field name="chart_template_id" select="1"/>
|
||||
<field name="tax_group" select="1"/>
|
||||
<field name="chart_template_id"/>
|
||||
<field name="tax_group"/>
|
||||
<field name="type"/>
|
||||
<field name="type_tax_use"/>
|
||||
</group>
|
||||
@@ -1760,6 +1975,27 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_account_tax_template_search" model="ir.ui.view">
|
||||
<field name="name">account.tax.template.search</field>
|
||||
<field name="model">account.tax.template</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Tax Templates">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-sale" string="Sale" domain="[('type_tax_use','=','sale')]" help="Taxes used in Sales"/>
|
||||
<filter icon="terp-purchase" string="Purchase" domain="[('type_tax_use','=','purchase')]" help="Taxes used in Purchases"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-folder-blue" string="Vat Taxes" domain="[('tax_group','=','vat')]" help="Vat Taxes"/>
|
||||
<filter icon="terp-folder-yellow" string="Other Taxes" domain="[('tax_group','=','other')]" help="Other Taxes"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
<field name="chart_template_id"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_tax_template_form" model="ir.actions.act_window">
|
||||
<field name="name">Tax Templates</field>
|
||||
<field name="res_model">account.tax.template</field>
|
||||
@@ -1782,7 +2018,26 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_tax_code_template_search" model="ir.ui.view">
|
||||
<field name="name">account.tax.code.template.search</field>
|
||||
<field name="model">account.tax.code.template</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search tax template">
|
||||
<group>
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="parent_id" select="1"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Parent Code" icon="terp-folder-orange" domain="[]" context="{'group_by':'parent_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_tax_code_template_form" model="ir.ui.view">
|
||||
<field name="name">account.tax.code.template.form</field>
|
||||
<field name="model">account.tax.code.template</field>
|
||||
@@ -1794,7 +2049,8 @@
|
||||
<field name="parent_id" select="1"/>
|
||||
<field name="sign"/>
|
||||
<newline/>
|
||||
<field colspan="4" name="info"/>
|
||||
<separator string="Description" colspan="4"/>
|
||||
<field colspan="4" name="info" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1803,7 +2059,7 @@
|
||||
<field name="name">Tax Code Templates</field>
|
||||
<field name="res_model">account.tax.code.template</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
<menuitem action="action_account_tax_code_template_form" id="menu_action_account_tax_code_template_form" parent="account_template_taxes" sequence="14"/>
|
||||
|
||||
@@ -1891,7 +2147,7 @@
|
||||
<field name="name" select="1"/>
|
||||
<field name="chart_template_id"/>
|
||||
<newline/>
|
||||
<field name="tax_ids" colspan="4">
|
||||
<field name="tax_ids" colspan="4" nolabel="1">
|
||||
<tree string="Taxes Mapping" editable="bottom">
|
||||
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
@@ -1901,7 +2157,7 @@
|
||||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
</form>
|
||||
</field>
|
||||
<field name="account_ids" colspan="4">
|
||||
<field name="account_ids" colspan="4" nolabel="1">
|
||||
<tree string="Accounts Mapping" editable="bottom">
|
||||
<field name="account_src_id"/>
|
||||
<field name="account_dest_id"/>
|
||||
|
||||
@@ -52,18 +52,15 @@
|
||||
<!-- <wizard id="wizard_reconcile_unreconcile" model="account.move.reconcile" name="account.reconcile.unreconcile" string="Unreconcile Entries"/>-->
|
||||
|
||||
|
||||
<!-- <wizard id="wizard_reconcile_select" menu="False" model="account.move.line" name="account.move.line.reconcile.select" string="Reconcile entries"/>
|
||||
<menuitem action="wizard_reconcile_select" id="menu_reconcile_select" parent="account.next_id_20" type="wizard"/>
|
||||
-->
|
||||
<!-- <wizard id="wizard_reconcile_select" menu="False" model="account.move.line" name="account.move.line.reconcile.select" string="Reconcile entries"/> -->
|
||||
<!-- <menuitem action="wizard_reconcile_select" id="menu_reconcile_select" parent="account.next_id_20" type="wizard"/> -->
|
||||
|
||||
<!-- unreconcile -->
|
||||
<!-- <wizard id="wizard_unreconcile" model="account.move.line" name="account.move.line.unreconcile" string="Unreconcile Entries"/>-->
|
||||
|
||||
<!-- unreconcile
|
||||
|
||||
<wizard id="wizard_unreconcile_select" menu="False" model="account.move.line" name="account.move.line.unreconcile.select" string="Unreconcile entries"/>
|
||||
<menuitem action="wizard_unreconcile_select" id="menu_unreconcile_select" parent="account.next_id_20" type="wizard"/>
|
||||
-->
|
||||
<!-- <wizard id="wizard_unreconcile_select" menu="False" model="account.move.line" name="account.move.line.unreconcile.select" string="Unreconcile entries"/> -->
|
||||
<!-- <menuitem action="wizard_unreconcile_select" id="menu_unreconcile_select" parent="account.next_id_20" type="wizard"/> -->
|
||||
|
||||
<!-- subscriptions -->
|
||||
<!--
|
||||
|
||||
@@ -34,4 +34,4 @@ void. Do not hesitate to contact our accounting department'
|
||||
}
|
||||
res_company()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -169,7 +169,7 @@ your own chart of account.
|
||||
<record id="refund_sales_journal" model="account.journal">
|
||||
<field name="name">x Sales Credit Note Journal</field>
|
||||
<field name="code">SCNJ</field>
|
||||
<field name="type">sale</field>
|
||||
<field name="type">sale_refund</field>
|
||||
<field name="refund_journal">True</field>
|
||||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="sequence_id" ref="sequence_sale_journal"/>
|
||||
@@ -191,7 +191,7 @@ your own chart of account.
|
||||
<record id="refund_expenses_journal" model="account.journal">
|
||||
<field name="name">x Expenses Credit Notes Journal</field>
|
||||
<field name="code">ECNJ</field>
|
||||
<field name="type">purchase</field>
|
||||
<field name="type">purchase_refund</field>
|
||||
<field name="refund_journal">True</field>
|
||||
<field name="view_id" ref="account_journal_view"/>
|
||||
<field name="sequence_id" ref="sequence_purchase_journal"/>
|
||||
|
||||
@@ -23,7 +23,6 @@ import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from os.path import join as opj
|
||||
from operator import itemgetter
|
||||
|
||||
from tools.translate import _
|
||||
from osv import fields, osv
|
||||
import netsvc
|
||||
|
||||
@@ -51,11 +51,12 @@ class account_invoice(osv.osv):
|
||||
type_inv = context.get('type', 'out_invoice')
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid)
|
||||
company_id = context.get('company_id', user.company_id.id)
|
||||
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'}
|
||||
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'}
|
||||
refund_journal = {'out_invoice': False, 'in_invoice': False, 'out_refund': True, 'in_refund': True}
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale')),
|
||||
('company_id', '=', company_id),('refund_journal', '=', refund_journal.get(type_inv, False))],
|
||||
('company_id', '=', company_id),
|
||||
('refund_journal', '=', refund_journal.get(type_inv, False))],
|
||||
limit=1)
|
||||
if res:
|
||||
return res[0]
|
||||
@@ -753,6 +754,8 @@ class account_invoice(osv.osv):
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
context = {}
|
||||
for inv in self.browse(cr, uid, ids):
|
||||
if not inv.invoice_line:
|
||||
raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
|
||||
if inv.move_id:
|
||||
continue
|
||||
|
||||
@@ -774,7 +777,8 @@ class account_invoice(osv.osv):
|
||||
|
||||
# one move line per tax line
|
||||
iml += ait_obj.move_line_get(cr, uid, inv.id)
|
||||
|
||||
|
||||
entry_type=''
|
||||
if inv.type in ('in_invoice', 'in_refund'):
|
||||
ref = inv.reference
|
||||
entry_type = 'journal_pur_voucher'
|
||||
@@ -932,13 +936,13 @@ class account_invoice(osv.osv):
|
||||
account_move_obj = self.pool.get('account.move')
|
||||
invoices = self.read(cr, uid, ids, ['move_id', 'payment_ids'])
|
||||
for i in invoices:
|
||||
if i['move_id']:
|
||||
if i['move_id']:
|
||||
account_move_obj.button_cancel(cr, uid, [i['move_id'][0]])
|
||||
# delete the move this invoice was pointing to
|
||||
# Note that the corresponding move_lines and move_reconciles
|
||||
# will be automatically deleted too
|
||||
account_move_obj.unlink(cr, uid, [i['move_id'][0]])
|
||||
if i['payment_ids']:
|
||||
if i['payment_ids']:
|
||||
account_move_line_obj = self.pool.get('account.move.line')
|
||||
pay_ids = account_move_line_obj.browse(cr, uid , i['payment_ids'])
|
||||
for move_line in pay_ids:
|
||||
@@ -1011,7 +1015,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
def refund(self, cr, uid, ids, date=None, period_id=None, description=None):
|
||||
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
|
||||
|
||||
|
||||
new_ids = []
|
||||
for invoice in invoices:
|
||||
del invoice['id']
|
||||
@@ -1030,6 +1034,10 @@ class account_invoice(osv.osv):
|
||||
tax_lines = self.pool.get('account.invoice.tax').read(cr, uid, invoice['tax_line'])
|
||||
tax_lines = filter(lambda l: l['manual'], tax_lines)
|
||||
tax_lines = self._refund_cleanup_lines(cr, uid, tax_lines)
|
||||
if invoice['type'] == 'in_invoice':
|
||||
refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','purchase_refund')])
|
||||
else:
|
||||
refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')])
|
||||
if not date :
|
||||
date = time.strftime('%Y-%m-%d')
|
||||
invoice.update({
|
||||
@@ -1038,7 +1046,8 @@ class account_invoice(osv.osv):
|
||||
'state': 'draft',
|
||||
'number': False,
|
||||
'invoice_line': invoice_lines,
|
||||
'tax_line': tax_lines
|
||||
'tax_line': tax_lines,
|
||||
'journal_id': refund_journal_ids
|
||||
})
|
||||
if period_id :
|
||||
invoice.update({
|
||||
@@ -1092,7 +1101,6 @@ class account_invoice(osv.osv):
|
||||
ref = invoice.reference
|
||||
else:
|
||||
ref = self._convert_ref(cr, uid, invoice.number)
|
||||
|
||||
# Pay attention to the sign for both debit/credit AND amount_currency
|
||||
l1 = {
|
||||
'debit': direction * pay_amount>0 and direction * pay_amount,
|
||||
|
||||
@@ -89,7 +89,7 @@ class res_partner(osv.osv):
|
||||
_name = 'res.partner'
|
||||
_inherit = 'res.partner'
|
||||
_description = 'Partner'
|
||||
|
||||
|
||||
def _credit_debit_get(self, cr, uid, ids, field_names, arg, context):
|
||||
query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
|
||||
cr.execute("""SELECT l.partner_id, a.type, SUM(l.debit-l.credit)
|
||||
@@ -114,7 +114,7 @@ class res_partner(osv.osv):
|
||||
if val is None: val=0
|
||||
res[pid][maps[type]] = (type=='receivable') and val or -val
|
||||
return res
|
||||
|
||||
|
||||
def _asset_difference_search(self, cr, uid, obj, name, type, args, context=None):
|
||||
if not len(args):
|
||||
return []
|
||||
@@ -136,7 +136,7 @@ class res_partner(osv.osv):
|
||||
if not len(res):
|
||||
return [('id','=','0')]
|
||||
return [('id','in',map(itemgetter(0), res))]
|
||||
|
||||
|
||||
def _credit_search(self, cr, uid, obj, name, args, context):
|
||||
return self._asset_difference_search(cr, uid, obj, name, 'receivable', args, context=context)
|
||||
|
||||
@@ -187,6 +187,7 @@ class res_partner(osv.osv):
|
||||
help="This payment term will be used instead of the default one for the current partner"),
|
||||
'ref_companies': fields.one2many('res.company', 'partner_id',
|
||||
'Companies that refers to partner'),
|
||||
'last_reconciliation_date': fields.datetime('Last Reconciliation Date', help='Date on which partner account entries reconciled last time')
|
||||
}
|
||||
res_partner()
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<form string="Fiscal Position">
|
||||
<field name="name" select="1"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<separator string="Mapping" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="note" colspan="4"/>
|
||||
<field name="tax_ids" colspan="4" widget="one2many_list">
|
||||
<field name="tax_ids" colspan="2" widget="one2many_list" nolabel="1">
|
||||
<tree string="Tax Mapping" editable="bottom">
|
||||
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
|
||||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
@@ -22,7 +22,7 @@
|
||||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
</form>
|
||||
</field>
|
||||
<field name="account_ids" colspan="4" widget="one2many_list">
|
||||
<field name="account_ids" colspan="2" widget="one2many_list" nolabel="1">
|
||||
<tree string="Account Mapping" editable="bottom">
|
||||
<field name="account_src_id"/>
|
||||
<field name="account_dest_id"/>
|
||||
@@ -32,6 +32,8 @@
|
||||
<field name="account_dest_id"/>
|
||||
</form>
|
||||
</field>
|
||||
<separator string="Notes" colspan="4"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -122,10 +124,10 @@
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Partners info tab view-->
|
||||
|
||||
<act_window
|
||||
<act_window
|
||||
id="action_analytic_open"
|
||||
name="Analytic Accounts"
|
||||
res_model="account.analytic.account"
|
||||
@@ -134,5 +136,16 @@
|
||||
view_type="form"
|
||||
view_mode="tree,form,graph,calendar"/>
|
||||
|
||||
<record id="view_res_partner_reconcile" model="ir.ui.view">
|
||||
<field name="name">res.partner.form.reconcile</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="credit_limit" position="after">
|
||||
<field name="last_reconciliation_date"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Account">
|
||||
<group col="8" colspan="4">
|
||||
<group col="8" colspan="4">
|
||||
<filter icon="terp-check" string="Current" domain="[('state','=','open')]" help="Current Accounts"/>
|
||||
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Pending Accounts"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -32,7 +32,15 @@
|
||||
<field name="code" select="1"/>
|
||||
<field name="partner_id" select="1"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Parent" icon="terp-folder-orange" domain="[]" context="{'group_by':'parent_id'}"/>
|
||||
<filter string="Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Associated Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -148,7 +156,7 @@
|
||||
<field name="journal_id" select="2"/>
|
||||
<field name="general_account_id" select="2"/>
|
||||
<field name="move_id" select="2"/>
|
||||
<separator string="Optionnal Information" colspan="4"/>
|
||||
<separator string="Optional Information" colspan="4"/>
|
||||
<field name="unit_amount" select="2"/>
|
||||
<field name="ref" select="2"/>
|
||||
<field name="currency_id" select="2"/>
|
||||
@@ -195,6 +203,14 @@
|
||||
<field name="date" select="1"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
</group>
|
||||
<separator orientation="vertical"/>
|
||||
<newline/>
|
||||
<group string="Group By..." expand="0">
|
||||
<filter string="General Account" context="{'group_by':'general_account_id'}"/>
|
||||
<filter string="Analytic Account" context="{'group_by':'account_id'}"/>
|
||||
<filter string="Analytic Journal" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Product" context="{'group_by':'product_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -277,7 +293,20 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_analytic_journal_search" model="ir.ui.view">
|
||||
<field name="name">account.analytic.journal.search</field>
|
||||
<field name="model">account.analytic.journal</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="analytic Journals">
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Type" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_analytic_journal_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.journal.form</field>
|
||||
<field name="model">account.analytic.journal</field>
|
||||
@@ -296,7 +325,7 @@
|
||||
<field name="name">Analytic Journals</field>
|
||||
<field name="res_model">account.analytic.journal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
<menuitem action="action_account_analytic_journal_form" id="account_def_analytic_journal" parent="menu_analytic"/>
|
||||
|
||||
|
||||
+14
-12
@@ -7,18 +7,20 @@
|
||||
<field name="model">account.analytic.cost.ledger.journal.report</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select period">
|
||||
<separator string="Cost Legder for period" colspan="4"/>
|
||||
<field name="date1"/>
|
||||
<field name="date2"/>
|
||||
<separator string="and Journals" colspan="4"/>
|
||||
<field name="journal" colspan="4"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print"/>
|
||||
</group>
|
||||
</form>
|
||||
<form string="Select period">
|
||||
<group width="450">
|
||||
<separator string="Cost Legder for period" colspan="4"/>
|
||||
<field name="date1"/>
|
||||
<field name="date2"/>
|
||||
<separator string="and Journals" colspan="4"/>
|
||||
<field name="journal" colspan="4" nolabel="1"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
import account_automatic_reconcile
|
||||
import account_move_line_reconcile_select
|
||||
import account_move_line_unreconcile_select
|
||||
import account_reconcile_partner_process
|
||||
import account_reconcile
|
||||
import account_unreconcile
|
||||
import account_invoice_refund
|
||||
|
||||
@@ -241,7 +241,6 @@ class account_automatic_reconcile(osv.osv_memory):
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'context': context,
|
||||
'nodestroy':True,
|
||||
}
|
||||
|
||||
account_automatic_reconcile()
|
||||
|
||||
@@ -7,16 +7,18 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Close states of Fiscal year and periods">
|
||||
<group colspan="4" >
|
||||
<field name="fy_id" domain = "[('state','=','draft')]"/>
|
||||
<separator string="Are you sure you want to close the fiscal year ?" colspan="4"/>
|
||||
<field name="sure"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-close" string="Close states" name="data_save" type="object"/>
|
||||
<group width="380" height="180">
|
||||
<group colspan="4">
|
||||
<field name="fy_id" domain = "[('state','=','draft')]"/>
|
||||
<separator string="Are you sure you want to close the fiscal year ?" colspan="4"/>
|
||||
<field name="sure"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-close" string="Close states" name="data_save" type="object"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_reconcile_select"
|
||||
id="menu_reconcile_select" parent="periodical_processing_reconciliation" />
|
||||
<!-- <menuitem action="action_account_reconcile_select"
|
||||
id="menu_reconcile_select" parent="periodical_processing_reconciliation" /> -->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -43,7 +43,6 @@ class account_move_line_select(osv.osv_memory):
|
||||
else:
|
||||
fiscalyear_ids = [context['fiscalyear']]
|
||||
|
||||
# fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
|
||||
fiscalyears = fiscalyear_obj.browse(cr, uid, fiscalyear_ids)
|
||||
|
||||
period_ids = []
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_unreconcile_select"
|
||||
id="menu_unreconcile_select" parent="periodical_processing_reconciliation" />
|
||||
<!-- <menuitem action="action_account_unreconcile_select"
|
||||
id="menu_unreconcile_select" parent="periodical_processing_reconciliation" /> -->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -23,19 +23,19 @@ import time
|
||||
from osv import fields, osv
|
||||
from tools.translate import _
|
||||
|
||||
class account_move_line_reconcile_prompt(osv.osv_memory):
|
||||
"""
|
||||
Asks user he wants to reconcile entries or not.
|
||||
"""
|
||||
_name = 'account.move.line.reconcile.prompt'
|
||||
_description = 'Account move line reconcile'
|
||||
_columns = {
|
||||
}
|
||||
|
||||
def ask_reconcilation(self, cr, uid, ids, context):
|
||||
return self.pool.get('account.move.line.reconcile').partial_check(cr, uid, ids, context)
|
||||
|
||||
account_move_line_reconcile_prompt()
|
||||
#class account_move_line_reconcile_prompt(osv.osv_memory):
|
||||
# """
|
||||
# Asks user he wants to reconcile entries or not.
|
||||
# """
|
||||
# _name = 'account.move.line.reconcile.prompt'
|
||||
# _description = 'Account move line reconcile'
|
||||
# _columns = {
|
||||
# }
|
||||
#
|
||||
# def ask_reconcilation(self, cr, uid, ids, context):
|
||||
# return self.pool.get('account.move.line.reconcile').partial_check(cr, uid, ids, context)
|
||||
#
|
||||
#account_move_line_reconcile_prompt()
|
||||
|
||||
class account_move_line_reconcile(osv.osv_memory):
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
class account_partner_reconcile_process(osv.osv_memory):
|
||||
_name = 'account.partner.reconcile.process'
|
||||
_description = 'Reconcilation Process partner by partner'
|
||||
|
||||
def _get_to_reconcile(self, cr, uid, context=None):
|
||||
cr.execute(
|
||||
"SELECT l.partner_id " \
|
||||
"FROM account_move_line AS l LEFT JOIN res_partner p ON (p.id = l.partner_id) " \
|
||||
"WHERE l.reconcile_id IS NULL " \
|
||||
"AND (%s > to_char(p.last_reconciliation_date, 'YYYY-MM-DD') " \
|
||||
"OR p.last_reconciliation_date IS NULL ) " \
|
||||
"AND l.state <> 'draft' " \
|
||||
"GROUP BY l.partner_id ",(time.strftime('%Y-%m-%d'),)
|
||||
)
|
||||
return len(map(lambda x: x[0], cr.fetchall())) - 1
|
||||
|
||||
def _get_today_reconciled(self, cr, uid, context=None):
|
||||
cr.execute(
|
||||
"SELECT l.partner_id " \
|
||||
"FROM account_move_line AS l LEFT JOIN res_partner p ON (p.id = l.partner_id) " \
|
||||
"WHERE l.reconcile_id IS NULL " \
|
||||
"AND %s = to_char(p.last_reconciliation_date, 'YYYY-MM-DD') " \
|
||||
"AND l.state <> 'draft' " \
|
||||
"GROUP BY l.partner_id ",(time.strftime('%Y-%m-%d'),)
|
||||
)
|
||||
return len(map(lambda x: x[0], cr.fetchall())) + 1
|
||||
|
||||
def _get_partner(self, cr, uid, context=None):
|
||||
partner = self.pool.get('account.move.line').get_next_partner_only(cr, uid, offset=1, context=context)
|
||||
if not partner:
|
||||
return False
|
||||
return partner[0]
|
||||
|
||||
def data_get(self, cr, uid, to_reconcile, today_reconciled, context=None):
|
||||
return {'progress': (100 / float(to_reconcile + today_reconciled)) * today_reconciled}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
res = super(account_partner_reconcile_process, self).default_get(cr, uid, fields, context=context)
|
||||
if 'to_reconcile' in res and 'today_reconciled' in res:
|
||||
data = self.data_get(cr, uid, res['to_reconcile'], res['today_reconciled'], context)
|
||||
res.update(data)
|
||||
return res
|
||||
|
||||
def next_partner(self, cr, uid, ids, context=None):
|
||||
partner_id = self.pool.get('account.move.line').read(cr, uid, context['active_id'], ['partner_id'])['partner_id'][0]
|
||||
self.pool.get('res.partner').write(cr, uid, partner_id, {'last_reconciliation_date': time.strftime('%Y-%m-%d')}, context)
|
||||
#TODO: we have to find a way to update the context of the current tab (we could open a new tab with the context but it's not really handy)
|
||||
#TODO: remove that comments when the client side dev is done
|
||||
#context.update({'partner_id': self.browse(cr, uid, ids, context)[0].next_partner_id})
|
||||
#return {'context': context,
|
||||
# 'target': 'opener',
|
||||
# 'name': 'reconciliation process',
|
||||
# 'view_type': 'form',
|
||||
# 'view_mode': 'tree,form',
|
||||
# 'res_model': 'account.move.line',
|
||||
# 'type': 'ir.actions.act_window'
|
||||
#}
|
||||
return {}
|
||||
|
||||
_columns = {
|
||||
'to_reconcile': fields.float('Remaining Partners', readonly=True, help='This is the remaining partners for who you should check if there is something to reconcile or not. This figure already count the current partner as reconciled.'),
|
||||
'today_reconciled': fields.float('Partners Reconciled Today', readonly=True, help='This figure depicts the total number of partners that have gone throught the reconciliation process today. The current partner is counted as already processed.'),
|
||||
'progress': fields.float('Progress', readonly=True, help='Shows you the progress made today on the reconciliation process. Given by \nPartners Reconciled Today \ (Remaining Partners + Partners Reconciled Today)'),
|
||||
'next_partner_id': fields.many2one('res.partner', 'Next Partner to Reconcile', readonly=True, help='This field shows you the next partner that will be automatically chosen by the system to go through the reconciliation process, based on the latest day it have been reconciled.'), # TODO: remove the readonly=True when teh client side will allow to update the context of existing tab, so that the user can change this value if he doesn't want to follow openerp proposal
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'to_reconcile': _get_to_reconcile,
|
||||
'today_reconciled': _get_today_reconciled,
|
||||
'next_partner_id': _get_partner,
|
||||
}
|
||||
|
||||
account_partner_reconcile_process()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="account_partner_reconcile_view" model="ir.ui.view">
|
||||
<field name="name">Partner Reconcilation Process</field>
|
||||
<field name="model">account.partner.reconcile.process</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Partner Reconciliation">
|
||||
<field name="progress" widget="progressbar" colspan="4"/>
|
||||
<field name="today_reconciled"/>
|
||||
<field name="to_reconcile"/>
|
||||
<newline/>
|
||||
<field name="next_partner_id" colspan="4"/>
|
||||
<newline/>
|
||||
<group colspan="4" col="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="next_partner" icon="gtk-go-forward" type="object" string="Go to next partner" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_partner_reconcile" model="ir.actions.act_window">
|
||||
<field name="name">Reconciliation: Go to Next Partner</field>
|
||||
<field name="res_model">account.partner.reconcile.process</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="account_partner_reconcile_view"/>
|
||||
<field name="context">{'record_id':active_id}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<record model="ir.values" id="action_partner_reconcile_actino">
|
||||
<field name="model_id" ref="account.model_account_move_line" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Partner reconciliation</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_partner_reconcile'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">account.move.line</field>
|
||||
</record>
|
||||
|
||||
<!-- <menuitem
|
||||
icon="STOCK_EXECUTE"
|
||||
name="Partner reconciliation"
|
||||
action="action_account_partner_reconcile"
|
||||
id="menu_partner_reconcile"
|
||||
parent="account.next_id_20"/>
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -2,86 +2,130 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_move_line_reconcile_prompt" model="ir.ui.view">
|
||||
<field name="name">account.move.line.reconcile.prompt.form</field>
|
||||
<field name="model">account.move.line.reconcile.prompt</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Reconciliation">
|
||||
<separator string="Are you sure you want to reconcile entries?" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<!-- <record id="view_account_move_line_reconcile_prompt" model="ir.ui.view">-->
|
||||
<!-- <field name="name">account.move.line.reconcile.prompt.form</field>-->
|
||||
<!-- <field name="model">account.move.line.reconcile.prompt</field>-->
|
||||
<!-- <field name="type">form</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="Reconciliation">-->
|
||||
<!-- <separator string="Are you sure you want to reconcile entries?" colspan="4"/>-->
|
||||
<!-- <group colspan="4" col="6">-->
|
||||
<!-- <label string ="" colspan="2"/>-->
|
||||
<!---->
|
||||
<!-- <button icon="gtk-cancel" special="cancel" string="Cancel"/>-->
|
||||
<!-- <button icon="gtk-ok" string="Ok" name="ask_reconcilation" type="object" default_focus="1"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-ok" string="Ok" name="ask_reconcilation" type="object" default_focus="1"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="action_view_account_move_line_reconcile_prompt" model="ir.actions.act_window">-->
|
||||
<!-- <field name="name">Reconcile Entries</field>-->
|
||||
<!-- <field name="res_model">account.move.line.reconcile.prompt</field>-->
|
||||
<!-- <field name="view_type">form</field>-->
|
||||
<!-- <field name="view_mode">tree,form</field>-->
|
||||
<!-- <field name="view_id" ref="view_account_move_line_reconcile_prompt"/>-->
|
||||
<!-- <field name="target">new</field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="action_view_account_move_line_reconcile_prompt" model="ir.actions.act_window">
|
||||
<field name="name">Reconcile Entries</field>
|
||||
<field name="res_model">account.move.line.reconcile.prompt</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_move_line_reconcile_prompt"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="action_account_move_line_reconcile_prompt_values">
|
||||
<field name="model_id" ref="account.model_account_move_line" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Reconcile Entries</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_view_account_move_line_reconcile_prompt'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">account.move.line</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_move_line_reconcile_full" model="ir.ui.view">
|
||||
<!-- <record model="ir.values" id="action_account_move_line_reconcile_prompt_values">-->
|
||||
<!-- <field name="model_id" ref="account.model_account_move_line" />-->
|
||||
<!-- <field name="object" eval="1" />-->
|
||||
<!-- <field name="name">Reconcile Entries</field>-->
|
||||
<!-- <field name="key2">client_action_multi</field>-->
|
||||
<!-- <field name="value" eval="'ir.actions.act_window,' +str(ref('action_view_account_move_line_reconcile_prompt'))" />-->
|
||||
<!-- <field name="key">action</field>-->
|
||||
<!-- <field name="model">account.move.line</field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="view_account_move_line_reconcile_full" model="ir.ui.view">
|
||||
<field name="name">account.move.line.reconcile.full.form</field>
|
||||
<field name="model">account.move.line.reconcile</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Reconciliation">
|
||||
<separator string="Reconciliation transactions" colspan="4"/>
|
||||
<field name="trans_nbr"/>
|
||||
<newline/>
|
||||
<field name="credit"/>
|
||||
<field name="debit"/>
|
||||
<separator string="Write-Off" colspan="4"/>
|
||||
<field name="writeoff"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="terp-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1"/>
|
||||
</group>
|
||||
<group height="210" width="550">
|
||||
<separator string="Reconciliation transactions" colspan="4"/>
|
||||
<field name="trans_nbr"/>
|
||||
<newline/>
|
||||
<field name="credit"/>
|
||||
<field name="debit"/>
|
||||
<separator string="Write-Off" colspan="4"/>
|
||||
<field name="writeoff"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="terp-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1" attrs="{'invisible':[('writeoff','!=',0)]}"/>
|
||||
<button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" attrs="{'invisible':[('writeoff','==',0)]}"/>
|
||||
<button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object" attrs="{'invisible':[('writeoff','==',0)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_move_line_reconcile_partial" model="ir.ui.view">
|
||||
<field name="name">account.move.line.reconcile.partial.form</field>
|
||||
<field name="model">account.move.line.reconcile</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Reconciliation">
|
||||
<separator string="Reconciliation transactions" colspan="4"/>
|
||||
<field name="trans_nbr"/>
|
||||
<newline/>
|
||||
<field name="credit"/>
|
||||
<field name="debit"/>
|
||||
<separator string="Write-Off" colspan="4"/>
|
||||
<field name="writeoff"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" default_focus="1"/>
|
||||
<button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
<record id="action_view_account_move_line_reconcile" model="ir.actions.act_window">
|
||||
<field name="name">Reconcile Entries</field>
|
||||
<field name="res_model">account.move.line.reconcile</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_account_move_line_reconcile_full"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="action_account_move_line_reconcile_prompt_values">
|
||||
<field name="model_id" ref="account.model_account_move_line" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Reconcile Entries</field>
|
||||
<field name="key2">client_action_multi</field>
|
||||
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_view_account_move_line_reconcile'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">account.move.line</field>
|
||||
</record>
|
||||
<!-- <record id="view_account_move_line_reconcile_full" model="ir.ui.view">-->
|
||||
<!-- <field name="name">account.move.line.reconcile.full.form</field>-->
|
||||
<!-- <field name="model">account.move.line.reconcile</field>-->
|
||||
<!-- <field name="type">form</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="Reconciliation">-->
|
||||
<!-- <separator string="Reconciliation transactions" colspan="4"/>-->
|
||||
<!-- <field name="trans_nbr"/>-->
|
||||
<!-- <newline/>-->
|
||||
<!-- <field name="credit"/>-->
|
||||
<!-- <field name="debit"/>-->
|
||||
<!-- <separator string="Write-Off" colspan="4"/>-->
|
||||
<!-- <field name="writeoff"/>-->
|
||||
<!-- <group colspan="4" col="6">-->
|
||||
<!-- <label string ="" colspan="2"/>-->
|
||||
<!-- <button icon="gtk-cancel" special="cancel" string="Cancel"/>-->
|
||||
<!-- <button icon="terp-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
<!---->
|
||||
<!-- <record id="view_account_move_line_reconcile_partial" model="ir.ui.view">-->
|
||||
<!-- <field name="name">account.move.line.reconcile.partial.form</field>-->
|
||||
<!-- <field name="model">account.move.line.reconcile</field>-->
|
||||
<!-- <field name="type">form</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="Reconciliation">-->
|
||||
<!-- <separator string="Reconciliation transactions" colspan="4"/>-->
|
||||
<!-- <field name="trans_nbr"/>-->
|
||||
<!-- <newline/>-->
|
||||
<!-- <field name="credit"/>-->
|
||||
<!-- <field name="debit"/>-->
|
||||
<!-- <separator string="Write-Off" colspan="4"/>-->
|
||||
<!-- <field name="writeoff"/>-->
|
||||
<!-- <group colspan="4" col="6">-->
|
||||
<!-- <label string ="" colspan="2"/>-->
|
||||
<!-- <button icon="gtk-cancel" special="cancel" string="Cancel"/>-->
|
||||
<!-- <button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" default_focus="1"/>-->
|
||||
<!-- <button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="account_move_line_reconcile_writeoff" model="ir.ui.view">
|
||||
<field name="name">account.move.line.reconcile.writeoff.form</field>
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Create Entries From Models">
|
||||
<group height="240" width="510">
|
||||
<group height="250" width="470">
|
||||
<separator string="This wizard will create entries from Models" colspan="4"/>
|
||||
<field name="model"/>
|
||||
<separator string="Account Models" colspan="4"/>
|
||||
<field name="model" nolabel="1"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="2">
|
||||
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="model">account.analytic.default</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Analytic Defaults" editable="bottom">
|
||||
<tree string="Analytic Defaults">
|
||||
<field name="sequence"/>
|
||||
<field name="analytic_id" required="1"/>
|
||||
<field name="product_id"/>
|
||||
@@ -18,17 +18,18 @@
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_analytic_default_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.default.form</field>
|
||||
<field name="model">account.analytic.default</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Analytic Defaults">
|
||||
<field name="analytic_id" select="1" required="1"/>
|
||||
<field name="analytic_id" required="1"/>
|
||||
<field name="sequence"/>
|
||||
<separator string="Conditions" colspan="4"/>
|
||||
<field name="product_id" select="1"/>
|
||||
<field name="partner_id" select="1"/>
|
||||
<field name="product_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="date_start"/>
|
||||
@@ -36,11 +37,27 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_analytic_default_form_search" model="ir.ui.view">
|
||||
<field name="name">account.analytic.default.search</field>
|
||||
<field name="model">account.analytic.default</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Accounts">
|
||||
<field name="analytic_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="company_id"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_analytic_default_form" model="ir.actions.act_window">
|
||||
<field name="name">Analytic Defaults</field>
|
||||
<field name="res_model">account.analytic.default</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_account_analytic_default_form_search"/>
|
||||
</record>
|
||||
<!-- <menuitem-->
|
||||
<!-- action="action_analytic_default_form"-->
|
||||
@@ -48,7 +65,12 @@
|
||||
<!-- parent="account.menu_analytic_accounting"/>-->
|
||||
|
||||
<act_window
|
||||
domain="[('account_id', '=', active_id)]" id="act_account_acount_move_line_open" name="Entries" res_model="account.move.line" src_model="account.account"/>
|
||||
name="Entries"
|
||||
id="act_account_acount_move_line_open"
|
||||
res_model="account.move.line"
|
||||
src_model="account.account"
|
||||
domain="[('account_id', '=', active_id)]"/>
|
||||
|
||||
<act_window
|
||||
name="Analytic Rules"
|
||||
id="analytic_rule_action_partner"
|
||||
@@ -56,12 +78,14 @@
|
||||
src_model="res.partner"
|
||||
domain="[('partner_id','=',active_id)]"
|
||||
groups="base.group_extended"/>
|
||||
|
||||
<act_window
|
||||
name="Analytic Rules"
|
||||
id="analytic_rule_action_user"
|
||||
res_model="account.analytic.default"
|
||||
src_model="res.users"
|
||||
domain="[('user_id','=',active_id)]"/>
|
||||
|
||||
<act_window
|
||||
name="Analytic Rules"
|
||||
res_model="account.analytic.default"
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
<form string="Analytic Plan">
|
||||
<field name="name" select="1"/>
|
||||
<field name="default_instance_id"/>
|
||||
<field name="plan_ids" colspan="4"/>
|
||||
<field name="plan_ids" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -192,7 +192,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
parent="account.menu_analytic"
|
||||
name="Multi Plans"
|
||||
@@ -201,7 +201,7 @@
|
||||
<menuitem
|
||||
parent="menu_account_analytic_multi_plan_action"
|
||||
id="menu_account_analytic_plan_action"
|
||||
action="account_analytic_plan_form_action"/>
|
||||
action="account_analytic_plan_form_action"/>
|
||||
|
||||
<record model="ir.ui.view" id="account_analytic_plan_line_form">
|
||||
<field name="name">account.analytic.plan.line.form</field>
|
||||
|
||||
@@ -75,11 +75,6 @@
|
||||
<page string="Accounts">
|
||||
<field name="account_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Dotations">
|
||||
<button string="Spread" name="%(action_account_budget_spread)d" type="action" icon="gtk-fullscreen"/>
|
||||
<field name="dotation_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
|
||||
<page string="Budget Lines">
|
||||
<field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="graph,tree">
|
||||
<graph type="bar" string="Lines">
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select Dates Period">
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
<group width="450">
|
||||
<separator string="This wizard is used to print budget" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -8,12 +8,15 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select Dates Period">
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
<group width="450">
|
||||
<separator string="This wizard is used to print budget" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select Dates Period">
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
<group width="450">
|
||||
<separator string="This wizard is used to print summary of budgets" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select Dates Period">
|
||||
<field name="date1"/>
|
||||
<field name="date2"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
<group width="450">
|
||||
<separator string="Print Budgets" colspan="4"/>
|
||||
<field name="date1"/>
|
||||
<field name="date2"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -7,14 +7,16 @@
|
||||
<field name="model">account.budget.spread</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select Dates Period">
|
||||
<field name="fiscalyear"/>
|
||||
<field name="amount"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_spread" string="Ok" type="object" icon="gtk-ok" default_focus="1"/>
|
||||
<form string="Select Fiscalyear">
|
||||
<group width="480">
|
||||
<separator string="" colspan="4"/>
|
||||
<field name="fiscalyear"/>
|
||||
<field name="amount"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_spread" string="Ok" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,7 +15,7 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -27,7 +27,7 @@ class account_coda(osv.osv):
|
||||
_description = "coda for an Account"
|
||||
_columns = {
|
||||
'name': fields.binary('Coda file', readonly=True),
|
||||
'statement_ids': fields.one2many('account.bank.statement','coda_id','Generated Bank Statement', readonly=True),
|
||||
'statement_ids': fields.one2many('account.bank.statement','coda_id','Generated Bank Statements', readonly=True),
|
||||
'note': fields.text('Import log', readonly=True),
|
||||
'journal_id': fields.many2one('account.journal','Bank Journal', readonly=True, select=True),
|
||||
'date': fields.date('Import Date', readonly=True, select=True),
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
<field name="journal_id" />
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<notebook colspan="4">
|
||||
<page string="Log">
|
||||
<field name="note" colspan="4"/>
|
||||
</page>
|
||||
<page string="Statements">
|
||||
<field name="statement_ids" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<notebook colspan="4">
|
||||
<page string="Log">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Statements">
|
||||
<field name="statement_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -124,7 +124,7 @@ def _coda_parsing(self, cr, uid, data, context):
|
||||
bank_statement['date'] = str2date(line[5:11])
|
||||
bank_statement['journal_id']=data['form']['journal_id']
|
||||
period_id = pool.get('account.period').search(cr, uid, [('date_start','<=',time.strftime('%Y-%m-%d',time.strptime(bank_statement['date'],"%y/%m/%d"))),('date_stop','>=',time.strftime('%Y-%m-%d',time.strptime(bank_statement['date'],"%y/%m/%d")))])
|
||||
bank_statement['period_id'] = period_id[0]
|
||||
bank_statement['period_id'] = period_id and period_id[0] or False
|
||||
bank_statement['state']='draft'
|
||||
elif line[0] == '1':
|
||||
# old balance data
|
||||
@@ -221,7 +221,7 @@ def _coda_parsing(self, cr, uid, data, context):
|
||||
bk_st_id = pool.get('account.bank.statement').create(cr,uid,{
|
||||
'journal_id': statement['journal_id'],
|
||||
'date':time.strftime('%Y-%m-%d',time.strptime(statement['date'],"%y/%m/%d")),
|
||||
# 'period_id':statement['period_id'],
|
||||
'period_id':statement['period_id'],
|
||||
'balance_start': statement["balance_start"],
|
||||
'balance_end_real': statement["balance_end_real"],
|
||||
'state': 'draft',
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
Modules to automate letters for unpaid invoices, with multi-level recalls.
|
||||
|
||||
You can define your multiple levels of recall through the menu:
|
||||
Financial Management/Configuration/Payment Terms/Follow-Ups
|
||||
Financial Management/Configuration/Follow-Ups
|
||||
|
||||
Once it's defined, you can automatically print recalls every day
|
||||
through simply clicking on the menu:
|
||||
Financial_Management/Periodical_Processing/Print_Follow-Ups
|
||||
Financial Management/Periodical Processing/Send followups
|
||||
|
||||
It will generate a PDF with all the letters according the the
|
||||
different levels of recall defined. You can define different policies
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
|
||||
Note that if you want to change the followup level for a given partner/account entry, you can do it in the menu:
|
||||
Financial_Management/Reporting/Follow-Ups/All Receivable Entries
|
||||
Financial Management/Reporting/Follow-Ups/All receivable entries
|
||||
|
||||
""",
|
||||
'author': 'Tiny',
|
||||
|
||||
@@ -171,14 +171,13 @@ class account_followup_print_all(osv.osv_memory):
|
||||
data = self.read(cr, uid, ids, [])[0]
|
||||
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_print_all_msg')], context=context)
|
||||
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
|
||||
|
||||
if data['email_conf']:
|
||||
mail_notsent = ''
|
||||
msg_sent = ''
|
||||
msg_unsent = ''
|
||||
count = 0
|
||||
data_user = user_obj.browse(cr, uid, uid)
|
||||
move_lines = line_obj.browse(cr, uid, data['partner_ids'][0][2])
|
||||
move_lines = line_obj.browse(cr, uid, data['partner_ids'])
|
||||
partners = []
|
||||
dict_lines = {}
|
||||
for line in move_lines:
|
||||
|
||||
@@ -45,11 +45,11 @@
|
||||
<field name="model">payment.type</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Payment Type">
|
||||
<field name="name" select="1"/>
|
||||
<form string="Payment Type">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<newline/>
|
||||
<field colspan="4" name="suitable_bank_types" select="1"/>
|
||||
<separator string="Suitable Bank Types" colspan="4"/>
|
||||
<field name="suitable_bank_types" nolabel="1" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -102,8 +102,8 @@
|
||||
</blockTable>
|
||||
<para style="P3"><font color="white"> </font></para>
|
||||
<para style="P3"><seqReset/></para>
|
||||
<para style="P1">[[ repeatIn(lines(data['form']),'o')]]</para>
|
||||
<section>
|
||||
<para style="P1">[[ repeatIn(lines(data['form']),'o')]]</para>
|
||||
<blockTable colWidths="528.0" style="Table7">
|
||||
<tr>
|
||||
<td><para style="P11"><font color="white">[['.....'*(o['level']) ]]</font><font>[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]</font>(<seq/>)<font>[[ o['name'] ]] ([[ o['code'] ]])</font></para></td>
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Indicators">
|
||||
<label string="Select the criteria based on which Indicators will be printed."/>
|
||||
<newline/>
|
||||
<group width="450">
|
||||
<separator string="Select the criteria based on which Indicators will be printed." colspan="4"/>
|
||||
<field name="select_base"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="next" string="Next" type="object" icon="gtk-ok" default_focus="1"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="next" string="Next" type="object" icon="gtk-ok" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -31,9 +31,11 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_account_report_print_indicators"
|
||||
name="Print Indicators"
|
||||
parent="account_report.menu_action_account_report_tree_view" id="menu_wizard_print_indicators"/>
|
||||
<menuitem
|
||||
action="action_account_report_print_indicators"
|
||||
name="Print Indicators"
|
||||
parent="account_report.menu_action_account_report_tree_view"
|
||||
id="menu_wizard_print_indicators"/>
|
||||
|
||||
<record id="account_report_print_indicators_relation_view" model="ir.ui.view">
|
||||
<field name="name">account.report.print.indicators.relation.form</field>
|
||||
@@ -41,10 +43,10 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Indicators">
|
||||
<newline/>
|
||||
<separator string="" colspan="4"/>
|
||||
<newline/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<newline/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
|
||||
@@ -8,16 +8,14 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select period">
|
||||
<group width="660" height="480">
|
||||
<field name="company_id"/>
|
||||
<field name="display_account" required = "True"/>
|
||||
<newline/>
|
||||
<field name="fiscalyear"/>
|
||||
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
|
||||
<field name="display_type"/>
|
||||
<newline/>
|
||||
<separator string="Filters" colspan="4"/>
|
||||
<field name="state" required="True"/>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('state','=','none')]}" colspan="4">
|
||||
<group attrs="{'invisible':[('state','=','byperiod')]}" colspan="4">
|
||||
<separator string="Date Filter" colspan="4"/>
|
||||
@@ -29,12 +27,12 @@
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_state" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -8,32 +8,30 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select period">
|
||||
<field name="company_id"/>
|
||||
<field name="display_account" required = "True"/>
|
||||
<newline/>
|
||||
<field name="fiscalyear"/>
|
||||
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
|
||||
<field name="display_type"/>
|
||||
<newline/>
|
||||
<separator string="Filters" colspan="4"/>
|
||||
<field name="state" required="True"/>
|
||||
<newline/>
|
||||
<group attrs="{'invisible':[('state','=','none')]}" colspan="4">
|
||||
<group attrs="{'invisible':[('state','=','byperiod')]}" colspan="4">
|
||||
<separator string="Date Filter" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('state','=','bydate')]}" colspan="4">
|
||||
<separator string="Filter on Periods" colspan="4"/>
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_state" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
<group width="660" height="480">
|
||||
<field name="company_id"/>
|
||||
<field name="display_account" required = "True"/>
|
||||
<field name="fiscalyear"/>
|
||||
<label colspan="2" string="(Keep empty for all open fiscal years)" align="0.0"/>
|
||||
<field name="display_type"/>
|
||||
<separator string="Filters" colspan="4"/>
|
||||
<field name="state" required="True"/>
|
||||
<group attrs="{'invisible':[('state','=','none')]}" colspan="4">
|
||||
<group attrs="{'invisible':[('state','=','byperiod')]}" colspan="4">
|
||||
<separator string="Date Filter" colspan="4"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('state','=','bydate')]}" colspan="4">
|
||||
<separator string="Filter on Periods" colspan="4"/>
|
||||
<field name="periods" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_state" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -73,9 +71,9 @@
|
||||
<field name="context">{'record_id':active_id}</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
parent="account.menu_finance_legal_statement"
|
||||
|
||||
<menuitem
|
||||
parent="account.menu_finance_legal_statement"
|
||||
id="final_accounting_reports"
|
||||
name="Accounting Reports"/>
|
||||
|
||||
|
||||
@@ -9,21 +9,22 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account reporting">
|
||||
<notebook>
|
||||
<page string="General">
|
||||
<field name="name" select="1" colspan="3"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="parent_id" select="1" />
|
||||
<field name="sequence"/>
|
||||
<field name="color_font"/>
|
||||
<field name="color_back"/>
|
||||
<field name="font_style" />
|
||||
<field name="report_type" />
|
||||
<newline/>
|
||||
<separator string="Accounts" colspan="4"/>
|
||||
<field name="account_id" colspan="4" nolabel="1"/>
|
||||
</page><page string="Notes">
|
||||
<field name="note" nolabel="1" colspan="4"/>
|
||||
</page>
|
||||
<page string="General">
|
||||
<field name="name" colspan="2"/>
|
||||
<field name="code"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="sequence"/>
|
||||
<field name="color_font"/>
|
||||
<field name="color_back"/>
|
||||
<field name="font_style"/>
|
||||
<field name="report_type"/>
|
||||
<newline/>
|
||||
<separator string="Accounts" colspan="4"/>
|
||||
<field name="account_id" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field name="note" nolabel="1" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Select Dates Period">
|
||||
<field name="fiscalyear"/>
|
||||
<newline/>
|
||||
<field name="periods"/>
|
||||
<group colspan="4" col="6">
|
||||
<label string ="" colspan="2"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
<group height="350" width="390">
|
||||
<field name="fiscalyear" colspan="4"/>
|
||||
<newline/>
|
||||
<separator string="Periods" colspan="4"/>
|
||||
<field name="periods" nolabel="1" colspan="4"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="check_report" string="Print" type="object" icon="gtk-print" default_focus="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -51,7 +51,7 @@ ir_sequence_type()
|
||||
class account_journal(osv.osv):
|
||||
_inherit = "account.journal"
|
||||
_columns = {
|
||||
'max_amount': fields.float('Verify Transection', digits=(16, int(config['price_accuracy'])), help="Validate voucher entry twice before posting it, if transection amount more then entered here"),
|
||||
'max_amount': fields.float('Verify Transaction', digits=(16, int(config['price_accuracy'])), help="Validate voucher entry twice before posting it, if transection amount more then entered here"),
|
||||
}
|
||||
account_journal()
|
||||
|
||||
@@ -60,7 +60,7 @@ class account_voucher(osv.osv):
|
||||
def _get_period(self, cr, uid, context={}):
|
||||
if context.get('period_id', False):
|
||||
return context.get('period_id')
|
||||
|
||||
|
||||
periods = self.pool.get('account.period').find(cr, uid)
|
||||
if periods:
|
||||
return periods[0]
|
||||
@@ -76,12 +76,12 @@ class account_voucher(osv.osv):
|
||||
|
||||
def _get_journal(self, cr, uid, context={}):
|
||||
journal_pool = self.pool.get('account.journal')
|
||||
|
||||
|
||||
if context.get('journal_id', False):
|
||||
return context.get('journal_id')
|
||||
|
||||
|
||||
type_inv = context.get('type', 'rec_voucher')
|
||||
|
||||
|
||||
ttype = type2journal.get(type_inv, type_inv)
|
||||
res = journal_pool.search(cr, uid, [('type', '=', ttype)], limit=1)
|
||||
|
||||
@@ -131,7 +131,7 @@ class account_voucher(osv.osv):
|
||||
help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed Voucher. \
|
||||
\n* The \'Pro-forma\' when voucher is in Pro-forma state,voucher does not have an voucher number. \
|
||||
\n* The \'Posted\' state is used when user create voucher,a voucher number is generated and voucher entries are created in account \
|
||||
\n* The \'Cancelled\' state is used when user cancel voucher.'),
|
||||
\n* The \'Cancelled\' state is used when user cancel voucher.'),
|
||||
'amount':fields.float('Amount', readonly=True),
|
||||
'number':fields.char('Number', size=32, readonly=True),
|
||||
'reference': fields.char('Voucher Reference', size=64),
|
||||
@@ -147,7 +147,7 @@ class account_voucher(osv.osv):
|
||||
'type': _get_type,
|
||||
'journal_id':_get_journal,
|
||||
'currency_id': _get_currency,
|
||||
|
||||
|
||||
'state': lambda *a: 'draft',
|
||||
'date' : lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'reference_type': lambda *a: "none",
|
||||
@@ -159,7 +159,7 @@ class account_voucher(osv.osv):
|
||||
# cur_obj = self.pool.get('res.currency')
|
||||
|
||||
def onchange_account(self, cr, uid, ids, account_id):
|
||||
|
||||
|
||||
if not account_id:
|
||||
return {
|
||||
'value':{'amount':False}
|
||||
@@ -176,9 +176,9 @@ class account_voucher(osv.osv):
|
||||
return {
|
||||
'value':{'account_id':False}
|
||||
}
|
||||
|
||||
|
||||
journal = self.pool.get('account.journal')
|
||||
|
||||
|
||||
if journal_id and (type in ('rec_voucher','bank_rec_voucher','journal_pur_voucher','journal_voucher')):
|
||||
account_id = journal.browse(cr, uid, journal_id).default_debit_account_id
|
||||
return {
|
||||
@@ -221,7 +221,7 @@ class account_voucher(osv.osv):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return True
|
||||
|
||||
def unlink(self, cr, uid, ids, context={}):
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
vouchers = self.read(cr, uid, ids, ['state'])
|
||||
unlink_ids = []
|
||||
for t in vouchers:
|
||||
@@ -229,7 +229,7 @@ class account_voucher(osv.osv):
|
||||
unlink_ids.append(t['id'])
|
||||
else:
|
||||
raise osv.except_osv('Invalid action !', 'Cannot delete Voucher(s) which are already opened or paid !')
|
||||
return super(account_voucher, self).unlink(self, cr, uid, unlink_ids)
|
||||
return super(account_voucher, self).unlink(cr, uid, unlink_ids, context=context)
|
||||
|
||||
def _get_analytic_lines(self, cr, uid, id):
|
||||
inv = self.browse(cr, uid, [id])[0]
|
||||
@@ -262,12 +262,12 @@ class account_voucher(osv.osv):
|
||||
return iml
|
||||
|
||||
def action_move_line_create(self, cr, uid, ids, *args):
|
||||
|
||||
|
||||
for inv in self.browse(cr, uid, ids):
|
||||
|
||||
|
||||
if inv.move_id:
|
||||
continue
|
||||
|
||||
|
||||
company_currency = inv.company_id.currency_id.id
|
||||
|
||||
line_ids = self.read(cr, uid, [inv.id], ['payment_ids'])[0]['payment_ids']
|
||||
@@ -386,7 +386,7 @@ class account_voucher(osv.osv):
|
||||
elif line.type == 'cr':
|
||||
move_line['credit'] = line.amount or False
|
||||
amount=line.amount * (-1)
|
||||
|
||||
|
||||
move_line['analytic_account_id'] = line.account_analytic_id.id or False
|
||||
ml_id=self.pool.get('account.move.line').create(cr, uid, move_line)
|
||||
|
||||
@@ -433,7 +433,7 @@ class account_voucher(osv.osv):
|
||||
'tax_amount': x.get('tax_amount', False),
|
||||
'ref':x.get('ref',False)
|
||||
}
|
||||
|
||||
|
||||
def _convert_ref(self, cr, uid, ref):
|
||||
return (ref or '').replace('/','')
|
||||
|
||||
|
||||
@@ -49,12 +49,16 @@
|
||||
<separator string="Narration" colspan="4"/>
|
||||
<field name="narration" colspan="4" nolabel="1" height="50"/>
|
||||
<group col="6" colspan="6">
|
||||
<group col="2" colspan="2">
|
||||
<field name="state"/>
|
||||
<button name="open_voucher" string="Pro-forma" states="draft"/>
|
||||
<button name="proforma_voucher" string="Create" states="proforma"/>
|
||||
</group>
|
||||
<group col="4" colspan="4">
|
||||
<button name="open_voucher" string="Pro-forma" states="draft" icon="terp-check"/>
|
||||
<button name="proforma_voucher" string="Create" states="proforma" icon="terp-document-new"/>
|
||||
<button name="recheck_voucher" string="Validate" states="recheck"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma,recheck" type="object"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma,recheck" type="object" icon="gtk-cancel"/>
|
||||
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Other Info">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import project
|
||||
import analytic
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * analytic
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2010-06-18 10:59:19+0000\n"
|
||||
"PO-Revision-Date: 2010-06-18 10:59:19+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,child_ids:0
|
||||
msgid "Child Accounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.line,amount_currency:0
|
||||
msgid "The amount expressed in the related account currency if not equal to the company one."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: constraint:ir.model:0
|
||||
msgid "The Object name must start with x_ and not contain any special character !"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,name:0
|
||||
msgid "Account Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.line,unit_amount:0
|
||||
msgid "Specifies the amount of quantity to count."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.line,currency_id:0
|
||||
msgid "The related account currency if not equal to the company one."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: model:ir.module.module,description:analytic.module_meta_information
|
||||
msgid "Module for defining analytic accounting object.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,state:0
|
||||
msgid "State"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,user_id:0
|
||||
msgid "Account Manager"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Draft"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Closed"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,debit:0
|
||||
msgid "Debit"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.account,state:0
|
||||
msgid "* When an account is created its in 'Draft' state. \n"
|
||||
"* If any associated partner is there, it can be in 'Open' state. \n"
|
||||
"* If any pending balance is there it can be in 'Pending'. \n"
|
||||
"* And finally when all the transactions are over, it can be in 'Close' state. \n"
|
||||
"* The project can be in either if the states 'Template' and 'Running'.\n"
|
||||
" If it is template then we can make projects based on the template projects. If its in 'Running' state it is a normal project. \n"
|
||||
" If it is to be reviewed then the state is 'Pending'.\n"
|
||||
" When the project is completed the state is set to 'Done'."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,type:0
|
||||
msgid "Account Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Template"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Pending"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: model:ir.model,name:analytic.model_account_analytic_line
|
||||
msgid "Analytic Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,description:0
|
||||
#: field:account.analytic.line,name:0
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.line,amount:0
|
||||
msgid "Calculated by multiplying the quantity and the price given in the Product's cost price."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,company_id:0
|
||||
#: field:account.analytic.line,company_id:0
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,quantity_max:0
|
||||
msgid "Maximum Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,user_id:0
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,parent_id:0
|
||||
msgid "Parent Analytic Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,date:0
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,currency_id:0
|
||||
#: field:account.analytic.line,currency_id:0
|
||||
msgid "Account currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,type:0
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.account,quantity_max:0
|
||||
msgid "Sets the higher limit of quantity of hours."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,credit:0
|
||||
msgid "Credit"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,amount:0
|
||||
msgid "Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,contact_id:0
|
||||
msgid "Contact"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Cancelled"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,balance:0
|
||||
msgid "Balance"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,date_start:0
|
||||
msgid "Date Start"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,quantity:0
|
||||
#: field:account.analytic.line,unit_amount:0
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,date:0
|
||||
msgid "Date End"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,code:0
|
||||
msgid "Account Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,type:0
|
||||
msgid "Normal"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,complete_name:0
|
||||
msgid "Full Account Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,account_id:0
|
||||
#: model:ir.model,name:analytic.model_account_analytic_account
|
||||
#: model:ir.module.module,shortdesc:analytic.module_meta_information
|
||||
msgid "Analytic Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,company_currency_id:0
|
||||
msgid "Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,amount_currency:0
|
||||
msgid "Amount currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,partner_id:0
|
||||
msgid "Associated Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Open"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,line_ids:0
|
||||
msgid "Analytic Entries"
|
||||
msgstr ""
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * analytic
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2010-06-18 11:01:12+0000\n"
|
||||
"PO-Revision-Date: 2010-06-18 11:01:12+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,child_ids:0
|
||||
msgid "Child Accounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.line,amount_currency:0
|
||||
msgid "The amount expressed in the related account currency if not equal to the company one."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: constraint:ir.model:0
|
||||
msgid "The Object name must start with x_ and not contain any special character !"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,name:0
|
||||
msgid "Account Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.line,unit_amount:0
|
||||
msgid "Specifies the amount of quantity to count."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.line,currency_id:0
|
||||
msgid "The related account currency if not equal to the company one."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: model:ir.module.module,description:analytic.module_meta_information
|
||||
msgid "Module for defining analytic accounting object.\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,state:0
|
||||
msgid "State"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,user_id:0
|
||||
msgid "Account Manager"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Draft"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Closed"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,debit:0
|
||||
msgid "Debit"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.account,state:0
|
||||
msgid "* When an account is created its in 'Draft' state. \n"
|
||||
"* If any associated partner is there, it can be in 'Open' state. \n"
|
||||
"* If any pending balance is there it can be in 'Pending'. \n"
|
||||
"* And finally when all the transactions are over, it can be in 'Close' state. \n"
|
||||
"* The project can be in either if the states 'Template' and 'Running'.\n"
|
||||
" If it is template then we can make projects based on the template projects. If its in 'Running' state it is a normal project. \n"
|
||||
" If it is to be reviewed then the state is 'Pending'.\n"
|
||||
" When the project is completed the state is set to 'Done'."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,type:0
|
||||
msgid "Account Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Template"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Pending"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: model:ir.model,name:analytic.model_account_analytic_line
|
||||
msgid "Analytic Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,description:0
|
||||
#: field:account.analytic.line,name:0
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.line,amount:0
|
||||
msgid "Calculated by multiplying the quantity and the price given in the Product's cost price."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,company_id:0
|
||||
#: field:account.analytic.line,company_id:0
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,quantity_max:0
|
||||
msgid "Maximum Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,user_id:0
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,parent_id:0
|
||||
msgid "Parent Analytic Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,date:0
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,currency_id:0
|
||||
#: field:account.analytic.line,currency_id:0
|
||||
msgid "Account currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,type:0
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: help:account.analytic.account,quantity_max:0
|
||||
msgid "Sets the higher limit of quantity of hours."
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,credit:0
|
||||
msgid "Credit"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,amount:0
|
||||
msgid "Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,contact_id:0
|
||||
msgid "Contact"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Cancelled"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,balance:0
|
||||
msgid "Balance"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,date_start:0
|
||||
msgid "Date Start"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,quantity:0
|
||||
#: field:account.analytic.line,unit_amount:0
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,date:0
|
||||
msgid "Date End"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,code:0
|
||||
msgid "Account Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,type:0
|
||||
msgid "Normal"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,complete_name:0
|
||||
msgid "Full Account Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,account_id:0
|
||||
#: model:ir.model,name:analytic.model_account_analytic_account
|
||||
#: model:ir.module.module,shortdesc:analytic.module_meta_information
|
||||
msgid "Analytic Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,company_currency_id:0
|
||||
msgid "Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.line,amount_currency:0
|
||||
msgid "Amount currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,partner_id:0
|
||||
msgid "Associated Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: selection:account.analytic.account,state:0
|
||||
msgid "Open"
|
||||
msgstr ""
|
||||
|
||||
#. module: analytic
|
||||
#: field:account.analytic.account,line_ids:0
|
||||
msgid "Analytic Entries"
|
||||
msgstr ""
|
||||
|
||||
+21
-20
@@ -7,13 +7,13 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.4\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2009-11-09 13:47+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"PO-Revision-Date: 2010-06-19 01:36+0000\n"
|
||||
"Last-Translator: Abdul Munif Hanafi <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-17 04:15+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-20 03:34+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: board
|
||||
@@ -21,6 +21,7 @@ msgstr ""
|
||||
msgid ""
|
||||
"The Object name must start with x_ and not contain any special character !"
|
||||
msgstr ""
|
||||
"Nama Objek harus berawalan dengan x_ dan tidak mengandung karakter khusus !"
|
||||
|
||||
#. module: board
|
||||
#: model:ir.model,name:board.model_board_board
|
||||
@@ -30,7 +31,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: field:board.note,user_id:0
|
||||
msgid "Author"
|
||||
msgstr ""
|
||||
msgstr "Pencipta"
|
||||
|
||||
#. module: board
|
||||
#: model:ir.module.module,shortdesc:board.module_meta_information
|
||||
@@ -41,22 +42,22 @@ msgstr ""
|
||||
#: view:board.note:0
|
||||
#: field:board.note,note:0
|
||||
msgid "Note"
|
||||
msgstr ""
|
||||
msgstr "Catatan"
|
||||
|
||||
#. module: board
|
||||
#: field:board.board.line,width:0
|
||||
msgid "Width"
|
||||
msgstr ""
|
||||
msgstr "Lebar"
|
||||
|
||||
#. module: board
|
||||
#: constraint:ir.actions.act_window:0
|
||||
msgid "Invalid model name in the action definition."
|
||||
msgstr ""
|
||||
msgstr "Nama model tidak sah di definsi aksi"
|
||||
|
||||
#. module: board
|
||||
#: field:board.board.line,name:0
|
||||
msgid "Title"
|
||||
msgstr ""
|
||||
msgstr "Judul"
|
||||
|
||||
#. module: board
|
||||
#: model:ir.actions.act_window,name:board.action_view_board_list_form
|
||||
@@ -73,7 +74,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: wizard_view:board.board.menu.create,init:0
|
||||
msgid "Menu Information"
|
||||
msgstr ""
|
||||
msgstr "Informasi Menu"
|
||||
|
||||
#. module: board
|
||||
#: field:board.board,line_ids:0
|
||||
@@ -88,12 +89,12 @@ msgstr ""
|
||||
#. module: board
|
||||
#: field:board.note,date:0
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
msgstr "Tanggal"
|
||||
|
||||
#. module: board
|
||||
#: model:ir.ui.menu,name:board.next_id_50
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
msgstr "Konfigurasi"
|
||||
|
||||
#. module: board
|
||||
#: field:board.note.type,name:0
|
||||
@@ -108,7 +109,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr ""
|
||||
msgstr "XML tidak sah untuk Menampilkan Arsitektur!"
|
||||
|
||||
#. module: board
|
||||
#: wizard_field:board.board.menu.create,init,menu_parent_id:0
|
||||
@@ -118,7 +119,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: view:board.note:0
|
||||
msgid "Notes"
|
||||
msgstr ""
|
||||
msgstr "Catatan"
|
||||
|
||||
#. module: board
|
||||
#: model:ir.model,name:board.model_board_note_type
|
||||
@@ -140,7 +141,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: field:board.board.line,position:0
|
||||
msgid "Position"
|
||||
msgstr ""
|
||||
msgstr "Posisi"
|
||||
|
||||
#. module: board
|
||||
#: model:ir.actions.act_window,name:board.dashboard_open
|
||||
@@ -150,7 +151,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: wizard_field:board.board.menu.create,init,menu_name:0
|
||||
msgid "Menu Name"
|
||||
msgstr ""
|
||||
msgstr "Nama Menu"
|
||||
|
||||
#. module: board
|
||||
#: field:board.note,type:0
|
||||
@@ -160,7 +161,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: selection:board.board.line,position:0
|
||||
msgid "Left"
|
||||
msgstr ""
|
||||
msgstr "Kiri"
|
||||
|
||||
#. module: board
|
||||
#: field:board.board,view_id:0
|
||||
@@ -170,7 +171,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: selection:board.board.line,position:0
|
||||
msgid "Right"
|
||||
msgstr ""
|
||||
msgstr "Kanan"
|
||||
|
||||
#. module: board
|
||||
#: field:board.board.line,sequence:0
|
||||
@@ -181,7 +182,7 @@ msgstr ""
|
||||
#: view:board.board:0
|
||||
#: wizard_button:board.board.menu.create,init,create_menu:0
|
||||
msgid "Create Menu"
|
||||
msgstr ""
|
||||
msgstr "Buat Menu"
|
||||
|
||||
#. module: board
|
||||
#: model:ir.ui.menu,name:board.dashboard_menu
|
||||
@@ -191,7 +192,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: field:board.board.line,height:0
|
||||
msgid "Height"
|
||||
msgstr ""
|
||||
msgstr "Tinggi"
|
||||
|
||||
#. module: board
|
||||
#: model:ir.actions.wizard,name:board.wizard_board_create_menu
|
||||
@@ -201,7 +202,7 @@ msgstr ""
|
||||
#. module: board
|
||||
#: wizard_button:board.board.menu.create,init,end:0
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
msgstr "Batal"
|
||||
|
||||
#. module: board
|
||||
#: view:board.board:0
|
||||
|
||||
@@ -177,7 +177,7 @@ class crm_send_new_email(osv.osv_memory):
|
||||
"%s <%s>" % (case.user_id.name, case.user_id.address_id.email)) or \
|
||||
tools.config.get('email_from',False)})
|
||||
if 'subject' in fields:
|
||||
res.update({'subject': '[%s] %s' %(str(case.id), case.name or '')})
|
||||
res.update({'subject': '[%s] %s' % (str(case.id), context.get('subject', case.name) or '')})
|
||||
if 'email_cc' in fields:
|
||||
res.update({'email_cc': case.email_cc or ''})
|
||||
if 'text' in fields:
|
||||
|
||||
@@ -7,13 +7,13 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-05-03 08:04+0000\n"
|
||||
"Last-Translator: Piotr Lipski <Unknown>\n"
|
||||
"PO-Revision-Date: 2010-06-19 13:34+0000\n"
|
||||
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-05-05 03:47+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-20 03:34+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: delivery
|
||||
@@ -57,7 +57,7 @@ msgstr ""
|
||||
#. module: delivery
|
||||
#: field:delivery.grid,state_ids:0
|
||||
msgid "States"
|
||||
msgstr "Stany"
|
||||
msgstr "Regiony"
|
||||
|
||||
#. module: delivery
|
||||
#: constraint:ir.actions.act_window:0
|
||||
@@ -68,6 +68,7 @@ msgstr "Nieprawidłowa nazwa modelu w definicji akcji."
|
||||
#: help:res.partner,property_delivery_carrier:0
|
||||
msgid "This delivery method will be used when invoicing from packing."
|
||||
msgstr ""
|
||||
"Ta metoda dostawy będzie stosowana przy fakturowaniu z wydania zewnętrznego."
|
||||
|
||||
#. module: delivery
|
||||
#: model:ir.model,name:delivery.model_delivery_grid
|
||||
@@ -109,7 +110,7 @@ msgstr "Pozycja tabeli opłat za dostawy"
|
||||
#. module: delivery
|
||||
#: model:ir.ui.menu,name:delivery.menu_delivery
|
||||
msgid "Delivery"
|
||||
msgstr "Dostawa"
|
||||
msgstr "Wydanie zewnętrzne"
|
||||
|
||||
#. module: delivery
|
||||
#: view:delivery.grid.line:0
|
||||
@@ -151,7 +152,7 @@ msgstr "="
|
||||
#. module: delivery
|
||||
#: field:delivery.carrier,product_id:0
|
||||
msgid "Delivery Product"
|
||||
msgstr ""
|
||||
msgstr "Dostawa jako produkt"
|
||||
|
||||
#. module: delivery
|
||||
#: view:delivery.grid.line:0
|
||||
|
||||
@@ -96,6 +96,8 @@
|
||||
<field name="search_view_id" ref="view_email_template_account_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Configuration" parent="base.menu_tools"
|
||||
id="base.menu_lunch_survey_root" sequence="20"/>
|
||||
<menuitem name="Emails" id="menu_email_template_configuration" parent="base.menu_lunch_survey_root" />
|
||||
|
||||
<menuitem name="Email Accounts" id="menu_email_template_account_all" parent="menu_email_template_configuration" action="action_email_template_account_tree_all"/>
|
||||
|
||||
@@ -164,7 +164,6 @@ class hr_sign_in_out(osv.osv_memory):
|
||||
return {} # To do: Return Success message
|
||||
|
||||
def sign_out(self, cr, uid, data, context=None):
|
||||
|
||||
emp_id = data['emp_id']
|
||||
if 'last_time' in data:
|
||||
if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'):
|
||||
|
||||
@@ -8,13 +8,13 @@ msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-01-25 07:27+0000\n"
|
||||
"Last-Translator: vir (Open ERP) <vir@tinyerp.com>\n"
|
||||
"PO-Revision-Date: 2010-06-20 20:17+0000\n"
|
||||
"Last-Translator: abhishek <Unknown>\n"
|
||||
"Language-Team: Hindi <hi@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-17 04:14+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-21 03:42+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: hr_contract
|
||||
@@ -57,7 +57,7 @@ msgstr ""
|
||||
#. module: hr_contract
|
||||
#: constraint:ir.actions.act_window:0
|
||||
msgid "Invalid model name in the action definition."
|
||||
msgstr ""
|
||||
msgstr "कार्य की परिभाषा में मॉडल का नाम अमान्य है."
|
||||
|
||||
#. module: hr_contract
|
||||
#: field:hr.contract,employee_id:0
|
||||
@@ -82,7 +82,7 @@ msgstr ""
|
||||
#. module: hr_contract
|
||||
#: field:hr.contract,function:0
|
||||
msgid "Function"
|
||||
msgstr ""
|
||||
msgstr "फंक्शन"
|
||||
|
||||
#. module: hr_contract
|
||||
#: field:hr.employee,marital_status:0
|
||||
@@ -91,7 +91,7 @@ msgstr ""
|
||||
#: model:ir.actions.act_window,name:hr_contract.action_hr_marital_status
|
||||
#: model:ir.ui.menu,name:hr_contract.hr_menu_marital_status
|
||||
msgid "Marital Status"
|
||||
msgstr ""
|
||||
msgstr "वैवाहिक वस्तुस्थिति"
|
||||
|
||||
#. module: hr_contract
|
||||
#: view:hr.employee:0
|
||||
@@ -108,7 +108,7 @@ msgstr ""
|
||||
#. module: hr_contract
|
||||
#: field:hr.contract.wage.type,type:0
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
msgstr "प्रकार"
|
||||
|
||||
#. module: hr_contract
|
||||
#: field:hr.contract,wage_type_id:0
|
||||
@@ -150,19 +150,19 @@ msgstr ""
|
||||
#. module: hr_contract
|
||||
#: field:hr.contract,date_end:0
|
||||
msgid "End Date"
|
||||
msgstr ""
|
||||
msgstr "समाप्ति तिथि"
|
||||
|
||||
#. module: hr_contract
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr ""
|
||||
msgstr "संरचना देखने के लिए अमान्य XML!"
|
||||
|
||||
#. module: hr_contract
|
||||
#: view:hr.contract:0
|
||||
#: field:hr.contract,notes:0
|
||||
#: view:hr.employee:0
|
||||
msgid "Notes"
|
||||
msgstr ""
|
||||
msgstr "टिप्पणियाँ"
|
||||
|
||||
#. module: hr_contract
|
||||
#: view:hr.contract:0
|
||||
@@ -209,12 +209,12 @@ msgstr ""
|
||||
#. module: hr_contract
|
||||
#: field:hr.employee,place_of_birth:0
|
||||
msgid "Place of Birth"
|
||||
msgstr ""
|
||||
msgstr "जन्म स्थान"
|
||||
|
||||
#. module: hr_contract
|
||||
#: field:hr.employee,manager:0
|
||||
msgid "Manager"
|
||||
msgstr ""
|
||||
msgstr "मैनेजर"
|
||||
|
||||
#. module: hr_contract
|
||||
#: view:hr.contract.wage.type.period:0
|
||||
@@ -239,7 +239,7 @@ msgstr ""
|
||||
#. module: hr_contract
|
||||
#: field:hr.contract,date_start:0
|
||||
msgid "Start Date"
|
||||
msgstr ""
|
||||
msgstr "प्रारंभ दिनांक"
|
||||
|
||||
#. module: hr_contract
|
||||
#: field:hr.employee.marital.status,description:0
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
'website':'http://www.openerp.com',
|
||||
'depends': [
|
||||
'hr',
|
||||
'account',
|
||||
'hr_contract',
|
||||
'hr_holidays',
|
||||
'hr_expense'
|
||||
|
||||
+130
-679
@@ -213,66 +213,29 @@ class payroll_register(osv.osv):
|
||||
def compute_sheet(self, cr, uid, ids, context={}):
|
||||
emp_pool = self.pool.get('hr.employee')
|
||||
slip_pool = self.pool.get('hr.payslip')
|
||||
func_pool = self.pool.get('hr.payroll.structure')
|
||||
slip_line_pool = self.pool.get('hr.payslip.line')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
vals = self.read(cr, uid, ids)[0]
|
||||
vals = self.browse(cr, uid, ids)[0]
|
||||
|
||||
emp_ids = emp_pool.search(cr, uid, [])
|
||||
|
||||
for emp in emp_pool.browse(cr, uid, emp_ids):
|
||||
old_slips = slip_pool.search(cr, uid, [('employee_id','=',emp.id), ('date','=',vals['date'])])
|
||||
old_slips = slip_pool.search(cr, uid, [('employee_id','=',emp.id), ('date','=',vals.date)])
|
||||
if old_slips:
|
||||
slip_pool.write(cr, uid, old_slips, {'register_id':ids[0]})
|
||||
for sid in old_slips:
|
||||
wf_service.trg_validate(uid, 'hr.payslip', sid, 'compute_sheet', cr)
|
||||
continue
|
||||
|
||||
sql_req= '''
|
||||
SELECT c.wage as wage, struct_id as function
|
||||
FROM hr_contract c
|
||||
LEFT JOIN hr_employee emp on (c.employee_id=emp.id)
|
||||
LEFT JOIN hr_contract_wage_type cwt on (cwt.id = c.wage_type_id)
|
||||
LEFT JOIN hr_contract_wage_type_period p on (cwt.period_id = p.id)
|
||||
WHERE
|
||||
(emp.id=%s) AND
|
||||
(date_start <= %s) AND
|
||||
(date_end IS NULL OR date_end >= %s)
|
||||
LIMIT 1
|
||||
'''
|
||||
cr.execute(sql_req, (emp.id, vals['date'], vals['date']))
|
||||
contract_info = cr.dictfetchone()
|
||||
|
||||
if not contract_info:
|
||||
continue
|
||||
|
||||
function = contract_info['struct_id']
|
||||
lines = []
|
||||
if function:
|
||||
func = func_pool.read(cr, uid, function, ['line_ids'])
|
||||
lines = slip_line_pool.browse(cr, uid, func['line_ids'])
|
||||
|
||||
|
||||
res = {
|
||||
'employee_id':emp.id,
|
||||
'basic':contract_info['wage'],
|
||||
'register_id':ids[0],
|
||||
'name':vals['name'],
|
||||
'date':vals['date'],
|
||||
'journal_id':vals['journal_id'][0],
|
||||
'bank_journal_id':vals['bank_journal_id'][0]
|
||||
'name':vals.name,
|
||||
'date':vals.date,
|
||||
'journal_id':vals.journal_id.id,
|
||||
'bank_journal_id':vals.bank_journal_id.id
|
||||
}
|
||||
slip_id = slip_pool.create(cr, uid, res)
|
||||
|
||||
old_slip_id = slip_line_pool.search(cr, uid, [('slip_id','=',slip_id)])
|
||||
slip_line_pool.unlink(cr, uid, old_slip_id)
|
||||
|
||||
for line in lines:
|
||||
slip_line_pool.copy(cr, uid, line.id, {'slip_id':slip_id, 'employee_id':False, 'function_id':False}, {})
|
||||
|
||||
for line in emp.line_ids:
|
||||
slip_line_pool.copy(cr, uid, line.id, {'slip_id':slip_id, 'employee_id':False, 'function_id':False}, {})
|
||||
|
||||
wf_service.trg_validate(uid, 'hr.payslip', slip_id, 'compute_sheet', cr)
|
||||
|
||||
number = self.pool.get('ir.sequence').get(cr, uid, 'salary.register')
|
||||
@@ -314,15 +277,17 @@ class payroll_register(osv.osv):
|
||||
for sid in sids:
|
||||
wf_service.trg_validate(uid, 'hr.payslip', sid, 'final_verify_sheet', cr)
|
||||
|
||||
|
||||
for reg in self.browse(cr, uid, ids):
|
||||
accs = {}
|
||||
for slip in reg.line_ids:
|
||||
pid = False
|
||||
if accs.get(slip.employee_id.property_bank_account.code, False) == False:
|
||||
company_name = self.pool.get('res.users').browse(cr, uid, uid).company_id.name
|
||||
bank_name = slip.employee_id.property_bank_account.name
|
||||
number = self.pool.get('ir.sequence').get(cr, uid, 'payment.advice')
|
||||
advice = {
|
||||
'name': 'Payment Advice from %s / Bank Account %s' % (self.pool.get('res.users').browse(cr, uid, uid).company_id.name, slip.employee_id.property_bank_account.name),
|
||||
'number': self.pool.get('ir.sequence').get(cr, uid, 'payment.advice'),
|
||||
'name': 'Payment Advice from %s / Bank Account %s' % (company_name, bank_name),
|
||||
'number': number,
|
||||
'register_id':reg.id,
|
||||
'account_id':slip.employee_id.property_bank_account.id
|
||||
}
|
||||
@@ -331,16 +296,18 @@ class payroll_register(osv.osv):
|
||||
else:
|
||||
pid = accs[slip.employee_id.property_bank_account.code]
|
||||
|
||||
pline = {
|
||||
'advice_id':pid,
|
||||
'name':slip.employee_id.otherid,
|
||||
'employee_id':slip.employee_id.id,
|
||||
'amount':slip.other_pay + slip.net,
|
||||
'bysal':slip.net
|
||||
}
|
||||
id = advice_line_pool.create(cr, uid, pline)
|
||||
if not slip.employee_id.bank_account_id:
|
||||
raise osv.except_osv(_('Warning'), _("Bank Account not defined for %s !" % (slip.employee_id.name)))
|
||||
else:
|
||||
pline = {
|
||||
'advice_id':pid,
|
||||
'name':slip.employee_id.bank_account_id.acc_number,
|
||||
'employee_id':slip.employee_id.id,
|
||||
'amount':slip.other_pay + slip.net,
|
||||
'bysal':slip.net
|
||||
}
|
||||
id = advice_line_pool.create(cr, uid, pline)
|
||||
|
||||
#, 'advice_ids':[(6, 0, [pid])]
|
||||
self.write(cr, uid, ids, {'state':'confirm'})
|
||||
return True
|
||||
|
||||
@@ -529,7 +496,7 @@ class payment_category(osv.osv):
|
||||
|
||||
_name = 'hr.allounce.deduction.categoty'
|
||||
_description = 'Allowance Deduction Heads'
|
||||
|
||||
|
||||
_columns = {
|
||||
'name':fields.char('Categoty Name', size=64, required=True, readonly=False),
|
||||
'code':fields.char('Categoty Code', size=64, required=True, readonly=False),
|
||||
@@ -538,13 +505,15 @@ class payment_category(osv.osv):
|
||||
('deduction','Deduction'),
|
||||
('other','Others'),
|
||||
],'Type', select=True),
|
||||
'base':fields.char('Based on', size=64, required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
|
||||
'base': fields.text('Based on', required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
|
||||
#'base':fields.char('Based on', size=64, required=True, readonly=False, help='This will use to computer the % fields values, in general its on basic, but You can use all heads code field in small letter as a variable name i.e. hra, ma, lta, etc...., also you can use, static varible basic'),
|
||||
'condition':fields.char('Condition', size=1024, required=True, readonly=False, help='Applied this head for calculation if condition is true'),
|
||||
'sequence': fields.integer('Sequence', required=True, help='Use to arrange calculation sequence'),
|
||||
'note': fields.text('Description'),
|
||||
'user_id':fields.char('User', size=64, required=False, readonly=False),
|
||||
'state':fields.char('Label', size=64, required=False, readonly=False),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'contribute_ids':fields.one2many('company.contribution', 'category_id', 'Company Contribution', required=False),
|
||||
}
|
||||
_defaults = {
|
||||
'condition': lambda *a: 'True',
|
||||
@@ -786,11 +755,7 @@ class hr_payslip(osv.osv):
|
||||
'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits=(16, 2)),
|
||||
'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits=(16, 2)),
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'move_ids':fields.one2many('hr.payslip.account.move', 'slip_id', 'Accounting vouchers', required=False),
|
||||
'move_line_ids':fields.many2many('account.move.line', 'payslip_lines_rel', 'slip_id', 'line_id', 'Accounting Lines', readonly=True),
|
||||
'move_payment_ids':fields.many2many('account.move.line', 'payslip_payment_rel', 'slip_id', 'payment_id', 'Payment Lines', readonly=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', required=False),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
|
||||
'holiday_days': fields.integer('No of Leaves', readonly=True),
|
||||
'worked_days': fields.integer('Worked Day', readonly=True),
|
||||
'working_days': fields.integer('Working Days', readonly=True),
|
||||
@@ -824,185 +789,16 @@ class hr_payslip(osv.osv):
|
||||
res_id = super(hr_payslip, self).copy(cr, uid, id, default, context)
|
||||
return res_id
|
||||
|
||||
def create_voucher(self, cr, uid, ids, name, voucher, sequence=5):
|
||||
slip_move = self.pool.get('hr.payslip.account.move')
|
||||
for slip in ids:
|
||||
res = {
|
||||
'slip_id':slip,
|
||||
'move_id':voucher,
|
||||
'sequence':sequence,
|
||||
'name':name
|
||||
}
|
||||
slip_move.create(cr, uid, res)
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'draft'})
|
||||
return True
|
||||
|
||||
def cancel_sheet(self, cr, uid, ids, context={}):
|
||||
move_pool = self.pool.get('account.move')
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context):
|
||||
if slip.move_id:
|
||||
if slip.move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.move_id.id])
|
||||
|
||||
if slip.adj_move_id:
|
||||
if slip.adj_move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.adj_move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.adj_move_id.id])
|
||||
|
||||
if slip.other_move_id:
|
||||
if slip.other_move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.other_move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.other_move_id.id])
|
||||
|
||||
self.write(cr, uid, ids, {'state':'cancel'})
|
||||
return True
|
||||
|
||||
def process_sheet(self, cr, uid, ids, context={}):
|
||||
move_pool = self.pool.get('account.move')
|
||||
movel_pool = self.pool.get('account.move.line')
|
||||
invoice_pool = self.pool.get('account.invoice')
|
||||
|
||||
for slip in self.browse(cr,uid,ids):
|
||||
line_ids = []
|
||||
partner = False
|
||||
partner_id = False
|
||||
exp_ids = []
|
||||
|
||||
partner = slip.employee_id.address_home_id.partner_id
|
||||
partner_id = partner.id
|
||||
|
||||
fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
|
||||
if not fiscal_year_ids:
|
||||
raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
|
||||
fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
|
||||
year_exist = False
|
||||
for fiscal_year in fiscal_year_objs:
|
||||
if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
|
||||
year_exist = True
|
||||
if not year_exist:
|
||||
raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
|
||||
search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
|
||||
if not search_period:
|
||||
raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
|
||||
period_id = search_period[0]
|
||||
name = 'Payment of Salary to %s' % (slip.employee_id.name)
|
||||
move = {
|
||||
'journal_id': slip.bank_journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'type':'bank_pay_voucher',
|
||||
'ref':slip.number,
|
||||
'narration': name
|
||||
}
|
||||
move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], name, move_id)
|
||||
|
||||
name = "To %s account" % (slip.employee_id.name)
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
#'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.property_bank_account.id,
|
||||
'debit': 0.0,
|
||||
'credit' : slip.total_pay,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
name = "By %s account" % (slip.employee_id.property_bank_account.name)
|
||||
cre_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': slip.total_pay,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
other_pay = slip.other_pay
|
||||
#Process all Reambuse Entries
|
||||
for line in slip.line_ids:
|
||||
if line.type == 'otherpay' and line.expanse_id.invoice_id:
|
||||
if not line.expanse_id.invoice_id.move_id:
|
||||
raise osv.except_osv(_('Warning !'), _('Please Confirm all Expanse Invoice appear for Reimbursement'))
|
||||
invids = [line.expanse_id.invoice_id.id]
|
||||
amount = line.total
|
||||
acc_id = slip.bank_journal_id.default_credit_account_id and slip.bank_journal_id.default_credit_account_id.id
|
||||
period_id = slip.period_id.id
|
||||
journal_id = slip.bank_journal_id.id
|
||||
name = '[%s]-%s' % (slip.number, line.name)
|
||||
invoice_pool.pay_and_reconcile(cr, uid, invids, amount, acc_id, period_id, journal_id, False, period_id, False, context, name)
|
||||
other_pay -= amount
|
||||
#TODO: link this account entries to the Payment Lines also Expanse Entries to Account Lines
|
||||
l_ids = movel_pool.search(cr, uid, [('name','=',name)])
|
||||
line_ids += l_ids
|
||||
|
||||
l_ids = movel_pool.search(cr, uid, [('invoice','=',line.expanse_id.invoice_id.id)])
|
||||
exp_ids += l_ids
|
||||
|
||||
#Process for Other payment if any
|
||||
other_move_id = False
|
||||
if slip.other_pay > 0:
|
||||
narration = 'Payment of Other Payeble amounts to %s' % (slip.employee_id.name)
|
||||
move = {
|
||||
'journal_id': slip.bank_journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'type':'bank_pay_voucher',
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
other_move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], narration, move_id)
|
||||
|
||||
name = "To %s account" % (slip.employee_id.name)
|
||||
ded_rec = {
|
||||
'move_id':other_move_id,
|
||||
'name':name,
|
||||
'date':slip.date,
|
||||
'account_id':slip.employee_id.property_bank_account.id,
|
||||
'debit': 0.0,
|
||||
'credit': other_pay,
|
||||
'journal_id':slip.journal_id.id,
|
||||
'period_id':period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
name = "By %s account" % (slip.employee_id.property_bank_account.name)
|
||||
cre_rec = {
|
||||
'move_id':other_move_id,
|
||||
'name':name,
|
||||
'partner_id':partner_id,
|
||||
'date':slip.date,
|
||||
'account_id':partner.property_account_payable.id,
|
||||
'debit': other_pay,
|
||||
'credit':0.0,
|
||||
'journal_id':slip.journal_id.id,
|
||||
'period_id':period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
rec = {
|
||||
'state':'done',
|
||||
'move_payment_ids':[(6, 0, line_ids)],
|
||||
'paid':True
|
||||
}
|
||||
self.write(cr, uid, [slip.id], rec)
|
||||
for exp_id in exp_ids:
|
||||
self.write(cr, uid, [slip.id], {'move_line_ids':[(4, exp_id)]})
|
||||
|
||||
self.write(cr, uid, ids, {'state':'done'})
|
||||
return True
|
||||
|
||||
def account_check_sheet(self, cr, uid, ids, context={}):
|
||||
@@ -1014,364 +810,22 @@ class hr_payslip(osv.osv):
|
||||
return True
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context={}):
|
||||
|
||||
move_pool = self.pool.get('account.move')
|
||||
movel_pool = self.pool.get('account.move.line')
|
||||
exp_pool = self.pool.get('hr.expense.expense')
|
||||
|
||||
for slip in self.browse(cr,uid,ids):
|
||||
total_deduct = 0.0
|
||||
|
||||
line_ids = []
|
||||
partner = False
|
||||
partner_id = False
|
||||
|
||||
if not slip.employee_id.address_home_id:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please defined the Employee Home Address Along with Partners !!'))
|
||||
|
||||
if not slip.employee_id.address_home_id.partner_id:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please defined the Partner in Home Address !!'))
|
||||
|
||||
partner = slip.employee_id.address_home_id.partner_id
|
||||
partner_id = slip.employee_id.address_home_id.partner_id.id
|
||||
|
||||
period_id = False
|
||||
|
||||
if slip.period_id:
|
||||
period_id = slip.period_id.id
|
||||
else:
|
||||
fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
|
||||
if not fiscal_year_ids:
|
||||
raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
|
||||
fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
|
||||
year_exist = False
|
||||
for fiscal_year in fiscal_year_objs:
|
||||
if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
|
||||
year_exist = True
|
||||
if not year_exist:
|
||||
raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
|
||||
search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
|
||||
if not search_period:
|
||||
raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
|
||||
period_id = search_period[0]
|
||||
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': slip.name
|
||||
}
|
||||
move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], slip.name, move_id)
|
||||
|
||||
line = {
|
||||
'move_id':move_id,
|
||||
'name': "By Basic Salary / " + slip.employee_id.name,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.salary_account.id,
|
||||
'debit': slip.basic,
|
||||
'credit': 0.0,
|
||||
'quantity':slip.working_days,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'analytic_account_id': False,
|
||||
'ref':slip.number
|
||||
}
|
||||
|
||||
#Setting Analysis Account for Basic Salary
|
||||
if slip.employee_id.analytic_account:
|
||||
line['analytic_account_id'] = slip.employee_id.analytic_account.id
|
||||
|
||||
move_line_id = movel_pool.create(cr, uid, line)
|
||||
line_ids += [move_line_id]
|
||||
|
||||
line = {
|
||||
'move_id':move_id,
|
||||
'name': "To Basic Paysble Salary / " + slip.employee_id.name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.employee_account.id,
|
||||
'debit': 0.0,
|
||||
'quantity':slip.working_days,
|
||||
'credit': slip.basic,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, line)]
|
||||
|
||||
for line in slip.line_ids:
|
||||
name = "[%s] - %s / %s" % (line.code, line.name, slip.employee_id.name)
|
||||
amount = line.total
|
||||
|
||||
if line.type == 'leaves':
|
||||
continue
|
||||
|
||||
rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'account_id': line.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'analytic_account_id':False,
|
||||
'ref':slip.number,
|
||||
'quantity':1
|
||||
}
|
||||
|
||||
#Setting Analysis Account for Salary Slip Lines
|
||||
if line.analytic_account_id:
|
||||
rec['analytic_account_id'] = line.analytic_account_id.id
|
||||
else:
|
||||
rec['analytic_account_id'] = slip.deg_id.account_id.id
|
||||
|
||||
if line.type == 'allounce' or line.type == 'otherpay':
|
||||
rec['debit'] = amount
|
||||
if not partner.property_account_payable:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Payable Account!!'))
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': 0.0,
|
||||
'quantity':1,
|
||||
'credit' : amount,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
elif line.type == 'deduction' or line.type == 'otherdeduct':
|
||||
if not partner.property_account_receivable:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Receivable Account!!'))
|
||||
rec['credit'] = amount
|
||||
total_deduct += amount
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': amount,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
|
||||
line_ids += [movel_pool.create(cr, uid, rec)]
|
||||
|
||||
if line.company_contrib > 0:
|
||||
company_contrib = line.company_contrib
|
||||
# if line.category_id.amount_type == 'per':
|
||||
# company_contrib = (amount * line.category_id.contribute_per)
|
||||
|
||||
narration = """Company Contribution of %s Encode same as a Company Expanse @ %s""" % (line.name, company_contrib)
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
company_contrib_move_id = move_pool.create(cr, uid, move)
|
||||
name = "[%s] - %s / %s - Company Contribution" % (line.code, line.name, slip.employee_id.name)
|
||||
self.create_voucher(cr, uid, [slip.id], name, company_contrib_move_id)
|
||||
|
||||
ded_deb = {
|
||||
'move_id':company_contrib_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.account_id.id,
|
||||
'debit': company_contrib,
|
||||
'credit' : 0.0,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
ded_cre = {
|
||||
'move_id':company_contrib_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.register_id.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : company_contrib,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
|
||||
if line.category_id.include_in_salary:
|
||||
narration = """Company Contribution of %s Deducted from Employee %s""" % (line.name, company_contrib)
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
include_in_salary_move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], narration, include_in_salary_move_id)
|
||||
|
||||
total_deduct += company_contrib
|
||||
ded_deb = {
|
||||
'move_id':include_in_salary_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': company_contrib,
|
||||
'credit' : 0.0,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
ded_cre = {
|
||||
'move_id':include_in_salary_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : company_contrib,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
|
||||
#make an entry line to contribution register
|
||||
if line.category_id.register_id:
|
||||
ctr = {
|
||||
'register_id':line.category_id.register_id.id,
|
||||
'name':line.name,
|
||||
'code':line.code,
|
||||
'employee_id':slip.employee_id.id,
|
||||
'period_id':period_id,
|
||||
'emp_deduction':amount,
|
||||
}
|
||||
if line.category_id.contribute:
|
||||
ctr['comp_deduction'] = amount
|
||||
|
||||
company = 0.0
|
||||
employee = 0.0
|
||||
if line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'per':
|
||||
new_amount = (amount * (line.category_id.contribute_per / (1+line.category_id.contribute_per)))
|
||||
company = new_amount
|
||||
employee = amount - company
|
||||
|
||||
elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
|
||||
company = line.category_id.contribute_per
|
||||
employee = amount - company
|
||||
|
||||
elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'func':
|
||||
company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
|
||||
employee = amount
|
||||
|
||||
elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'per':
|
||||
company = amount * line.category_id.contribute_per
|
||||
employee = amount
|
||||
|
||||
elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
|
||||
company = line.category_id.contribute_per
|
||||
employee = amount
|
||||
|
||||
elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'func':
|
||||
company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
|
||||
employee = amount
|
||||
|
||||
ctr['emp_deduction'] = employee
|
||||
ctr['comp_deduction'] = company
|
||||
|
||||
self.pool.get('hr.contibution.register.line').create(cr, uid, ctr)
|
||||
|
||||
adj_move_id = False
|
||||
if total_deduct > 0:
|
||||
move = {
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': 'Adjustment : %s' % (slip.name)
|
||||
}
|
||||
adj_move_id = move_pool.create(cr, uid, move)
|
||||
name = "Adjustment Entry - %s" % (slip.employee_id.name)
|
||||
self.create_voucher(cr, uid, [slip.id], name, adj_move_id)
|
||||
|
||||
ded_rec = {
|
||||
'move_id':adj_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': 0.0,
|
||||
'quantity':1,
|
||||
'credit' : total_deduct,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
cre_rec = {
|
||||
'move_id':adj_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': total_deduct,
|
||||
'quantity':1,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
rec = {
|
||||
'state':'confirm',
|
||||
'move_line_ids':[(6, 0,line_ids)],
|
||||
}
|
||||
if not slip.period_id:
|
||||
rec['period_id'] = period_id
|
||||
|
||||
dates = prev_bounds(slip.date)
|
||||
exp_ids = exp_pool.search(cr, uid, [('date_valid','>=',dates[0]), ('date_valid','<=',dates[1]), ('state','=','invoiced')])
|
||||
if exp_ids:
|
||||
acc = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
|
||||
for exp in exp_pool.browse(cr, uid, exp_ids):
|
||||
exp_res = {
|
||||
'name':exp.name,
|
||||
'amount_type':'fix',
|
||||
'type':'otherpay',
|
||||
'category_id':exp.category_id.id,
|
||||
'amount':exp.amount,
|
||||
'slip_id':slip.id,
|
||||
'expanse_id':exp.id,
|
||||
'account_id':acc
|
||||
}
|
||||
self.pool.get('hr.payslip.line').create(cr, uid, exp_res)
|
||||
|
||||
self.write(cr, uid, [slip.id], rec)
|
||||
|
||||
self.write(cr, uid, ids, {'state':'confirm'})
|
||||
return True
|
||||
|
||||
def get_contract(self, cr, uid, employee, date, context={}):
|
||||
"""
|
||||
Compute leaves for an employee
|
||||
|
||||
@param cr: cursor to database
|
||||
@param uid: id of current user
|
||||
@param employee: object of the hr.employee model
|
||||
@param date: date on which pay slip is creating
|
||||
@param context: context arguments, like lang, time zone
|
||||
|
||||
@return: return a current contract from the list of contract
|
||||
"""
|
||||
|
||||
sql_req= '''
|
||||
SELECT c.id as id, c.wage as wage, struct_id as function
|
||||
FROM hr_contract c
|
||||
@@ -1398,7 +852,6 @@ class hr_payslip(osv.osv):
|
||||
@param slip: object of the hr.payroll.slip model
|
||||
@param employee: object of the hr.employee model
|
||||
@param context: context arguments, like lang, time zone
|
||||
|
||||
@return: return a result
|
||||
"""
|
||||
|
||||
@@ -1434,12 +887,17 @@ class hr_payslip(osv.osv):
|
||||
if datetime.date(year, month, day).weekday() == calc_day:
|
||||
count += 1
|
||||
return count
|
||||
|
||||
|
||||
basic = 0.0
|
||||
contract = False
|
||||
for slip in self.browse(cr, uid, ids):
|
||||
basic = 0.0
|
||||
|
||||
contracts = self.get_contract(cr, uid, slip.employee_id, date, context)
|
||||
|
||||
if contracts.get('id', False) == False:
|
||||
if not contracts or contracts.get('id', False) == False:
|
||||
continue
|
||||
|
||||
|
||||
contract = self.pool.get('hr.contract').browse(cr, uid, contracts.get('id'))
|
||||
sal_type = contract.wage_type_id.type
|
||||
@@ -1516,7 +974,7 @@ class hr_payslip(osv.osv):
|
||||
amt = eval(base, obj)
|
||||
except Exception, e:
|
||||
raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e)))
|
||||
|
||||
|
||||
if sal_type in ('gross', 'net'):
|
||||
if line.amount_type == 'per':
|
||||
percent = line.amount
|
||||
@@ -1528,7 +986,10 @@ class hr_payslip(osv.osv):
|
||||
|
||||
if value > 0:
|
||||
percent = 0.0
|
||||
|
||||
|
||||
for cline in line.category_id.contribute_ids:
|
||||
pass
|
||||
|
||||
elif line.amount_type == 'fix':
|
||||
value = line.amount
|
||||
|
||||
@@ -1536,12 +997,16 @@ class hr_payslip(osv.osv):
|
||||
value = self.pool.get('hr.payslip.line').execute_function(cr, uid, line.id, amt, context)
|
||||
line.amount = value
|
||||
else:
|
||||
if line.amount_type in ('fix', 'per'):
|
||||
value = line.amount
|
||||
elif line.amount_type == 'func':
|
||||
if line.amount_type == 'func':
|
||||
value = self.pool.get('hr.payslip.line').execute_function(cr, uid, line.id, amt, context)
|
||||
line.amount = value
|
||||
|
||||
|
||||
# for cline in line.category_id.contribute_ids:
|
||||
# if cline.amount_type == 'fix':
|
||||
# contribute = cline.contribute_per
|
||||
# elif cline.amount_type == 'func':
|
||||
# contribute = func_pool.execute_function(cr, uid, cline.id, line.amount, context)
|
||||
|
||||
if line.type == 'allowance':
|
||||
all_per += percent
|
||||
all_fix += value
|
||||
@@ -1557,7 +1022,7 @@ class hr_payslip(osv.osv):
|
||||
'base':base
|
||||
}
|
||||
slip_line_pool.copy(cr, uid, line.id, vals, {})
|
||||
|
||||
|
||||
if sal_type in ('gross', 'net'):
|
||||
sal = contract.wage
|
||||
if sal_type == 'net':
|
||||
@@ -1589,94 +1054,80 @@ class hr_payslip(osv.osv):
|
||||
})
|
||||
self.write(cr, uid, [slip.id], update)
|
||||
|
||||
|
||||
for slip in self.browse(cr, uid, ids):
|
||||
basic_before_leaves = basic
|
||||
if contract:
|
||||
for slip in self.browse(cr, uid, ids):
|
||||
basic_before_leaves = basic
|
||||
|
||||
working_day = 0
|
||||
off_days = 0
|
||||
dates = prev_bounds(slip.date)
|
||||
|
||||
days_arr = [0, 1, 2, 3, 4, 5, 6]
|
||||
for dy in range(contract.working_days_per_week, 7):
|
||||
off_days += get_days(1, dates[1].day, dates[1].month, dates[1].year, days_arr[dy])
|
||||
|
||||
total_off = off_days
|
||||
working_day = dates[1].day - total_off
|
||||
perday = slip.net / working_day
|
||||
|
||||
total = 0.0
|
||||
leave = 0.0
|
||||
|
||||
leave_ids = self._get_leaves(cr, uid, slip, slip.employee_id, context)
|
||||
|
||||
total_leave = 0.0
|
||||
paid_leave = 0.0
|
||||
for hday in holiday_pool.browse(cr, uid, leave_ids):
|
||||
res = {
|
||||
'slip_id':slip.id,
|
||||
'name':hday.holiday_status_id.name + '-%s' % (hday.number_of_days),
|
||||
'code':hday.holiday_status_id.code,
|
||||
'amount_type':'fix',
|
||||
'category_id':hday.holiday_status_id.head_id.id,
|
||||
'account_id':hday.holiday_status_id.account_id.id,
|
||||
'analytic_account_id':hday.holiday_status_id.analytic_account_id.id
|
||||
}
|
||||
|
||||
days = hday.number_of_days
|
||||
if hday.number_of_days < 0:
|
||||
days = hday.number_of_days * -1
|
||||
|
||||
total_leave += days
|
||||
if hday.holiday_status_id.type == 'paid':
|
||||
paid_leave += days
|
||||
continue
|
||||
working_day = 0
|
||||
off_days = 0
|
||||
dates = prev_bounds(slip.date)
|
||||
|
||||
elif hday.holiday_status_id.type == 'halfpaid':
|
||||
paid_leave += (days / 2)
|
||||
res['name'] = hday.holiday_status_id.name + '-%s/2' % (days)
|
||||
res['amount'] = perday * (days/2)
|
||||
total += perday * (days/2)
|
||||
leave += days / 2
|
||||
res['type'] = 'deduction'
|
||||
else:
|
||||
res['name'] = hday.holiday_status_id.name + '-%s' % (days)
|
||||
res['amount'] = perday * days
|
||||
res['type'] = 'deduction'
|
||||
leave += days
|
||||
total += perday * days
|
||||
days_arr = [0, 1, 2, 3, 4, 5, 6]
|
||||
for dy in range(contract.working_days_per_week, 7):
|
||||
off_days += get_days(1, dates[1].day, dates[1].month, dates[1].year, days_arr[dy])
|
||||
|
||||
slip_line_pool.create(cr, uid, res)
|
||||
basic = basic - total
|
||||
leaves = total
|
||||
total_off = off_days
|
||||
working_day = dates[1].day - total_off
|
||||
perday = slip.net / working_day
|
||||
|
||||
total = 0.0
|
||||
leave = 0.0
|
||||
|
||||
leave_ids = self._get_leaves(cr, uid, slip, slip.employee_id, context)
|
||||
|
||||
total_leave = 0.0
|
||||
paid_leave = 0.0
|
||||
for hday in holiday_pool.browse(cr, uid, leave_ids):
|
||||
res = {
|
||||
'slip_id':slip.id,
|
||||
'name':hday.holiday_status_id.name + '-%s' % (hday.number_of_days),
|
||||
'code':hday.holiday_status_id.code,
|
||||
'amount_type':'fix',
|
||||
'category_id':hday.holiday_status_id.head_id.id,
|
||||
'account_id':hday.holiday_status_id.account_id.id,
|
||||
'analytic_account_id':hday.holiday_status_id.analytic_account_id.id
|
||||
}
|
||||
|
||||
days = hday.number_of_days
|
||||
if hday.number_of_days < 0:
|
||||
days = hday.number_of_days * -1
|
||||
|
||||
total_leave += days
|
||||
if hday.holiday_status_id.type == 'paid':
|
||||
paid_leave += days
|
||||
continue
|
||||
|
||||
elif hday.holiday_status_id.type == 'halfpaid':
|
||||
paid_leave += (days / 2)
|
||||
res['name'] = hday.holiday_status_id.name + '-%s/2' % (days)
|
||||
res['amount'] = perday * (days/2)
|
||||
total += perday * (days/2)
|
||||
leave += days / 2
|
||||
res['type'] = 'deduction'
|
||||
else:
|
||||
res['name'] = hday.holiday_status_id.name + '-%s' % (days)
|
||||
res['amount'] = perday * days
|
||||
res['type'] = 'deduction'
|
||||
leave += days
|
||||
total += perday * days
|
||||
|
||||
slip_line_pool.create(cr, uid, res)
|
||||
basic = basic - total
|
||||
leaves = total
|
||||
|
||||
update.update({
|
||||
'basic_before_leaves': round(basic_before_leaves),
|
||||
'leaves':total,
|
||||
'holiday_days':leave,
|
||||
'worked_days':working_day - leave,
|
||||
'working_days':working_day,
|
||||
})
|
||||
self.write(cr, uid, [slip.id], update)
|
||||
|
||||
update.update({
|
||||
'basic_before_leaves': round(basic_before_leaves),
|
||||
'leaves':total,
|
||||
'holiday_days':leave,
|
||||
'worked_days':working_day - leave,
|
||||
'working_days':working_day,
|
||||
})
|
||||
self.write(cr, uid, [slip.id], update)
|
||||
|
||||
return True
|
||||
|
||||
hr_payslip()
|
||||
|
||||
class account_move_link_slip(osv.osv):
|
||||
'''
|
||||
Account Move Link to Pay Slip
|
||||
'''
|
||||
_name = 'hr.payslip.account.move'
|
||||
_description = 'Account Move Link to Pay Slip'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=256, required=True, readonly=False),
|
||||
'move_id':fields.many2one('account.move', 'Expanse Entries', required=False, readonly=True),
|
||||
'slip_id':fields.many2one('hr.payslip', 'Pay Slip', required=False),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
}
|
||||
account_move_link_slip()
|
||||
|
||||
class line_condition(osv.osv):
|
||||
'''
|
||||
Line Condition
|
||||
@@ -1834,7 +1285,7 @@ class hr_employee(osv.osv):
|
||||
'esi_account':fields.char('ESI Account', size=64, required=False, readonly=False),
|
||||
'hospital_id':fields.many2one('res.partner.address', 'ESI Hospital', required=False),
|
||||
'passport_id':fields.many2one('hr.passport', 'Passport', required=False),
|
||||
'otherid':fields.char('Other Id', size=64, required=False),
|
||||
'bank_account_id':fields.many2one('res.partner.bank', 'Bank Account', required=False),
|
||||
'line_ids':fields.one2many('hr.payslip.line', 'employee_id', 'Salary Structure', required=False),
|
||||
'slip_ids':fields.one2many('hr.payslip', 'employee_id', 'Payslips', required=False, readonly=True),
|
||||
'property_bank_account': fields.property(
|
||||
@@ -1847,7 +1298,7 @@ class hr_employee(osv.osv):
|
||||
help="Select Bank Account from where Salary Expanse will be Paid",
|
||||
required=True),
|
||||
'salary_account':fields.property(
|
||||
'account.account',
|
||||
'account.account',
|
||||
type='many2one',
|
||||
relation='account.account',
|
||||
string="Salary Account",
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Personal Info" colspan="2"/>
|
||||
<field name="pan_no" select="1"/>
|
||||
<field name="bank_account"/>
|
||||
<field name="bank_account_id"/>
|
||||
<field name="place_of_birth"/>
|
||||
<field name="children"/>
|
||||
</group>
|
||||
@@ -458,23 +458,8 @@
|
||||
</group>
|
||||
</page>
|
||||
<page string="Accounting Details">
|
||||
<group col="2" colspan="3">
|
||||
<separator colspan="4" string="Accounting Informations"/>
|
||||
<field name="move_ids" colspan="2" nolabel="1" readonly="1">
|
||||
<tree string="Accounting Vouchers">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="move_id"/>
|
||||
</tree>
|
||||
<form string="Accounting Vouchers">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="move_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</group>
|
||||
<group col="2" colspan="1">
|
||||
<separator colspan="4" string="Other Informations"/>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Other Informations"/>
|
||||
<field name="paid" readonly="1"/>
|
||||
<field name="company_id"/>
|
||||
<field name="register_id"/>
|
||||
@@ -484,12 +469,6 @@
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Account Lines">
|
||||
<field name="move_line_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Payment Lines">
|
||||
<field name="move_payment_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="9" colspan="4">
|
||||
<field name="state"/>
|
||||
@@ -526,14 +505,22 @@
|
||||
<field name="name" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
<group col="2" colspan="4">
|
||||
<separator colspan="4" string="Dynamic Computation"/>
|
||||
<field name="base"/>
|
||||
|
||||
<group col="4" colspan="4">
|
||||
<separator colspan="2" string="Based on"/>
|
||||
<field name="base" colspan="4" nolabel="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Dynamic Computation"/>
|
||||
<field name="condition"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<notebook colspan="4">
|
||||
<page string="Contribution">
|
||||
<field name="contribute_ids" colspan="4" nolabel="1" height="300"/>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
|
||||
@@ -28,13 +28,6 @@
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="act_account_check" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf"/>
|
||||
<field name="name">account_check</field>
|
||||
<field name="action">account_check_sheet()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="act_confirm" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf"/>
|
||||
<field name="name">confirm</field>
|
||||
@@ -66,27 +59,13 @@
|
||||
<record id="t2" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_hr_check"/>
|
||||
<field name="condition">basic>=10000</field>
|
||||
<field name="signal">verify_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t3" model="workflow.transition">
|
||||
<field name="act_from" ref="act_hr_check"/>
|
||||
<field name="act_to" ref="act_account_check"/>
|
||||
<field name="signal">verify_twice_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t4" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_account_check"/>
|
||||
<field name="condition">basic<10000</field>
|
||||
<field name="signal">verify_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t5" model="workflow.transition">
|
||||
<field name="act_from" ref="act_account_check"/>
|
||||
<field name="act_from" ref="act_hr_check"/>
|
||||
<field name="act_to" ref="act_confirm"/>
|
||||
<field name="signal">final_verify_sheet</field>
|
||||
<field name="signal">verify_twice_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t6" model="workflow.transition">
|
||||
@@ -107,12 +86,6 @@
|
||||
<field name="signal">cancel_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t9" model="workflow.transition">
|
||||
<field name="act_from" ref="act_account_check"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">cancel_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t10" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirm"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#-*- coding:utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# d$
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import hr_payroll_account
|
||||
@@ -0,0 +1,47 @@
|
||||
#-*- coding:utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# d$
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
'name': 'Human Resource Payroll Accounting',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules/Human Resources',
|
||||
'description': """Generic Payroll system Integrated with Accountings
|
||||
* Expanse Encoding
|
||||
* Payment Encoding
|
||||
* Comany Contribution Managemet
|
||||
""",
|
||||
'author':'Tiny/Axelor',
|
||||
'website':'http://www.openerp.com',
|
||||
'depends': [
|
||||
'hr_payroll',
|
||||
'account',
|
||||
],
|
||||
'init_xml': [
|
||||
],
|
||||
'update_xml': [
|
||||
"hr_payroll_account_view.xml",
|
||||
"hr_payroll_account_workflow.xml"
|
||||
],
|
||||
'demo_xml': [
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
@@ -0,0 +1,618 @@
|
||||
#-*- coding:utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
|
||||
# d$
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import netsvc
|
||||
from osv import osv
|
||||
from osv import fields
|
||||
from tools import config
|
||||
from tools.translate import _
|
||||
|
||||
from datetime import date
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
|
||||
def prev_bounds(cdate=False):
|
||||
when = date.fromtimestamp(time.mktime(time.strptime(cdate,"%Y-%m-%d")))
|
||||
this_first = date(when.year, when.month, 1)
|
||||
month = when.month + 1
|
||||
year = when.year
|
||||
if month > 12:
|
||||
month = 1
|
||||
year += 1
|
||||
next_month = date(year, month, 1)
|
||||
prev_end = next_month - timedelta(days=1)
|
||||
return this_first, prev_end
|
||||
|
||||
class hr_payslip(osv.osv):
|
||||
'''
|
||||
Pay Slip
|
||||
'''
|
||||
_inherit = 'hr.payslip'
|
||||
_description = 'Pay Slip'
|
||||
|
||||
_columns = {
|
||||
'move_ids':fields.one2many('hr.payslip.account.move', 'slip_id', 'Accounting vouchers', required=False),
|
||||
'move_line_ids':fields.many2many('account.move.line', 'payslip_lines_rel', 'slip_id', 'line_id', 'Accounting Lines', readonly=True),
|
||||
'move_payment_ids':fields.many2many('account.move.line', 'payslip_payment_rel', 'slip_id', 'payment_id', 'Payment Lines', readonly=True),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
|
||||
}
|
||||
|
||||
def create_voucher(self, cr, uid, ids, name, voucher, sequence=5):
|
||||
slip_move = self.pool.get('hr.payslip.account.move')
|
||||
for slip in ids:
|
||||
res = {
|
||||
'slip_id':slip,
|
||||
'move_id':voucher,
|
||||
'sequence':sequence,
|
||||
'name':name
|
||||
}
|
||||
slip_move.create(cr, uid, res)
|
||||
|
||||
def cancel_sheet(self, cr, uid, ids, context={}):
|
||||
move_pool = self.pool.get('account.move')
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context):
|
||||
if slip.move_id:
|
||||
if slip.move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.move_id.id])
|
||||
|
||||
if slip.adj_move_id:
|
||||
if slip.adj_move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.adj_move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.adj_move_id.id])
|
||||
|
||||
if slip.other_move_id:
|
||||
if slip.other_move_id.state == 'posted':
|
||||
move_pool.button_cancel(cr, uid [slip.other_move_id.id], context)
|
||||
move_pool.unlink(cr, uid, [slip.other_move_id.id])
|
||||
|
||||
self.write(cr, uid, ids, {'state':'cancel'})
|
||||
return True
|
||||
|
||||
def process_sheet(self, cr, uid, ids, context={}):
|
||||
move_pool = self.pool.get('account.move')
|
||||
movel_pool = self.pool.get('account.move.line')
|
||||
invoice_pool = self.pool.get('account.invoice')
|
||||
|
||||
for slip in self.browse(cr,uid,ids):
|
||||
line_ids = []
|
||||
partner = False
|
||||
partner_id = False
|
||||
exp_ids = []
|
||||
|
||||
partner = slip.employee_id.bank_account_id.partner_id
|
||||
partner_id = partner.id
|
||||
|
||||
fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
|
||||
if not fiscal_year_ids:
|
||||
raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
|
||||
fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
|
||||
year_exist = False
|
||||
for fiscal_year in fiscal_year_objs:
|
||||
if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
|
||||
year_exist = True
|
||||
if not year_exist:
|
||||
raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
|
||||
search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
|
||||
if not search_period:
|
||||
raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
|
||||
period_id = search_period[0]
|
||||
name = 'Payment of Salary to %s' % (slip.employee_id.name)
|
||||
move = {
|
||||
'journal_id': slip.bank_journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'type':'bank_pay_voucher',
|
||||
'ref':slip.number,
|
||||
'narration': name
|
||||
}
|
||||
move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], name, move_id)
|
||||
|
||||
name = "To %s account" % (slip.employee_id.name)
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
#'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.property_bank_account.id,
|
||||
'debit': 0.0,
|
||||
'credit' : slip.total_pay,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
name = "By %s account" % (slip.employee_id.property_bank_account.name)
|
||||
cre_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': slip.total_pay,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
other_pay = slip.other_pay
|
||||
#Process all Reambuse Entries
|
||||
for line in slip.line_ids:
|
||||
if line.type == 'otherpay' and line.expanse_id.invoice_id:
|
||||
if not line.expanse_id.invoice_id.move_id:
|
||||
raise osv.except_osv(_('Warning !'), _('Please Confirm all Expanse Invoice appear for Reimbursement'))
|
||||
invids = [line.expanse_id.invoice_id.id]
|
||||
amount = line.total
|
||||
acc_id = slip.bank_journal_id.default_credit_account_id and slip.bank_journal_id.default_credit_account_id.id
|
||||
period_id = slip.period_id.id
|
||||
journal_id = slip.bank_journal_id.id
|
||||
name = '[%s]-%s' % (slip.number, line.name)
|
||||
invoice_pool.pay_and_reconcile(cr, uid, invids, amount, acc_id, period_id, journal_id, False, period_id, False, context, name)
|
||||
other_pay -= amount
|
||||
#TODO: link this account entries to the Payment Lines also Expanse Entries to Account Lines
|
||||
l_ids = movel_pool.search(cr, uid, [('name','=',name)])
|
||||
line_ids += l_ids
|
||||
|
||||
l_ids = movel_pool.search(cr, uid, [('invoice','=',line.expanse_id.invoice_id.id)])
|
||||
exp_ids += l_ids
|
||||
|
||||
#Process for Other payment if any
|
||||
other_move_id = False
|
||||
if slip.other_pay > 0:
|
||||
narration = 'Payment of Other Payeble amounts to %s' % (slip.employee_id.name)
|
||||
move = {
|
||||
'journal_id': slip.bank_journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'type':'bank_pay_voucher',
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
other_move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], narration, move_id)
|
||||
|
||||
name = "To %s account" % (slip.employee_id.name)
|
||||
ded_rec = {
|
||||
'move_id':other_move_id,
|
||||
'name':name,
|
||||
'date':slip.date,
|
||||
'account_id':slip.employee_id.property_bank_account.id,
|
||||
'debit': 0.0,
|
||||
'credit': other_pay,
|
||||
'journal_id':slip.journal_id.id,
|
||||
'period_id':period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
name = "By %s account" % (slip.employee_id.property_bank_account.name)
|
||||
cre_rec = {
|
||||
'move_id':other_move_id,
|
||||
'name':name,
|
||||
'partner_id':partner_id,
|
||||
'date':slip.date,
|
||||
'account_id':partner.property_account_payable.id,
|
||||
'debit': other_pay,
|
||||
'credit':0.0,
|
||||
'journal_id':slip.journal_id.id,
|
||||
'period_id':period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
rec = {
|
||||
'state':'done',
|
||||
'move_payment_ids':[(6, 0, line_ids)],
|
||||
'paid':True
|
||||
}
|
||||
self.write(cr, uid, [slip.id], rec)
|
||||
for exp_id in exp_ids:
|
||||
self.write(cr, uid, [slip.id], {'move_line_ids':[(4, exp_id)]})
|
||||
|
||||
return True
|
||||
|
||||
def account_check_sheet(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'accont_check'})
|
||||
return True
|
||||
|
||||
def hr_check_sheet(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'hr_check'})
|
||||
return True
|
||||
|
||||
def verify_sheet(self, cr, uid, ids, context={}):
|
||||
|
||||
move_pool = self.pool.get('account.move')
|
||||
movel_pool = self.pool.get('account.move.line')
|
||||
exp_pool = self.pool.get('hr.expense.expense')
|
||||
|
||||
for slip in self.browse(cr,uid,ids):
|
||||
total_deduct = 0.0
|
||||
|
||||
line_ids = []
|
||||
partner = False
|
||||
partner_id = False
|
||||
|
||||
if not slip.employee_id.bank_account_id:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please defined bank account for %s !' % (slip.employee_id.name)))
|
||||
|
||||
if not slip.employee_id.bank_account_id.partner_id:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please defined partner in bank account for %s !' % (slip.employee_id.name)))
|
||||
|
||||
partner = slip.employee_id.bank_account_id.partner_id
|
||||
partner_id = slip.employee_id.bank_account_id.partner_id.id
|
||||
|
||||
period_id = False
|
||||
|
||||
if slip.period_id:
|
||||
period_id = slip.period_id.id
|
||||
else:
|
||||
fiscal_year_ids = self.pool.get('account.fiscalyear').search(cr, uid, [])
|
||||
if not fiscal_year_ids:
|
||||
raise osv.except_osv(_('Warning !'), _('Please define fiscal year for perticular contract'))
|
||||
fiscal_year_objs = self.pool.get('account.fiscalyear').read(cr, uid, fiscal_year_ids, ['date_start','date_stop'])
|
||||
year_exist = False
|
||||
for fiscal_year in fiscal_year_objs:
|
||||
if ((fiscal_year['date_start'] <= slip.date) and (fiscal_year['date_stop'] >= slip.date)):
|
||||
year_exist = True
|
||||
if not year_exist:
|
||||
raise osv.except_osv(_('Warning !'), _('Fiscal Year is not defined for slip date %s'%slip.date))
|
||||
search_period = self.pool.get('account.period').search(cr,uid,[('date_start','<=',slip.date),('date_stop','>=',slip.date)])
|
||||
if not search_period:
|
||||
raise osv.except_osv(_('Warning !'), _('Period is not defined for slip date %s'%slip.date))
|
||||
period_id = search_period[0]
|
||||
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': slip.name
|
||||
}
|
||||
move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], slip.name, move_id)
|
||||
|
||||
line = {
|
||||
'move_id':move_id,
|
||||
'name': "By Basic Salary / " + slip.employee_id.name,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.salary_account.id,
|
||||
'debit': slip.basic,
|
||||
'credit': 0.0,
|
||||
'quantity':slip.working_days,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'analytic_account_id': False,
|
||||
'ref':slip.number
|
||||
}
|
||||
|
||||
#Setting Analysis Account for Basic Salary
|
||||
if slip.employee_id.analytic_account:
|
||||
line['analytic_account_id'] = slip.employee_id.analytic_account.id
|
||||
|
||||
move_line_id = movel_pool.create(cr, uid, line)
|
||||
line_ids += [move_line_id]
|
||||
|
||||
line = {
|
||||
'move_id':move_id,
|
||||
'name': "To Basic Paysble Salary / " + slip.employee_id.name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': slip.employee_id.employee_account.id,
|
||||
'debit': 0.0,
|
||||
'quantity':slip.working_days,
|
||||
'credit': slip.basic,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, line)]
|
||||
|
||||
for line in slip.line_ids:
|
||||
name = "[%s] - %s / %s" % (line.code, line.name, slip.employee_id.name)
|
||||
amount = line.total
|
||||
|
||||
if line.type == 'leaves':
|
||||
continue
|
||||
|
||||
rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'account_id': line.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'analytic_account_id':False,
|
||||
'ref':slip.number,
|
||||
'quantity':1
|
||||
}
|
||||
|
||||
#Setting Analysis Account for Salary Slip Lines
|
||||
if line.analytic_account_id:
|
||||
rec['analytic_account_id'] = line.analytic_account_id.id
|
||||
else:
|
||||
rec['analytic_account_id'] = slip.deg_id.account_id.id
|
||||
|
||||
if line.type == 'allounce' or line.type == 'otherpay':
|
||||
rec['debit'] = amount
|
||||
if not partner.property_account_payable:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Payable Account!!'))
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': 0.0,
|
||||
'quantity':1,
|
||||
'credit' : amount,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
elif line.type == 'deduction' or line.type == 'otherdeduct':
|
||||
if not partner.property_account_receivable:
|
||||
raise osv.except_osv(_('Integrity Error !'), _('Please Configure Partners Receivable Account!!'))
|
||||
rec['credit'] = amount
|
||||
total_deduct += amount
|
||||
ded_rec = {
|
||||
'move_id':move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': amount,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
|
||||
line_ids += [movel_pool.create(cr, uid, rec)]
|
||||
|
||||
if line.company_contrib > 0:
|
||||
company_contrib = line.company_contrib
|
||||
# if line.category_id.amount_type == 'per':
|
||||
# company_contrib = (amount * line.category_id.contribute_per)
|
||||
|
||||
narration = """Company Contribution of %s Encode same as a Company Expanse @ %s""" % (line.name, company_contrib)
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
company_contrib_move_id = move_pool.create(cr, uid, move)
|
||||
name = "[%s] - %s / %s - Company Contribution" % (line.code, line.name, slip.employee_id.name)
|
||||
self.create_voucher(cr, uid, [slip.id], name, company_contrib_move_id)
|
||||
|
||||
ded_deb = {
|
||||
'move_id':company_contrib_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.account_id.id,
|
||||
'debit': company_contrib,
|
||||
'credit' : 0.0,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
ded_cre = {
|
||||
'move_id':company_contrib_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.register_id.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : company_contrib,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
|
||||
if line.category_id.include_in_salary:
|
||||
narration = """Company Contribution of %s Deducted from Employee %s""" % (line.name, company_contrib)
|
||||
move = {
|
||||
#'name': slip.name,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': narration
|
||||
}
|
||||
include_in_salary_move_id = move_pool.create(cr, uid, move)
|
||||
self.create_voucher(cr, uid, [slip.id], narration, include_in_salary_move_id)
|
||||
|
||||
total_deduct += company_contrib
|
||||
ded_deb = {
|
||||
'move_id':include_in_salary_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': company_contrib,
|
||||
'credit' : 0.0,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_deb)]
|
||||
ded_cre = {
|
||||
'move_id':include_in_salary_move_id,
|
||||
'name': name,
|
||||
'date': slip.date,
|
||||
'quantity':1,
|
||||
'account_id': line.category_id.account_id.id,
|
||||
'debit': 0.0,
|
||||
'credit' : company_contrib,
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_cre)]
|
||||
|
||||
#make an entry line to contribution register
|
||||
# if line.category_id.register_id:
|
||||
# ctr = {
|
||||
# 'register_id':line.category_id.register_id.id,
|
||||
# 'name':line.name,
|
||||
# 'code':line.code,
|
||||
# 'employee_id':slip.employee_id.id,
|
||||
# 'period_id':period_id,
|
||||
# 'emp_deduction':amount,
|
||||
# }
|
||||
# if line.category_id.contribute:
|
||||
# ctr['comp_deduction'] = amount
|
||||
#
|
||||
# company = 0.0
|
||||
# employee = 0.0
|
||||
# if line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'per':
|
||||
# new_amount = (amount * (line.category_id.contribute_per / (1+line.category_id.contribute_per)))
|
||||
# company = new_amount
|
||||
# employee = amount - company
|
||||
#
|
||||
# elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
|
||||
# company = line.category_id.contribute_per
|
||||
# employee = amount - company
|
||||
|
||||
# elif line.category_id.contribute and line.category_id.include_in_salary and line.category_id.amount_type == 'func':
|
||||
# company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
|
||||
# employee = amount
|
||||
#
|
||||
# elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'per':
|
||||
# company = amount * line.category_id.contribute_per
|
||||
# employee = amount
|
||||
#
|
||||
# elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'fix':
|
||||
# company = line.category_id.contribute_per
|
||||
# employee = amount
|
||||
|
||||
# elif line.category_id.contribute and not line.category_id.include_in_salary and line.category_id.amount_type == 'func':
|
||||
# company = self.pool.get('hr.allounce.deduction.categoty').execute_function(cr, uid, line.category_id.id, line.slip_id.basic, context)
|
||||
# employee = amount
|
||||
#
|
||||
# ctr['emp_deduction'] = employee
|
||||
# ctr['comp_deduction'] = company
|
||||
#
|
||||
# self.pool.get('hr.contibution.register.line').create(cr, uid, ctr)
|
||||
|
||||
adj_move_id = False
|
||||
if total_deduct > 0:
|
||||
move = {
|
||||
'journal_id': slip.journal_id.id,
|
||||
'period_id': period_id,
|
||||
'date': slip.date,
|
||||
'ref':slip.number,
|
||||
'narration': 'Adjustment : %s' % (slip.name)
|
||||
}
|
||||
adj_move_id = move_pool.create(cr, uid, move)
|
||||
name = "Adjustment Entry - %s" % (slip.employee_id.name)
|
||||
self.create_voucher(cr, uid, [slip.id], name, adj_move_id)
|
||||
|
||||
ded_rec = {
|
||||
'move_id':adj_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_receivable.id,
|
||||
'debit': 0.0,
|
||||
'quantity':1,
|
||||
'credit' : total_deduct,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, ded_rec)]
|
||||
cre_rec = {
|
||||
'move_id':adj_move_id,
|
||||
'name': name,
|
||||
'partner_id': partner_id,
|
||||
'date': slip.date,
|
||||
'account_id': partner.property_account_payable.id,
|
||||
'debit': total_deduct,
|
||||
'quantity':1,
|
||||
'credit' : 0.0,
|
||||
'journal_id' : slip.journal_id.id,
|
||||
'period_id' :period_id,
|
||||
'ref':slip.number
|
||||
}
|
||||
line_ids += [movel_pool.create(cr, uid, cre_rec)]
|
||||
|
||||
rec = {
|
||||
'state':'confirm',
|
||||
'move_line_ids':[(6, 0,line_ids)],
|
||||
}
|
||||
if not slip.period_id:
|
||||
rec['period_id'] = period_id
|
||||
|
||||
dates = prev_bounds(slip.date)
|
||||
exp_ids = exp_pool.search(cr, uid, [('date_valid','>=',dates[0]), ('date_valid','<=',dates[1]), ('state','=','invoiced')])
|
||||
if exp_ids:
|
||||
acc = self.pool.get('ir.property').get(cr, uid, 'property_account_expense_categ', 'product.category')
|
||||
for exp in exp_pool.browse(cr, uid, exp_ids):
|
||||
exp_res = {
|
||||
'name':exp.name,
|
||||
'amount_type':'fix',
|
||||
'type':'otherpay',
|
||||
'category_id':exp.category_id.id,
|
||||
'amount':exp.amount,
|
||||
'slip_id':slip.id,
|
||||
'expanse_id':exp.id,
|
||||
'account_id':acc
|
||||
}
|
||||
self.pool.get('hr.payslip.line').create(cr, uid, exp_res)
|
||||
|
||||
self.write(cr, uid, [slip.id], rec)
|
||||
|
||||
return True
|
||||
|
||||
hr_payslip()
|
||||
|
||||
class account_move_link_slip(osv.osv):
|
||||
'''
|
||||
Account Move Link to Pay Slip
|
||||
'''
|
||||
_name = 'hr.payslip.account.move'
|
||||
_description = 'Account Move Link to Pay Slip'
|
||||
_columns = {
|
||||
'name':fields.char('Name', size=256, required=True, readonly=False),
|
||||
'move_id':fields.many2one('account.move', 'Expanse Entries', required=False, readonly=True),
|
||||
'slip_id':fields.many2one('hr.payslip', 'Pay Slip', required=False),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
}
|
||||
account_move_link_slip()
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_hr_payslip_form_inherit" model="ir.ui.view">
|
||||
<field name="name">hr.payslip.form</field>
|
||||
<field name="model">hr.payslip</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Accounting Details" position="replace">
|
||||
<page string="Accounting Details">
|
||||
<group col="4" colspan="3">
|
||||
<separator colspan="4" string="Accounting Informations"/>
|
||||
<field name="move_ids" colspan="4" nolabel="1" readonly="1">
|
||||
<tree string="Accounting Vouchers">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="move_id"/>
|
||||
</tree>
|
||||
<form string="Accounting Vouchers">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="move_id"/>
|
||||
</form>
|
||||
</field>
|
||||
</group>
|
||||
<group col="2" colspan="1">
|
||||
<separator colspan="2" string="Other Informations"/>
|
||||
<field name="paid" readonly="1"/>
|
||||
<field name="company_id"/>
|
||||
<field name="register_id"/>
|
||||
<field name="deg_id"/>
|
||||
<field name="contract_id" domain="[('employee_id','=',employee_id)]"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_payslip_form_inherit1" model="ir.ui.view">
|
||||
<field name="name">hr.payslip.form</field>
|
||||
<field name="model">hr.payslip</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="view_hr_payslip_form_inherit"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Account Lines">
|
||||
<field name="move_line_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Payment Lines">
|
||||
<field name="move_payment_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="act_account_check" model="workflow.activity">
|
||||
<field name="wkf_id" ref="hr_payroll.wkf"/>
|
||||
<field name="name">account_check</field>
|
||||
<field name="action">account_check_sheet()</field>
|
||||
<field name="kind">function</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll.t2" model="workflow.transition">
|
||||
<field name="act_from" ref="hr_payroll.act_draft"/>
|
||||
<field name="act_to" ref="hr_payroll.act_hr_check"/>
|
||||
<field name="condition">True</field>
|
||||
<field name="signal">verify_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="t3" model="workflow.transition">
|
||||
<field name="act_from" ref="hr_payroll.act_hr_check"/>
|
||||
<field name="act_to" ref="act_account_check"/>
|
||||
<field name="condition">True</field>
|
||||
<field name="signal">verify_twice_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll.t5" model="workflow.transition">
|
||||
<field name="act_from" ref="act_account_check"/>
|
||||
<field name="act_to" ref="hr_payroll.act_confirm"/>
|
||||
<field name="signal">final_verify_sheet</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll.t9" model="workflow.transition">
|
||||
<field name="act_from" ref="act_account_check"/>
|
||||
<field name="act_to" ref="hr_payroll.act_cancel"/>
|
||||
<field name="signal">cancel_sheet</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="hr_timesheet_invoice_cost_ledger_values">
|
||||
<!-- <record model="ir.values" id="hr_timesheet_invoice_cost_ledger_values">
|
||||
<field name="model_id" ref="model_account_analytic_account" />
|
||||
<field name="object" eval="1" />
|
||||
<field name="name">Cost Ledger</field>
|
||||
@@ -38,7 +38,7 @@
|
||||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_hr_timesheet_invoice_cost_ledger'))" />
|
||||
<field name="key">action</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
</record>
|
||||
</record> -->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -72,7 +72,6 @@ class hr_timesheet_invoice_create(osv.osv_memory):
|
||||
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
|
||||
res = mod_obj.read(cr, uid, result, ['res_id'])
|
||||
data = self.read(cr, uid, ids, [], context)[0]
|
||||
|
||||
account_ids = data['accounts']
|
||||
for account in analytic_account_obj.browse(cr, uid, account_ids, context):
|
||||
partner = account.partner_id
|
||||
|
||||
@@ -151,16 +151,13 @@ class hr_timesheet_sheet(osv.osv):
|
||||
raise osv.except_osv(_('Error !'), _('You can not duplicate a timesheet !'))
|
||||
|
||||
def button_confirm(self, cr, uid, ids, context=None):
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
for sheet in self.browse(cr, uid, ids, context=context):
|
||||
di = sheet.user_id.company_id.timesheet_max_difference
|
||||
|
||||
if (abs(sheet.total_difference) < di) or not di:
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr)
|
||||
|
||||
else:
|
||||
raise osv.except_osv(_('Warning !'), _('Please verify that the total difference of the sheet is lower than %.2f !') %(di,))
|
||||
return True
|
||||
|
||||
@@ -247,6 +247,7 @@
|
||||
<field name="count_comments" />
|
||||
<field name="count_votes" />
|
||||
<field name="state"/>
|
||||
<button name="idea_open" string="Open" states="draft" icon="terp-gtk-go-back-rtl"/>
|
||||
<button name="%(idea.action_idea_post_vote)d" icon="gtk-execute" type="action" states="open" string="Submit Vote"/>
|
||||
<button name="idea_close" string="Accept" states="open" icon="gtk-jump-to"/>
|
||||
<button name="idea_cancel" string="Refuse" states="open" icon="gtk-cancel"/>
|
||||
@@ -372,7 +373,7 @@
|
||||
<field name="search_view_id" ref="view_idea_vote_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Votes" parent="menu_ideas" id="menu_idea_vote" action="action_idea_vote"/>
|
||||
<menuitem name="Votes" parent="menu_idea_reporting" id="menu_idea_vote" action="action_idea_vote"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -101,6 +101,7 @@ class idea_post_vote(osv.osv_memory):
|
||||
"""
|
||||
|
||||
vote_ids = context and context.get('active_ids', []) or []
|
||||
vote_id = context['active_ids'][0]
|
||||
vote_pool = self.pool.get('idea.vote')
|
||||
idea_pool = self.pool.get('idea.idea')
|
||||
comment_pool = self.pool.get('idea.comment')
|
||||
|
||||
@@ -62,6 +62,7 @@ class partner_vat(osv.osv_memory):
|
||||
obj_vat_lclient = self.pool.get('vat.listing.clients')
|
||||
obj_model_data = self.pool.get('ir.model.data')
|
||||
data = self.read(cursor, user, ids)[0]
|
||||
context['test_xml'] = data['test_xml']
|
||||
period = obj_period.search(cursor, user, [('fiscalyear_id', '=', data['fyear'])], context=context)
|
||||
p_id_list = obj_partner.search(cursor, user, [('vat_subjected', '!=', False)], context=context)
|
||||
if not p_id_list:
|
||||
@@ -196,7 +197,7 @@ class partner_vat_list(osv.osv_memory):
|
||||
|
||||
data_file = '<?xml version="1.0"?>\n<VatList xmlns="http://www.minfin.fgov.be/VatList" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.minfin.fgov.be/VatList VatList.xml" RecipientId="VAT-ADMIN" SenderId="'+ str(company_vat) + '"'
|
||||
data_file +=' ControlRef="'+ cref + '" MandataireId="'+ tools.ustr(context['mand_id']) + '" SenderDate="'+ str(sender_date)+ '"'
|
||||
if ['test_xml']:
|
||||
if context['test_xml']:
|
||||
data_file += ' Test="0"'
|
||||
data_file += ' VersionTech="1.2">'
|
||||
data_file += '\n<AgentRepr DecNumber="1">\n\t<CompanyInfo>\n\t\t<VATNum>'+str(company_vat)+'</VATNum>\n\t\t<Name>'+tools.ustr(obj_cmpny.name)+'</Name>\n\t\t<Street>'+ tools.ustr(street) +'</Street>\n\t\t<CityAndZipCode>'+ tools.ustr(zip_city) +'</CityAndZipCode>'
|
||||
@@ -225,7 +226,7 @@ class partner_vat_list(osv.osv_memory):
|
||||
seq +=1
|
||||
sum_tax +=line['amount']
|
||||
sum_turnover +=line['turnover']
|
||||
data_clientinfo +='\n<ClientList SequenceNum="'+str(seq)+'">\n\t<CompanyInfo>\n\t\t<VATNum>'+line['vat'] +'</VATNum>\n\t\t<Country>'+tools.ustr(line['country']) +'</Country>\n\t</CompanyInfo>\n\t<Amount>'+str(int(line['amount'] * 100)) +'</Amount>\n\t<TurnOver>'+str(int(line['turnover'] * 100)) +'</TurnOver>\n</ClientList>'
|
||||
data_clientinfo +='\n<ClientList SequenceNum="'+str(seq)+'">\n\t<CompanyInfo>\n\t\t<VATNum>'+str(line['vat']) +'</VATNum>\n\t\t<Country>'+tools.ustr(line['country']) +'</Country>\n\t</CompanyInfo>\n\t<Amount>'+str(int(line['amount'] * 100)) +'</Amount>\n\t<TurnOver>'+str(int(line['turnover'] * 100)) +'</TurnOver>\n</ClientList>'
|
||||
|
||||
data_decl ='\n<DeclarantList SequenceNum="1" DeclarantNum="'+ dnum + '" ClientNbr="'+ str(seq) +'" TurnOverSum="'+ str(int(sum_turnover * 100)) +'" TaxSum="'+ str(int(sum_tax * 100)) +'" />'
|
||||
data_file += tools.ustr(data_decl) + tools.ustr(data_comp) + tools.ustr(data_period) + tools.ustr(data_clientinfo) + '\n</VatList>'
|
||||
|
||||
@@ -53,16 +53,51 @@
|
||||
<field name="state"/>
|
||||
<field name="descript"/>
|
||||
<field name="price" sum="Total price"/>
|
||||
<button colspan="1"
|
||||
name="%(action_lunch_order_confirm)d"
|
||||
string="Confirm Order"
|
||||
type="action" states="draft"
|
||||
icon="terp-gtk-go-back-rtl" />
|
||||
<button colspan="1"
|
||||
name="%(action_lunch_order_cancel)d"
|
||||
string="Cancel Order"
|
||||
type="action" states="confirmed"
|
||||
icon="terp-gtk-stop" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Lunch order Search view -->
|
||||
|
||||
<record id="view_lunch_order_filter" model="ir.ui.view">
|
||||
<field name="name">lunch.order.list.select</field>
|
||||
<field name="model">lunch.order</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Lunch Order">
|
||||
<filter icon="terp-check" string="To Confirm" domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-camera_test" string="Confirmed" domain="[('state','=',('confirmed'))]"/>
|
||||
<filter icon="terp-go-today" name="Today" string="Today" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="20">
|
||||
<filter string="Cashbox" icon="terp-dolar" domain="[]" context="{'group_by':'cashmove'}"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Lunch order Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_order_form">
|
||||
<field name="name">Lunch Orders</field>
|
||||
<field name="res_model">lunch.order</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_lunch_order_filter"/>
|
||||
<field name="context">{"search_default_Today":1}</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Lunch Order" parent="menu_lunch"
|
||||
@@ -133,20 +168,45 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="CashMove" editable="top">
|
||||
<field name="box" select="1"/>
|
||||
<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"/>
|
||||
<field name="amount" select="1" sum="Total amount"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Cash Move Search View -->
|
||||
|
||||
<record id="view_lunch_cashmove_filter" model="ir.ui.view">
|
||||
<field name="name">lunch.cashmove.list.select</field>
|
||||
<field name="model">lunch.cashmove</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search CashMove">
|
||||
<filter icon="terp-go-today" name="Today" string="Today" domain="[('create_date','<=',time.strftime('%%Y-%%m-%%d 23:59:59'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="user_cashmove"/>
|
||||
<field name="create_date"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="20">
|
||||
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_cashmove'}"/>
|
||||
<filter string="Box" icon="terp-accessories-archiver+" domain="[]" context="{'group_by':'box'}"/>
|
||||
</group>
|
||||
</search>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Cash Move Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_lunch_cashmove_form">
|
||||
<field name="name">CashMove</field>
|
||||
<field name="res_model">lunch.cashmove</field>
|
||||
<field name="search_view_id" ref="view_lunch_cashmove_filter"/>
|
||||
<field name="context">{"search_default_Today":1}</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Cash Moves" parent="menu_lunch"
|
||||
|
||||
@@ -195,7 +195,7 @@ class pos_order(osv.osv):
|
||||
line.price_unit * \
|
||||
(1-(line.discount or 0.0)/100.0), line.qty),
|
||||
res[order.id]['amount_tax'])
|
||||
else:
|
||||
elif line.qty != 0.0:
|
||||
for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty, line.product_id, line.order_id.partner_id)['taxes']:
|
||||
val += c['amount']
|
||||
res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
|
||||
@@ -238,6 +238,7 @@ class pos_order(osv.osv):
|
||||
'invoice_id': False,
|
||||
'account_move': False,
|
||||
'picking_id': False,
|
||||
'statement_ids':[],
|
||||
'nb_print': 0,
|
||||
'pickings': []
|
||||
})
|
||||
@@ -1055,11 +1056,13 @@ class pos_order_line(osv.osv):
|
||||
return res
|
||||
|
||||
def _amount_line_ttc(self, cr, uid, ids, field_name, arg, context):
|
||||
res = {}
|
||||
res = dict.fromkeys(ids, 0.0)
|
||||
account_tax_obj = self.pool.get('account.tax')
|
||||
for line in self.browse(cr, uid, ids):
|
||||
tax_amount = 0.0
|
||||
taxes = [t for t in line.product_id.taxes_id]
|
||||
if line.qty == 0.0:
|
||||
continue
|
||||
computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['taxes']
|
||||
for tax in computed_taxes:
|
||||
tax_amount += tax['amount']
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
<group colspan="4" col="7">
|
||||
<field name="amount_tax"/>
|
||||
<field name="amount_total"/>
|
||||
<button name="%(action_pos_discount)d" string="D_iscount" type="action" states="draft"/>
|
||||
<button name="dummy_button" string="Compute" type="object" />
|
||||
<button name="%(action_pos_discount)d" string="D_iscount" icon="gtk-execute" type="action" states="draft"/>
|
||||
<button name="dummy_button" string="Compute" icon="gtk-execute" type="object" />
|
||||
</group>
|
||||
|
||||
<group colspan="4" col="9" groups="base.group_extended">
|
||||
@@ -95,8 +95,8 @@
|
||||
<field name="sale_journal" domain="[('type','=','sale'),('company_id','=',company_id)]"/>
|
||||
<field name="pricelist_id" domain="[('type','=','sale')]"/>
|
||||
<field name="invoice_id"/>
|
||||
<group colspan="2" col="3">
|
||||
<button name="invoice" string="Create _Invoice" states="paid"/>
|
||||
<group colspan="2" col="4">
|
||||
<button name="invoice" icon="gtk-execute" string="Create _Invoice" states="paid"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
|
||||
@@ -35,19 +35,19 @@ class pos_invoice(report_sxw.rml_parse):
|
||||
})
|
||||
|
||||
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
super(pos_invoice, self).set_context(objects, data, ids, report_type)
|
||||
def set_context(self, order, data, ids, report_type=None):
|
||||
super(pos_invoice, self).set_context(order, data, ids, report_type)
|
||||
iids = []
|
||||
nids = []
|
||||
|
||||
for order in objects:
|
||||
order.write({'nb_print': order.nb_print + 1})
|
||||
|
||||
if order.invoice_id and order.invoice_id not in iids:
|
||||
if not order.invoice_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
|
||||
iids.append(order.invoice_id)
|
||||
nids.append(order.invoice_id.id)
|
||||
order.write({'nb_print': order.nb_print + 1})
|
||||
|
||||
if order.invoice_id and order.invoice_id not in iids:
|
||||
if not order.invoice_id:
|
||||
raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
|
||||
iids.append(order.invoice_id)
|
||||
nids.append(order.invoice_id.id)
|
||||
self.cr.commit()
|
||||
data['ids'] = nids
|
||||
self.datas = data
|
||||
|
||||
@@ -41,13 +41,20 @@ class report_pos_order(osv.osv):
|
||||
('advance','Advance'),
|
||||
('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')],
|
||||
'State'),
|
||||
'state_2': fields.function([('to_verify', 'To Verify'), ('accepted', 'Accepted'),
|
||||
('refused', 'Refused')], string='State'),
|
||||
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
|
||||
'price_total':fields.float('Total Price', readonly=True),
|
||||
'total_discount':fields.float('Total Discount', readonly=True),
|
||||
'average_price': fields.float('Average Price', readonly=True,group_operator="avg"),
|
||||
'shop_id':fields.many2one('sale.shop', 'Shop', readonly=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', readonly=True),
|
||||
'nbr':fields.integer('# of Lines', readonly=True),
|
||||
'product_qty':fields.float('# of Qty', readonly=True),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal'),
|
||||
'statement_journal_id': fields.many2one('account.journal','Cash Register'),
|
||||
'delay_validation': fields.integer('Delay Validation'),
|
||||
'delay_payment': fields.integer('Delay Payment'),
|
||||
}
|
||||
_order = 'date desc'
|
||||
def init(self, cr):
|
||||
@@ -63,26 +70,32 @@ class report_pos_order(osv.osv):
|
||||
to_char(po.date_order, 'YYYY') as year,
|
||||
to_char(po.date_order, 'MM') as month,
|
||||
to_char(po.date_order, 'YYYY-MM-DD') as day,
|
||||
(date(po.date_order)-date(po.date_validation)) as delay_validation,
|
||||
(date(po.date_order)-date(po.date_payment)) as delay_payment,
|
||||
po.partner_id as partner_id,
|
||||
po.state as state,
|
||||
po.state_2 as state_2,
|
||||
po.user_id as user_id,
|
||||
po.shop_id as shop_id,
|
||||
po.company_id as company_id,
|
||||
po.sale_journal as journal_id
|
||||
po.sale_journal as journal_id,
|
||||
aj.id as statement_journal_id
|
||||
|
||||
from
|
||||
pos_order as po,
|
||||
pos_order as po,account_bank_statement_line absl,account_journal as aj,
|
||||
( select pl.id as id,
|
||||
pl.product_id as product_id,
|
||||
pl.qty as product_qty,
|
||||
sum(pl.qty * pl.price_unit)- sum(pl.qty * pl.price_ded) as price_total,
|
||||
sum(pl.qty * pl.price_ded) as total_discount,
|
||||
((sum(pl.qty * pl.price_unit)-sum(pl.qty * pl.price_ded))/sum(pl.qty)*count(pl.qty))::decimal(16,2) as average_price,
|
||||
pl.order_id
|
||||
from
|
||||
pos_order_line as pl
|
||||
left join product_template pt on (pt.id=pl.product_id)
|
||||
group by
|
||||
pl.id,pl.order_id, pl.qty,pl.product_id) el
|
||||
where po.id = el.order_id
|
||||
where po.id = el.order_id and absl.pos_statement_id = po.id and aj.name = absl.journal_id
|
||||
)
|
||||
""")
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Point of Sale Analysis">
|
||||
<field name="date" />
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="date_validation" invisible="1"/>
|
||||
<field name="date_payment" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
@@ -18,10 +18,15 @@
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="shop_id" invisible="1"/>
|
||||
<field name="journal_id" invisible="1"/>
|
||||
<field name="statement_journal_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="nbr" sum="# of Lines"/>
|
||||
<field name="product_qty" sum="# of Qty"/>
|
||||
<field name="price_total" sum="Total Price"/>
|
||||
<field name="total_discount" sum="Total Discount"/>
|
||||
<field name="average_price" avg="Average Price"/>
|
||||
<field name="delay_validation"/>
|
||||
<field name="delay_payment"/>
|
||||
<field name="state" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -45,6 +50,7 @@
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="POS ordered created last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-today"
|
||||
string=" Today "
|
||||
name="today"
|
||||
@@ -52,15 +58,15 @@
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="POS ordered created by today"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new"
|
||||
string="Draft"
|
||||
domain="[('state','=','draft')]"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Accepted"
|
||||
domain="[('state_2','=',('to_verify'))]" groups="base.group_extended"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Invoiced"
|
||||
domain="[('state','=',('invoiced'))]"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Paid"
|
||||
domain="[('state','=',('paid'))]"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Invoiced"
|
||||
domain="[('state','=',('invoiced'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id" widget="selection">
|
||||
@@ -73,14 +79,15 @@
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Salesman" icon="terp-personal" name="User" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Customer" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Cash Register" icon="terp-folder-orange" context="{'group_by':'statement_journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Shop" icon="terp-go-home" context="{'group_by':'shop_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" groups="base.group_multi_company" context="{'group_by':'company_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<field name="balance_end"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
|
||||
<button type="object" string="Open" name="button_open" states="draft" icon="terp-camera_test"/>
|
||||
<button type="object" string="Confirm" name="button_confirm" states="open" icon="terp-gtk-go-back-rtl"/>
|
||||
<button type="object" string="Cancel" name="button_cancel" states="confirm" icon="terp-gtk-stop"/>
|
||||
</tree>
|
||||
@@ -109,10 +109,10 @@
|
||||
<field name="total_entry_encoding"/>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<button name="button_dummy" states="draft" string="Compute"/>
|
||||
<button name="button_confirm" states="open" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
<button name="button_dummy" states="draft" icon="gtk-execute" string="Compute"/>
|
||||
<button name="button_confirm" states="open" icon="terp-gtk-go-back-rtl" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" icon="terp-camera_test" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel" groups="base.group_extended"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -172,10 +172,10 @@
|
||||
<field name="total_entry_encoding"/>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<button name="button_dummy" states="draft" string="Compute"/>
|
||||
<button name="button_confirm" states="open" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
<button name="button_dummy" states="draft" icon="gtk-execute" string="Compute"/>
|
||||
<button name="button_confirm" states="open" icon="terp-gtk-go-back-rtl" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" icon="terp-camera_test" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" icon="gtk-cancel" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -301,10 +301,11 @@
|
||||
<field name="total_entry_encoding"/>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<button name="button_dummy" states="draft" string="Compute"/>
|
||||
<button name="button_open" states="draft" string="Open CashBox" type="object" />
|
||||
<button name="button_confirm" states="open" string="Confirm" type="object" />
|
||||
<button name="button_cancel" states="confirm" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
<button name="button_dummy" states="draft" icon="gtk-execute" string="Compute"/>
|
||||
<button name="button_confirm" states="open" icon="terp-gtk-go-back-rtl" string="Close CashBox" type="object"/>
|
||||
<button name="button_open" states="draft" icon="terp-camera_test" string="Open CashBox" type="object"/>
|
||||
<button name="button_cancel" states="confirm" icon="gtk-cancel" string="Cancel" type="object" groups="base.group_extended"/>
|
||||
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -14,7 +14,7 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -39,7 +39,7 @@ class res_partner_manufacturer(osv.osv):
|
||||
'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'),
|
||||
}
|
||||
_defaults = {
|
||||
'authorized': lambda *a: True,
|
||||
'authorized': True,
|
||||
}
|
||||
|
||||
res_partner_manufacturer()
|
||||
|
||||
@@ -42,7 +42,7 @@ class product_product(osv.osv):
|
||||
invoice_types=()
|
||||
states=()
|
||||
if invoice_state=='paid':
|
||||
states=('paid')
|
||||
states=('paid',)
|
||||
elif invoice_state=='open_paid':
|
||||
states=('open','paid')
|
||||
elif invoice_state=='draft_open_paid':
|
||||
|
||||
@@ -46,6 +46,25 @@ class sale_order_line(osv.osv):
|
||||
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
|
||||
lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False, flag=False):
|
||||
|
||||
def get_real_price(res_dict, product_id, pricelist):
|
||||
item_obj = self.pool.get('product.pricelist.item')
|
||||
price_type_obj = self.pool.get('product.price.type')
|
||||
product_obj = self.pool.get('product.product')
|
||||
template_obj = self.pool.get('product.template')
|
||||
field_name = 'list_price'
|
||||
|
||||
if res_dict.get('item_id',False) and res_dict['item_id'].get(pricelist,False):
|
||||
item = res_dict['item_id'].get(pricelist,False)
|
||||
item_base = item_obj.read(cr, uid, [item], ['base'])[0]['base']
|
||||
if item_base > 0:
|
||||
field_name = price_type_obj.browse(cr, uid, item_base).field
|
||||
|
||||
product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id
|
||||
|
||||
product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context)
|
||||
return product_read[field_name]
|
||||
|
||||
|
||||
res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty,
|
||||
uom, qty_uos, uos, name, partner_id,
|
||||
lang, update_tax,date_order,fiscal_position=fiscal_position,flag=flag)
|
||||
@@ -68,15 +87,16 @@ class sale_order_line(osv.osv):
|
||||
# product_read = self.pool.get('product.template').read(cr, uid, product_tmpl_id, [field_name], context)
|
||||
# list_price = product_read[field_name]
|
||||
list_price = pricelist_obj.price_get(cr, uid, [pricelist],
|
||||
product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })[pricelist]
|
||||
product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })
|
||||
|
||||
pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
|
||||
pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
|
||||
|
||||
old_uom = product.uos_id or product.uom_id
|
||||
new_list_price = product_uom_obj._compute_price(cr,
|
||||
uid, old_uom.id, list_price, uom)
|
||||
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price != 0):
|
||||
discount=(new_list_price-price) / new_list_price * 100
|
||||
# new_list_price = product_uom_obj._compute_price(cr,
|
||||
# uid, old_uom.id, list_price, uom)
|
||||
new_list_price = get_real_price(list_price, product.id, pricelist)
|
||||
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0):
|
||||
discount = (new_list_price - price) / new_list_price * 100
|
||||
result['price_unit'] = new_list_price
|
||||
result['discount'] = discount
|
||||
else:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<!--<wizard id="wizard_schedule_task" menu="False" model="project.phase" name="phase.schedule.tasks" string="Schedule Tasks"/>-->
|
||||
<!--<wizard id="wizard_compute_task" model="project.task" menu="False" name="wizard.compute.tasks" string="Compute Task Scheduling"/>-->
|
||||
|
||||
<menuitem icon="terp-project" id="base.menu_main" name="Project Management" sequence="1"/>
|
||||
<!-- <menuitem icon="terp-project" id="base.menu_main" name="Project Management" sequence="1"/>-->
|
||||
<!--<menuitem id="base.menu_pm_planning" name="Planning" parent="base.menu_main" sequence="3"/>-->
|
||||
<!-- <menuitem
|
||||
action="wizard_compute_phase"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,14 +15,15 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
from mx import DateTime
|
||||
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
import ir
|
||||
from mx import DateTime
|
||||
from tools import config
|
||||
|
||||
class sale_order_line(osv.osv):
|
||||
@@ -31,13 +32,15 @@ class sale_order_line(osv.osv):
|
||||
_columns = {
|
||||
'analytics_id':fields.many2one('account.analytic.plan.instance','Analytic Distribution'),
|
||||
}
|
||||
def invoice_line_create(self, cr, uid, ids, context={}):
|
||||
create_ids=super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
|
||||
i=0
|
||||
def invoice_line_create(self, cr, uid, ids, context=None):
|
||||
line_obj = self.pool.get('account.invoice.line')
|
||||
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context=context)
|
||||
i = 0
|
||||
for line in self.browse(cr, uid, ids, context):
|
||||
self.pool.get('account.invoice.line').write(cr,uid,[create_ids[i]],{'analytics_id':line.analytics_id.id})
|
||||
i=i+1
|
||||
line_obj.write(cr, uid, [create_ids[i]], {'analytics_id':line.analytics_id.id})
|
||||
i = i+1
|
||||
return create_ids
|
||||
sale_order_line()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
sale_order_line()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -27,7 +27,7 @@ class sale_order(osv.osv):
|
||||
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
|
||||
}
|
||||
|
||||
def _get_section(self, cr, uid, context):
|
||||
def _get_section(self, cr, uid, context=None):
|
||||
return context.get('context_section_id',False)
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,11 +15,12 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from report import report_sxw
|
||||
from osv import osv
|
||||
import pooler
|
||||
@@ -71,4 +72,5 @@ class shipping(report_sxw.rml_parse):
|
||||
# return True
|
||||
|
||||
report_sxw.report_sxw('report.sale.shipping','stock.picking','addons/sale_delivery_report/report/shipping.rml',parser=shipping)
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -13,7 +13,7 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-18 03:32+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-06-19 03:51+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: stock
|
||||
|
||||
@@ -349,7 +349,8 @@ class product_product(osv.osv):
|
||||
if location_info.usage == 'inventory':
|
||||
if fields.get('virtual_available'):
|
||||
res['fields']['virtual_available']['string'] = _('Future P&L')
|
||||
res['fields']['qty_available']['string'] = _('P&L Qty')
|
||||
if fields.get('qty_available'):
|
||||
res['fields']['qty_available']['string'] = _('P&L Qty')
|
||||
|
||||
if location_info.usage == 'procurement':
|
||||
if fields.get('virtual_available'):
|
||||
|
||||
+17
-15
@@ -559,7 +559,7 @@ class stock_picking(osv.osv):
|
||||
}
|
||||
new_id = super(stock_picking, self).create(cr, user, vals, context)
|
||||
if not vals.get('auto_picking', False):
|
||||
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals['origin'] or "n/a") + "' "+ _("is created.")
|
||||
message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals.get('origin') or "n/a") + "' "+ _("is created.")
|
||||
self.log(cr, user, new_id, message)
|
||||
return new_id
|
||||
|
||||
@@ -687,6 +687,8 @@ class stock_picking(osv.osv):
|
||||
"""
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for pick in self.browse(cr, uid, ids):
|
||||
if not pick.move_lines:
|
||||
raise osv.except_osv(_('Error !'),_('You can not process picking without stock moves'))
|
||||
wf_service.trg_validate(uid, 'stock.picking', pick.id,
|
||||
'button_confirm', cr)
|
||||
#move_ids = [x.id for x in pick.move_lines]
|
||||
@@ -1385,9 +1387,9 @@ class stock_move(osv.osv):
|
||||
'price_unit': fields.float('Unit Price',
|
||||
digits_compute= dp.get_precision('Account')),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, select=1),
|
||||
'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner"),
|
||||
'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner", store=True),
|
||||
'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order"),
|
||||
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"),
|
||||
'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin",store=True),
|
||||
'scraped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scraped'),
|
||||
}
|
||||
_constraints = [
|
||||
@@ -1701,7 +1703,7 @@ class stock_move(osv.osv):
|
||||
tracking_id = tracking_obj.search(cr, uid, ['name','=', tracking])
|
||||
if prodlot_id:
|
||||
update_val['prodlot_id'] = prodlot_id
|
||||
else:
|
||||
else:
|
||||
tracking_id = tracking_obj.create(cr, uid, {'name': tracking}, {'product_id': self.browse(cr, uid, ids)[0].product_id.id})
|
||||
update_val['tracking_id'] = tracking_id
|
||||
else:
|
||||
@@ -2191,17 +2193,17 @@ class stock_move(osv.osv):
|
||||
|
||||
for move in complete:
|
||||
self.action_done(cr, uid, [move.id], context)
|
||||
|
||||
# TOCHECK : Done picking if all moves are done
|
||||
cr.execute("""
|
||||
SELECT move.id FROM stock_picking pick
|
||||
RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
|
||||
WHERE pick.id = %s""",
|
||||
('done', move.picking_id.id))
|
||||
res = cr.fetchall()
|
||||
if len(res) == len(move.picking_id.move_lines):
|
||||
picking_obj.action_move(cr, uid, [move.picking_id.id])
|
||||
wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
|
||||
if move.picking_id.id :
|
||||
# TOCHECK : Done picking if all moves are done
|
||||
cr.execute("""
|
||||
SELECT move.id FROM stock_picking pick
|
||||
RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
|
||||
WHERE pick.id = %s""",
|
||||
('done', move.picking_id.id))
|
||||
res = cr.fetchall()
|
||||
if len(res) == len(move.picking_id.move_lines):
|
||||
picking_obj.action_move(cr, uid, [move.picking_id.id])
|
||||
wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
|
||||
|
||||
ref = {}
|
||||
done_move_ids = []
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<data>
|
||||
<report auto="False" id="report_product_history" model="product.product" name="stock.product.history" string="Future Stock Forecast"/>
|
||||
<report id="report_picking_list" model="stock.picking" name="stock.picking.list" string="Picking list" rml="stock/report/picking.rml"/>
|
||||
<report id="report_packing_list" model="stock.picking" name="stock.packing.list" string="Packing list" rml="stock/report/packing.rml"/>
|
||||
<report id="report_move_labels" model="stock.move" name="stock.move.label" string="Item Labels" xml="stock/report/lot_move_label.xml" xsl="stock/report/lot_move_label.xsl"/>
|
||||
<report auto="False" id="report_location_overview" model="stock.location" name="lot.stock.overview" string="Location Overview" rml="stock/report/lot_overview.rml" groups="base.group_extended"/>
|
||||
<report auto="False" id="report_lot_location" model="stock.location" name="lot.location" rml="stock/report/lot_location.rml" string="Lots by location"/>
|
||||
|
||||
@@ -1254,12 +1254,9 @@
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
<group col="7" colspan="4">
|
||||
<label colspan="5"/>
|
||||
<button name="%(act_stock_picking_move_wizard)d" string="Unreceived Products" type="action" states="draft" icon="gtk-redo"/>
|
||||
</group>
|
||||
<group col="10" colspan="4">
|
||||
<field name="state" readonly="1"/>
|
||||
<button name="%(act_stock_picking_move_wizard)d" string="Unreceived Products" type="action" states="draft" icon="gtk-redo"/>
|
||||
<button name="draft_force_assign" states="draft" string="Process Later" type="object" icon="gtk-ok"/>
|
||||
<button name="draft_validate" states="draft" string="Process Now" type="object" icon="gtk-media-play"/>
|
||||
<button name="action_assign" states="confirmed" string="Check Availability" type="object" icon="gtk-find"/>
|
||||
@@ -1354,7 +1351,6 @@
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="4" col="8">
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Partner" icon="terp-personal" domain="[]" context="{'group_by':'address_id'}"/>
|
||||
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
<filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'min_date'}"/>
|
||||
<filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<field name="name">cancel</field>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_cancel_inventary()</field>
|
||||
<field name="action">action_cancel()</field>
|
||||
</record>
|
||||
|
||||
<record id="act_cancel" model="workflow.activity">
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
<field name="model">stock.inventory.merge</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Merge inventories">
|
||||
<separator colspan="4" string="Merge inventories" />
|
||||
<label string="Do you want to merge theses inventories ?"/>
|
||||
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
|
||||
<button name="do_merge" string="Yes" type="object" icon="gtk-apply"/>
|
||||
<form string="Merge inventories">
|
||||
<separator colspan="4" string="Merge inventories" />
|
||||
<label string="Do you want to merge theses inventories ?"/>
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
|
||||
<button name="do_merge" string="Yes" type="object" icon="gtk-apply"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -176,15 +176,16 @@ class split_in_production_lot(osv.osv_memory):
|
||||
"""
|
||||
|
||||
res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
|
||||
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
|
||||
if 'product_id' in fields:
|
||||
res.update({'product_id': move.product_id.id})
|
||||
if 'product_uom' in fields:
|
||||
res.update({'product_uom': move.product_uom.id})
|
||||
if 'qty' in fields:
|
||||
res.update({'qty': move.product_qty})
|
||||
if 'use_exist' in fields:
|
||||
res.update({'use_exist': (move.picking_id and move.picking_id.type=='out' and True) or False})
|
||||
if context.get('active_id'):
|
||||
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
|
||||
if 'product_id' in fields:
|
||||
res.update({'product_id': move.product_id.id})
|
||||
if 'product_uom' in fields:
|
||||
res.update({'product_uom': move.product_uom.id})
|
||||
if 'qty' in fields:
|
||||
res.update({'qty': move.product_qty})
|
||||
if 'use_exist' in fields:
|
||||
res.update({'use_exist': (move.picking_id and move.picking_id.type=='out' and True) or False})
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
|
||||
@@ -44,7 +44,9 @@ class stock_partial_move(osv.osv_memory):
|
||||
moveids = []
|
||||
for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
|
||||
if m.state in ('done', 'cancel'):
|
||||
continue
|
||||
raise osv.except_osv(_('Invalid action !'), _('Cannot delivery products which are already delivered !'))
|
||||
|
||||
|
||||
if 'move%s_product_id'%(m.id) not in self._columns:
|
||||
self._columns['move%s_product_id'%(m.id)] = fields.many2one('product.product',string="Product")
|
||||
if 'move%s_product_qty'%(m.id) not in self._columns:
|
||||
@@ -66,7 +68,8 @@ class stock_partial_move(osv.osv_memory):
|
||||
move_ids = move_obj.search(cr, uid, [('id','in',move_ids)])
|
||||
_moves_arch_lst = """<form string="Deliver Products">
|
||||
<separator colspan="4" string="Delivery Information"/>
|
||||
<field name="date" colspan="4" />
|
||||
<field name="date" />
|
||||
<separator colspan="4"/>
|
||||
<group colspan="4" attrs="{'invisible':[('type','=','in')]}">
|
||||
<field name="partner_id" attrs="{'required':[('type','!=','in')]}" />
|
||||
<field name="address_id" attrs="{'required':[('type','!=','in')]}"/>
|
||||
|
||||
@@ -62,7 +62,8 @@ class stock_partial_picking(osv.osv_memory):
|
||||
picking_ids = context.get('active_ids', False)
|
||||
_moves_arch_lst = """<form string="Deliver Products">
|
||||
<separator colspan="4" string="Delivery Information"/>
|
||||
<field name="date" colspan="4" />
|
||||
<field name="date" />
|
||||
<separator colspan="4"/>
|
||||
<separator colspan="4" string="Move Detail"/>
|
||||
"""
|
||||
_moves_fields = result['fields']
|
||||
|
||||
@@ -32,7 +32,7 @@ class procurement_order(osv.osv):
|
||||
def check_buy(self, cr, uid, ids, context=None):
|
||||
for procurement in self.browse(cr, uid, ids):
|
||||
for line in procurement.product_id.flow_pull_ids:
|
||||
print line.location_src_id.name, line.location_id.name, line.type_proc
|
||||
|
||||
if line.location_id==procurement.location_id:
|
||||
return line.type_proc=='buy'
|
||||
return super(procurement_order, self).check_buy(cr, uid, ids)
|
||||
@@ -58,7 +58,6 @@ class procurement_order(osv.osv):
|
||||
move_obj = self.pool.get('stock.move')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
|
||||
for proc in proc_obj.browse(cr, uid, ids, context=context):
|
||||
line = None
|
||||
for line in proc.product_id.flow_pull_ids:
|
||||
@@ -79,7 +78,7 @@ class procurement_order(osv.osv):
|
||||
move_id = self.pool.get('stock.move').create(cr, uid, {
|
||||
'name': line.name,
|
||||
'picking_id': picking_id,
|
||||
'company_id': line.company_id and line.company_id.id or False,
|
||||
'company_id': line.company_id and line.company_id.id or False,
|
||||
'product_id': proc.product_id.id,
|
||||
'date_planned': proc.date_planned,
|
||||
'product_qty': proc.product_qty,
|
||||
@@ -104,7 +103,7 @@ class procurement_order(osv.osv):
|
||||
proc_id = self.pool.get('procurement.order').create(cr, uid, {
|
||||
'name': line.name,
|
||||
'origin': origin,
|
||||
'company_id': line.company_id and line.company_id.id or False,
|
||||
'company_id': line.company_id and line.company_id.id or False,
|
||||
'date_planned': proc.date_planned,
|
||||
'product_id': proc.product_id.id,
|
||||
'product_qty': proc.product_qty,
|
||||
|
||||
@@ -80,18 +80,19 @@ class product_pulled_flow(osv.osv):
|
||||
required=True,),
|
||||
}
|
||||
_defaults = {
|
||||
'cancel_cascade': lambda *arg: False,
|
||||
'procure_method': lambda *args: 'make_to_stock',
|
||||
'type_proc': lambda *args: 'move',
|
||||
'picking_type':lambda *args:'out',
|
||||
'invoice_state': lambda *args: 'none',
|
||||
'cancel_cascade': False,
|
||||
'procure_method': 'make_to_stock',
|
||||
'type_proc': 'move',
|
||||
'picking_type': 'out',
|
||||
'invoice_state': 'none',
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'product.pulled.flow', context=c),
|
||||
}
|
||||
product_pulled_flow()
|
||||
|
||||
class product_product(osv.osv):
|
||||
_inherit = 'product.product'
|
||||
_columns = {
|
||||
'flow_pull_ids': fields.one2many('product.pulled.flow', 'product_id', 'Pulled Flows'),
|
||||
'flow_pull_ids': fields.one2many('product.pulled.flow', 'product_id', 'Pulled Flows'),
|
||||
'path_ids': fields.one2many('stock.location.path', 'product_id',
|
||||
'Pushed Flow',
|
||||
help="These rules set the right path of the product in the "\
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,7 +15,7 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -28,7 +28,7 @@ class product(osv.osv):
|
||||
'auto_pick': fields.boolean('Auto Picking', help="Auto picking for raw materials of production orders.")
|
||||
}
|
||||
_defaults = {
|
||||
'auto_pick': lambda *args: True
|
||||
'auto_pick': True
|
||||
}
|
||||
product()
|
||||
|
||||
|
||||
@@ -346,12 +346,13 @@ class stock_sale_forecast(osv.osv):
|
||||
|
||||
def product_amt_change(self, cr, uid, ids, product_amt = 0.0, product_uom=False):
|
||||
ret={}
|
||||
round_value = 1
|
||||
if product_amt:
|
||||
coeff_def2uom = 1
|
||||
val1 = self.browse(cr, uid, ids)
|
||||
val = val1[0]
|
||||
if (product_uom != val.product_id.uom_id.id):
|
||||
coeff_def2uom, rounding = self._from_default_uom_factor( cr, uid, val, product_uom, {})
|
||||
coeff_def2uom, round_value = self._from_default_uom_factor( cr, uid, val, product_uom, {})
|
||||
ret['product_qty'] = rounding(coeff_def2uom * product_amt/(val.product_id.product_tmpl_id.list_price), round_value)
|
||||
res = {'value': ret}
|
||||
return res
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user