commit
0231697b84
|
|
@ -8,7 +8,7 @@
|
|||
<field name="body_html" type="html">
|
||||
<div style="margin: 0px; padding: 0px;">
|
||||
<p style="margin: 0px; padding: 0px; font-size: 13px; font-family: Arial, sans-serif; direction: rtl; text-align: right;">
|
||||
عزيزي ${object.vendor_id.name}
|
||||
السادة ${object.vendor_id.name}
|
||||
% if object.vendor_id.parent_id:
|
||||
(${object.vendor_id.parent_id.name})
|
||||
% endif
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<record id="seq_odx_annual_request" model="ir.sequence">
|
||||
<field name="name">Annual Request</field>
|
||||
<field name="code">odx.annual.request</field>
|
||||
<field name="prefix">AR%(y)s-</field>
|
||||
<field name="prefix">AR %(year)s/%(month)s/</field>
|
||||
<field name="padding">4</field>
|
||||
</record>
|
||||
<record id="seq_odx_annual_addendum" model="ir.sequence">
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ msgstr "الطلبات السنوية"
|
|||
#. module: odex25_annual_purchase
|
||||
#: model_terms:ir.ui.view,arch_db:odex25_annual_purchase.view_odx_annual_request_form
|
||||
msgid "Approve"
|
||||
msgstr "موافقة"
|
||||
msgstr "اعتماد"
|
||||
|
||||
#. module: odex25_annual_purchase
|
||||
#: model_terms:ir.ui.view,arch_db:odex25_annual_purchase.view_odx_annual_request_form
|
||||
|
|
@ -1098,7 +1098,7 @@ msgstr "موصى به"
|
|||
#: model:ir.model.fields.selection,name:odex25_annual_purchase.selection__annual_rfq__state__draft
|
||||
#: model_terms:ir.ui.view,arch_db:odex25_annual_purchase.view_annual_rfq_form
|
||||
msgid "Sign"
|
||||
msgstr "تنفيذ عرض سعر"
|
||||
msgstr "مسودة"
|
||||
|
||||
|
||||
#. module: odex25_annual_purchase
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class AnnualPurchaseRequest(models.Model):
|
|||
_order = "create_date desc"
|
||||
|
||||
name = fields.Char(string="Reference", default="New", readonly=True, copy=False)
|
||||
employee_id = fields.Many2one('hr.employee', string="Employee", tracking=True, default=lambda self: self.env['hr.employee'].search([('user_id', '=', self.env.user.id)], limit=1))
|
||||
employee_id = fields.Many2one('hr.employee', string="Employee", tracking=True, default=lambda self: self.env['hr.employee'].search([('user_id', '=', self.env.user.id)], limit=1),copy=False)
|
||||
user_id = fields.Many2one('res.users', string="Requested By", default=lambda self: self.env.user, tracking=True)
|
||||
department_id = fields.Many2one('hr.department', string="Department", tracking=True, related='employee_id.department_id', store=True)
|
||||
date = fields.Date(
|
||||
|
|
@ -38,7 +38,7 @@ class AnnualPurchaseRequest(models.Model):
|
|||
purpose = fields.Char(string="Purpose", tracking=True, required=True)
|
||||
note = fields.Text(string="Notes")
|
||||
state = fields.Selection(selection=STATES, default='draft', tracking=True)
|
||||
line_ids = fields.One2many('odx.annual.request.line', 'request_id', string="Products")
|
||||
line_ids = fields.One2many('odx.annual.request.line', 'request_id', string="Products", copy=True)
|
||||
agreement_id = fields.Many2one('purchase.requisition', string="Purchase Agreement", readonly=True)
|
||||
vendor_id = fields.Many2one('res.partner', string="Selected Vendor", domain=[('supplier_rank','>',0)])
|
||||
currency_id = fields.Many2one('res.currency', string="Currency", default=lambda self: self.env.company.currency_id.id)
|
||||
|
|
@ -54,7 +54,7 @@ class AnnualPurchaseRequest(models.Model):
|
|||
|
||||
product_category_ids = fields.Many2many('product.category', string='Items Categories',
|
||||
compute='_compute_product_category_ids',
|
||||
store=True)
|
||||
store=True,copy=True)
|
||||
|
||||
committee_enabled = fields.Boolean(string="Require Committee Review", default=False)
|
||||
ssd_approve = fields.Boolean(string="SSD Approve", default=True)
|
||||
|
|
@ -328,8 +328,11 @@ class AnnualPurchaseRequest(models.Model):
|
|||
return self._open_reason_wizard('manager_reject')
|
||||
|
||||
def action_send_to_committee(self):
|
||||
self.write({'sent_to_commitee': True})
|
||||
self.write({'state': 'committee'})
|
||||
if self.rfq_count > 0:
|
||||
self.write({'sent_to_commitee': True})
|
||||
self.write({'state': 'committee'})
|
||||
else:
|
||||
raise UserError("لا يمكن الإرسال إلى اللجنة لأن عدد RFQs يساوي صفر.")
|
||||
|
||||
def action_send_to_ssd(self):
|
||||
self.write({'state':'ssd'})
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class PurchaseRFQ(models.Model):
|
|||
('po', 'Purchase Order'),
|
||||
('approved', 'Approved'),
|
||||
('rejected', 'Rejected'),
|
||||
('cancel', 'Cancelled'),
|
||||
], string='Status', default='draft', tracking=True)
|
||||
purpose = fields.Text(string='Purpose')
|
||||
company_id = fields.Many2one('res.company', default=lambda self: self.env.company, required=True)
|
||||
|
|
@ -99,6 +100,12 @@ class PurchaseRFQ(models.Model):
|
|||
order.recommendation_order = True
|
||||
|
||||
|
||||
def unlink(self):
|
||||
for record in self:
|
||||
if record.state != 'draft':
|
||||
raise UserError(_('لا يمكن حذف السجل إلا إذا كانت الحالة مسودة فقط.'))
|
||||
return super(PurchaseRFQ, self).unlink()
|
||||
|
||||
def action_select_rfq(self):
|
||||
self.ensure_one()
|
||||
member = self._get_current_member_vote()
|
||||
|
|
@ -135,6 +142,19 @@ class PurchaseRFQ(models.Model):
|
|||
|
||||
self._check_committee_rejection()
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Select Reason'),
|
||||
'res_model': 'refuse.reason.rfq',
|
||||
'view_mode': 'form',
|
||||
'target': 'new',
|
||||
'context': {
|
||||
'default_rfq_id': self.id
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
def _check_committee_rejection(self):
|
||||
self.ensure_one()
|
||||
|
||||
|
|
@ -194,7 +214,7 @@ class PurchaseRFQ(models.Model):
|
|||
('id', '!=', rec.id),
|
||||
('state', 'not in', ['po', 'approved', 'rejected'])
|
||||
])
|
||||
related_rfqs.write({'state': 'rejected'})
|
||||
related_rfqs.write({'state': 'cancel'})
|
||||
return res
|
||||
|
||||
def action_rfq_send(self):
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ access_annual_request_group_annual_committee,annual_request_group_annual_committ
|
|||
|
||||
access_annual_request_line_group_technical_committee,annual_request_line_group_technical_committee,model_odx_annual_request_line,odex25_annual_purchase.group_technical_committee,1,1,0,0
|
||||
access_annual_request_line_group_annual_committee,annual_request_line_group_annual_committee,model_odx_annual_request_line,odex25_annual_purchase.group_annual_committee,1,1,0,0
|
||||
access_annual_request_line_group_annual_committee_gnral,annual_request_line_group_annual_committee_gnra,model_odx_annual_request_line,hr_base.group_general_manager,1,1,0,0
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
|
@ -8,7 +8,7 @@
|
|||
<field name="name">annual.rfq.form</field>
|
||||
<field name="model">annual.rfq</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Request for Quotation" create="1" edit="1">
|
||||
<form string="Request for Quotation" create="1" edit="1" delete="1">
|
||||
<header>
|
||||
|
||||
<button name="action_rfq_send"
|
||||
|
|
@ -21,11 +21,11 @@
|
|||
<button name="action_sign_rfq"
|
||||
type="object"
|
||||
string="Sign"
|
||||
groups="purchase.group_purchase_manager, purchase.group_purchase_user"
|
||||
groups="purchase.group_purchase_manager, purchase.group_purchase_user,odex25_annual_purchase.group_annual_committee"
|
||||
class="btn-primary"
|
||||
attrs="{'invisible': [('state', 'not in', ['sent','draft'])]}"
|
||||
/>
|
||||
<button name="action_rfq_send" states="sent" string="Re-Send by Email" type="object" context="{'send_rfq':True}"/>
|
||||
<button name="action_rfq_send" states="sent" string="Re-Send by Email" type="object" context="{'send_rfq':True}" groups="purchase.group_purchase_user"/>
|
||||
|
||||
|
||||
<button name="action_select_rfq"
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
<button name="get_attachments"
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-file-text-o">
|
||||
icon="fa-file-text-o" groups="odex25_annual_purchase.group_annual_committee,purchase.group_purchase_user">
|
||||
<field name="attach_no" widget="statinfo" string="Documents"/>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -167,7 +167,7 @@
|
|||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page string="العرض الفني" id="page_technical_offer" groups="purchase.group_purchase_user">
|
||||
<page string="العرض الفني" id="page_technical_offer" >
|
||||
<group>
|
||||
<field name="technical_attachment_ids" widget="many2many_binary"
|
||||
string="Technical Attachments"
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
<field name="name">annual.rfq.tree</field>
|
||||
<field name="model">annual.rfq</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Annual RFQs" default_order="id desc">
|
||||
<tree string="Annual RFQs" default_order="id desc" delete="1">
|
||||
<field name="name"/>
|
||||
<field name="recommendation_order" />
|
||||
<field name="vendor_id"/>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
(4, ref('purchase.group_purchase_user')),
|
||||
(4, ref('purchase.group_purchase_manager'))]"/>
|
||||
</record>
|
||||
<menuitem id="menu_odx_root" name="Annual Purchase" sequence="10" parent="purchase.menu_purchase_root"/>
|
||||
<menuitem id="menu_odx_root" name="Annual Purchase" sequence="10" parent="purchase.menu_purchase_root" groups="odex25_annual_purchase.group_annual_committee,odex25_annual_purchase.group_technical_committee,hr_base.group_general_manager,purchase.group_purchase_user"/>
|
||||
<menuitem id="menu_odx_requests" name="Annual Requests" parent="menu_odx_root" sequence="10" action="action_odx_annual_request" groups="hr_base.group_general_manager,hr_base.group_services_manager,purchase.group_purchase_user,purchase.group_purchase_manager"/>
|
||||
<menuitem id="menu_odx_annual_committee" name="Annual Committee" parent="menu_odx_root" sequence="11" action="action_annual_committe" groups="odex25_annual_purchase.group_annual_committee,odex25_annual_purchase.group_technical_committee"/>
|
||||
<!-- <menuitem id="menu_odx_addendum" name="Addendum" parent="menu_odx_root" sequence="30" action="action_odx_annual_addendum"/>-->
|
||||
|
|
@ -14,7 +14,8 @@
|
|||
<record id="purchase.menu_purchase_root" model="ir.ui.menu">
|
||||
<field name="groups_id" eval="[
|
||||
(4, ref('odex25_annual_purchase.group_annual_committee')),
|
||||
(4, ref('odex25_annual_purchase.group_technical_committee'))
|
||||
(4, ref('odex25_annual_purchase.group_technical_committee')),
|
||||
(4, ref('hr_base.group_general_manager'))
|
||||
]"/>
|
||||
</record>
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class AnnualRequestReasonWizard(models.TransientModel):
|
|||
vals['cancel_reason'] = self.reason
|
||||
req.write(vals)
|
||||
|
||||
elif self.action_type in ['ssd_reject', 'ceo_reject', 'manager_reject']: # حدث هنا لتشمل الرفض من المدير
|
||||
elif self.action_type in ['ssd_reject', 'ceo_reject', 'manager_reject']:
|
||||
req.message_post(body=_("Reason: %s") % self.reason)
|
||||
req.write({'state': 'rejected'})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue