Cash Spent
This commit is contained in:
parent
693a677a90
commit
e5c24046ed
|
|
@ -2761,4 +2761,20 @@ msgstr ""
|
|||
#. module: purchase_requisition_custom
|
||||
#: model_terms:ir.ui.view,arch_db:purchase_requisition_custom.committee_meeting_minutes_report_document
|
||||
msgid "نطاق العمل"
|
||||
msgstr ""
|
||||
msgstr ""
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: code:addons/purchase_requisition_custom/models/purchase_request.py:0
|
||||
#, python-format
|
||||
msgid "Please add the analytical account"
|
||||
msgstr "يرجى إضافة الحساب التحليلي"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__is_cash_advance_spent
|
||||
msgid "Cash Spent"
|
||||
msgstr "منصرف من العهدة"
|
||||
|
||||
#. module: purchase_requisition_custom
|
||||
#: model:ir.model.fields,field_description:purchase_requisition_custom.field_purchase_order__cash_advance_employee_id
|
||||
msgid "Employee Cash Spent"
|
||||
msgstr "موظف العهد"
|
||||
|
|
@ -45,7 +45,15 @@ class PurchaseOrderCustom(models.Model):
|
|||
requisition_state = fields.Selection(related="requisition_id.state")
|
||||
requisition_type_exclusive = fields.Selection(related="requisition_id.type_exclusive")
|
||||
can_committee_vote = fields.Boolean(compute='_compute_can_committee_vote')
|
||||
is_cash_advance_spent = fields.Boolean(
|
||||
string="Cash Spent",
|
||||
default=False,
|
||||
)
|
||||
|
||||
cash_advance_employee_id = fields.Many2one(
|
||||
'hr.employee',
|
||||
string="Employee Cash Spent",
|
||||
)
|
||||
def _compute_can_committee_vote(self):
|
||||
user = self.env.user
|
||||
context = self._context or {}
|
||||
|
|
|
|||
|
|
@ -226,6 +226,15 @@ class PurchaseRequest(models.Model):
|
|||
def action_submit(self):
|
||||
if len(self.line_ids) == 0:
|
||||
raise ValidationError(_("Can't Confirm Request With No Item!"))
|
||||
|
||||
activate_initial_engagement = self.env.company.activate_initial_engagement
|
||||
|
||||
if activate_initial_engagement:
|
||||
if (not self.department_id.analytic_account_id and
|
||||
not self.use_analytic and
|
||||
not self.account_analytic_id):
|
||||
raise ValidationError(_("Please add the analytical account"))
|
||||
|
||||
self.write({'state': 'direct_manager'})
|
||||
|
||||
def action_confirm(self):
|
||||
|
|
|
|||
|
|
@ -116,6 +116,14 @@
|
|||
<field name="attach_no" widget="statinfo" string="Documents"/>
|
||||
</button>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='requisition_id']" position="after">
|
||||
<field name="is_cash_advance_spent"
|
||||
attrs="{'readonly': [('state', 'in', ['sign', 'wait'])]}"/>
|
||||
<field name="cash_advance_employee_id"
|
||||
attrs="{'invisible': [('is_cash_advance_spent', '=', False)],
|
||||
'readonly': [('state', 'in', ['sign', 'wait'])]}"/>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='payment_term_id']" position="after">
|
||||
<field invisible="1" readonly="1" name='res_model'/>
|
||||
<field invisible="1" readonly="1" name='res_id'/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue