hide fields and enhance views
This commit is contained in:
parent
3d5c0eb9e4
commit
f17b2ff5af
|
|
@ -25,7 +25,6 @@ Add asset operations (Transfer, Sell/Dispose, Maitenenace, Assesment)
|
|||
'installable': True,
|
||||
'depends': [
|
||||
'odex25_account_asset',
|
||||
# 'hr_expense_petty_cash',
|
||||
'hr', 'barcodes', 'report_xlsx'
|
||||
],
|
||||
'data': [
|
||||
|
|
|
|||
|
|
@ -10,9 +10,8 @@ class PurchaseRequest(models.Model):
|
|||
_inherit = 'purchase.request'
|
||||
|
||||
state = fields.Selection(
|
||||
selection=[('draft', 'Draft'), ('direct_manager', 'Direct Manager'), ('wait_for_send', 'Wait For Sent'),
|
||||
('initial', 'Initial Engagement'),
|
||||
('waiting', 'In Purchase'), ('done', 'Done'), ('cancel', 'Cancel'), ('refuse', 'Refuse')],
|
||||
selection_add=[('wait_for_send', 'Wait For Sent'),
|
||||
('initial', 'Initial Engagement')],
|
||||
default="draft",
|
||||
tracking=True
|
||||
)
|
||||
|
|
@ -22,6 +21,9 @@ class PurchaseRequest(models.Model):
|
|||
initial_engagement_activate = fields.Boolean(compute='_check_initial_engagement_activate', store=True,
|
||||
default=False)
|
||||
|
||||
def action_skip_budget(self):
|
||||
self.state = 'waiting'
|
||||
|
||||
@api.depends('name', 'date', 'department_id', 'state')
|
||||
def _check_initial_engagement_activate(self):
|
||||
for rec in self:
|
||||
|
|
|
|||
|
|
@ -9,9 +9,12 @@
|
|||
<button name="initial_engagement"
|
||||
type="object" string="Initial Engagement" states="wait_for_send" class="oe_highlight"/>
|
||||
|
||||
<button name="action_skip_budget" type="object" string="Skip Budget" attrs="{'invisible':[('state','not in',('wait_for_send'))]}"
|
||||
groups="purchase_requisition_custom.group_skip_purchase_budget"/>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//button[@name='action_refuse']" position="attributes">
|
||||
<attribute name="states">direct_manager,wait_for_send,initial</attribute>
|
||||
<attribute name="states">direct_manager,wait_for_send</attribute>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='date']" position="after">
|
||||
|
|
|
|||
Loading…
Reference in New Issue