[V9] Port to V9 (switch from period to date)

This commit is contained in:
vrenaville
2015-10-27 17:08:19 +01:00
parent 02d0c49257
commit bb8d431c82
4 changed files with 16 additions and 13 deletions

View File

@@ -19,13 +19,13 @@
##############################################################################
{
"name": "Move locked to prevent modification",
"version": "8.0.1.0.0",
"version": "9.0.1.0.0",
"depends": ["base", "account"],
"author": "Camptocamp,Odoo Community Association (OCA)",
'license': 'AGPL-3',
'website': 'http://www.camptocamp.com',
'data': ['account_view.xml',
'wizard/account_lock_move_view.xml'],
'installable': False,
'installable': True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -6,7 +6,7 @@
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<field name="to_check" position="after">
<field name="date" position="after">
<field name="locked" />
</field>
</field>

View File

@@ -29,11 +29,10 @@ class lock_account_move(models.TransientModel):
rel='wizard_lock_account_move_journal',
string='Journal',
required=True)
period_ids = fields.Many2many('account.period',
rel='wizard_lock_account_move_period',
string='Period',
required=True,
domain=[('state', '<>', 'done')])
date_start = fields.Datetime(string='Date start',
required=True)
date_end = fields.Datetime(string='Date end',
required=True)
@api.multi
def lock_move(self, data):
@@ -42,8 +41,10 @@ class lock_account_move(models.TransientModel):
('journal_id',
'in',
self.journal_ids.ids),
('period_id', 'in',
self.period_ids.ids)],
('date', '>=',
self.date_start),
('date', '<=',
self.date_end)],
order='date')
if draft_move:
raise exceptions.Warning(_('Warning!'),
@@ -53,7 +54,8 @@ class lock_account_move(models.TransientModel):
move = obj_move.search([('state', '=', 'posted'),
('locked', '=', False),
('journal_id', 'in', self.journal_ids.ids),
('period_id', 'in', self.period_ids.ids)],
('date', '>=', self.date_start),
('date', '<=', self.date_end)],
order='date')
if not move:
raise exceptions.Warning(_('Warning!'),

View File

@@ -10,7 +10,8 @@
<form string="Lock Journal Entries">
<group>
<field name="journal_ids"/>
<field name="period_ids"/>
<field name="date_start"/>
<field name="date_end"/>
</group>
<footer>
<button string="Approve" name="lock_move" type="object" class="oe_highlight"/>
@@ -32,7 +33,7 @@
<menuitem
name="Lock Journal Entries"
parent="account.periodical_processing_journal_entries_validation"
parent="account.menu_finance_entries"
action="action_lock_account_move"
id="menu_lock_account_moves"
/>