Merge branch 'develop' into feature/commercially_launched
This commit is contained in:
@@ -9,6 +9,8 @@ class jikimo_purchase_tier_validation(models.Model):
|
||||
_name = 'purchase.order'
|
||||
_inherit = ['purchase.order', 'tier.validation']
|
||||
_description = "采购订单"
|
||||
_state_from = ["draft", "to approve", "rejected"]
|
||||
_state_to = ["approved"]
|
||||
|
||||
_tier_validation_buttons_xpath = "/form/header/button[@id='draft_confirm'][1]"
|
||||
|
||||
@@ -21,7 +23,7 @@ class jikimo_purchase_tier_validation(models.Model):
|
||||
|
||||
def button_confirm(self):
|
||||
for record in self:
|
||||
if record.state in ['to approve']:
|
||||
if record.need_validation and not record.validation_status == 'validated':
|
||||
raise ValidationError(_('请先完成审批。'))
|
||||
res = super(jikimo_purchase_tier_validation, self).button_confirm()
|
||||
for record in self:
|
||||
@@ -68,11 +70,6 @@ class jikimo_purchase_tier_validation(models.Model):
|
||||
|
||||
return res
|
||||
|
||||
def _rejected_tier(self, tiers=False):
|
||||
res = super(jikimo_purchase_tier_validation, self)._rejected_tier(tiers)
|
||||
self.state = 'draft'
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def _get_under_validation_exceptions(self):
|
||||
res = super(jikimo_purchase_tier_validation, self)._get_under_validation_exceptions()
|
||||
|
||||
@@ -67,6 +67,16 @@
|
||||
<filter string="追溯参考" name="retrospect" domain="[]"
|
||||
context="{'group_by': 'retrospect_ref'}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='picking_type_id']" position="after">
|
||||
<field name="product_id"
|
||||
string="零件图号"
|
||||
filter_domain="[('product_id.part_number', 'ilike', self)]"
|
||||
/>
|
||||
<field name="product_id"
|
||||
string="零件名称"
|
||||
filter_domain="[('product_id.part_name', 'ilike', self)]"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -42,20 +42,20 @@
|
||||
<field name="currency_id" position="after">
|
||||
<field name="remark" attrs="{'readonly': [('state', 'in', ['purchase'])]}" string="订单备注"/>
|
||||
</field>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="replace">
|
||||
<button name="action_rfq_send" states="draft" string="通过Email发送采购单" type="object"
|
||||
context="{'send_rfq':True}" class="oe_highlight" data-hotkey="g"
|
||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][2]" position="replace">
|
||||
<button name="action_rfq_send" states="sent" string="通过Email重新发送采购单" type="object"
|
||||
context="{'send_rfq':True}" data-hotkey="g"
|
||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][2]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][3]" position="replace">
|
||||
<button name="action_rfq_send" states="purchase" string="通过Email发送订单" type="object"
|
||||
context="{'send_rfq':False}" data-hotkey="g"
|
||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
||||
<xpath expr="//form/header/button[@name='action_rfq_send'][3]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='print_quotation'][1]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='print_quotation'][2]" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
|
||||
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
|
||||
@@ -353,5 +353,9 @@
|
||||
</field>
|
||||
<field name="view_mode">tree,kanban,form,activity</field>
|
||||
</record>
|
||||
|
||||
<record id="purchase.purchase_rfq" model="ir.actions.act_window">
|
||||
<field name="context">{'quotation_only': True,"search_default_draft":1}</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user