* fix: Issues related to RFQ and Supplier Quotation on Portal (#37565)
fix: RFQ and Supplier Quotation for Portal
(cherry picked from commit 2851a41310)
* chore: removed backport changes
---------
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -7,7 +7,6 @@ from typing import Optional
|
||||
import frappe
|
||||
from frappe import _, msgprint, scrub
|
||||
from frappe.contacts.doctype.address.address import get_company_address, get_default_address
|
||||
from frappe.contacts.doctype.contact.contact import get_contact_details
|
||||
from frappe.core.doctype.user_permission.user_permission import get_permitted_documents
|
||||
from frappe.model.utils import get_fetch_values
|
||||
from frappe.query_builder.functions import Abs, Date, Sum
|
||||
@@ -294,7 +293,34 @@ def set_contact_details(party_details, party, party_type):
|
||||
}
|
||||
)
|
||||
else:
|
||||
party_details.update(get_contact_details(party_details.contact_person))
|
||||
fields = [
|
||||
"name as contact_person",
|
||||
"salutation",
|
||||
"first_name",
|
||||
"last_name",
|
||||
"email_id as contact_email",
|
||||
"mobile_no as contact_mobile",
|
||||
"phone as contact_phone",
|
||||
"designation as contact_designation",
|
||||
"department as contact_department",
|
||||
]
|
||||
|
||||
contact_details = frappe.db.get_value(
|
||||
"Contact", party_details.contact_person, fields, as_dict=True
|
||||
)
|
||||
|
||||
contact_details.contact_display = " ".join(
|
||||
filter(
|
||||
None,
|
||||
[
|
||||
contact_details.get("salutation"),
|
||||
contact_details.get("first_name"),
|
||||
contact_details.get("last_name"),
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
party_details.update(contact_details)
|
||||
|
||||
|
||||
def set_other_values(party_details, party, party_type):
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{% if d.thumbnail or d.image %}
|
||||
{{ product_image(d.thumbnail or d.image, no_border=True) }}
|
||||
{% else %}
|
||||
<div class="no-image-cart-item" style="min-height: 100px;">
|
||||
<div class="no-image-cart-item" style="min-height: 50px;">
|
||||
{{ frappe.utils.get_abbr(d.item_name) or "NA" }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -72,7 +72,7 @@ rfq = class rfq {
|
||||
}
|
||||
|
||||
submit_rfq(){
|
||||
$('.btn-sm').click(function(){
|
||||
$('.btn-sm').click(function() {
|
||||
frappe.freeze();
|
||||
frappe.call({
|
||||
type: "POST",
|
||||
@@ -81,7 +81,7 @@ rfq = class rfq {
|
||||
doc: doc
|
||||
},
|
||||
btn: this,
|
||||
callback: function(r){
|
||||
callback: function(r) {
|
||||
frappe.unfreeze();
|
||||
if(r.message){
|
||||
$('.btn-sm').hide()
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
{% from "erpnext/templates/includes/macros.html" import product_image_square, product_image %}
|
||||
|
||||
{% macro item_name_and_description(d, doc) %}
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
{{ product_image(d.image) }}
|
||||
</div>
|
||||
<div class="col-9">
|
||||
{{ d.item_code }}
|
||||
<p class="text-muted small">{{ d.description }}</p>
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
{% if d.image %}
|
||||
{{ product_image(d.image) }}
|
||||
{% else %}
|
||||
<div class="website-image h-100 w-100" style="background-color:var(--gray-100);text-align: center;line-height: 3.6;">
|
||||
{{ frappe.utils.get_abbr(d.item_name)}}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-9">
|
||||
{{ d.item_code }}
|
||||
<p class="text-muted small">{{ d.description }}</p>
|
||||
{% set supplier_part_no = frappe.db.get_value("Item Supplier", {'parent': d.item_code, 'supplier': doc.supplier}, "supplier_part_no") %}
|
||||
<p class="text-muted small supplier-part-no">
|
||||
{% if supplier_part_no %}
|
||||
{{_("Supplier Part No") + ": "+ supplier_part_no}}
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
@@ -165,7 +165,6 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% if attachments %}
|
||||
<div class="order-item-table">
|
||||
<div class="row order-items order-item-header text-muted">
|
||||
@@ -193,6 +192,7 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block script %}
|
||||
<script> {% include "templates/pages/order.js" %}</script>
|
||||
<script>
|
||||
@@ -204,4 +204,4 @@
|
||||
currency: '{{ doc.currency }}'
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% block header %}
|
||||
<h1>{{ doc.name }}</h1>
|
||||
<h1 style="margin-top: 10px;">{{ doc.name }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
@@ -16,7 +16,7 @@
|
||||
{% if doc.items %}
|
||||
<button class="btn btn-primary btn-sm"
|
||||
type="button">
|
||||
{{ _("Submit") }}</button>
|
||||
{{ _("Make Quotation") }}</button>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user