[IMP] account_move : display "Post Automatically" on vendor bills
As we already have the Post Automatically concept in account.move, we want to be able to use it for vendor bills. This way, e.g. one can prepare all it's office rents bill for the year and everything will be automatic.. Other changes : - auto_post reset to False when move is canceled - auto_post set to readonly in view when state != draft Task : 2200743 closes odoo/odoo#46218 Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
This commit is contained in:
@@ -2231,7 +2231,7 @@ class AccountMove(models.Model):
|
||||
self.write({'state': 'draft'})
|
||||
|
||||
def button_cancel(self):
|
||||
self.write({'state': 'cancel'})
|
||||
self.write({'auto_post': False, 'state': 'cancel'})
|
||||
|
||||
def action_invoice_sent(self):
|
||||
""" Open a window to compose an email, with the edi invoice template
|
||||
|
||||
@@ -987,6 +987,8 @@
|
||||
<field name="invoice_source_email"
|
||||
widget="email"
|
||||
attrs="{'invisible': ['|', ('move_type', 'not in', ('in_invoice', 'in_refund')), ('invoice_source_email', '=', False)]}"/>
|
||||
<field name="auto_post"
|
||||
attrs="{'invisible': [('move_type', '!=', 'in_invoice')], 'readonly': ['|',('reversed_entry_id', '!=', False),('state','!=','draft')]}"/>
|
||||
<field name="to_check"/>
|
||||
</group>
|
||||
<group string="Payments"
|
||||
@@ -1005,7 +1007,7 @@
|
||||
<group id="other_tab_entry_group">
|
||||
<group name="misc_group">
|
||||
<field name="auto_post"
|
||||
attrs="{'invisible': [('move_type', '!=', 'entry')], 'readonly': [('reversed_entry_id', '!=', False)]}"/>
|
||||
attrs="{'invisible': [('move_type', '!=', 'entry')], 'readonly': ['|',('reversed_entry_id', '!=', False),('state','!=','draft')]}"/>
|
||||
<field name="reversed_entry_id"
|
||||
attrs="{'invisible': [('move_type', '!=', 'entry')]}"/>
|
||||
<field name="to_check"
|
||||
|
||||
Reference in New Issue
Block a user