Skip to content

Commit 9bf4732

Browse files
JoanMForgeFlowAungKoKoLin1997
authored andcommitted
[IMP][14.0] Purchase_deposit:added button create_deposit
1 parent 27a783b commit 9bf4732

8 files changed

+16
-12
lines changed

purchase_deposit/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Purchase Deposit
2323
:target: https://runbot.odoo-community.org/runbot/142/14.0
2424
:alt: Try me on Runbot
2525

26-
|badge1| |badge2| |badge3| |badge4| |badge5|
26+
|badge1| |badge2| |badge3| |badge4| |badge5|
2727

2828
This module allow purchase order to register deposit similar to that in sales order
2929

purchase_deposit/models/purchase.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PurchaseOrderLine(models.Model):
2323

2424
is_deposit = fields.Boolean(
2525
string="Is a deposit payment",
26-
help="Deposit payments are made when creating invoices from a purhcase"
26+
help="Deposit payments are made when creating bills from a purhcase"
2727
" order. They are not copied when duplicating a purchase order.",
2828
)
2929

purchase_deposit/readme/CONFIGURATION.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
After install this module, you need to select the product "Purchase Deposit" in
2-
configuration window to be used as default product when create deposit invoice.
2+
configuration window to be used as default product when create deposit bill.
33

44
Go to Purchase > Configuration > Settings, then select product "Purchase Deposit"
55

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* Dominique K. <dominique.k@elico-corp.com.sg>
22
* Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
33
* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
4+
* Joan Mateu <joan.mateu@forgeflow.com>

purchase_deposit/readme/USAGE.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
When purchase order is confirmed, a new button "Register Deposit" will appear.
2-
Normally, deposit will be used to create the 1st invoice (as deposit).
2+
Normally, deposit will be used to create the 1st bill (as deposit).
33

44
#. On confirmed purchase order, click Register Deposit button, wizard will open
5-
#. 2 type of deposit invoice can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
6-
#. Fill in the value and click Create Invoice button.
5+
#. 2 type of deposit bill can be create 1) Down Payment (percentage) 2) Deposit Payment (fixed amount)
6+
#. Fill in the value and click Create bill or just create deposit.
77

88
As deposit is created, when user click button "Create Bill" again in purchase order,
99
the Vendor Bill will be created with deposit amount deducted.

purchase_deposit/tests/test_purchase_deposit.py

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def test_create_deposit_invoice(self):
6262
"active_id": self.po.id,
6363
"active_ids": [self.po.id],
6464
"active_model": "purchase.order",
65+
"create_bills": True,
6566
}
6667
CreateDeposit = self.env["purchase.advance.payment.inv"]
6768
self.po.button_confirm()
@@ -125,6 +126,7 @@ def test_create_deposit_invoice_exception(self):
125126
"active_id": self.po.id,
126127
"active_ids": [self.po.id],
127128
"active_model": "purchase.order",
129+
"create_bills": True,
128130
}
129131
CreateDeposit = self.env["purchase.advance.payment.inv"]
130132
# 1. This action is allowed only in Purchase Order sate

purchase_deposit/wizard/purchase_make_invoice_advance.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ def create_invoices(self):
206206
}
207207
)
208208
del context
209-
self._create_invoice(order, po_line, amount)
210-
if self._context.get("open_invoices", False):
211-
return purchases.action_view_invoice()
209+
210+
if self._context.get("create_bills", False):
211+
self._create_invoice(order, po_line, amount)
212+
return purchases.action_view_invoice()
212213
return {"type": "ir.actions.act_window_close"}
213214

214215
def _prepare_deposit_product(self):

purchase_deposit/wizard/purchase_make_invoice_advance_views.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
<footer>
4545
<button
4646
name="create_invoices"
47-
string="Create and View Invoices"
47+
string="Create and View bills"
4848
type="object"
49-
context="{'open_invoices': True}"
49+
context="{'create_bills': True}"
5050
class="btn-primary"
5151
/>
5252
<button
5353
name="create_invoices"
54-
string="Create Invoices"
54+
string="Create deposit"
5555
type="object"
5656
class="btn-primary"
5757
/>

0 commit comments

Comments
 (0)