-
-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[8.0] [ADD] pos order to sale order (w/o picking) #188
Conversation
80d612a
to
c09074a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good contribution!
some details
pos_order_to_sale_order/README.rst
Outdated
======================= | ||
|
||
|
||
This module extends the functionality of point of sale to allow you create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to allow sales order creation from the Point of Sales.
pos_order_to_sale_order/README.rst
Outdated
This module extends the functionality of point of sale to allow you create | ||
Sale Orders from the Point of sale. | ||
|
||
It adds a new button, below the current bill on the point of sale front end UI, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the POS UI, a button has been added to create the sales order and discard the current POS order
pos_order_to_sale_order/README.rst
Outdated
that allows you to create a Sale order, based on the current PoS Order lines | ||
and then to discard the current PoS Order. | ||
|
||
This module is usefull if you have some customers that come every day in your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a bit limited: this is not the only case I know. Another potential usage is the possibility to have a tablet in a fair and take orders with a very simple interface
Maybe add "For example"
iface_create_sale_order_action = fields.Selection( | ||
string='Sale Order Actions', default='delivered_picking', | ||
required=True, selection=CREATE_SALE_ORDER_ACTION_SELECTION, | ||
help="Choose wich operation will be done after creating a Sale Order" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... The selection is dynamic but the help message is not 😉 (none blocking)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, the warning message of the PoS front end ?
} | ||
self.pos.pos_widget.screen_selector.show_popup('confirm', { | ||
message: _t('Create Sale Order and discard the current PoS Order ?'), | ||
comment: _t("This operation will permanently destroy the current PoS Order and create a Sale Order, based on the current order lines. You'll have to create later an invoice.\n Note if you had manually changed unit prices for some products, this changes will not been taken into account in the sale order, and should be done manually on the invoice again."), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/destroy/discard
Hi, @elicoidal : Thanks a lot for your review. I'll fix the description in the next days. I just talked with @sebastienbeau, about this module, and we was imagining having the possibility to create an invoice too. (based on the delivered products), and even to create a paid invoice (with account payment) that mark the invoice as paid. could you be interested by such features ? |
return; | ||
} | ||
// Check Customer | ||
if (current_order.get('client') === null){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!current_order.get('client'))
Are you sure get() returns null and not Undefined ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it works yes. Do you want I test with Undefined, because it's a best practice ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!current_order.get('client'))
Less strict, more conscise
comment: _t("This operation will permanently destroy the current PoS Order and create a Sale Order, based on the current order lines. You'll have to create later an invoice.\n Note if you had manually changed unit prices for some products, this changes will not been taken into account in the sale order, and should be done manually on the invoice again."), | ||
confirm: function(){ | ||
var SaleOrderModel = new instance.web.Model('sale.order'); | ||
SaleOrderModel.call('create_order_from_pos', [self.prepare_create_sale_order(current_order)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may return SaleOrderModel.call(...
for somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to understand. renderElement doesn't return a deferred (in the native Odoo). So it will not be interpreted and managed ?
).then(function (result) { | ||
self.hook_create_sale_order_success(result); | ||
}).fail(function (error, event){ | ||
self.hook_create_sale_order_error(error, event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and re-throw a failed promise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same remark here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a suggestion of improvement.
It's ok as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few remarks which are not blocking.
Thanks for this great work @legalsylvain
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for you review @hparfr . Do you have any thought about my proposal to include paid invoices ?
).then(function (result) { | ||
self.hook_create_sale_order_success(result); | ||
}).fail(function (error, event){ | ||
self.hook_create_sale_order_error(error, event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same remark here.
pos_order_to_sale_order/README.rst
Outdated
|
||
This module is usefull if you have some customers that come every day in your | ||
shop, but want to have a unique invoice at the end of the month. With that | ||
module, you can create a sale order adn deliver products every time to keep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:s/adn/and/
Personally not (at least not for my customers) but having a quick entry for sales order and invoices looks like a very good idea for Very Small Businesses |
This module doesn't take into account of the taxes in sales order. Has anyone been able to get a solution for it! I am new in Odoo community and will really appreciate the help. |
Hi all. Sorry for the late. @hparfr : the same, except two JS remarks. (promise, promise, ...) need help ! Note : I changed the field selection on pos.config by three checkbox. So :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some details.
LGTM
class PosConfig(models.Model): | ||
_inherit = 'pos.config' | ||
|
||
iface_create_draft_sale_order = fields.Boolean( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a remark: it could have been interesting to have a checkbox "Create Sales Order" and a selection box with all possible states (you give 3 but multiple others could be imaginable).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Saw your previous message later 👅 anyway both usability options have pros and cons 😄 )
this.sale_order_state = options.sale_order_state; | ||
if (this.sale_order_state == 'draft') { | ||
this.display_text = _t("Create Draft Order"); | ||
this.confirmation_message = _t('Create Draft Sale Order and discard the current PoS Order ?'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove space before '?' (multiple)
if (this.sale_order_state == 'draft') { | ||
this.display_text = _t("Create Draft Order"); | ||
this.confirmation_message = _t('Create Draft Sale Order and discard the current PoS Order ?'); | ||
this.confirmation_comment = _t("This operation will permanently discard the current PoS Order and create a draft Sale Order, based on the current order lines. Note if you had manually changed unit prices for some products, this changes will not been taken into account in the sale order."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had changed->have changed
(shouldnot this limitation be highlighted in the README BTW)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is written in the readme.
@@ -71,7 +82,10 @@ openerp.pos_order_to_sale_order = function(instance, local) { | |||
|
|||
// Overload This function to send custom sale order data to server | |||
prepare_create_sale_order: function(order) { | |||
return order.export_as_JSON(); | |||
var res = order.export_as_JSON(); | |||
console.log(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log
@elicoidal : typo fixed. Now ok ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
17890bd
to
7e5e612
Compare
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
* [ADD] new module pos_order_to_sale_order
This PR add a new module pos_order_to_sale order that allow to create sale order based on draft pos order.
3 options are available : create Draft Order, Create Confirmed Order, or Create delivered Picking.
Configuration is available on pos.config :
New button is available on PoS :
this PR is an alternative to another WIP module, made by Akretion team 'pos_sale_order'. (but the other module, completely remove pos.order feature). In that module, user can continue to create pos.order, and create sale.order (and delivered picking), if desired.
Ref OCA PR : #35 and other work here : https://github.com/stefanrijnhart/pos/tree/8.0-pos-sale-order.
CC : @sebastienbeau, @chafique-delli, @houssine78, @hparfr, @StefanRijnhart.
@grap/developers
More detailled feature available here :
https://github.com/grap/pos/blob/8.0_ADD_pos_order_to_sale_picking/pos_order_to_sale_order/README.rst